From 7c5dc005ae5a440d141683bf6dfb60bfe5b08708 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 12 Aug 2019 16:50:41 -0400 Subject: [PATCH 001/100] GraphQL explorer now uses font color from theme --- packages/insomnia-app/app/common/import.js | 53 +++++++++++++--------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/packages/insomnia-app/app/common/import.js b/packages/insomnia-app/app/common/import.js index de573bdd34..88559fb7b9 100644 --- a/packages/insomnia-app/app/common/import.js +++ b/packages/insomnia-app/app/common/import.js @@ -6,14 +6,15 @@ import * as har from './har'; import type { BaseModel } from '../models/index'; import * as models from '../models/index'; import { getAppVersion } from './constants'; -import { showModal, showError } from '../ui/components/modals/index'; +import { showError, showModal } from '../ui/components/modals/index'; import AlertModal from '../ui/components/modals/alert-modal'; import fs from 'fs'; -import type { Workspace } from '../models/workspace'; -import type { Environment } from '../models/environment'; import { fnOrString, generateId } from './misc'; import YAML from 'yaml'; +const WORKSPACE_ID_KEY = '__WORKSPACE_ID__'; +const BASE_ENVIRONMENT_ID_KEY = '__BASE_ENVIRONMENT_ID__'; + const EXPORT_FORMAT = 4; const EXPORT_TYPE_REQUEST = 'request'; @@ -33,7 +34,10 @@ const MODELS = { [EXPORT_TYPE_ENVIRONMENT]: models.environment, }; -export async function importUri(workspaceId: string | null, uri: string): Promise { +export async function importUri( + getWorkspaceId: () => Promise, + uri: string, +): Promise { let rawText; if (uri.match(/^(http|https):\/\//)) { const response = await window.fetch(uri); @@ -45,7 +49,7 @@ export async function importUri(workspaceId: string | null, uri: string): Promis throw new Error(`Invalid import URI ${uri}`); } - const result = await importRaw(workspaceId, rawText); + const result = await importRaw(getWorkspaceId, rawText); const { summary, error } = result; if (error) { @@ -75,7 +79,7 @@ export async function importUri(workspaceId: string | null, uri: string): Promis } export async function importRaw( - workspaceId: string | null, + getWorkspaceId: () => Promise, rawContent: string, generateNewIds: boolean = false, ): Promise<{ @@ -96,13 +100,6 @@ export async function importRaw( const { data } = results; - let workspace: Workspace | null = await models.workspace.getById(workspaceId || 'n/a'); - - // Fetch the base environment in case we need it - let baseEnvironment: Environment | null = await models.environment.getOrCreateForWorkspaceId( - workspaceId || 'n/a', - ); - // Generate all the ids we may need const generatedIds: { [string]: string | Function } = {}; for (const r of data.resources) { @@ -111,20 +108,32 @@ export async function importRaw( } } - // Always replace these "constants" - generatedIds['__WORKSPACE_ID__'] = async () => { - if (!workspace) { + // Contains the ID of the workspace to be used with the import + generatedIds[WORKSPACE_ID_KEY] = async () => { + const workspaceId = await getWorkspaceId(); + + // First try getting the workspace to overwrite + let workspace = await models.workspace.getById(workspaceId || 'n/a'); + + // If none provided, create a new workspace + if (workspace === null) { workspace = await models.workspace.create({ name: 'Imported Workspace' }); } + // Update this fn so it doesn't run again + generatedIds[WORKSPACE_ID_KEY] = workspace._id; + return workspace._id; }; - generatedIds['__BASE_ENVIRONMENT_ID__'] = async () => { - if (!baseEnvironment) { - const parentId = await fnOrString(generatedIds['__WORKSPACE_ID__']); - baseEnvironment = await models.environment.getOrCreateForWorkspaceId(parentId); - } + // Contains the ID of the base environment to be used with the import + generatedIds[BASE_ENVIRONMENT_ID_KEY] = async () => { + const parentId = await fnOrString(generatedIds[WORKSPACE_ID_KEY]); + const baseEnvironment = await models.environment.getOrCreateForWorkspaceId(parentId); + + // Update this fn so it doesn't run again + generatedIds[BASE_ENVIRONMENT_ID_KEY] = baseEnvironment._id; + return baseEnvironment._id; }; @@ -143,7 +152,7 @@ export async function importRaw( // Replace null parentIds with current workspace if (!resource.parentId && resource._type !== EXPORT_TYPE_WORKSPACE) { - resource.parentId = '__WORKSPACE_ID__'; + resource.parentId = WORKSPACE_ID_KEY; } // Replace _id if we need to From 26dc5233cc77bd4eb6d03441eacc0ad4254eb409 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 12 Aug 2019 16:54:45 -0400 Subject: [PATCH 002/100] GraphQL explorer now uses font color from theme --- .../insomnia-app/app/ui/css/components/graph-ql-explorer.less | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/insomnia-app/app/ui/css/components/graph-ql-explorer.less b/packages/insomnia-app/app/ui/css/components/graph-ql-explorer.less index 6cb0c2614b..e0360176fa 100644 --- a/packages/insomnia-app/app/ui/css/components/graph-ql-explorer.less +++ b/packages/insomnia-app/app/ui/css/components/graph-ql-explorer.less @@ -14,6 +14,7 @@ z-index: 100; background: var(--color-bg); box-shadow: 0 0 1rem 0 rgba(0, 0, 0, 0.4); + color: var(--color-font); .markdown-preview__content *:first-child { margin-top: @padding-sm; From 257685ca47e835c484bfeebecc0be7e689441393 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 12 Aug 2019 17:15:44 -0400 Subject: [PATCH 003/100] Ask user on import whether they want to use current workspace --- packages/insomnia-app/app/common/import.js | 10 ++++- .../insomnia-app/app/plugins/context/data.js | 4 +- .../app/ui/components/modals/ask-modal.js | 17 +++++--- .../app/ui/redux/modules/global.js | 43 ++++++++++++++++--- 4 files changed, 59 insertions(+), 15 deletions(-) diff --git a/packages/insomnia-app/app/common/import.js b/packages/insomnia-app/app/common/import.js index 88559fb7b9..f69fe10c5f 100644 --- a/packages/insomnia-app/app/common/import.js +++ b/packages/insomnia-app/app/common/import.js @@ -37,7 +37,11 @@ const MODELS = { export async function importUri( getWorkspaceId: () => Promise, uri: string, -): Promise { +): Promise<{ + source: string, + error: Error | null, + summary: { [string]: Array }, +}> { let rawText; if (uri.match(/^(http|https):\/\//)) { const response = await window.fetch(uri); @@ -58,7 +62,7 @@ export async function importUri( error: error.message, message: 'Import failed', }); - return; + return result; } let statements = Object.keys(summary) @@ -76,6 +80,8 @@ export async function importUri( message = `You imported ${statements.join(', ')}!`; } showModal(AlertModal, { title: 'Import Succeeded', message }); + + return result; } export async function importRaw( diff --git a/packages/insomnia-app/app/plugins/context/data.js b/packages/insomnia-app/app/plugins/context/data.js index 8f62fd9fb2..c25333a447 100644 --- a/packages/insomnia-app/app/plugins/context/data.js +++ b/packages/insomnia-app/app/plugins/context/data.js @@ -10,10 +10,10 @@ export function init(): { import: Object, export: Object } { return { import: { async uri(uri: string, options: { workspaceId?: string } = {}): Promise { - await importUri(options.workspaceId || null, uri); + await importUri(() => Promise.resolve(options.workspaceId || null), uri); }, async raw(text: string, options: { workspaceId?: string } = {}): Promise { - await importRaw(options.workspaceId || null, text); + await importRaw(() => Promise.resolve(options.workspaceId || null), text); }, }, export: { diff --git a/packages/insomnia-app/app/ui/components/modals/ask-modal.js b/packages/insomnia-app/app/ui/components/modals/ask-modal.js index f81a84da1a..a941562b9f 100644 --- a/packages/insomnia-app/app/ui/components/modals/ask-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/ask-modal.js @@ -13,6 +13,8 @@ class AskModal extends PureComponent { this.state = { title: '', message: '', + yesText: 'Yes', + noText: 'No', }; } @@ -41,11 +43,16 @@ class AskModal extends PureComponent { } show(options = {}) { - const { title, message, onDone } = options; + const { title, message, onDone, yesText, noText } = options; this._doneCallback = onDone; - this.setState({ title, message }); + this.setState({ + title: title || 'Confirm', + message: message || 'No message provided', + yesText: yesText || 'Yes', + noText: noText || 'No', + }); this.modal.show(); @@ -59,7 +66,7 @@ class AskModal extends PureComponent { } render() { - const { message, title } = this.state; + const { message, title, yesText, noText } = this.state; return ( @@ -68,10 +75,10 @@ class AskModal extends PureComponent {
diff --git a/packages/insomnia-app/app/ui/redux/modules/global.js b/packages/insomnia-app/app/ui/redux/modules/global.js index d57e21b087..73319921bc 100644 --- a/packages/insomnia-app/app/ui/redux/modules/global.js +++ b/packages/insomnia-app/app/ui/redux/modules/global.js @@ -132,10 +132,8 @@ export function loadRequestStop(requestId) { } export function setActiveWorkspace(workspaceId) { - window.localStorage.setItem( - `${LOCALSTORAGE_PREFIX}::activeWorkspaceId`, - JSON.stringify(workspaceId), - ); + const key = `${LOCALSTORAGE_PREFIX}::activeWorkspaceId`; + window.localStorage.setItem(key, JSON.stringify(workspaceId)); return { type: SET_ACTIVE_WORKSPACE, workspaceId }; } @@ -163,16 +161,22 @@ export function importFile(workspaceId) { } // Let's import all the paths! + let importedWorkspaces = []; for (const p of paths) { try { const uri = `file://${p}`; - await importUtils.importUri(workspaceId, uri); + const result = await importUtils.importUri(askToImportIntoWorkspace(workspaceId), uri); + importedWorkspaces = [...importedWorkspaces, ...result.summary[models.workspace.type]]; } catch (err) { showModal(AlertModal, { title: 'Import Failed', message: err + '' }); } finally { dispatch(loadStop()); } } + + if (importedWorkspaces.length === 1) { + dispatch(setActiveWorkspace(importedWorkspaces[0]._id)); + } }); }; } @@ -180,13 +184,20 @@ export function importFile(workspaceId) { export function importUri(workspaceId, uri) { return async dispatch => { dispatch(loadStart()); + + let importedWorkspaces = []; try { - await importUtils.importUri(workspaceId, uri); + const result = await importUtils.importUri(askToImportIntoWorkspace(workspaceId), uri); + importedWorkspaces = [...importedWorkspaces, ...result.summary[models.workspace.type]]; } catch (err) { showModal(AlertModal, { title: 'Import Failed', message: err + '' }); } finally { dispatch(loadStop()); } + + if (importedWorkspaces.length === 1) { + dispatch(setActiveWorkspace(importedWorkspaces[0]._id)); + } }; } @@ -434,3 +445,23 @@ export function init() { return setActiveWorkspace(workspaceId); } + +// ~~~~~~~ // +// HELPERS // +// ~~~~~~~ // + +function askToImportIntoWorkspace(workspaceId) { + return function() { + return new Promise(resolve => { + showModal(AskModal, { + title: 'Import', + message: 'Do you wand to import into the current workspace or a new one?', + yesText: 'Current', + noText: 'New Workspace', + onDone: yes => { + resolve(yes ? workspaceId : null); + }, + }); + }); + }; +} From 3e2311e4e134000f3c687731ebf0dbf000df4da6 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 15 Aug 2019 12:56:32 -0700 Subject: [PATCH 004/100] Make OpenAPI importer generate deterministic IDs --- packages/insomnia-app/app/common/import.js | 21 +- packages/insomnia-cookies/package-lock.json | 2 +- packages/insomnia-importers/package-lock.json | 2 +- .../src/__tests__/fixtures.test.js | 10 + .../openapi3/dereferenced-output.json | 350 ++++++++--------- .../dereferenced-with-tags-output.json | 356 +++++++++--------- .../fixtures/openapi3/petstore-output.json | 350 ++++++++--------- .../openapi3/petstore-readonly-output.json | 80 ++-- .../openapi3/petstore-with-tags-output.json | 356 +++++++++--------- .../fixtures/openapi3/petstore-yml-input.yml | 1 - .../openapi3/petstore-yml-output.json | 78 ++-- .../openapi3/petstore-yml-with-tags-input.yml | 1 + .../petstore-yml-with-tags-output.json | 102 ++--- .../src/importers/openapi3.js | 77 +++- packages/insomnia-libcurl/package-lock.json | 2 +- packages/insomnia-xpath/package-lock.json | 2 +- .../package-lock.json | 2 +- .../package-lock.json | 2 +- plugins/insomnia-plugin-now/package-lock.json | 2 +- plugins/insomnia-plugin-os/package-lock.json | 2 +- .../insomnia-plugin-uuid/package-lock.json | 2 +- 21 files changed, 932 insertions(+), 868 deletions(-) diff --git a/packages/insomnia-app/app/common/import.js b/packages/insomnia-app/app/common/import.js index f69fe10c5f..8a3bcacf96 100644 --- a/packages/insomnia-app/app/common/import.js +++ b/packages/insomnia-app/app/common/import.js @@ -24,7 +24,7 @@ const EXPORT_TYPE_COOKIE_JAR = 'cookie_jar'; const EXPORT_TYPE_ENVIRONMENT = 'environment'; // If we come across an ID of this form, we will replace it with a new one -const REPLACE_ID_REGEX = /^__\w+_\d+__$/; +const REPLACE_ID_REGEX = /__\w+_\d+__/g; const MODELS = { [EXPORT_TYPE_REQUEST]: models.request, @@ -87,7 +87,6 @@ export async function importUri( export async function importRaw( getWorkspaceId: () => Promise, rawContent: string, - generateNewIds: boolean = false, ): Promise<{ source: string, error: Error | null, @@ -109,8 +108,8 @@ export async function importRaw( // Generate all the ids we may need const generatedIds: { [string]: string | Function } = {}; for (const r of data.resources) { - if (generateNewIds || r._id.match(REPLACE_ID_REGEX)) { - generatedIds[r._id] = generateId(MODELS[r._type].prefix); + for (const key of r._id.match(REPLACE_ID_REGEX) || []) { + generatedIds[key] = generateId(MODELS[r._type].prefix); } } @@ -161,14 +160,12 @@ export async function importRaw( resource.parentId = WORKSPACE_ID_KEY; } - // Replace _id if we need to - if (generatedIds[resource._id]) { - resource._id = await fnOrString(generatedIds[resource._id]); - } - - // Replace newly generated IDs if they exist - if (generatedIds[resource.parentId]) { - resource.parentId = await fnOrString(generatedIds[resource.parentId]); + // Replace ID placeholders (eg. __WORKSPACE_ID__) with generated values + for (const key of Object.keys(generatedIds)) { + const { parentId, _id } = resource; + const id = await fnOrString(generatedIds[key]); + resource.parentId = parentId ? parentId.replace(key, id) : parentId; + resource._id = _id ? _id.replace(key, id) : _id; } const model: Object = MODELS[resource._type]; diff --git a/packages/insomnia-cookies/package-lock.json b/packages/insomnia-cookies/package-lock.json index 835b049506..e09e615b8a 100644 --- a/packages/insomnia-cookies/package-lock.json +++ b/packages/insomnia-cookies/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-cookies", - "version": "0.0.16", + "version": "0.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-importers/package-lock.json b/packages/insomnia-importers/package-lock.json index 1761a84a6b..dce277d721 100644 --- a/packages/insomnia-importers/package-lock.json +++ b/packages/insomnia-importers/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-importers", - "version": "2.0.19", + "version": "2.0.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-importers/src/__tests__/fixtures.test.js b/packages/insomnia-importers/src/__tests__/fixtures.test.js index 099a32b382..d5281f56c7 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures.test.js +++ b/packages/insomnia-importers/src/__tests__/fixtures.test.js @@ -32,6 +32,16 @@ describe('Fixtures', () => { expected.__export_date = results.data.__export_date; expect(results.data).toEqual(expected); + + const ids = new Set(); + for (const r of results.data.resources) { + if (ids.has(r._id)) { + throw new Error( + 'Export contained multiple duplicate IDs: ' + JSON.stringify(r, null, '\t'), + ); + } + ids.add(r._id); + } }); } } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json index d1169f3ea7..06d655e606 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json @@ -1,314 +1,314 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:31:41.712Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:46.908Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json index 1c6b1e93f1..2d34d042b5 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json @@ -1,38 +1,38 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:31:41.767Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:46.908Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "_id": "__GRP_1__", + "_id": "fld___WORKSPACE_ID__1b034c38", "_type": "request_group", "description": "Everything about your Pets", "environment": {}, @@ -40,7 +40,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_2__", + "_id": "fld___WORKSPACE_ID__3a21295d", "_type": "request_group", "description": "Access to Petstore orders", "environment": {}, @@ -48,7 +48,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_3__", + "_id": "fld___WORKSPACE_ID__12dea96f", "_type": "request_group", "description": "Operations about user", "environment": {}, @@ -56,283 +56,283 @@ "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__GRP_1__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__GRP_1__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_2__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__GRP_3__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json index c4fa52ef28..3464386785 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json @@ -1,314 +1,314 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:32:12.775Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:54.091Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json index 938c51722e..2158b55296 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json @@ -1,80 +1,80 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:32:12.806Z", "__export_format": 4, - "__export_date": "2018-01-09T23:33:12.799Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "", "name": "Swagger Petstore 1.0.0", - "description": "" + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v1", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "List all pets", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__26e3ae98", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "List all pets", "parameters": [ { - "name": "limit", "disabled": true, + "name": "limit", "value": "0" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "listPets" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Create a pet", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__09e1157b", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"name\": \"string\",\n \"tag\": \"string\"\n}" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createPets" + "method": "POST", + "name": "Create a pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Info for a specific pet", - "url": "{{ base_url }}/pets/{{ petId }}", - "body": {}, - "method": "GET", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__3b13e39c", "_type": "request", - "_id": "showPetById" + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "Info for a specific pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets/{{ petId }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json index 3fca9f140a..869c61dad6 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json @@ -1,38 +1,38 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:32:12.839Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:54.091Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "_id": "__GRP_1__", + "_id": "fld___WORKSPACE_ID__1b034c38", "_type": "request_group", "description": "Everything about your Pets", "environment": {}, @@ -40,7 +40,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_2__", + "_id": "fld___WORKSPACE_ID__3a21295d", "_type": "request_group", "description": "Access to Petstore orders", "environment": {}, @@ -48,7 +48,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_3__", + "_id": "fld___WORKSPACE_ID__12dea96f", "_type": "request_group", "description": "Operations about user", "environment": {}, @@ -56,283 +56,283 @@ "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__GRP_1__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__GRP_1__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_2__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__GRP_3__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml index f6dce609ed..d22a829af3 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml @@ -12,7 +12,6 @@ paths: tags: - pets summary: List all pets - operationId: listPets parameters: - name: limit in: query diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json index 468e83d6a5..5ed42cbb71 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json @@ -1,77 +1,77 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:45:14.616Z", "__export_format": 4, - "__export_date": "2018-01-09T23:33:12.799Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "", "name": "Swagger Petstore 1.0.0", - "description": "" + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v1", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "List all pets", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__2aab4183", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "List all pets", "parameters": [ { - "name": "limit", "disabled": true, + "name": "limit", "value": "0" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "listPets" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Create a pet", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__09e1157b", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "POST", + "name": "Create a pet", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createPets" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Info for a specific pet", - "url": "{{ base_url }}/pets/{{ petId }}", - "body": {}, - "method": "GET", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__3b13e39c", "_type": "request", - "_id": "showPetById" + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "Info for a specific pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets/{{ petId }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml index 995e90bf60..dd3c665b15 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml @@ -17,6 +17,7 @@ paths: get: tags: - pets + - another summary: List all pets operationId: listPets parameters: diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json index 37cd522f85..2f45f909ad 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json @@ -1,38 +1,38 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:50:19.680Z", "__export_format": 4, - "__export_date": "2018-01-09T23:33:12.799Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "", "name": "Swagger Petstore 1.0.0", - "description": "" + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v1", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "_id": "__GRP_1__", + "_id": "fld___WORKSPACE_ID__a8acce24", "_type": "request_group", "description": "Everything about your Pets", "environment": {}, @@ -40,46 +40,64 @@ "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__GRP_1__", - "name": "List all pets", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__26e3ae98", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "List all pets", "parameters": [ { - "name": "limit", "disabled": true, + "name": "limit", "value": "0" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "listPets" + "parentId": "fld___WORKSPACE_ID__a8acce24", + "url": "{{ base_url }}/pets" }, { - "parentId": "__GRP_1__", - "name": "Create a pet", - "url": "{{ base_url }}/pets", - "body": {}, - "method": "POST", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__26e3ae981", "_type": "request", - "_id": "createPets" - }, - { - "parentId": "__GRP_1__", - "name": "Info for a specific pet", - "url": "{{ base_url }}/pets/{{ petId }}", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", - "parameters": [], - "headers": [], - "authentication": {}, + "name": "List all pets", + "parameters": [ + { + "disabled": true, + "name": "limit", + "value": "0" + } + ], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" + }, + { + "_id": "req___WORKSPACE_ID__09e1157b", "_type": "request", - "_id": "showPetById" + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", + "name": "Create a pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__a8acce24", + "url": "{{ base_url }}/pets" + }, + { + "_id": "req___WORKSPACE_ID__3b13e39c", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "Info for a specific pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__a8acce24", + "url": "{{ base_url }}/pets/{{ petId }}" } ] } diff --git a/packages/insomnia-importers/src/importers/openapi3.js b/packages/insomnia-importers/src/importers/openapi3.js index b6cd4edcd1..ad8d380276 100644 --- a/packages/insomnia-importers/src/importers/openapi3.js +++ b/packages/insomnia-importers/src/importers/openapi3.js @@ -1,5 +1,7 @@ 'use strict'; +const crypto = require('crypto'); + const SwaggerParser = require('swagger-parser'); const URL = require('url').URL; const utils = require('../utils'); @@ -10,8 +12,7 @@ const MIMETYPE_LITERALLY_ANYTHING = '*/*'; const SUPPORTED_MIME_TYPES = [MIMETYPE_JSON, MIMETYPE_LITERALLY_ANYTHING]; const WORKSPACE_ID = '__WORKSPACE_ID__'; -let requestCount = 1; -let requestGroupCount = 1; +let requestCounts = {}; module.exports.id = 'openapi3'; module.exports.name = 'OpenAPI 3.0'; @@ -19,8 +20,7 @@ module.exports.description = 'Importer for OpenAPI 3.0 specification (json/yaml) module.exports.convert = async function(rawData) { // Reset - requestCount = 1; - requestGroupCount = 1; + requestCounts = {}; // Validate let api = await parseDocument(rawData); @@ -45,7 +45,7 @@ module.exports.convert = async function(rawData) { const baseEnv = { _type: 'environment', - _id: '__ENV_1__', + _id: '__BASE_ENVIRONMENT_ID__', parentId: WORKSPACE_ID, name: 'Base environment', data: { @@ -58,7 +58,7 @@ module.exports.convert = async function(rawData) { const openapiEnv = { _type: 'environment', - _id: '__ENV_2__', + _id: `env___BASE_ENVIRONMENT_ID___sub`, parentId: baseEnv._id, name: 'OpenAPI env', data: { @@ -108,7 +108,11 @@ function parseEndpoints(document) { .filter(method => method !== 'parameters') .map(method => Object.assign({}, schemasPerMethod[method], { path, method })); }) - .reduce((flat, arr) => flat.concat(arr), []); // flat single array + .reduce( + // flat single array + (flat, arr) => flat.concat(arr), + [], + ); const tags = document.tags || []; const folders = tags.map(tag => { @@ -120,14 +124,15 @@ function parseEndpoints(document) { const requests = []; endpointsSchemas.map(endpointSchema => { let { tags } = endpointSchema; - if (!tags || tags.length === 0) tags = ['']; - tags.forEach((tag, index) => { - let id = endpointSchema.operationId - ? `${endpointSchema.operationId}${index > 0 ? index : ''}` - : `__REQUEST_${requestCount++}__`; - let parentId = folderLookup[tag] || defaultParent; - requests.push(importRequest(endpointSchema, id, parentId)); - }); + + if (!tags || tags.length === 0) { + tags = ['']; + } + + for (const tag of tags) { + const parentId = folderLookup[tag] || defaultParent; + requests.push(importRequest(endpointSchema, parentId)); + } }); return [...folders, ...requests]; @@ -142,9 +147,14 @@ function parseEndpoints(document) { * @returns {Object} */ function importFolderItem(item, parentId) { + const hash = crypto + .createHash('sha1') + .update(item.name) + .digest('hex') + .slice(0, 8); return { parentId, - _id: `__GRP_${requestGroupCount++}__`, + _id: `fld___WORKSPACE_ID__${hash}`, _type: 'request_group', name: item.name || `Folder {requestGroupCount}`, description: item.description || '', @@ -156,12 +166,13 @@ function importFolderItem(item, parentId) { * * * @param {Object} endpointSchema - OpenAPI 3 endpoint schema - * @param {string} id - id to be given to current request * @param {string} parentId - id of parent category * @returns {Object} */ -function importRequest(endpointSchema, id, parentId) { - const name = endpointSchema.summary || `${endpointSchema.method} ${endpointSchema.path}`; +function importRequest(endpointSchema, parentId) { + const name = endpointSchema.summary || endpointSchema.path; + const id = generateUniqueRequestId(endpointSchema); + return { _type: 'request', _id: id, @@ -342,3 +353,31 @@ function generateParameterExample(schema) { return factory(schema); } } + +/** + * Generates a unique and deterministic request ID based on the endpoint schema + * + * @param endpointSchema + */ +function generateUniqueRequestId(endpointSchema) { + // `operationId` is unique already, so we can just use that, combined with the ID + // of the workspace to get something globally unique + const uniqueKey = endpointSchema.operationId + ? `${endpointSchema.operationId}` + : `[${endpointSchema.method}]${endpointSchema.path}`; + + const hash = crypto + .createHash('sha1') + .update(uniqueKey) + .digest('hex') + .slice(0, 8); + + // Suffix the ID with a counter in case we try creating two with the same hash + if (requestCounts.hasOwnProperty(hash)) { + requestCounts[hash]++; + } else { + requestCounts[hash] = 0; + } + + return `req_${WORKSPACE_ID}${hash}${requestCounts[hash] || ''}`; +} diff --git a/packages/insomnia-libcurl/package-lock.json b/packages/insomnia-libcurl/package-lock.json index 6529d1a2e1..d6f52596b8 100644 --- a/packages/insomnia-libcurl/package-lock.json +++ b/packages/insomnia-libcurl/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-libcurl", - "version": "0.0.27", + "version": "0.0.28", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-xpath/package-lock.json b/packages/insomnia-xpath/package-lock.json index 5cceaa4f9a..7760923c72 100644 --- a/packages/insomnia-xpath/package-lock.json +++ b/packages/insomnia-xpath/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-xpath", - "version": "1.0.13", + "version": "1.0.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-cookie-jar/package-lock.json b/plugins/insomnia-plugin-cookie-jar/package-lock.json index 5d7d6b4ce9..5c58543b99 100644 --- a/plugins/insomnia-plugin-cookie-jar/package-lock.json +++ b/plugins/insomnia-plugin-cookie-jar/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-cookie-jar", - "version": "1.0.14", + "version": "1.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-jsonpath/package-lock.json b/plugins/insomnia-plugin-jsonpath/package-lock.json index 35deb7f5e0..8050d95bda 100644 --- a/plugins/insomnia-plugin-jsonpath/package-lock.json +++ b/plugins/insomnia-plugin-jsonpath/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-jsonpath", - "version": "1.0.17", + "version": "1.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-now/package-lock.json b/plugins/insomnia-plugin-now/package-lock.json index d8e274e41f..a41acca753 100644 --- a/plugins/insomnia-plugin-now/package-lock.json +++ b/plugins/insomnia-plugin-now/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-now", - "version": "1.0.15", + "version": "1.0.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-os/package-lock.json b/plugins/insomnia-plugin-os/package-lock.json index ab9c70b82d..25b10eb5c9 100644 --- a/plugins/insomnia-plugin-os/package-lock.json +++ b/plugins/insomnia-plugin-os/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-os", - "version": "1.0.17", + "version": "1.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-uuid/package-lock.json b/plugins/insomnia-plugin-uuid/package-lock.json index 2ba316d322..03b528fa4b 100644 --- a/plugins/insomnia-plugin-uuid/package-lock.json +++ b/plugins/insomnia-plugin-uuid/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-uuid", - "version": "1.0.14", + "version": "1.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { From 899926450aab233da2afefe88afcb3e5307c9814 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 15 Aug 2019 14:06:55 -0700 Subject: [PATCH 005/100] Fix tests --- packages/insomnia-app/app/common/import.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/insomnia-app/app/common/import.js b/packages/insomnia-app/app/common/import.js index 8a3bcacf96..c9608fc331 100644 --- a/packages/insomnia-app/app/common/import.js +++ b/packages/insomnia-app/app/common/import.js @@ -163,9 +163,14 @@ export async function importRaw( // Replace ID placeholders (eg. __WORKSPACE_ID__) with generated values for (const key of Object.keys(generatedIds)) { const { parentId, _id } = resource; - const id = await fnOrString(generatedIds[key]); - resource.parentId = parentId ? parentId.replace(key, id) : parentId; - resource._id = _id ? _id.replace(key, id) : _id; + + if (parentId && parentId.includes(key)) { + resource.parentId = parentId.replace(key, await fnOrString(generatedIds[key])); + } + + if (_id && _id.includes(key)) { + resource._id = _id.replace(key, await fnOrString(generatedIds[key])); + } } const model: Object = MODELS[resource._type]; From 0a3a26c726eb985b9d3e7de8970e176565b974ca Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 15 Aug 2019 14:29:01 -0700 Subject: [PATCH 006/100] Make OpenAPI importer generate deterministic IDs (#1641) * Make OpenAPI importer generate deterministic IDs * Fix tests --- packages/insomnia-app/app/common/import.js | 24 +- packages/insomnia-cookies/package-lock.json | 2 +- packages/insomnia-importers/package-lock.json | 2 +- .../src/__tests__/fixtures.test.js | 10 + .../openapi3/dereferenced-output.json | 350 ++++++++--------- .../dereferenced-with-tags-output.json | 356 +++++++++--------- .../fixtures/openapi3/petstore-output.json | 350 ++++++++--------- .../openapi3/petstore-readonly-output.json | 80 ++-- .../openapi3/petstore-with-tags-output.json | 356 +++++++++--------- .../fixtures/openapi3/petstore-yml-input.yml | 1 - .../openapi3/petstore-yml-output.json | 78 ++-- .../openapi3/petstore-yml-with-tags-input.yml | 1 + .../petstore-yml-with-tags-output.json | 102 ++--- .../src/importers/openapi3.js | 77 +++- packages/insomnia-libcurl/package-lock.json | 2 +- packages/insomnia-xpath/package-lock.json | 2 +- .../package-lock.json | 2 +- .../package-lock.json | 2 +- plugins/insomnia-plugin-now/package-lock.json | 2 +- plugins/insomnia-plugin-os/package-lock.json | 2 +- .../insomnia-plugin-uuid/package-lock.json | 2 +- 21 files changed, 936 insertions(+), 867 deletions(-) diff --git a/packages/insomnia-app/app/common/import.js b/packages/insomnia-app/app/common/import.js index f69fe10c5f..c9608fc331 100644 --- a/packages/insomnia-app/app/common/import.js +++ b/packages/insomnia-app/app/common/import.js @@ -24,7 +24,7 @@ const EXPORT_TYPE_COOKIE_JAR = 'cookie_jar'; const EXPORT_TYPE_ENVIRONMENT = 'environment'; // If we come across an ID of this form, we will replace it with a new one -const REPLACE_ID_REGEX = /^__\w+_\d+__$/; +const REPLACE_ID_REGEX = /__\w+_\d+__/g; const MODELS = { [EXPORT_TYPE_REQUEST]: models.request, @@ -87,7 +87,6 @@ export async function importUri( export async function importRaw( getWorkspaceId: () => Promise, rawContent: string, - generateNewIds: boolean = false, ): Promise<{ source: string, error: Error | null, @@ -109,8 +108,8 @@ export async function importRaw( // Generate all the ids we may need const generatedIds: { [string]: string | Function } = {}; for (const r of data.resources) { - if (generateNewIds || r._id.match(REPLACE_ID_REGEX)) { - generatedIds[r._id] = generateId(MODELS[r._type].prefix); + for (const key of r._id.match(REPLACE_ID_REGEX) || []) { + generatedIds[key] = generateId(MODELS[r._type].prefix); } } @@ -161,14 +160,17 @@ export async function importRaw( resource.parentId = WORKSPACE_ID_KEY; } - // Replace _id if we need to - if (generatedIds[resource._id]) { - resource._id = await fnOrString(generatedIds[resource._id]); - } + // Replace ID placeholders (eg. __WORKSPACE_ID__) with generated values + for (const key of Object.keys(generatedIds)) { + const { parentId, _id } = resource; - // Replace newly generated IDs if they exist - if (generatedIds[resource.parentId]) { - resource.parentId = await fnOrString(generatedIds[resource.parentId]); + if (parentId && parentId.includes(key)) { + resource.parentId = parentId.replace(key, await fnOrString(generatedIds[key])); + } + + if (_id && _id.includes(key)) { + resource._id = _id.replace(key, await fnOrString(generatedIds[key])); + } } const model: Object = MODELS[resource._type]; diff --git a/packages/insomnia-cookies/package-lock.json b/packages/insomnia-cookies/package-lock.json index 835b049506..e09e615b8a 100644 --- a/packages/insomnia-cookies/package-lock.json +++ b/packages/insomnia-cookies/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-cookies", - "version": "0.0.16", + "version": "0.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-importers/package-lock.json b/packages/insomnia-importers/package-lock.json index 1761a84a6b..dce277d721 100644 --- a/packages/insomnia-importers/package-lock.json +++ b/packages/insomnia-importers/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-importers", - "version": "2.0.19", + "version": "2.0.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-importers/src/__tests__/fixtures.test.js b/packages/insomnia-importers/src/__tests__/fixtures.test.js index 099a32b382..d5281f56c7 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures.test.js +++ b/packages/insomnia-importers/src/__tests__/fixtures.test.js @@ -32,6 +32,16 @@ describe('Fixtures', () => { expected.__export_date = results.data.__export_date; expect(results.data).toEqual(expected); + + const ids = new Set(); + for (const r of results.data.resources) { + if (ids.has(r._id)) { + throw new Error( + 'Export contained multiple duplicate IDs: ' + JSON.stringify(r, null, '\t'), + ); + } + ids.add(r._id); + } }); } } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json index d1169f3ea7..06d655e606 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json @@ -1,314 +1,314 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:31:41.712Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:46.908Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json index 1c6b1e93f1..2d34d042b5 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json @@ -1,38 +1,38 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:31:41.767Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:46.908Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "_id": "__GRP_1__", + "_id": "fld___WORKSPACE_ID__1b034c38", "_type": "request_group", "description": "Everything about your Pets", "environment": {}, @@ -40,7 +40,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_2__", + "_id": "fld___WORKSPACE_ID__3a21295d", "_type": "request_group", "description": "Access to Petstore orders", "environment": {}, @@ -48,7 +48,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_3__", + "_id": "fld___WORKSPACE_ID__12dea96f", "_type": "request_group", "description": "Operations about user", "environment": {}, @@ -56,283 +56,283 @@ "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__GRP_1__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__GRP_1__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_2__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__GRP_3__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json index c4fa52ef28..3464386785 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json @@ -1,314 +1,314 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:32:12.775Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:54.091Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__WORKSPACE_ID__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json index 938c51722e..2158b55296 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-readonly-output.json @@ -1,80 +1,80 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:32:12.806Z", "__export_format": 4, - "__export_date": "2018-01-09T23:33:12.799Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "", "name": "Swagger Petstore 1.0.0", - "description": "" + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v1", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "List all pets", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__26e3ae98", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "List all pets", "parameters": [ { - "name": "limit", "disabled": true, + "name": "limit", "value": "0" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "listPets" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Create a pet", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__09e1157b", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"name\": \"string\",\n \"tag\": \"string\"\n}" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createPets" + "method": "POST", + "name": "Create a pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Info for a specific pet", - "url": "{{ base_url }}/pets/{{ petId }}", - "body": {}, - "method": "GET", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__3b13e39c", "_type": "request", - "_id": "showPetById" + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "Info for a specific pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets/{{ petId }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json index 3fca9f140a..869c61dad6 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json @@ -1,38 +1,38 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:32:12.839Z", "__export_format": 4, - "__export_date": "2018-01-09T23:32:54.091Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "name": "Swagger Petstore 1.0.0", - "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters." + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v2", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "_id": "__GRP_1__", + "_id": "fld___WORKSPACE_ID__1b034c38", "_type": "request_group", "description": "Everything about your Pets", "environment": {}, @@ -40,7 +40,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_2__", + "_id": "fld___WORKSPACE_ID__3a21295d", "_type": "request_group", "description": "Access to Petstore orders", "environment": {}, @@ -48,7 +48,7 @@ "parentId": "__WORKSPACE_ID__" }, { - "_id": "__GRP_3__", + "_id": "fld___WORKSPACE_ID__12dea96f", "_type": "request_group", "description": "Operations about user", "environment": {}, @@ -56,283 +56,283 @@ "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__GRP_1__", - "name": "Add a new pet to the store", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__23acbe44", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, + "headers": [], "method": "POST", + "name": "Add a new pet to the store", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "addPet" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Update an existing pet", - "url": "{{ base_url }}/pet", + "_id": "req___WORKSPACE_ID__74a7a059", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/json", "text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}" }, - "method": "PUT", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePet" + "method": "PUT", + "name": "Update an existing pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by status", - "url": "{{ base_url }}/pet/findByStatus", + "_id": "req___WORKSPACE_ID__80ab0d08", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by status", "parameters": [ { - "name": "status", "disabled": false, + "name": "status", "value": "available" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByStatus" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByStatus" }, { - "parentId": "__GRP_1__", - "name": "Finds Pets by tags", - "url": "{{ base_url }}/pet/findByTags", + "_id": "req___WORKSPACE_ID__42a17980", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Finds Pets by tags", "parameters": [ { - "name": "tags", "disabled": false, + "name": "tags", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "findPetsByTags" + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/findByTags" }, { - "parentId": "__GRP_1__", - "name": "Find pet by ID", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__3d1a51d3", + "_type": "request", + "authentication": {}, "body": {}, - "method": "GET", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getPetById" + "method": "GET", + "name": "Find pet by ID", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Updates a pet in the store with form data", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__a4608701", + "_type": "request", + "authentication": {}, "body": { "mimeType": "application/x-www-form-urlencoded" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updatePetWithForm" + "method": "POST", + "name": "Updates a pet in the store with form data", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "Deletes a pet", - "url": "{{ base_url }}/pet/{{ petId }}", + "_id": "req___WORKSPACE_ID__e804bd05", + "_type": "request", + "authentication": {}, "body": {}, - "method": "DELETE", - "parameters": [], "headers": [ { - "name": "api_key", "disabled": true, + "name": "api_key", "value": "string" } ], - "authentication": {}, - "_type": "request", - "_id": "deletePet" + "method": "DELETE", + "name": "Deletes a pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}" }, { - "parentId": "__GRP_1__", - "name": "uploads an image", - "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", + "_id": "req___WORKSPACE_ID__8081fb6f", + "_type": "request", + "authentication": {}, "body": { "mimeType": "multipart/form-data" }, - "method": "POST", - "parameters": [], "headers": [], - "authentication": {}, - "_type": "request", - "_id": "uploadFile" + "method": "POST", + "name": "uploads an image", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__1b034c38", + "url": "{{ base_url }}/pet/{{ petId }}/uploadImage" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__443ac9e7", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Returns pet inventories by status", - "url": "{{ base_url }}/store/inventory", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getInventory" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/inventory" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__e24a4f9e", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Place an order for a pet", - "url": "{{ base_url }}/store/order", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "placeOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order" }, { - "parentId": "__GRP_2__", + "_id": "req___WORKSPACE_ID__f021bcd3", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Find purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getOrderById" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_2__", - "name": "Delete purchase order by ID", - "url": "{{ base_url }}/store/order/{{ orderId }}", + "_id": "req___WORKSPACE_ID__15e47538", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "DELETE", + "name": "Delete purchase order by ID", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "deleteOrder" + "parentId": "fld___WORKSPACE_ID__3a21295d", + "url": "{{ base_url }}/store/order/{{ orderId }}" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__fe3d55d0", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Create user", - "url": "{{ base_url }}/user", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__4cb83333", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithArray", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithArrayInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithArray" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__e94a615f", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", "name": "Creates list of users with given input array", - "url": "{{ base_url }}/user/createWithList", - "body": {}, - "method": "POST", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createUsersWithListInput" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/createWithList" }, { - "parentId": "__GRP_3__", - "name": "Logs user into the system", - "url": "{{ base_url }}/user/login", + "_id": "req___WORKSPACE_ID__00ac9da2", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "Logs user into the system", "parameters": [ { - "name": "username", "disabled": false, + "name": "username", "value": "string" }, { - "name": "password", "disabled": false, + "name": "password", "value": "string" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "loginUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/login" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__740025cb", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Logs out current logged in user session", - "url": "{{ base_url }}/user/logout", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "logoutUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/logout" }, { - "parentId": "__GRP_3__", + "_id": "req___WORKSPACE_ID__74f1d1d1", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", "name": "Get user by user name", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "GET", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "getUserByName" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Updated user", - "url": "{{ base_url }}/user/{{ username }}", + "_id": "req___WORKSPACE_ID__6d74493f", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "PUT", + "name": "Updated user", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "updateUser" + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" }, { - "parentId": "__GRP_3__", - "name": "Delete user", - "url": "{{ base_url }}/user/{{ username }}", - "body": {}, - "method": "DELETE", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__38e8e88f", "_type": "request", - "_id": "deleteUser" + "authentication": {}, + "body": {}, + "headers": [], + "method": "DELETE", + "name": "Delete user", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__12dea96f", + "url": "{{ base_url }}/user/{{ username }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml index f6dce609ed..d22a829af3 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-input.yml @@ -12,7 +12,6 @@ paths: tags: - pets summary: List all pets - operationId: listPets parameters: - name: limit in: query diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json index 468e83d6a5..5ed42cbb71 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-output.json @@ -1,77 +1,77 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:45:14.616Z", "__export_format": 4, - "__export_date": "2018-01-09T23:33:12.799Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "", "name": "Swagger Petstore 1.0.0", - "description": "" + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v1", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "parentId": "__WORKSPACE_ID__", - "name": "List all pets", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__2aab4183", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "List all pets", "parameters": [ { - "name": "limit", "disabled": true, + "name": "limit", "value": "0" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "listPets" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Create a pet", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__09e1157b", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "POST", + "name": "Create a pet", "parameters": [], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "createPets" + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" }, { - "parentId": "__WORKSPACE_ID__", - "name": "Info for a specific pet", - "url": "{{ base_url }}/pets/{{ petId }}", - "body": {}, - "method": "GET", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__3b13e39c", "_type": "request", - "_id": "showPetById" + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "Info for a specific pet", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets/{{ petId }}" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml index 995e90bf60..dd3c665b15 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-input.yml @@ -17,6 +17,7 @@ paths: get: tags: - pets + - another summary: List all pets operationId: listPets parameters: diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json index 37cd522f85..2f45f909ad 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-yml-with-tags-output.json @@ -1,38 +1,38 @@ { - "_type": "export", + "__export_date": "2019-08-15T19:50:19.680Z", "__export_format": 4, - "__export_date": "2018-01-09T23:33:12.799Z", "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", "resources": [ { - "_type": "workspace", "_id": "__WORKSPACE_ID__", - "parentId": null, + "_type": "workspace", + "description": "", "name": "Swagger Petstore 1.0.0", - "description": "" + "parentId": null }, { - "parentId": "__WORKSPACE_ID__", - "name": "Base environment", + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", "data": { "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" }, - "_type": "environment", - "_id": "__ENV_1__" + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__ENV_1__", - "name": "OpenAPI env", + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", "data": { "base_path": "/v1", - "scheme": "http", - "host": "petstore.swagger.io" + "host": "petstore.swagger.io", + "scheme": "http" }, - "_type": "environment", - "_id": "__ENV_2__" + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" }, { - "_id": "__GRP_1__", + "_id": "fld___WORKSPACE_ID__a8acce24", "_type": "request_group", "description": "Everything about your Pets", "environment": {}, @@ -40,46 +40,64 @@ "parentId": "__WORKSPACE_ID__" }, { - "parentId": "__GRP_1__", - "name": "List all pets", - "url": "{{ base_url }}/pets", + "_id": "req___WORKSPACE_ID__26e3ae98", + "_type": "request", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", + "name": "List all pets", "parameters": [ { - "name": "limit", "disabled": true, + "name": "limit", "value": "0" } ], - "headers": [], - "authentication": {}, - "_type": "request", - "_id": "listPets" + "parentId": "fld___WORKSPACE_ID__a8acce24", + "url": "{{ base_url }}/pets" }, { - "parentId": "__GRP_1__", - "name": "Create a pet", - "url": "{{ base_url }}/pets", - "body": {}, - "method": "POST", - "parameters": [], - "headers": [], - "authentication": {}, + "_id": "req___WORKSPACE_ID__26e3ae981", "_type": "request", - "_id": "createPets" - }, - { - "parentId": "__GRP_1__", - "name": "Info for a specific pet", - "url": "{{ base_url }}/pets/{{ petId }}", + "authentication": {}, "body": {}, + "headers": [], "method": "GET", - "parameters": [], - "headers": [], - "authentication": {}, + "name": "List all pets", + "parameters": [ + { + "disabled": true, + "name": "limit", + "value": "0" + } + ], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/pets" + }, + { + "_id": "req___WORKSPACE_ID__09e1157b", "_type": "request", - "_id": "showPetById" + "authentication": {}, + "body": {}, + "headers": [], + "method": "POST", + "name": "Create a pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__a8acce24", + "url": "{{ base_url }}/pets" + }, + { + "_id": "req___WORKSPACE_ID__3b13e39c", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "Info for a specific pet", + "parameters": [], + "parentId": "fld___WORKSPACE_ID__a8acce24", + "url": "{{ base_url }}/pets/{{ petId }}" } ] } diff --git a/packages/insomnia-importers/src/importers/openapi3.js b/packages/insomnia-importers/src/importers/openapi3.js index b6cd4edcd1..ad8d380276 100644 --- a/packages/insomnia-importers/src/importers/openapi3.js +++ b/packages/insomnia-importers/src/importers/openapi3.js @@ -1,5 +1,7 @@ 'use strict'; +const crypto = require('crypto'); + const SwaggerParser = require('swagger-parser'); const URL = require('url').URL; const utils = require('../utils'); @@ -10,8 +12,7 @@ const MIMETYPE_LITERALLY_ANYTHING = '*/*'; const SUPPORTED_MIME_TYPES = [MIMETYPE_JSON, MIMETYPE_LITERALLY_ANYTHING]; const WORKSPACE_ID = '__WORKSPACE_ID__'; -let requestCount = 1; -let requestGroupCount = 1; +let requestCounts = {}; module.exports.id = 'openapi3'; module.exports.name = 'OpenAPI 3.0'; @@ -19,8 +20,7 @@ module.exports.description = 'Importer for OpenAPI 3.0 specification (json/yaml) module.exports.convert = async function(rawData) { // Reset - requestCount = 1; - requestGroupCount = 1; + requestCounts = {}; // Validate let api = await parseDocument(rawData); @@ -45,7 +45,7 @@ module.exports.convert = async function(rawData) { const baseEnv = { _type: 'environment', - _id: '__ENV_1__', + _id: '__BASE_ENVIRONMENT_ID__', parentId: WORKSPACE_ID, name: 'Base environment', data: { @@ -58,7 +58,7 @@ module.exports.convert = async function(rawData) { const openapiEnv = { _type: 'environment', - _id: '__ENV_2__', + _id: `env___BASE_ENVIRONMENT_ID___sub`, parentId: baseEnv._id, name: 'OpenAPI env', data: { @@ -108,7 +108,11 @@ function parseEndpoints(document) { .filter(method => method !== 'parameters') .map(method => Object.assign({}, schemasPerMethod[method], { path, method })); }) - .reduce((flat, arr) => flat.concat(arr), []); // flat single array + .reduce( + // flat single array + (flat, arr) => flat.concat(arr), + [], + ); const tags = document.tags || []; const folders = tags.map(tag => { @@ -120,14 +124,15 @@ function parseEndpoints(document) { const requests = []; endpointsSchemas.map(endpointSchema => { let { tags } = endpointSchema; - if (!tags || tags.length === 0) tags = ['']; - tags.forEach((tag, index) => { - let id = endpointSchema.operationId - ? `${endpointSchema.operationId}${index > 0 ? index : ''}` - : `__REQUEST_${requestCount++}__`; - let parentId = folderLookup[tag] || defaultParent; - requests.push(importRequest(endpointSchema, id, parentId)); - }); + + if (!tags || tags.length === 0) { + tags = ['']; + } + + for (const tag of tags) { + const parentId = folderLookup[tag] || defaultParent; + requests.push(importRequest(endpointSchema, parentId)); + } }); return [...folders, ...requests]; @@ -142,9 +147,14 @@ function parseEndpoints(document) { * @returns {Object} */ function importFolderItem(item, parentId) { + const hash = crypto + .createHash('sha1') + .update(item.name) + .digest('hex') + .slice(0, 8); return { parentId, - _id: `__GRP_${requestGroupCount++}__`, + _id: `fld___WORKSPACE_ID__${hash}`, _type: 'request_group', name: item.name || `Folder {requestGroupCount}`, description: item.description || '', @@ -156,12 +166,13 @@ function importFolderItem(item, parentId) { * * * @param {Object} endpointSchema - OpenAPI 3 endpoint schema - * @param {string} id - id to be given to current request * @param {string} parentId - id of parent category * @returns {Object} */ -function importRequest(endpointSchema, id, parentId) { - const name = endpointSchema.summary || `${endpointSchema.method} ${endpointSchema.path}`; +function importRequest(endpointSchema, parentId) { + const name = endpointSchema.summary || endpointSchema.path; + const id = generateUniqueRequestId(endpointSchema); + return { _type: 'request', _id: id, @@ -342,3 +353,31 @@ function generateParameterExample(schema) { return factory(schema); } } + +/** + * Generates a unique and deterministic request ID based on the endpoint schema + * + * @param endpointSchema + */ +function generateUniqueRequestId(endpointSchema) { + // `operationId` is unique already, so we can just use that, combined with the ID + // of the workspace to get something globally unique + const uniqueKey = endpointSchema.operationId + ? `${endpointSchema.operationId}` + : `[${endpointSchema.method}]${endpointSchema.path}`; + + const hash = crypto + .createHash('sha1') + .update(uniqueKey) + .digest('hex') + .slice(0, 8); + + // Suffix the ID with a counter in case we try creating two with the same hash + if (requestCounts.hasOwnProperty(hash)) { + requestCounts[hash]++; + } else { + requestCounts[hash] = 0; + } + + return `req_${WORKSPACE_ID}${hash}${requestCounts[hash] || ''}`; +} diff --git a/packages/insomnia-libcurl/package-lock.json b/packages/insomnia-libcurl/package-lock.json index 6529d1a2e1..d6f52596b8 100644 --- a/packages/insomnia-libcurl/package-lock.json +++ b/packages/insomnia-libcurl/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-libcurl", - "version": "0.0.27", + "version": "0.0.28", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-xpath/package-lock.json b/packages/insomnia-xpath/package-lock.json index 5cceaa4f9a..7760923c72 100644 --- a/packages/insomnia-xpath/package-lock.json +++ b/packages/insomnia-xpath/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-xpath", - "version": "1.0.13", + "version": "1.0.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-cookie-jar/package-lock.json b/plugins/insomnia-plugin-cookie-jar/package-lock.json index 5d7d6b4ce9..5c58543b99 100644 --- a/plugins/insomnia-plugin-cookie-jar/package-lock.json +++ b/plugins/insomnia-plugin-cookie-jar/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-cookie-jar", - "version": "1.0.14", + "version": "1.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-jsonpath/package-lock.json b/plugins/insomnia-plugin-jsonpath/package-lock.json index 35deb7f5e0..8050d95bda 100644 --- a/plugins/insomnia-plugin-jsonpath/package-lock.json +++ b/plugins/insomnia-plugin-jsonpath/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-jsonpath", - "version": "1.0.17", + "version": "1.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-now/package-lock.json b/plugins/insomnia-plugin-now/package-lock.json index d8e274e41f..a41acca753 100644 --- a/plugins/insomnia-plugin-now/package-lock.json +++ b/plugins/insomnia-plugin-now/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-now", - "version": "1.0.15", + "version": "1.0.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-os/package-lock.json b/plugins/insomnia-plugin-os/package-lock.json index ab9c70b82d..25b10eb5c9 100644 --- a/plugins/insomnia-plugin-os/package-lock.json +++ b/plugins/insomnia-plugin-os/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-os", - "version": "1.0.17", + "version": "1.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-uuid/package-lock.json b/plugins/insomnia-plugin-uuid/package-lock.json index 2ba316d322..03b528fa4b 100644 --- a/plugins/insomnia-plugin-uuid/package-lock.json +++ b/plugins/insomnia-plugin-uuid/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-uuid", - "version": "1.0.14", + "version": "1.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { From e965de17f9f400c289419d862eeabf6bbabc4222 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 15 Aug 2019 14:53:27 -0700 Subject: [PATCH 007/100] Still show nunjucks tag label when render error present --- .../codemirror/extensions/nunjucks-tags.js | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/codemirror/extensions/nunjucks-tags.js b/packages/insomnia-app/app/ui/components/codemirror/extensions/nunjucks-tags.js index 9dc111bb1e..a725076fa6 100644 --- a/packages/insomnia-app/app/ui/components/codemirror/extensions/nunjucks-tags.js +++ b/packages/insomnia-app/app/ui/components/codemirror/extensions/nunjucks-tags.js @@ -240,16 +240,16 @@ async function _updateElementText(render, mark, text, renderContext, isVariableU let dataIgnore = ''; let dataError = ''; - try { - const str = text.replace(/\\/g, ''); - const tagMatch = str.match(/{% *([^ ]+) *.*%}/); - const cleanedStr = str - .replace(/^{%/, '') - .replace(/%}$/, '') - .replace(/^{{/, '') - .replace(/}}$/, '') - .trim(); + const str = text.replace(/\\/g, ''); + const tagMatch = str.match(/{% *([^ ]+) *.*%}/); + const cleanedStr = str + .replace(/^{%/, '') + .replace(/%}$/, '') + .replace(/^{{/, '') + .replace(/}}$/, '') + .trim(); + try { if (tagMatch) { const tagData = tokenizeTag(str); const tagDefinition = (await getTagDefinitions()).find(d => d.name === tagData.name); @@ -281,9 +281,7 @@ async function _updateElementText(render, mark, text, renderContext, isVariableU } dataError = 'off'; } catch (err) { - const fullMessage = err.message.replace(/\[.+,.+]\s*/, ''); - let message = fullMessage; - title = message; + title = err.message.replace(/\[.+,.+]\s*/, ''); dataError = 'on'; } @@ -291,7 +289,7 @@ async function _updateElementText(render, mark, text, renderContext, isVariableU el.setAttribute('data-ignore', dataIgnore); if (dataError === 'on') { el.setAttribute('data-error', dataError); - el.innerHTML = '' + innerHTML; + el.innerHTML = '' + cleanedStr; } else { el.innerHTML = '' + innerHTML; } From 5e53c82972caba495203876ab8066dc94edf9a14 Mon Sep 17 00:00:00 2001 From: Gabrz <37636455+Gabrz@users.noreply.github.com> Date: Fri, 16 Aug 2019 22:54:01 +0200 Subject: [PATCH 008/100] [Bug Fix 1288] "Undefined" for nested variables (#1637) * Update nunjucks-tags.js (Fixes bug #1288) Extract parent from nunjucks tag when it is a nested property nested. The parent is then used to fetch the keyContext * Revert "Update nunjucks-tags.js" This reverts commit 4d4da99de3220ee38632081bc405d964a468fc4c. * Update render.js Added function that recursively gets the keys. So they will show the correct parent location in the nunjuck tooltip. * Rework after review from gschier A few little changes after review of the initial change. * Added keySource for Arrays Added loop to store Key and Source when item is an Array. --- packages/insomnia-app/app/common/render.js | 36 +++++++++++++++------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/packages/insomnia-app/app/common/render.js b/packages/insomnia-app/app/common/render.js index 43739a325f..f5df8f9e24 100644 --- a/packages/insomnia-app/app/common/render.js +++ b/packages/insomnia-app/app/common/render.js @@ -237,18 +237,34 @@ export async function getRenderContext( const subEnvironment = await models.environment.getById(environmentId || 'n/a'); let keySource = {}; - for (let key in (rootEnvironment || {}).data) { - keySource[key] = 'root'; - } - - if (subEnvironment) { - for (const key of Object.keys(subEnvironment.data || {})) { - if (subEnvironment.name) { - keySource[key] = subEnvironment.name; + // Function that gets Keys and stores their Source location + function getKeySource(subObject, inKey, inSource) { + for (const key of Object.keys(subObject)) { + if (Object.prototype.toString.call(subObject[key]) === '[object Object]') { + // Type is an Object, keep on going, recursively building the full key path + getKeySource(subObject[key], inKey + key + '.', inSource); + } else if (Object.prototype.toString.call(subObject[key]) === '[object Array]') { + // Type is an Array, Loop and store the full Key and Source in keySource + for (let i = 0, length = subObject[key].length; i < length; i++) { + keySource[inKey + key + '[' + i + ']'] = inSource; + } + } else { + // For all other types, store the full Key and Source in keySource + keySource[inKey + key] = inSource; } } + return keySource; } + // Get Keys from root environment + getKeySource((rootEnvironment || {}).data, '', 'root'); + + // Get Keys from sub environment + if (subEnvironment) { + getKeySource(subEnvironment.data || {}, '', subEnvironment.name || ''); + } + + // Get Keys from ancestors (e.g. Folders) if (ancestors) { for (let idx = 0; idx < ancestors.length; idx++) { let ancestor: any = ancestors[idx] || {}; @@ -257,9 +273,7 @@ export async function getRenderContext( ancestor.hasOwnProperty('environment') && ancestor.hasOwnProperty('name') ) { - for (const key of Object.keys(ancestor.environment || {})) { - keySource[key] = ancestor.name || ''; - } + getKeySource(ancestor.environment || {}, '', ancestor.name || ''); } } } From d4a4efc515894169f0018a39400ef6ec954da5e4 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 16 Aug 2019 14:19:25 -0700 Subject: [PATCH 009/100] Tweak keysource alg for more robust recursion --- packages/insomnia-app/app/common/render.js | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/insomnia-app/app/common/render.js b/packages/insomnia-app/app/common/render.js index f5df8f9e24..4a02d424aa 100644 --- a/packages/insomnia-app/app/common/render.js +++ b/packages/insomnia-app/app/common/render.js @@ -236,24 +236,26 @@ export async function getRenderContext( ); const subEnvironment = await models.environment.getById(environmentId || 'n/a'); - let keySource = {}; + const keySource = {}; + // Function that gets Keys and stores their Source location function getKeySource(subObject, inKey, inSource) { - for (const key of Object.keys(subObject)) { - if (Object.prototype.toString.call(subObject[key]) === '[object Object]') { - // Type is an Object, keep on going, recursively building the full key path - getKeySource(subObject[key], inKey + key + '.', inSource); - } else if (Object.prototype.toString.call(subObject[key]) === '[object Array]') { - // Type is an Array, Loop and store the full Key and Source in keySource - for (let i = 0, length = subObject[key].length; i < length; i++) { - keySource[inKey + key + '[' + i + ']'] = inSource; - } - } else { - // For all other types, store the full Key and Source in keySource - keySource[inKey + key] = inSource; + // Add key to map if it's not root + if (inKey) { + keySource[inKey] = inSource; + } + + // Recurse down for Objects and Arrays + const typeStr = Object.prototype.toString.call(subObject); + if (typeStr === '[object Object]') { + for (const key of Object.keys(subObject)) { + getKeySource(subObject[key], inKey ? `${inKey}.${key}` : key, inSource); + } + } else if (typeStr === '[object Array]') { + for (let i = 0; i < subObject.length; i++) { + getKeySource(subObject[i], `${inKey}[${i}]`, inSource); } } - return keySource; } // Get Keys from root environment From 57bf6c2df28c34c57f2b5626e1b9fc07d59b6005 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 20 Aug 2019 11:24:53 -0700 Subject: [PATCH 010/100] Always show GraphQL introspection errors (Fixes #1643) --- .../editors/body/graph-ql-editor.js | 10 +++++--- .../components/modals/response-debug-modal.js | 24 ++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js index 8011ab5962..9b89f88e07 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js +++ b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js @@ -227,7 +227,7 @@ class GraphQLEditor extends React.PureComponent { const { response } = schemaFetchError; showModal(ResponseDebugModal, { - title: 'Introspection Request', + title: 'GraphQL Introspection Response', response: response, }); } @@ -345,8 +345,12 @@ class GraphQLEditor extends React.PureComponent { }); } - async _handleRefreshSchema(): Promise { - await this._fetchAndSetSchema(this.props.request); + _handleRefreshSchema() { + // First, "forget" preference to hide errors so they always show + // again after a refresh + this.setState({ hideSchemaFetchErrors: false }, async () => { + await this._fetchAndSetSchema(this.props.request); + }); } async _handleToggleAutomaticFetching(): Promise { diff --git a/packages/insomnia-app/app/ui/components/modals/response-debug-modal.js b/packages/insomnia-app/app/ui/components/modals/response-debug-modal.js index 793972d6fc..6842b9d606 100644 --- a/packages/insomnia-app/app/ui/components/modals/response-debug-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/response-debug-modal.js @@ -9,11 +9,14 @@ import * as models from '../../../models/index'; import type { Response } from '../../../models/response'; import type { Settings } from '../../../models/settings'; -type Props = { settings: Settings }; +type Props = {| + settings: Settings, +|}; -type State = { +type State = {| response: Response | null, -}; + title: string | null, +|}; @autobind class ResponseDebugModal extends React.PureComponent { @@ -24,6 +27,7 @@ class ResponseDebugModal extends React.PureComponent { this.state = { response: null, + title: '', }; } @@ -35,24 +39,28 @@ class ResponseDebugModal extends React.PureComponent { this.modal && this.modal.hide(); } - async show(options: { responseId?: string, response?: Response }) { + async show(options: { responseId?: string, response?: Response, title?: string }) { const response = options.response ? options.response : await models.response.getById(options.responseId || 'n/a'); - this.setState({ response }); + this.setState({ + response, + title: options.title || null, + }); + this.modal && this.modal.show(); } render() { const { settings } = this.props; - const { response } = this.state; + const { response, title } = this.state; return ( - OAuth 2 Response + {title || 'Response Timeline'} -
+
{response ? ( Date: Tue, 20 Aug 2019 17:24:18 -0700 Subject: [PATCH 011/100] Base64 encode JSONPath template tag --- packages/insomnia-app/app/common/hotkeys.js | 26 +++++++++++++++++++++ plugins/insomnia-plugin-jsonpath/index.js | 1 + 2 files changed, 27 insertions(+) diff --git a/packages/insomnia-app/app/common/hotkeys.js b/packages/insomnia-app/app/common/hotkeys.js index 4dbb37c64e..efaf5142c3 100644 --- a/packages/insomnia-app/app/common/hotkeys.js +++ b/packages/insomnia-app/app/common/hotkeys.js @@ -487,3 +487,29 @@ export function constructKeyCombinationDisplay( } return joint; } + +/** + * Construct the display string for a key combination + * + * @param hotKeyDef + * @param hotKeyRegistry + * @param mustUsePlus + * @returns {string} – key combination as string or empty string if not found + */ +export function getHotKeyDisplay( + hotKeyDef: HotKeyDefinition, + hotKeyRegistry: HotKeyRegistry, + mustUsePlus: boolean, +) { + const hotKey: ?KeyBindings = hotKeyRegistry[hotKeyDef.id]; + if (!hotKey) { + return ''; + } + + const keyCombs: Array = getPlatformKeyCombinations(hotKey); + if (keyCombs.length === 0) { + return ''; + } + + return constructKeyCombinationDisplay(keyCombs[0], mustUsePlus); +} diff --git a/plugins/insomnia-plugin-jsonpath/index.js b/plugins/insomnia-plugin-jsonpath/index.js index fc76b9ca7c..f532541d2e 100644 --- a/plugins/insomnia-plugin-jsonpath/index.js +++ b/plugins/insomnia-plugin-jsonpath/index.js @@ -12,6 +12,7 @@ module.exports.templateTags = [ }, { displayName: 'JSONPath Filter', + encoding: 'base64', // So it doesn't cause syntax errors type: 'string', }, ], From 32a45ac8bfab162e677fddedb99ac68c240e2982 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 21 Aug 2019 10:43:54 -0700 Subject: [PATCH 012/100] Consider min x/y when clamping initial window (Fixes #1255) --- packages/insomnia-app/app/main/window-utils.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/insomnia-app/app/main/window-utils.js b/packages/insomnia-app/app/main/window-utils.js index aa289f1950..028ab86c3a 100644 --- a/packages/insomnia-app/app/main/window-utils.js +++ b/packages/insomnia-app/app/main/window-utils.js @@ -35,15 +35,24 @@ export function createWindow() { const { x, y, width, height } = bounds; // Make sure we don't place the window outside of the visible space - let maxX = 0; - let maxY = 0; + let maxX = Number.MIN_VALUE; + let maxY = Number.MIN_VALUE; + let minX = Number.MAX_VALUE; + let minY = Number.MAX_VALUE; + for (const d of electron.screen.getAllDisplays()) { // Set the maximum placement location to 50 pixels short of the end maxX = Math.max(maxX, d.bounds.x + d.bounds.width - 50); maxY = Math.max(maxY, d.bounds.y + d.bounds.height - 50); + + // Set the minimum placement location 50 pixels from the start + minX = Math.min(minX, d.bounds.x + 50); + minY = Math.min(minY, d.bounds.y + 50); } - const finalX = Math.min(maxX, x); - const finalY = Math.min(maxX, y); + + // Clamp screen position between min and max + const finalX = Math.max(minX, Math.min(maxX, x)); + const finalY = Math.max(maxY, Math.min(maxX, y)); mainWindow = new BrowserWindow({ // Make sure we don't initialize the window outside the bounds From 773eefc05950cdd6bd839df5d59b8f0e22f6c254 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 21 Aug 2019 23:59:06 -0700 Subject: [PATCH 013/100] Initial try at creating GitHub actions (#1646) * Initial try at creating GitHub actions * Fix Git checkout * Just Mac for now * Add Windows back * Try change run for WIndows * Configure msvs * Try again * Try again * Try downgrading windows * Change msvs version * Separate Windows steps * Try adding Ubuntu * Linux packages * SUdo? * Try something else * Make test more robust --- .github/workflows/main.yml | 53 +++++++++++++++++++ package-lock.json | 43 ++++----------- .../__tests__/index.test.js | 2 +- 3 files changed, 64 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..fd420350bb --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,53 @@ +name: CI + +on: [push] + +jobs: + Windows: + name: Windows + runs-on: windows-2016 + steps: + - name: Checkout branch + uses: actions/checkout@v1 + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + version: 10 + - name: Configure Visual Studio version + run: npm config set msvs_version 2017 + - name: Bootstrap packages + run: npm run bootstrap + - name: Run tests + run: npm test + Mac: + name: Mac + runs-on: macOS-latest + steps: + - name: Checkout branch + uses: actions/checkout@v1 + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + version: 10 + - name: Bootstrap packages + run: npm run bootstrap + - name: Run tests + run: npm test + Linux: + name: Ubuntu + runs-on: ubuntu-16.04 + steps: + - name: Checkout branch + uses: actions/checkout@v1 + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + version: 10 + - name: Install OS packages + run: | + sudo apt-get update + sudo apt-get install -y libcurl4-openssl-dev + - name: Bootstrap packages + run: npm run bootstrap + - name: Run tests + run: npm test diff --git a/package-lock.json b/package-lock.json index b879512563..458662425e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13922,9 +13922,9 @@ } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -16240,9 +16240,9 @@ "dev": true }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -17239,38 +17239,15 @@ "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "unique-filename": { diff --git a/plugins/insomnia-plugin-file/__tests__/index.test.js b/plugins/insomnia-plugin-file/__tests__/index.test.js index 9e392eeead..f7c0169294 100644 --- a/plugins/insomnia-plugin-file/__tests__/index.test.js +++ b/plugins/insomnia-plugin-file/__tests__/index.test.js @@ -26,7 +26,7 @@ describe('FileExtension', () => { it( 'fails on missing file', assertTemplateFails( - [process.platform === 'win32' ? 'C:\\foo' : '/foo'], + [path.resolve('/foo')], `ENOENT: no such file or directory, open '${path.resolve('/foo')}'`, ), ); From d2d29bd1e1e73cfc3fc046dd0a571b7017d0bd99 Mon Sep 17 00:00:00 2001 From: CodyDWJones Date: Tue, 17 Sep 2019 11:59:59 -0700 Subject: [PATCH 014/100] Add Audience parameter for Resource Owner Password Credentials (#1677) --- .../network/o-auth-2/__tests__/grant-password.test.js | 9 +++++++++ packages/insomnia-app/app/network/o-auth-2/get-token.js | 1 + .../insomnia-app/app/network/o-auth-2/grant-password.js | 3 +++ .../app/ui/components/editors/auth/o-auth-2-auth.js | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/network/o-auth-2/__tests__/grant-password.test.js b/packages/insomnia-app/app/network/o-auth-2/__tests__/grant-password.test.js index 9e26ec0cfc..ae2be0e8ae 100644 --- a/packages/insomnia-app/app/network/o-auth-2/__tests__/grant-password.test.js +++ b/packages/insomnia-app/app/network/o-auth-2/__tests__/grant-password.test.js @@ -12,6 +12,7 @@ const CLIENT_SECRET = 'secret_12345456677756343'; const USERNAME = 'user'; const PASSWORD = 'password'; const SCOPE = 'scope_123'; +const AUDIENCE = 'https://foo.com/userinfo'; describe('password', () => { beforeEach(globalBeforeEach); @@ -24,6 +25,7 @@ describe('password', () => { access_token: 'token_123', token_type: 'token_type', scope: SCOPE, + audience: AUDIENCE, }), ); @@ -44,6 +46,7 @@ describe('password', () => { USERNAME, PASSWORD, SCOPE, + AUDIENCE, ); // Check the request to fetch the token @@ -60,6 +63,7 @@ describe('password', () => { { name: 'username', value: USERNAME }, { name: 'password', value: PASSWORD }, { name: 'scope', value: SCOPE }, + { name: 'audience', value: AUDIENCE }, ], }, headers: [ @@ -87,6 +91,7 @@ describe('password', () => { token_type: 'token_type', refresh_token: null, scope: SCOPE, + audience: AUDIENCE, error: null, error_uri: null, error_description: null, @@ -103,6 +108,7 @@ describe('password', () => { access_token: 'token_123', token_type: 'token_type', scope: SCOPE, + audience: AUDIENCE, }), ); @@ -123,6 +129,7 @@ describe('password', () => { USERNAME, PASSWORD, SCOPE, + AUDIENCE, ); // Check the request to fetch the token @@ -139,6 +146,7 @@ describe('password', () => { { name: 'username', value: USERNAME }, { name: 'password', value: PASSWORD }, { name: 'scope', value: SCOPE }, + { name: 'audience', value: AUDIENCE }, { name: 'client_id', value: CLIENT_ID }, { name: 'client_secret', value: CLIENT_SECRET }, ], @@ -164,6 +172,7 @@ describe('password', () => { token_type: 'token_type', refresh_token: null, scope: SCOPE, + audience: AUDIENCE, error: null, error_uri: null, error_description: null, diff --git a/packages/insomnia-app/app/network/o-auth-2/get-token.js b/packages/insomnia-app/app/network/o-auth-2/get-token.js index a6824780d2..29b1f0ae59 100644 --- a/packages/insomnia-app/app/network/o-auth-2/get-token.js +++ b/packages/insomnia-app/app/network/o-auth-2/get-token.js @@ -138,6 +138,7 @@ async function _getOAuth2PasswordHeader( authentication.username, authentication.password, authentication.scope, + authentication.audience, ); return _updateOAuth2Token(requestId, results); diff --git a/packages/insomnia-app/app/network/o-auth-2/grant-password.js b/packages/insomnia-app/app/network/o-auth-2/grant-password.js index 7dccc0e2e4..1f49047bd3 100644 --- a/packages/insomnia-app/app/network/o-auth-2/grant-password.js +++ b/packages/insomnia-app/app/network/o-auth-2/grant-password.js @@ -15,6 +15,7 @@ export default async function( username: string, password: string, scope: string = '', + audience: string = '', ): Promise { const params = [ { name: c.P_GRANT_TYPE, value: c.GRANT_TYPE_PASSWORD }, @@ -24,6 +25,7 @@ export default async function( // Add optional params scope && params.push({ name: c.P_SCOPE, value: scope }); + audience && params.push({ name: c.P_AUDIENCE, value: audience }); const headers = [ { name: 'Content-Type', value: 'application/x-www-form-urlencoded' }, @@ -73,6 +75,7 @@ export default async function( c.P_EXPIRES_IN, c.P_REFRESH_TOKEN, c.P_SCOPE, + c.P_AUDIENCE, c.P_ERROR, c.P_ERROR_URI, c.P_ERROR_DESCRIPTION, diff --git a/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.js b/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.js index d94b9d8267..7b0e08956e 100644 --- a/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.js +++ b/packages/insomnia-app/app/ui/components/editors/auth/o-auth-2-auth.js @@ -433,7 +433,7 @@ class OAuth2Auth extends React.PureComponent { } else if (grantType === GRANT_TYPE_PASSWORD) { basicFields = [username, password, accessTokenUrl, clientId, clientSecret, enabled]; - advancedFields = [scope, credentialsInBody, tokenPrefix]; + advancedFields = [scope, credentialsInBody, tokenPrefix, audience]; } else if (grantType === GRANT_TYPE_IMPLICIT) { basicFields = [authorizationUrl, clientId, redirectUri, enabled]; From cc489c9d22829750822d0032b37927d71baf47f0 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 17 Sep 2019 13:50:10 -0700 Subject: [PATCH 015/100] Reference Windows build tools in Readme dev setup Closes #1672 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ab11af603f..2f40935f0c 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ npm test npm run app-start ``` +If you are on Windows and have problems, you may need to install [Windows Build Tools](https://github.com/felixrieseberg/windows-build-tools)
From 945ff0e6311aadcc4ff162275e7e8d5fe37e07ba Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 17 Sep 2019 17:02:42 -0700 Subject: [PATCH 016/100] Unify build config in one place --- packages/insomnia-app/.electronbuilder | 8 +-- packages/insomnia-app/app/models/settings.js | 3 +- .../app/network/__tests__/network.test.js | 18 ++--- packages/insomnia-app/app/network/network.js | 27 ++----- packages/insomnia-app/app/plugins/index.js | 17 +---- packages/insomnia-app/app/renderer.html | 1 - packages/insomnia-app/app/ui/index.js | 2 + packages/insomnia-app/flow-typed/mkdirp.js | 2 +- packages/insomnia-app/package.json | 20 +++++- packages/insomnia-app/scripts/build.js | 33 ++++++++- packages/insomnia-app/scripts/package.js | 14 +++- packages/insomnia-prettify/package-lock.json | 6 +- packages/insomnia-url/package-lock.json | 6 +- packages/insomnia-xpath/package-lock.json | 27 +++++++ .../insomnia-plugin-base64/package-lock.json | 6 +- .../package-lock.json | 2 +- .../package-lock.json | 6 +- .../insomnia-plugin-file/package-lock.json | 6 +- .../insomnia-plugin-hash/package-lock.json | 6 +- .../insomnia-plugin-prompt/package-lock.json | 5 ++ .../insomnia-plugin-request/package-lock.json | 70 ++++++++++--------- .../package-lock.json | 47 +++++++++++++ 22 files changed, 222 insertions(+), 110 deletions(-) create mode 100644 plugins/insomnia-plugin-prompt/package-lock.json diff --git a/packages/insomnia-app/.electronbuilder b/packages/insomnia-app/.electronbuilder index 5f0b2081d5..05f4ab1535 100644 --- a/packages/insomnia-app/.electronbuilder +++ b/packages/insomnia-app/.electronbuilder @@ -1,5 +1,5 @@ { - "appId": "com.insomnia.app", + "appId": "__APP_ID__", "publish": false, "extraResources": [ { @@ -40,11 +40,11 @@ ] }, "squirrelWindows":{ - "iconUrl": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true" + "iconUrl": "__ICON_URL__" }, "linux": { - "executableName": "insomnia", - "synopsis": "A simple, beautiful, and free REST API client", + "executableName": "__EXECUTABLE_NAME__", + "synopsis": "__SYNOPSIS__", "category": "Development", "target": [ "AppImage", diff --git a/packages/insomnia-app/app/models/settings.js b/packages/insomnia-app/app/models/settings.js index ee0e2474ef..428b11cf5b 100644 --- a/packages/insomnia-app/app/models/settings.js +++ b/packages/insomnia-app/app/models/settings.js @@ -1,4 +1,5 @@ // @flow +import * as packageJson from '../../package.json'; import type { BaseModel } from './index'; import * as db from '../common/database'; import { UPDATE_CHANNEL_STABLE } from '../common/constants'; @@ -71,7 +72,7 @@ export function init(): BaseSettings { validateSSL: true, forceVerticalLayout: false, autoHideMenuBar: false, - theme: 'default', + theme: packageJson.app.theme, pluginPath: '', nunjucksPowerUserMode: false, deviceId: null, diff --git a/packages/insomnia-app/app/network/__tests__/network.test.js b/packages/insomnia-app/app/network/__tests__/network.test.js index 656e014f6b..74fcba9308 100644 --- a/packages/insomnia-app/app/network/__tests__/network.test.js +++ b/packages/insomnia-app/app/network/__tests__/network.test.js @@ -102,7 +102,7 @@ describe('actuallySend()', () => { 'Accept: */*', 'Accept-Encoding:', ], - NOPROGRESS: false, + NOPROGRESS: true, USERNAME: 'user', PASSWORD: 'pass', POSTFIELDS: 'foo=bar', @@ -163,7 +163,7 @@ describe('actuallySend()', () => { 'Accept: */*', 'Accept-Encoding:', ], - NOPROGRESS: false, + NOPROGRESS: true, POSTFIELDS: 'foo=bar&bar=&=value', PROXY: '', TIMEOUT_MS: 0, @@ -252,7 +252,7 @@ describe('actuallySend()', () => { 'Accept: */*', 'Accept-Encoding:', ], - NOPROGRESS: false, + NOPROGRESS: true, USERNAME: 'user', PASSWORD: 'pass', POSTFIELDS: 'foo=bar', @@ -310,7 +310,7 @@ describe('actuallySend()', () => { 'Accept: */*', 'Accept-Encoding:', ], - NOPROGRESS: false, + NOPROGRESS: true, INFILESIZE_LARGE: 26, PROXY: '', READDATA: fs.readFileSync(fileName, 'utf8'), @@ -377,7 +377,7 @@ describe('actuallySend()', () => { 'Accept-Encoding:', ], INFILESIZE_LARGE: 244, - NOPROGRESS: false, + NOPROGRESS: true, READDATA: [ `--${DEFAULT_BOUNDARY}`, 'Content-Disposition: form-data; name="foo"; filename="testfile.txt"', @@ -434,7 +434,7 @@ describe('actuallySend()', () => { COOKIEFILE: '', FOLLOWLOCATION: true, HTTPHEADER: ['Accept: */*', 'Accept-Encoding:', 'content-type:'], - NOPROGRESS: false, + NOPROGRESS: true, PROXY: '', TIMEOUT_MS: 0, URL: 'http://my/path', @@ -478,7 +478,7 @@ describe('actuallySend()', () => { COOKIEFILE: '', FOLLOWLOCATION: true, HTTPHEADER: ['Accept: */*', 'Accept-Encoding:', 'content-type:'], - NOPROGRESS: false, + NOPROGRESS: true, PROXY: '', TIMEOUT_MS: 0, URL: 'http://localhost:3000/foo/bar', @@ -521,7 +521,7 @@ describe('actuallySend()', () => { COOKIEFILE: '', FOLLOWLOCATION: true, HTTPHEADER: ['Accept: */*', 'Accept-Encoding:', 'content-type:'], - NOPROGRESS: false, + NOPROGRESS: true, PROXY: '', TIMEOUT_MS: 0, URL: 'http://unix:3000/my/path', @@ -565,7 +565,7 @@ describe('actuallySend()', () => { COOKIEFILE: '', FOLLOWLOCATION: true, HTTPHEADER: ['Accept: */*', 'Accept-Encoding:', 'content-type:'], - NOPROGRESS: false, + NOPROGRESS: true, PROXY: '', TIMEOUT_MS: 0, NETRC: 2, diff --git a/packages/insomnia-app/app/network/network.js b/packages/insomnia-app/app/network/network.js index 5e75ad19a0..613a738c23 100644 --- a/packages/insomnia-app/app/network/network.js +++ b/packages/insomnia-app/app/network/network.js @@ -215,7 +215,7 @@ export async function _actuallySend( // Set all the basic options setOpt(Curl.option.FOLLOWLOCATION, settings.followRedirects); setOpt(Curl.option.VERBOSE, true); // True so debug function works - setOpt(Curl.option.NOPROGRESS, false); // False so progress function works + setOpt(Curl.option.NOPROGRESS, true); // True so curl doesn't print progress setOpt(Curl.option.ACCEPT_ENCODING, ''); // Auto decode everything enable(Curl.feature.NO_HEADER_PARSING); enable(Curl.feature.NO_DATA_PARSING); @@ -286,26 +286,6 @@ export async function _actuallySend( // Set the headers (to be modified as we go) const headers = clone(renderedRequest.headers); - let lastPercent = 0; - // NOTE: This option was added in 7.32.0 so make it optional - setOpt( - Curl.option.XFERINFOFUNCTION, - (dltotal, dlnow, ultotal, ulnow) => { - if (dltotal === 0) { - return 0; - } - - const percent = Math.round((dlnow / dltotal) * 100); - if (percent !== lastPercent) { - // console.log(`[network] Request downloaded ${percent}%`); - lastPercent = percent; - } - - return 0; - }, - true, - ); - // Set the URL, including the query parameters const qs = buildQueryStringFromParams(renderedRequest.parameters); const url = joinUrlAndQueryString(renderedRequest.url, qs); @@ -711,7 +691,7 @@ export async function _actuallySend( // Update cookie jar if we need to and if we found any cookies if (renderedRequest.settingStoreCookies && setCookieStrings.length) { const cookies = await cookiesFromJar(jar); - models.cookieJar.update(renderedRequest.cookieJar, { cookies }); + await models.cookieJar.update(renderedRequest.cookieJar, { cookies }); } // Print informational message @@ -743,7 +723,8 @@ export async function _actuallySend( // Make sure the response body has been fully written first await waitForStreamToFinish(responseBodyWriteStream); - respond(responsePatch, responseBodyPath); + // Send response + await respond(responsePatch, responseBodyPath); }); curl.on('error', function(err, code) { diff --git a/packages/insomnia-app/app/plugins/index.js b/packages/insomnia-app/app/plugins/index.js index 3f4ff43d01..e45430ffbf 100644 --- a/packages/insomnia-app/app/plugins/index.js +++ b/packages/insomnia-app/app/plugins/index.js @@ -1,5 +1,6 @@ // @flow import mkdirp from 'mkdirp'; +import * as packageJson from '../../package.json'; import * as models from '../models'; import fs from 'fs'; import path from 'path'; @@ -52,20 +53,6 @@ export type Theme = { theme: PluginTheme, }; -const CORE_PLUGINS = [ - 'insomnia-plugin-base64', - 'insomnia-plugin-hash', - 'insomnia-plugin-file', - 'insomnia-plugin-now', - 'insomnia-plugin-uuid', - 'insomnia-plugin-prompt', - 'insomnia-plugin-request', - 'insomnia-plugin-response', - 'insomnia-plugin-jsonpath', - 'insomnia-plugin-cookie-jar', - 'insomnia-plugin-core-themes', -]; - let plugins: ?Array = null; export async function init(): Promise { @@ -157,7 +144,7 @@ export async function getPlugins(force: boolean = false): Promise> // "name": "module" }; - for (const p of CORE_PLUGINS) { + for (const p of packageJson.app.plugins) { const pluginJson = global.require(`${p}/package.json`); const pluginModule = global.require(p); pluginMap[pluginJson.name] = _initPlugin(pluginJson, pluginModule); diff --git a/packages/insomnia-app/app/renderer.html b/packages/insomnia-app/app/renderer.html index d0b7b1c98a..5dcb40ec69 100644 --- a/packages/insomnia-app/app/renderer.html +++ b/packages/insomnia-app/app/renderer.html @@ -2,7 +2,6 @@ - Insomnia void, + sync: (path: string) => string | null, }; } diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index a71858a7a6..d2567d829c 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -4,10 +4,28 @@ "name": "insomnia-app", "app": { "name": "insomnia", + "executableName": "insomnia", + "appId": "com.insomnia.app", "productName": "Insomnia", "longName": "Insomnia REST Client", + "synopsis": "A simple, beautiful, and free REST API client", + "icon": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true", + "theme": "default", "version": "6.6.2", - "main": "main.min.js" + "main": "main.min.js", + "plugins": [ + "insomnia-plugin-base64", + "insomnia-plugin-hash", + "insomnia-plugin-file", + "insomnia-plugin-now", + "insomnia-plugin-uuid", + "insomnia-plugin-prompt", + "insomnia-plugin-request", + "insomnia-plugin-response", + "insomnia-plugin-jsonpath", + "insomnia-plugin-cookie-jar", + "insomnia-plugin-core-themes" + ] }, "licence": "MIT", "homepage": "https://insomnia.rest/", diff --git a/packages/insomnia-app/scripts/build.js b/packages/insomnia-app/scripts/build.js index c5435bda89..b08ccab25a 100644 --- a/packages/insomnia-app/scripts/build.js +++ b/packages/insomnia-app/scripts/build.js @@ -1,3 +1,4 @@ +const packageJson = require('../package.json'); const childProcess = require('child_process'); const webpack = require('webpack'); const rimraf = require('rimraf'); @@ -48,11 +49,13 @@ module.exports.start = async function() { async function buildWebpack(config) { return new Promise((resolve, reject) => { - webpack(config, (err, stats) => { + const compiler = webpack(config); + compiler.run((err, stats) => { if (err) { reject(err); } else if (stats.hasErrors()) { reject(new Error('Failed to build webpack')); + console.log(stats.toJson().errors); } else { resolve(); } @@ -90,9 +93,33 @@ async function copyFiles(relSource, relDest) { } async function install(relDir) { - return new Promise((resolve, reject) => { + return new Promise(resolve => { const prefix = path.resolve(__dirname, relDir); + // Link all plugins + const plugins = path.resolve(__dirname, `../../../plugins`); + for (const dir of fs.readdirSync(plugins)) { + console.log(`[build] Linking plugin ${dir}`); + const p = path.join(plugins, dir); + childProcess.spawnSync('npm', ['link', p], { + cwd: prefix, + shell: true, + }); + } + + // Link all packages + const packages = path.resolve(__dirname, `../../../packages`); + for (const dir of fs.readdirSync(packages)) { + // Don't like ourselves + if (dir === packageJson.name) { + continue; + } + + console.log(`[build] Linking local package ${dir}`); + const p = path.join(packages, dir); + childProcess.spawnSync('npm', ['link', p], { cwd: prefix, shell: true }); + } + const p = childProcess.spawn('npm', ['install', '--production', '--no-optional'], { cwd: prefix, shell: true, @@ -121,7 +148,7 @@ function generatePackageJson(relBasePkg, relOutPkg) { const basePkg = JSON.parse(fs.readFileSync(basePath)); const appPkg = { - name: 'insomnia', + name: packageJson.app.name, version: basePkg.app.version, productName: basePkg.app.productName, longName: basePkg.app.longName, diff --git a/packages/insomnia-app/scripts/package.js b/packages/insomnia-app/scripts/package.js index d8cf4a028b..e05e7a8ead 100644 --- a/packages/insomnia-app/scripts/package.js +++ b/packages/insomnia-app/scripts/package.js @@ -1,3 +1,4 @@ +const packageJson = require('../package.json'); const electronBuilder = require('electron-builder'); const path = require('path'); const rimraf = require('rimraf'); @@ -38,7 +39,18 @@ module.exports.start = async function() { async function pkg(relConfigPath) { const configPath = path.resolve(__dirname, relConfigPath); - const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); + + // Replace some things + const rawConfig = fs + .readFileSync(configPath, 'utf8') + .replace('__APP_ID__', packageJson.app.appId) + .replace('__ICON_URL__', packageJson.app.icon) + .replace('__EXECUTABLE_NAME__', packageJson.app.executableName) + .replace('__SYNOPSIS__', packageJson.app.synopsis); + + console.log(`[package] Using electron-builder config\n${rawConfig}`); + + const config = JSON.parse(rawConfig); const targetPlatform = PLATFORM_MAP[process.platform]; const target = process.env.BUILD_TARGETS diff --git a/packages/insomnia-prettify/package-lock.json b/packages/insomnia-prettify/package-lock.json index 48a386b670..01a8da7972 100644 --- a/packages/insomnia-prettify/package-lock.json +++ b/packages/insomnia-prettify/package-lock.json @@ -1,5 +1,5 @@ { - "name": "insomnia-prettify", - "version": "0.1.1", - "lockfileVersion": 1 + "name": "insomnia-prettify", + "version": "0.1.11", + "lockfileVersion": 1 } diff --git a/packages/insomnia-url/package-lock.json b/packages/insomnia-url/package-lock.json index 77c1fd9222..9c30cbe3da 100644 --- a/packages/insomnia-url/package-lock.json +++ b/packages/insomnia-url/package-lock.json @@ -1,5 +1,5 @@ { - "name": "insomnia-url", - "version": "0.1.1", - "lockfileVersion": 1 + "name": "insomnia-url", + "version": "0.1.10", + "lockfileVersion": 1 } diff --git a/packages/insomnia-xpath/package-lock.json b/packages/insomnia-xpath/package-lock.json index 7760923c72..f681a64f1b 100644 --- a/packages/insomnia-xpath/package-lock.json +++ b/packages/insomnia-xpath/package-lock.json @@ -4,6 +4,33 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "insomnia-cookies": { + "version": "0.0.17", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.17.tgz", + "integrity": "sha512-L+5HrvkHRciCImArY5u4Ua0Nl+/YNLNzaADlsAsoB/Pb2desKIQMU37J6onxka9h7umvhuBchxROK2lKjy+oYQ==", + "requires": { + "tough-cookie": "^2.3.3" + } + }, + "psl": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "xmldom": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", diff --git a/plugins/insomnia-plugin-base64/package-lock.json b/plugins/insomnia-plugin-base64/package-lock.json index d227cea09a..ddc7484ea0 100644 --- a/plugins/insomnia-plugin-base64/package-lock.json +++ b/plugins/insomnia-plugin-base64/package-lock.json @@ -1,5 +1,5 @@ { - "name": "insomnia-plugin-base64", - "version": "1.0.2", - "lockfileVersion": 1 + "name": "insomnia-plugin-base64", + "version": "1.0.10", + "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-core-themes/package-lock.json b/plugins/insomnia-plugin-core-themes/package-lock.json index 72fe523b37..37e3ba0af3 100644 --- a/plugins/insomnia-plugin-core-themes/package-lock.json +++ b/plugins/insomnia-plugin-core-themes/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-plugin-core-themes", - "version": "1.0.8", + "version": "1.0.9", "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-default-headers/package-lock.json b/plugins/insomnia-plugin-default-headers/package-lock.json index 5fa5308375..effb11c7c2 100644 --- a/plugins/insomnia-plugin-default-headers/package-lock.json +++ b/plugins/insomnia-plugin-default-headers/package-lock.json @@ -1,5 +1,5 @@ { - "name": "insomnia-plugin-default-headers", - "version": "1.0.3", - "lockfileVersion": 1 + "name": "insomnia-plugin-default-headers", + "version": "1.1.11", + "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-file/package-lock.json b/plugins/insomnia-plugin-file/package-lock.json index 658fe24335..ec0b4f4e39 100644 --- a/plugins/insomnia-plugin-file/package-lock.json +++ b/plugins/insomnia-plugin-file/package-lock.json @@ -1,5 +1,5 @@ { - "name": "insomnia-plugin-file", - "version": "1.0.2", - "lockfileVersion": 1 + "name": "insomnia-plugin-file", + "version": "1.0.11", + "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-hash/package-lock.json b/plugins/insomnia-plugin-hash/package-lock.json index 1cabaaa7aa..633dcad51f 100644 --- a/plugins/insomnia-plugin-hash/package-lock.json +++ b/plugins/insomnia-plugin-hash/package-lock.json @@ -1,5 +1,5 @@ { - "name": "insomnia-plugin-hash", - "version": "1.0.2", - "lockfileVersion": 1 + "name": "insomnia-plugin-hash", + "version": "1.0.11", + "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-prompt/package-lock.json b/plugins/insomnia-plugin-prompt/package-lock.json new file mode 100644 index 0000000000..baf3c3f686 --- /dev/null +++ b/plugins/insomnia-plugin-prompt/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "insomnia-plugin-prompt", + "version": "1.1.15", + "lockfileVersion": 1 +} diff --git a/plugins/insomnia-plugin-request/package-lock.json b/plugins/insomnia-plugin-request/package-lock.json index d3661905e8..f0567c02c9 100644 --- a/plugins/insomnia-plugin-request/package-lock.json +++ b/plugins/insomnia-plugin-request/package-lock.json @@ -1,34 +1,40 @@ { - "name": "insomnia-plugin-request", - "version": "1.0.3", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "insomnia-cookies": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.3.tgz", - "integrity": "sha512-w15mXZd9aoYVxhtKgeZEfLREzn26Ggq1Y5CSazjcib/FQyyovd7O473/YVz9eQaQwgsUgOfmUAg2ofQTVIQ58A==", - "requires": { - "tough-cookie": "2.3.3" - } - }, - "insomnia-url": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/insomnia-url/-/insomnia-url-0.1.1.tgz", - "integrity": "sha512-wkrtC4M/9m0Rwi04eDv/DxJvo8dPwbfdTxucfahK/bNGUza9h7JdVHWgJNviEiQ6u4y08ne13tT+SnqSbe7pDA==" - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", - "requires": { - "punycode": "1.4.1" - } - } - } + "name": "insomnia-plugin-request", + "version": "1.0.24", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "insomnia-cookies": { + "version": "0.0.17", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.17.tgz", + "integrity": "sha512-L+5HrvkHRciCImArY5u4Ua0Nl+/YNLNzaADlsAsoB/Pb2desKIQMU37J6onxka9h7umvhuBchxROK2lKjy+oYQ==", + "requires": { + "tough-cookie": "^2.3.3" + } + }, + "insomnia-url": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/insomnia-url/-/insomnia-url-0.1.10.tgz", + "integrity": "sha512-fSN3/gNryiDi07Ut9M9GjGMM5bg1v6RwfG5FyQGkCettzgqJNc1pDO5QQSargR6vdSYo9rqBU9gZVGVdWWR2kg==" + }, + "psl": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } + } } diff --git a/plugins/insomnia-plugin-response/package-lock.json b/plugins/insomnia-plugin-response/package-lock.json index 76ea5ebdcb..2edcfb7133 100644 --- a/plugins/insomnia-plugin-response/package-lock.json +++ b/plugins/insomnia-plugin-response/package-lock.json @@ -53,6 +53,24 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, + "insomnia-cookies": { + "version": "0.0.17", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.17.tgz", + "integrity": "sha512-L+5HrvkHRciCImArY5u4Ua0Nl+/YNLNzaADlsAsoB/Pb2desKIQMU37J6onxka9h7umvhuBchxROK2lKjy+oYQ==", + "requires": { + "tough-cookie": "^2.3.3" + } + }, + "insomnia-xpath": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/insomnia-xpath/-/insomnia-xpath-1.0.14.tgz", + "integrity": "sha512-GedSmR+P9SPhKfJRX4bNM9uoPBdTPPmhxaapODSjrdHtOE2jj0Ggl/K/7YbqpvbAIU5GgUDWiRqCgrYNW+2QfQ==", + "requires": { + "insomnia-cookies": "^0.0.17", + "xmldom": "^0.1.27", + "xpath": "0.0.27" + } + }, "jsonpath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.0.2.tgz", @@ -90,6 +108,16 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, + "psl": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -104,6 +132,15 @@ "escodegen": "^1.8.1" } }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -121,6 +158,16 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + }, + "xpath": { + "version": "0.0.27", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", + "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==" } } } From c27140648ad5e3a81a08dbbf3e8cb65a700b738e Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 18 Sep 2019 12:07:09 -0700 Subject: [PATCH 017/100] Send app ID to auto-update server --- packages/insomnia-app/app/common/constants.js | 4 ++++ packages/insomnia-app/app/main/updates.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/packages/insomnia-app/app/common/constants.js b/packages/insomnia-app/app/common/constants.js index 56d20670c8..eabfeac7d7 100644 --- a/packages/insomnia-app/app/common/constants.js +++ b/packages/insomnia-app/app/common/constants.js @@ -18,6 +18,10 @@ export function getAppName() { return packageJSON.app.productName; } +export function getAppId() { + return packageJSON.app.appId; +} + export function getAppPlatform() { return process.platform; } diff --git a/packages/insomnia-app/app/main/updates.js b/packages/insomnia-app/app/main/updates.js index 91900481b0..b663d222d6 100644 --- a/packages/insomnia-app/app/main/updates.js +++ b/packages/insomnia-app/app/main/updates.js @@ -3,6 +3,7 @@ import electron from 'electron'; import { CHECK_FOR_UPDATES_INTERVAL, getAppVersion, + getAppId, isDevelopment, UPDATE_URL_MAC, UPDATE_URL_WINDOWS, @@ -28,6 +29,7 @@ async function getUpdateUrl(force: boolean): Promise { const params = [ { name: 'v', value: getAppVersion() }, + { name: 'app', value: getAppId() }, { name: 'channel', value: settings.updateChannel }, ]; From 400f15a348a5100bfbbd48a3e850edc2dd9861ca Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 19 Sep 2019 13:57:27 -0700 Subject: [PATCH 018/100] Publish - insomnia-app@1.1.9 - insomnia-cookies@0.0.18 - insomnia-importers@2.0.21 - insomnia-libcurl@0.0.29 - insomnia-prettify@0.1.12 - insomnia-url@0.1.11 - insomnia-xpath@1.0.15 - insomnia-plugin-base64@1.0.11 - insomnia-plugin-cookie-jar@1.0.16 - insomnia-plugin-core-themes@1.0.10 - insomnia-plugin-default-headers@1.1.12 - insomnia-plugin-file@1.0.12 - insomnia-plugin-hash@1.0.12 - insomnia-plugin-jsonpath@1.0.19 - insomnia-plugin-now@1.0.17 - insomnia-plugin-os@1.0.19 - insomnia-plugin-prompt@1.1.16 - insomnia-plugin-request@1.0.25 - insomnia-plugin-response@1.0.25 - insomnia-plugin-uuid@1.0.16 --- packages/insomnia-app/package.json | 36 +++++++++---------- packages/insomnia-cookies/package.json | 2 +- packages/insomnia-importers/package.json | 2 +- packages/insomnia-libcurl/package.json | 2 +- packages/insomnia-prettify/package.json | 2 +- packages/insomnia-url/package.json | 2 +- packages/insomnia-xpath/package.json | 4 +-- plugins/insomnia-plugin-base64/package.json | 2 +- .../insomnia-plugin-cookie-jar/package.json | 2 +- .../insomnia-plugin-core-themes/package.json | 2 +- .../package.json | 2 +- plugins/insomnia-plugin-file/package.json | 2 +- plugins/insomnia-plugin-hash/package.json | 2 +- plugins/insomnia-plugin-jsonpath/package.json | 2 +- plugins/insomnia-plugin-now/package.json | 2 +- plugins/insomnia-plugin-os/package.json | 2 +- plugins/insomnia-plugin-prompt/package.json | 2 +- plugins/insomnia-plugin-request/package.json | 6 ++-- plugins/insomnia-plugin-response/package.json | 4 +-- plugins/insomnia-plugin-uuid/package.json | 2 +- 20 files changed, 41 insertions(+), 41 deletions(-) diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index d2567d829c..b77259a7b4 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "1.1.8", + "version": "1.1.9", "name": "insomnia-app", "app": { "name": "insomnia", @@ -134,23 +134,23 @@ "html-entities": "^1.2.0", "httpsnippet": "^1.19.1", "iconv-lite": "^0.4.15", - "insomnia-cookies": "^0.0.17", - "insomnia-importers": "^2.0.20", - "insomnia-libcurl": "^0.0.28", - "insomnia-plugin-base64": "^1.0.10", - "insomnia-plugin-cookie-jar": "^1.0.15", - "insomnia-plugin-core-themes": "^1.0.9", - "insomnia-plugin-file": "^1.0.11", - "insomnia-plugin-hash": "^1.0.11", - "insomnia-plugin-jsonpath": "^1.0.18", - "insomnia-plugin-now": "^1.0.16", - "insomnia-plugin-prompt": "^1.1.15", - "insomnia-plugin-request": "^1.0.24", - "insomnia-plugin-response": "^1.0.24", - "insomnia-plugin-uuid": "^1.0.15", - "insomnia-prettify": "^0.1.11", - "insomnia-url": "^0.1.10", - "insomnia-xpath": "^1.0.14", + "insomnia-cookies": "^0.0.18", + "insomnia-importers": "^2.0.21", + "insomnia-libcurl": "^0.0.29", + "insomnia-plugin-base64": "^1.0.11", + "insomnia-plugin-cookie-jar": "^1.0.16", + "insomnia-plugin-core-themes": "^1.0.10", + "insomnia-plugin-file": "^1.0.12", + "insomnia-plugin-hash": "^1.0.12", + "insomnia-plugin-jsonpath": "^1.0.19", + "insomnia-plugin-now": "^1.0.17", + "insomnia-plugin-prompt": "^1.1.16", + "insomnia-plugin-request": "^1.0.25", + "insomnia-plugin-response": "^1.0.25", + "insomnia-plugin-uuid": "^1.0.16", + "insomnia-prettify": "^0.1.12", + "insomnia-url": "^0.1.11", + "insomnia-xpath": "^1.0.15", "json-order": "^1.0.9", "jsonlint": "^1.6.3", "jsonpath": "^1.0.2", diff --git a/packages/insomnia-cookies/package.json b/packages/insomnia-cookies/package.json index 3f861c010b..dc53897f8c 100644 --- a/packages/insomnia-cookies/package.json +++ b/packages/insomnia-cookies/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-cookies", - "version": "0.0.17", + "version": "0.0.18", "author": "Gregory Schier ", "description": "Cookie utilities", "license": "MIT", diff --git a/packages/insomnia-importers/package.json b/packages/insomnia-importers/package.json index bd8b5d654a..69faf917de 100755 --- a/packages/insomnia-importers/package.json +++ b/packages/insomnia-importers/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-importers", - "version": "2.0.20", + "version": "2.0.21", "author": "Gregory Schier ", "description": "Various data importers for Insomnia", "license": "MIT", diff --git a/packages/insomnia-libcurl/package.json b/packages/insomnia-libcurl/package.json index 58bad5d825..d222460b44 100644 --- a/packages/insomnia-libcurl/package.json +++ b/packages/insomnia-libcurl/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-libcurl", - "version": "0.0.28", + "version": "0.0.29", "author": "Gregory Schier ", "description": "Insomnia libcurl wrapper", "license": "MIT", diff --git a/packages/insomnia-prettify/package.json b/packages/insomnia-prettify/package.json index 30f23a58fd..47648b4eff 100644 --- a/packages/insomnia-prettify/package.json +++ b/packages/insomnia-prettify/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-prettify", - "version": "0.1.11", + "version": "0.1.12", "author": "Gregory Schier ", "description": "Prettification utilities for Insomnia", "license": "MIT", diff --git a/packages/insomnia-url/package.json b/packages/insomnia-url/package.json index 20ee68299a..0c70fb4797 100644 --- a/packages/insomnia-url/package.json +++ b/packages/insomnia-url/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-url", - "version": "0.1.10", + "version": "0.1.11", "author": "Gregory Schier ", "description": "URL Utilities", "license": "MIT", diff --git a/packages/insomnia-xpath/package.json b/packages/insomnia-xpath/package.json index 1202dd19d4..f450eb2546 100644 --- a/packages/insomnia-xpath/package.json +++ b/packages/insomnia-xpath/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-xpath", - "version": "1.0.14", + "version": "1.0.15", "author": "Gregory Schier ", "description": "Query XML using XPath", "license": "MIT", @@ -9,7 +9,7 @@ "test": "jest --silent" }, "dependencies": { - "insomnia-cookies": "^0.0.17", + "insomnia-cookies": "^0.0.18", "xmldom": "^0.1.27", "xpath": "0.0.27" } diff --git a/plugins/insomnia-plugin-base64/package.json b/plugins/insomnia-plugin-base64/package.json index 9f3a70e66e..d1c30e0e32 100644 --- a/plugins/insomnia-plugin-base64/package.json +++ b/plugins/insomnia-plugin-base64/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-base64", - "version": "1.0.10", + "version": "1.0.11", "author": "Gregory Schier ", "description": "Insomnia base64 template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-cookie-jar/package.json b/plugins/insomnia-plugin-cookie-jar/package.json index 03ebbbf033..23a2a2fbe6 100644 --- a/plugins/insomnia-plugin-cookie-jar/package.json +++ b/plugins/insomnia-plugin-cookie-jar/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-cookie-jar", - "version": "1.0.15", + "version": "1.0.16", "author": "Preston Alvarado ", "description": "Insomnia cookie jar template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-core-themes/package.json b/plugins/insomnia-plugin-core-themes/package.json index 1d24c67b4a..a640937618 100644 --- a/plugins/insomnia-plugin-core-themes/package.json +++ b/plugins/insomnia-plugin-core-themes/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-core-themes", - "version": "1.0.9", + "version": "1.0.10", "author": "Gregory Schier ", "description": "Insomnia core themes", "license": "MIT", diff --git a/plugins/insomnia-plugin-default-headers/package.json b/plugins/insomnia-plugin-default-headers/package.json index 22485e45ab..58b6dfbd2d 100644 --- a/plugins/insomnia-plugin-default-headers/package.json +++ b/plugins/insomnia-plugin-default-headers/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-default-headers", - "version": "1.1.11", + "version": "1.1.12", "author": "Gregory Schier ", "description": "Various data importers for Insomnia", "license": "MIT", diff --git a/plugins/insomnia-plugin-file/package.json b/plugins/insomnia-plugin-file/package.json index 7c801943d7..c58f1c63a8 100644 --- a/plugins/insomnia-plugin-file/package.json +++ b/plugins/insomnia-plugin-file/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-file", - "version": "1.0.11", + "version": "1.0.12", "author": "Gregory Schier ", "description": "Insomnia file templte tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-hash/package.json b/plugins/insomnia-plugin-hash/package.json index b4f5c35e6a..ad984c9539 100644 --- a/plugins/insomnia-plugin-hash/package.json +++ b/plugins/insomnia-plugin-hash/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-hash", - "version": "1.0.11", + "version": "1.0.12", "author": "Gregory Schier ", "description": "Insomnia hash template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-jsonpath/package.json b/plugins/insomnia-plugin-jsonpath/package.json index c503c4b629..16665257a3 100644 --- a/plugins/insomnia-plugin-jsonpath/package.json +++ b/plugins/insomnia-plugin-jsonpath/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-jsonpath", - "version": "1.0.18", + "version": "1.0.19", "author": "Gregory Schier ", "description": "Template tag to pull data from JSON strings", "license": "MIT", diff --git a/plugins/insomnia-plugin-now/package.json b/plugins/insomnia-plugin-now/package.json index 4b54431d2e..bd92344c4b 100644 --- a/plugins/insomnia-plugin-now/package.json +++ b/plugins/insomnia-plugin-now/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-now", - "version": "1.0.16", + "version": "1.0.17", "author": "Gregory Schier ", "description": "Insomnia now template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-os/package.json b/plugins/insomnia-plugin-os/package.json index 3532b26231..d17e9d28f5 100644 --- a/plugins/insomnia-plugin-os/package.json +++ b/plugins/insomnia-plugin-os/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-os", - "version": "1.0.18", + "version": "1.0.19", "author": "Gregory Schier ", "description": "Template tag to get information about the OS", "license": "MIT", diff --git a/plugins/insomnia-plugin-prompt/package.json b/plugins/insomnia-plugin-prompt/package.json index 420c9e7cdd..f0f4dc7823 100644 --- a/plugins/insomnia-plugin-prompt/package.json +++ b/plugins/insomnia-plugin-prompt/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-prompt", - "version": "1.1.15", + "version": "1.1.16", "author": "Gregory Schier ", "description": "Insomnia prompt template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-request/package.json b/plugins/insomnia-plugin-request/package.json index b9b1e90556..1a6186da2f 100644 --- a/plugins/insomnia-plugin-request/package.json +++ b/plugins/insomnia-plugin-request/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-request", - "version": "1.0.24", + "version": "1.0.25", "author": "Gregory Schier ", "description": "Insomnia request template tag", "license": "MIT", @@ -16,7 +16,7 @@ "test": "jest --silent" }, "dependencies": { - "insomnia-cookies": "^0.0.17", - "insomnia-url": "^0.1.10" + "insomnia-cookies": "^0.0.18", + "insomnia-url": "^0.1.11" } } diff --git a/plugins/insomnia-plugin-response/package.json b/plugins/insomnia-plugin-response/package.json index 50e0a3eced..c513fe6bef 100644 --- a/plugins/insomnia-plugin-response/package.json +++ b/plugins/insomnia-plugin-response/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-response", - "version": "1.0.24", + "version": "1.0.25", "author": "Gregory Schier ", "description": "Insomnia response template tag", "license": "MIT", @@ -17,7 +17,7 @@ }, "dependencies": { "iconv-lite": "^0.4.19", - "insomnia-xpath": "^1.0.14", + "insomnia-xpath": "^1.0.15", "jsonpath": "^1.0.2" } } diff --git a/plugins/insomnia-plugin-uuid/package.json b/plugins/insomnia-plugin-uuid/package.json index 193a459dcd..92a4396cde 100644 --- a/plugins/insomnia-plugin-uuid/package.json +++ b/plugins/insomnia-plugin-uuid/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-uuid", - "version": "1.0.15", + "version": "1.0.16", "author": "Gregory Schier ", "description": "Insomnia uuid template tag", "license": "MIT", From ede63b9a3f43890ef762feb30911119ffa535137 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 26 Sep 2019 20:45:30 -0700 Subject: [PATCH 019/100] Add Insomnia Documentor to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2f40935f0c..3e3d10a912 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Here is a list of plugins available for installation via NPM. ## Community Projects +- [Insomnia Documenter](https://github.com/jozsefsallai/insomnia-documenter) – Generate beautiful API documentation pages using your Insomnia export file. - [GitHub API Spec Importer](https://github.com/swinton/github-rest-apis-for-insomnia) – A complete set of GitHub REST API route specifications that can be imported straight into Insomnia - [Swaggymnia](https://github.com/mlabouardy/swaggymnia) – Generate [Swagger](https://swagger.io/) documentation for your existing API in Insomnia. From bdb09f9eeab5660dce79501af1c82a3f33dac6e1 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 30 Sep 2019 11:44:04 -0700 Subject: [PATCH 020/100] Send app property with notification request --- .../dropdowns/workspace-dropdown.js | 6 ++- .../app/ui/components/gravatar-img.js | 44 ++++++++++--------- .../insomnia-app/app/ui/components/toast.js | 1 + 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js b/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js index cedadfcb5d..3169ea1dfa 100644 --- a/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js +++ b/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js @@ -9,7 +9,7 @@ import DropdownItem from '../base/dropdown/dropdown-item'; import DropdownHint from '../base/dropdown/dropdown-hint'; import SettingsModal, { TAB_INDEX_EXPORT } from '../modals/settings-modal'; import * as models from '../../../models'; -import { getAppVersion } from '../../../common/constants'; +import { getAppName, getAppVersion } from '../../../common/constants'; import { showAlert, showModal, showPrompt } from '../modals'; import Link from '../base/link'; import WorkspaceSettingsModal from '../modals/workspace-settings-modal'; @@ -307,7 +307,9 @@ class WorkspaceDropdown extends React.PureComponent { ))} - Insomnia Version {getAppVersion()} + + {getAppName()} v{getAppVersion()} + Preferences diff --git a/packages/insomnia-app/app/ui/components/gravatar-img.js b/packages/insomnia-app/app/ui/components/gravatar-img.js index 14d1aca9ab..01d23c04aa 100644 --- a/packages/insomnia-app/app/ui/components/gravatar-img.js +++ b/packages/insomnia-app/app/ui/components/gravatar-img.js @@ -1,37 +1,39 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; +// @flow +import * as React from 'react'; import crypto from 'crypto'; -class GravatarImg extends PureComponent { +type Props = {| + email?: string, + size?: number, + fallback?: string, + className?: string, +|}; + +class GravatarImg extends React.PureComponent { render() { - const { email, size: rawSize, className } = this.props; + const { email, size: rawSize, className, fallback } = this.props; const size = rawSize || 100; - const sanitizedEmail = email.trim().toLowerCase(); - const hash = crypto - .createHash('md5') - .update(sanitizedEmail) - .digest('hex'); - const url = `https://www.gravatar.com/avatar/${hash}?s=${size * 2}`; + let src = fallback; + + if (email) { + const hash = crypto + .createHash('md5') + .update(email.trim().toLowerCase()) + .digest('hex'); + src = `https://www.gravatar.com/avatar/${hash}?s=${size * 2}`; + } + const cssSize = `${size}px`; return ( Profile picture ); } } -GravatarImg.propTypes = { - // Required - email: PropTypes.string.isRequired, - - // Optional - size: PropTypes.number, - className: PropTypes.string, -}; - export default GravatarImg; diff --git a/packages/insomnia-app/app/ui/components/toast.js b/packages/insomnia-app/app/ui/components/toast.js index 2699997dcb..e9b25568f7 100644 --- a/packages/insomnia-app/app/ui/components/toast.js +++ b/packages/insomnia-app/app/ui/components/toast.js @@ -80,6 +80,7 @@ class Toast extends React.PureComponent { firstLaunch: stats.created, launches: stats.launches, platform: constants.getAppPlatform(), + app: constants.getAppId(), version: constants.getAppVersion(), requests: await db.count(models.request.type), requestGroups: await db.count(models.requestGroup.type), From e14237a555f38251e164daf021c8871f9b820bd0 Mon Sep 17 00:00:00 2001 From: Ranjan Purbey Date: Tue, 1 Oct 2019 01:41:15 +0530 Subject: [PATCH 021/100] Fix transparent line-numbers background (#1690) --- packages/insomnia-app/app/ui/css/editor/general.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/ui/css/editor/general.less b/packages/insomnia-app/app/ui/css/editor/general.less index d3fdd567bd..4d20fd325a 100644 --- a/packages/insomnia-app/app/ui/css/editor/general.less +++ b/packages/insomnia-app/app/ui/css/editor/general.less @@ -71,7 +71,6 @@ .CodeMirror, .cm-s-seti.CodeMirror, // Hack because seti theme is dumb - .CodeMirror-gutters, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { // Let the background behind show through @@ -98,7 +97,7 @@ } .CodeMirror-gutters { - background-color: transparent; + background-color: var(--color-bg); } .CodeMirror-scroll { From e1c185ced2e5897a9529e49d5996dc1e5e6cb062 Mon Sep 17 00:00:00 2001 From: v1ktor Date: Mon, 30 Sep 2019 23:13:03 +0300 Subject: [PATCH 022/100] Escape dirs in the yarn cmd (#1688) --- packages/insomnia-app/app/plugins/install.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/plugins/install.js b/packages/insomnia-app/app/plugins/install.js index fbb690b367..3936485ac0 100644 --- a/packages/insomnia-app/app/plugins/install.js +++ b/packages/insomnia-app/app/plugins/install.js @@ -133,9 +133,9 @@ async function _installPluginToTmpDir(lookupName: string): Promise<{ tmpDir: str 'add', lookupName, '--modules-folder', - tmpDir, + escape(tmpDir), '--cwd', - tmpDir, + escape(tmpDir), '--no-lockfile', '--production', '--no-progress', From ebb8bb531d2631245029b66248747906b03d5354 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 30 Sep 2019 17:58:07 -0700 Subject: [PATCH 023/100] Version bump --- packages/insomnia-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index b77259a7b4..c620bb6da0 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -11,7 +11,7 @@ "synopsis": "A simple, beautiful, and free REST API client", "icon": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true", "theme": "default", - "version": "6.6.2", + "version": "7.0.0", "main": "main.min.js", "plugins": [ "insomnia-plugin-base64", From eed567294863503d825f16107539536a3400a91e Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 2 Oct 2019 08:01:58 -0700 Subject: [PATCH 024/100] Bump package locks --- packages/insomnia-app/package-lock.json | 2 +- packages/insomnia-cookies/package-lock.json | 2 +- packages/insomnia-importers/package-lock.json | 2 +- packages/insomnia-libcurl/package-lock.json | 2 +- packages/insomnia-xpath/package-lock.json | 29 +---------- .../package-lock.json | 2 +- .../package-lock.json | 2 +- plugins/insomnia-plugin-now/package-lock.json | 2 +- plugins/insomnia-plugin-os/package-lock.json | 2 +- .../package-lock.json | 49 +------------------ .../insomnia-plugin-uuid/package-lock.json | 2 +- 11 files changed, 11 insertions(+), 85 deletions(-) diff --git a/packages/insomnia-app/package-lock.json b/packages/insomnia-app/package-lock.json index e2e0cbc424..7227d195ee 100644 --- a/packages/insomnia-app/package-lock.json +++ b/packages/insomnia-app/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-app", - "version": "1.1.8", + "version": "1.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-cookies/package-lock.json b/packages/insomnia-cookies/package-lock.json index e09e615b8a..f76fa2f714 100644 --- a/packages/insomnia-cookies/package-lock.json +++ b/packages/insomnia-cookies/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-cookies", - "version": "0.0.17", + "version": "0.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-importers/package-lock.json b/packages/insomnia-importers/package-lock.json index dce277d721..d3daf827fb 100644 --- a/packages/insomnia-importers/package-lock.json +++ b/packages/insomnia-importers/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-importers", - "version": "2.0.20", + "version": "2.0.21", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-libcurl/package-lock.json b/packages/insomnia-libcurl/package-lock.json index d6f52596b8..77f54b5efe 100644 --- a/packages/insomnia-libcurl/package-lock.json +++ b/packages/insomnia-libcurl/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-libcurl", - "version": "0.0.28", + "version": "0.0.29", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-xpath/package-lock.json b/packages/insomnia-xpath/package-lock.json index f681a64f1b..38758ed653 100644 --- a/packages/insomnia-xpath/package-lock.json +++ b/packages/insomnia-xpath/package-lock.json @@ -1,36 +1,9 @@ { "name": "insomnia-xpath", - "version": "1.0.14", + "version": "1.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { - "insomnia-cookies": { - "version": "0.0.17", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.17.tgz", - "integrity": "sha512-L+5HrvkHRciCImArY5u4Ua0Nl+/YNLNzaADlsAsoB/Pb2desKIQMU37J6onxka9h7umvhuBchxROK2lKjy+oYQ==", - "requires": { - "tough-cookie": "^2.3.3" - } - }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "xmldom": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", diff --git a/plugins/insomnia-plugin-cookie-jar/package-lock.json b/plugins/insomnia-plugin-cookie-jar/package-lock.json index 5c58543b99..4fadfc74c7 100644 --- a/plugins/insomnia-plugin-cookie-jar/package-lock.json +++ b/plugins/insomnia-plugin-cookie-jar/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-cookie-jar", - "version": "1.0.15", + "version": "1.0.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-jsonpath/package-lock.json b/plugins/insomnia-plugin-jsonpath/package-lock.json index 8050d95bda..92755c4e6e 100644 --- a/plugins/insomnia-plugin-jsonpath/package-lock.json +++ b/plugins/insomnia-plugin-jsonpath/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-jsonpath", - "version": "1.0.18", + "version": "1.0.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-now/package-lock.json b/plugins/insomnia-plugin-now/package-lock.json index a41acca753..beaacaeb0a 100644 --- a/plugins/insomnia-plugin-now/package-lock.json +++ b/plugins/insomnia-plugin-now/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-now", - "version": "1.0.16", + "version": "1.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-os/package-lock.json b/plugins/insomnia-plugin-os/package-lock.json index 25b10eb5c9..58b13b29d6 100644 --- a/plugins/insomnia-plugin-os/package-lock.json +++ b/plugins/insomnia-plugin-os/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-os", - "version": "1.0.18", + "version": "1.0.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-response/package-lock.json b/plugins/insomnia-plugin-response/package-lock.json index 2edcfb7133..65ba5361c8 100644 --- a/plugins/insomnia-plugin-response/package-lock.json +++ b/plugins/insomnia-plugin-response/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-response", - "version": "1.0.24", + "version": "1.0.25", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -53,24 +53,6 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, - "insomnia-cookies": { - "version": "0.0.17", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.17.tgz", - "integrity": "sha512-L+5HrvkHRciCImArY5u4Ua0Nl+/YNLNzaADlsAsoB/Pb2desKIQMU37J6onxka9h7umvhuBchxROK2lKjy+oYQ==", - "requires": { - "tough-cookie": "^2.3.3" - } - }, - "insomnia-xpath": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/insomnia-xpath/-/insomnia-xpath-1.0.14.tgz", - "integrity": "sha512-GedSmR+P9SPhKfJRX4bNM9uoPBdTPPmhxaapODSjrdHtOE2jj0Ggl/K/7YbqpvbAIU5GgUDWiRqCgrYNW+2QfQ==", - "requires": { - "insomnia-cookies": "^0.0.17", - "xmldom": "^0.1.27", - "xpath": "0.0.27" - } - }, "jsonpath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.0.2.tgz", @@ -108,16 +90,6 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -132,15 +104,6 @@ "escodegen": "^1.8.1" } }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -158,16 +121,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" - }, - "xmldom": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" - }, - "xpath": { - "version": "0.0.27", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", - "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==" } } } diff --git a/plugins/insomnia-plugin-uuid/package-lock.json b/plugins/insomnia-plugin-uuid/package-lock.json index 03b528fa4b..9f0947ebbc 100644 --- a/plugins/insomnia-plugin-uuid/package-lock.json +++ b/plugins/insomnia-plugin-uuid/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-uuid", - "version": "1.0.15", + "version": "1.0.16", "lockfileVersion": 1, "requires": true, "dependencies": { From cab9475de9d9fb94914691ca3a0b19f01123bfdd Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 2 Oct 2019 08:19:23 -0700 Subject: [PATCH 025/100] Remove package linking from release --- packages/insomnia-app/scripts/build.js | 52 +++++++++++-------- packages/insomnia-app/scripts/package.js | 2 +- packages/insomnia-prettify/package-lock.json | 2 +- packages/insomnia-url/package-lock.json | 2 +- packages/insomnia-xpath/package-lock.json | 27 ++++++++++ .../insomnia-plugin-base64/package-lock.json | 2 +- .../package-lock.json | 2 +- .../package-lock.json | 2 +- .../insomnia-plugin-file/package-lock.json | 2 +- .../insomnia-plugin-hash/package-lock.json | 2 +- .../insomnia-plugin-prompt/package-lock.json | 2 +- .../insomnia-plugin-request/package-lock.json | 14 ++--- .../package-lock.json | 47 +++++++++++++++++ 13 files changed, 120 insertions(+), 38 deletions(-) diff --git a/packages/insomnia-app/scripts/build.js b/packages/insomnia-app/scripts/build.js index b08ccab25a..b6c0f7a85d 100644 --- a/packages/insomnia-app/scripts/build.js +++ b/packages/insomnia-app/scripts/build.js @@ -96,29 +96,37 @@ async function install(relDir) { return new Promise(resolve => { const prefix = path.resolve(__dirname, relDir); - // Link all plugins - const plugins = path.resolve(__dirname, `../../../plugins`); - for (const dir of fs.readdirSync(plugins)) { - console.log(`[build] Linking plugin ${dir}`); - const p = path.join(plugins, dir); - childProcess.spawnSync('npm', ['link', p], { - cwd: prefix, - shell: true, - }); - } + // // Link all plugins + // const plugins = path.resolve(__dirname, `../../../plugins`); + // for (const dir of fs.readdirSync(plugins)) { + // if (dir.indexOf('.') === 0) { + // continue; + // } + // + // console.log(`[build] Linking plugin ${dir}`); + // const p = path.join(plugins, dir); + // childProcess.spawnSync('npm', ['link', p], { + // cwd: prefix, + // shell: true, + // }); + // } - // Link all packages - const packages = path.resolve(__dirname, `../../../packages`); - for (const dir of fs.readdirSync(packages)) { - // Don't like ourselves - if (dir === packageJson.name) { - continue; - } - - console.log(`[build] Linking local package ${dir}`); - const p = path.join(packages, dir); - childProcess.spawnSync('npm', ['link', p], { cwd: prefix, shell: true }); - } + // // Link all packages + // const packages = path.resolve(__dirname, `../../../packages`); + // for (const dir of fs.readdirSync(packages)) { + // // Don't like ourselves + // if (dir === packageJson.name) { + // continue; + // } + // + // if (dir.indexOf('.') === 0) { + // continue; + // } + // + // console.log(`[build] Linking local package ${dir}`); + // const p = path.join(packages, dir); + // childProcess.spawnSync('npm', ['link', p], { cwd: prefix, shell: true }); + // } const p = childProcess.spawn('npm', ['install', '--production', '--no-optional'], { cwd: prefix, diff --git a/packages/insomnia-app/scripts/package.js b/packages/insomnia-app/scripts/package.js index e05e7a8ead..ed9252e6f3 100644 --- a/packages/insomnia-app/scripts/package.js +++ b/packages/insomnia-app/scripts/package.js @@ -48,7 +48,7 @@ async function pkg(relConfigPath) { .replace('__EXECUTABLE_NAME__', packageJson.app.executableName) .replace('__SYNOPSIS__', packageJson.app.synopsis); - console.log(`[package] Using electron-builder config\n${rawConfig}`); + // console.log(`[package] Using electron-builder config\n${rawConfig}`); const config = JSON.parse(rawConfig); const targetPlatform = PLATFORM_MAP[process.platform]; diff --git a/packages/insomnia-prettify/package-lock.json b/packages/insomnia-prettify/package-lock.json index 01a8da7972..15a2523d30 100644 --- a/packages/insomnia-prettify/package-lock.json +++ b/packages/insomnia-prettify/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-prettify", - "version": "0.1.11", + "version": "0.1.12", "lockfileVersion": 1 } diff --git a/packages/insomnia-url/package-lock.json b/packages/insomnia-url/package-lock.json index 9c30cbe3da..0b7e11015c 100644 --- a/packages/insomnia-url/package-lock.json +++ b/packages/insomnia-url/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-url", - "version": "0.1.10", + "version": "0.1.11", "lockfileVersion": 1 } diff --git a/packages/insomnia-xpath/package-lock.json b/packages/insomnia-xpath/package-lock.json index 38758ed653..05356baac1 100644 --- a/packages/insomnia-xpath/package-lock.json +++ b/packages/insomnia-xpath/package-lock.json @@ -4,6 +4,33 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "insomnia-cookies": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.18.tgz", + "integrity": "sha512-NOjNaAdQooN4scL9iJTVUZaTLzWffHDnxgqEMLQH1OS0ANFpay+UQkOu5M2qoQybSKr87YwrrcKJdI7Gt6HivQ==", + "requires": { + "tough-cookie": "^2.3.3" + } + }, + "psl": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "xmldom": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", diff --git a/plugins/insomnia-plugin-base64/package-lock.json b/plugins/insomnia-plugin-base64/package-lock.json index ddc7484ea0..43e8bed2b1 100644 --- a/plugins/insomnia-plugin-base64/package-lock.json +++ b/plugins/insomnia-plugin-base64/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-plugin-base64", - "version": "1.0.10", + "version": "1.0.11", "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-core-themes/package-lock.json b/plugins/insomnia-plugin-core-themes/package-lock.json index 37e3ba0af3..4584892c19 100644 --- a/plugins/insomnia-plugin-core-themes/package-lock.json +++ b/plugins/insomnia-plugin-core-themes/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-plugin-core-themes", - "version": "1.0.9", + "version": "1.0.10", "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-default-headers/package-lock.json b/plugins/insomnia-plugin-default-headers/package-lock.json index effb11c7c2..9442209a2f 100644 --- a/plugins/insomnia-plugin-default-headers/package-lock.json +++ b/plugins/insomnia-plugin-default-headers/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-plugin-default-headers", - "version": "1.1.11", + "version": "1.1.12", "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-file/package-lock.json b/plugins/insomnia-plugin-file/package-lock.json index ec0b4f4e39..95e0e0c53e 100644 --- a/plugins/insomnia-plugin-file/package-lock.json +++ b/plugins/insomnia-plugin-file/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-plugin-file", - "version": "1.0.11", + "version": "1.0.12", "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-hash/package-lock.json b/plugins/insomnia-plugin-hash/package-lock.json index 633dcad51f..677485d6d6 100644 --- a/plugins/insomnia-plugin-hash/package-lock.json +++ b/plugins/insomnia-plugin-hash/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-plugin-hash", - "version": "1.0.11", + "version": "1.0.12", "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-prompt/package-lock.json b/plugins/insomnia-plugin-prompt/package-lock.json index baf3c3f686..b968c00d0f 100644 --- a/plugins/insomnia-plugin-prompt/package-lock.json +++ b/plugins/insomnia-plugin-prompt/package-lock.json @@ -1,5 +1,5 @@ { "name": "insomnia-plugin-prompt", - "version": "1.1.15", + "version": "1.1.16", "lockfileVersion": 1 } diff --git a/plugins/insomnia-plugin-request/package-lock.json b/plugins/insomnia-plugin-request/package-lock.json index f0567c02c9..c2f454bd3d 100644 --- a/plugins/insomnia-plugin-request/package-lock.json +++ b/plugins/insomnia-plugin-request/package-lock.json @@ -1,21 +1,21 @@ { "name": "insomnia-plugin-request", - "version": "1.0.24", + "version": "1.0.25", "lockfileVersion": 1, "requires": true, "dependencies": { "insomnia-cookies": { - "version": "0.0.17", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.17.tgz", - "integrity": "sha512-L+5HrvkHRciCImArY5u4Ua0Nl+/YNLNzaADlsAsoB/Pb2desKIQMU37J6onxka9h7umvhuBchxROK2lKjy+oYQ==", + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.18.tgz", + "integrity": "sha512-NOjNaAdQooN4scL9iJTVUZaTLzWffHDnxgqEMLQH1OS0ANFpay+UQkOu5M2qoQybSKr87YwrrcKJdI7Gt6HivQ==", "requires": { "tough-cookie": "^2.3.3" } }, "insomnia-url": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/insomnia-url/-/insomnia-url-0.1.10.tgz", - "integrity": "sha512-fSN3/gNryiDi07Ut9M9GjGMM5bg1v6RwfG5FyQGkCettzgqJNc1pDO5QQSargR6vdSYo9rqBU9gZVGVdWWR2kg==" + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/insomnia-url/-/insomnia-url-0.1.11.tgz", + "integrity": "sha512-RWn5398ZDgkeOUF8vkowXvD2KW/sw+NA2G9tf9fImrxouP2ZIde+CQt+KeiRPWLs4ofPnAhxEdXuCtmJkAG7RQ==" }, "psl": { "version": "1.4.0", diff --git a/plugins/insomnia-plugin-response/package-lock.json b/plugins/insomnia-plugin-response/package-lock.json index 65ba5361c8..7868b7ac63 100644 --- a/plugins/insomnia-plugin-response/package-lock.json +++ b/plugins/insomnia-plugin-response/package-lock.json @@ -53,6 +53,24 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, + "insomnia-cookies": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.18.tgz", + "integrity": "sha512-NOjNaAdQooN4scL9iJTVUZaTLzWffHDnxgqEMLQH1OS0ANFpay+UQkOu5M2qoQybSKr87YwrrcKJdI7Gt6HivQ==", + "requires": { + "tough-cookie": "^2.3.3" + } + }, + "insomnia-xpath": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/insomnia-xpath/-/insomnia-xpath-1.0.15.tgz", + "integrity": "sha512-tqxw2vb2zVYXIZ9gkGPqTPQ/bU09Fb4ArMBEvxiQVlxEnFvXXmEP8Skm0kY2+ZiYfqHCVyEIXx/bM4XU5NEk8A==", + "requires": { + "insomnia-cookies": "^0.0.18", + "xmldom": "^0.1.27", + "xpath": "0.0.27" + } + }, "jsonpath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.0.2.tgz", @@ -90,6 +108,16 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, + "psl": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -104,6 +132,15 @@ "escodegen": "^1.8.1" } }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -121,6 +158,16 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + }, + "xpath": { + "version": "0.0.27", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", + "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==" } } } From 9909f8e907dd590c058fd91a25d57f9914d516f3 Mon Sep 17 00:00:00 2001 From: v1ktor Date: Mon, 7 Oct 2019 21:37:42 +0300 Subject: [PATCH 026/100] Escape yarn paths (#1699) --- packages/insomnia-app/app/plugins/install.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/plugins/install.js b/packages/insomnia-app/app/plugins/install.js index 3936485ac0..22945b1d76 100644 --- a/packages/insomnia-app/app/plugins/install.js +++ b/packages/insomnia-app/app/plugins/install.js @@ -63,7 +63,7 @@ async function _isInsomniaPlugin(lookupName: string): Promise { escape(process.execPath), [ '--no-deprecation', // Because Yarn still uses `new Buffer()` - _getYarnPath(), + escape(_getYarnPath()), 'info', lookupName, '--json', @@ -129,7 +129,7 @@ async function _installPluginToTmpDir(lookupName: string): Promise<{ tmpDir: str escape(process.execPath), [ '--no-deprecation', // Because Yarn still uses `new Buffer()` - _getYarnPath(), + escape(_getYarnPath()), 'add', lookupName, '--modules-folder', From 69cbcdf2533e7f6d0bd8f926b99f751f916a10cf Mon Sep 17 00:00:00 2001 From: Manoel Date: Mon, 7 Oct 2019 15:39:55 -0300 Subject: [PATCH 027/100] Add extension to .eslintrc file (#1711) .eslintrc without extension is deprecated --- .eslintrc => .eslintrc.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .eslintrc => .eslintrc.json (100%) diff --git a/.eslintrc b/.eslintrc.json similarity index 100% rename from .eslintrc rename to .eslintrc.json From 8a290784aa6da93d1b4b41229db44aa4e618d7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20H=C3=AEncu?= Date: Mon, 7 Oct 2019 21:43:34 +0300 Subject: [PATCH 028/100] Add ability to duplicate environments (#1706) --- packages/insomnia-app/app/models/environment.js | 14 ++++++++++++++ .../modals/workspace-environments-edit-modal.js | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/packages/insomnia-app/app/models/environment.js b/packages/insomnia-app/app/models/environment.js index af86c6c3af..3387348edb 100644 --- a/packages/insomnia-app/app/models/environment.js +++ b/packages/insomnia-app/app/models/environment.js @@ -82,6 +82,20 @@ export function getById(id: string): Promise { return db.get(type, id); } +export async function duplicate(environment: Environment): Promise { + const name = `${environment.name} (Copy)`; + + // Get sort key of next environment + const q = { metaSortKey: { $gt: environment.metaSortKey } }; + const [nextEnvironment] = await db.find(type, q, { metaSortKey: 1 }); + const nextSortKey = nextEnvironment ? nextEnvironment.metaSortKey : environment.metaSortKey + 100; + + // Calculate new sort key + const metaSortKey = (environment.metaSortKey + nextSortKey) / 2; + + return db.duplicate(environment, { name, metaSortKey }); +} + export function remove(environment: Environment): Promise { return db.remove(environment); } diff --git a/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.js b/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.js index 10fa01324f..f6e522fe96 100644 --- a/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/workspace-environments-edit-modal.js @@ -205,6 +205,12 @@ class WorkspaceEnvironmentsEditModal extends React.PureComponent { await this._load(workspace, environment); } + async _handleDuplicateEnvironment(environment: Environment) { + const { workspace } = this.state; + const newEnvironment = await models.environment.duplicate(environment); + this._load(workspace, newEnvironment); + } + async _handleDeleteEnvironment(environment: Environment) { const { rootEnvironment, workspace } = this.state; @@ -484,6 +490,13 @@ class WorkspaceEnvironmentsEditModal extends React.PureComponent { + + Date: Mon, 7 Oct 2019 21:44:16 +0300 Subject: [PATCH 029/100] Add request name in the hover tooltip (#1705) --- .../app/ui/components/sidebar/sidebar-request-row.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js b/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js index 3f2fc7b054..0f99a735f0 100644 --- a/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js +++ b/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js @@ -123,7 +123,12 @@ class SidebarRequestRow extends PureComponent { onEditStart={this._handleEditStart} onSubmit={this._handleRequestUpdateName} renderReadView={(value, props) => ( - + )} /> From 6fe838eef7bfee433199dd5c47e38fbc1ce12d64 Mon Sep 17 00:00:00 2001 From: Corey Gouker Date: Mon, 7 Oct 2019 11:51:05 -0700 Subject: [PATCH 030/100] Set macOS icon to png for correct icon.icns build (#1707) --- packages/insomnia-app/.electronbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/insomnia-app/.electronbuilder b/packages/insomnia-app/.electronbuilder index 05f4ab1535..a4dc5da8c5 100644 --- a/packages/insomnia-app/.electronbuilder +++ b/packages/insomnia-app/.electronbuilder @@ -24,6 +24,7 @@ }, "mac": { "category": "public.app-category.developer-tools", + "icon": "./build/icon.png", "target": [ "dmg", "zip" From 607b219afa5b60b3fc17fa0d339a66336812eed9 Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Mon, 7 Oct 2019 13:52:00 -0500 Subject: [PATCH 031/100] Correct typo on import dialog (#1696) --- packages/insomnia-app/app/ui/redux/modules/global.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/ui/redux/modules/global.js b/packages/insomnia-app/app/ui/redux/modules/global.js index 73319921bc..1645368e48 100644 --- a/packages/insomnia-app/app/ui/redux/modules/global.js +++ b/packages/insomnia-app/app/ui/redux/modules/global.js @@ -455,7 +455,7 @@ function askToImportIntoWorkspace(workspaceId) { return new Promise(resolve => { showModal(AskModal, { title: 'Import', - message: 'Do you wand to import into the current workspace or a new one?', + message: 'Do you want to import into the current workspace or a new one?', yesText: 'Current', noText: 'New Workspace', onDone: yes => { From 552ca2ad69dc3a5bbb5cc8586a16f0ca6c72203b Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Mon, 7 Oct 2019 13:54:46 -0500 Subject: [PATCH 032/100] No longer override in GraphQL editor on initialization (#1701) --- .../insomnia-app/app/ui/components/codemirror/code-editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/insomnia-app/app/ui/components/codemirror/code-editor.js b/packages/insomnia-app/app/ui/components/codemirror/code-editor.js index fa6ad498ef..3829b33d9c 100644 --- a/packages/insomnia-app/app/ui/components/codemirror/code-editor.js +++ b/packages/insomnia-app/app/ui/components/codemirror/code-editor.js @@ -294,6 +294,7 @@ class CodeEditor extends React.Component { this.codeMirror.setCursor({ line: -1, ch: -1 }); this.codeMirror.setOption('extraKeys', { + ...BASE_CODEMIRROR_OPTIONS.extraKeys, Tab: cm => { const spaces = this._indentChars(); cm.replaceSelection(spaces); From edf94643c1eef9f6cdf3529636a3d74f70c762a6 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 7 Oct 2019 12:17:34 -0700 Subject: [PATCH 033/100] Re-detect operationName when editing GQL query (Fixes #1708) --- .../editors/body/graph-ql-editor.js | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js index 9b89f88e07..f61287f2f2 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js +++ b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.js @@ -399,6 +399,20 @@ class GraphQLEditor extends React.PureComponent { return; } + try { + this._documentAST = parse(query); + } catch (e) { + this._documentAST = null; + } + + // Find op if there isn't one yet + if (!body.operationName) { + const newOperationName = this._getCurrentOperation(); + if (newOperationName) { + body.operationName = newOperationName; + } + } + this.setState({ variablesSyntaxError: '', body, @@ -406,17 +420,13 @@ class GraphQLEditor extends React.PureComponent { this.props.onChange(newContent); this._highlightOperation(body.operationName || null); - - try { - this._documentAST = parse(query); - } catch (e) { - this._documentAST = null; - } } _handleQueryChange(query: string): void { - const currentOperation = this._getCurrentOperation(); - this._handleBodyChange(query, this.state.body.variables, currentOperation); + // Since we're editing the query, we may be changing the operation name, so + // Don't pass it to the body change in order to automatically re-detect it + // based on the current cursor position. + this._handleBodyChange(query, this.state.body.variables, null); } _handleVariablesChange(variables: string): void { From f5978b22f9729eb01b9126b8e98f691967c10e46 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 7 Oct 2019 12:26:28 -0700 Subject: [PATCH 034/100] Fix tab key in code editor (Closes #1703) --- .../app/ui/components/codemirror/code-editor.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/codemirror/code-editor.js b/packages/insomnia-app/app/ui/components/codemirror/code-editor.js index 3829b33d9c..b4ce3f0d98 100644 --- a/packages/insomnia-app/app/ui/components/codemirror/code-editor.js +++ b/packages/insomnia-app/app/ui/components/codemirror/code-editor.js @@ -296,8 +296,13 @@ class CodeEditor extends React.Component { this.codeMirror.setOption('extraKeys', { ...BASE_CODEMIRROR_OPTIONS.extraKeys, Tab: cm => { - const spaces = this._indentChars(); - cm.replaceSelection(spaces); + // Indent with tabs or spaces + // From https://github.com/codemirror/CodeMirror/issues/988#issuecomment-14921785 + if (cm.somethingSelected()) { + cm.indentSelection('add'); + } else { + cm.replaceSelection(this._indentChars(), 'end', '+input'); + } }, }); From 384c65bd378fdf8ab7e724dc9218a2ed744e7bc4 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 7 Oct 2019 12:37:16 -0700 Subject: [PATCH 035/100] Reset window bounds if not within bounds of any display (Closes #1702) --- .../insomnia-app/app/main/window-utils.js | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/packages/insomnia-app/app/main/window-utils.js b/packages/insomnia-app/app/main/window-utils.js index 028ab86c3a..7a5e03eaab 100644 --- a/packages/insomnia-app/app/main/window-utils.js +++ b/packages/insomnia-app/app/main/window-utils.js @@ -34,30 +34,25 @@ export function createWindow() { const { bounds, fullscreen, maximize } = getBounds(); const { x, y, width, height } = bounds; - // Make sure we don't place the window outside of the visible space - let maxX = Number.MIN_VALUE; - let maxY = Number.MIN_VALUE; - let minX = Number.MAX_VALUE; - let minY = Number.MAX_VALUE; - + let isVisibleOnAnyDisplay = true; for (const d of electron.screen.getAllDisplays()) { - // Set the maximum placement location to 50 pixels short of the end - maxX = Math.max(maxX, d.bounds.x + d.bounds.width - 50); - maxY = Math.max(maxY, d.bounds.y + d.bounds.height - 50); + const isVisibleOnDisplay = + x >= d.bounds.x && + y >= d.bounds.y && + x + width <= d.bounds.x + d.bounds.width && + y + height <= d.bounds.y + d.bounds.height; - // Set the minimum placement location 50 pixels from the start - minX = Math.min(minX, d.bounds.x + 50); - minY = Math.min(minY, d.bounds.y + 50); + if (!isVisibleOnDisplay) { + isVisibleOnAnyDisplay = false; + } } - // Clamp screen position between min and max - const finalX = Math.max(minX, Math.min(maxX, x)); - const finalY = Math.max(maxY, Math.min(maxX, y)); - mainWindow = new BrowserWindow({ // Make sure we don't initialize the window outside the bounds - x: finalX, - y: finalY, + x: isVisibleOnAnyDisplay ? x : undefined, + y: isVisibleOnAnyDisplay ? y : undefined, + + // Other options fullscreen: fullscreen, fullscreenable: true, title: getAppName(), From 76f5d8da1a7f6df77be8fbcf69eec2a43f16dff1 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 7 Oct 2019 13:45:05 -0700 Subject: [PATCH 036/100] Only handle supported Curl args during import (Fixes #1697) --- .../src/__tests__/fixtures.test.js | 4 +++ .../fixtures/curl/simple-url-input.sh | 1 + .../fixtures/curl/simple-url-output.json | 20 +++++++++++++ .../insomnia-importers/src/importers/curl.js | 28 ++++++++++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-input.sh create mode 100644 packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json diff --git a/packages/insomnia-importers/src/__tests__/fixtures.test.js b/packages/insomnia-importers/src/__tests__/fixtures.test.js index d5281f56c7..7225d565ef 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures.test.js +++ b/packages/insomnia-importers/src/__tests__/fixtures.test.js @@ -16,6 +16,10 @@ describe('Fixtures', () => { const prefix = input.replace(/-input\.[^.]+/, ''); const output = `${prefix}-output.json`; + if (!prefix.includes('simple')) { + continue; + } + it(`Import ${name} ${input}`, async () => { expect(typeof input).toBe('string'); expect(typeof output).toBe('string'); diff --git a/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-input.sh b/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-input.sh new file mode 100644 index 0000000000..9cada9b7fb --- /dev/null +++ b/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-input.sh @@ -0,0 +1 @@ +curl --compressed 'https://www.google.com/' \ No newline at end of file diff --git a/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json b/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json new file mode 100644 index 0000000000..b5f7f2034c --- /dev/null +++ b/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json @@ -0,0 +1,20 @@ +{ + "_type": "export", + "__export_format": 4, + "__export_date": "2016-11-18T22:34:51.526Z", + "__export_source": "insomnia.importers:v0.1.0", + "resources": [ + { + "_id": "__REQ_1__", + "_type": "request", + "parentId": "__WORKSPACE_ID__", + "url": "https://www.google.com/", + "name": "https://www.google.com/", + "method": "GET", + "body": {}, + "parameters": [], + "headers": [], + "authentication": {} + } + ] +} diff --git a/packages/insomnia-importers/src/importers/curl.js b/packages/insomnia-importers/src/importers/curl.js index a9fdd24fc4..b90eb83745 100755 --- a/packages/insomnia-importers/src/importers/curl.js +++ b/packages/insomnia-importers/src/importers/curl.js @@ -8,6 +8,28 @@ module.exports.id = 'curl'; module.exports.name = 'cURL'; module.exports.description = 'cURL command line tool'; +const SUPPORTED_ARGS = [ + 'url', + 'u', + 'user', + 'header', + 'H', + 'cookie', + 'b', + 'get', + 'G', + 'd', + 'data', + 'data-raw', + 'data-urlencode', + 'data-binary', + 'data-ascii', + 'form', + 'F', + 'request', + 'X', +]; + module.exports.convert = function(rawData) { requestCount = 1; @@ -75,6 +97,10 @@ function importArgs(args) { const isSingleDash = arg[0] === '-' && arg[1] !== '-'; let name = arg.replace(/^-{1,2}/, ''); + if (!SUPPORTED_ARGS.includes(name)) { + continue; + } + let value; if (isSingleDash && name.length > 1) { // Handle squished arguments like -XPOST @@ -116,7 +142,7 @@ function importArgs(args) { }); // Cookies - const cookieHeaderValue = [...(pairs.cookie || []), ...(pairs.b || [])] + const cookieHeaderValue = [...(pairs['cookie'] || []), ...(pairs['b'] || [])] .map(str => { const name = str.split('=', 1)[0]; const value = str.replace(`${name}=`, ''); From 8ce877eb738e6fc6a282fcf2ddb3e13f1ce1d5da Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 7 Oct 2019 13:48:48 -0700 Subject: [PATCH 037/100] Publish - insomnia-app@1.1.10 - insomnia-cookies@0.0.19 - insomnia-importers@2.0.22 - insomnia-libcurl@0.0.30 - insomnia-prettify@0.1.13 - insomnia-url@0.1.12 - insomnia-xpath@1.0.16 - insomnia-plugin-base64@1.0.12 - insomnia-plugin-cookie-jar@1.0.17 - insomnia-plugin-core-themes@1.0.11 - insomnia-plugin-default-headers@1.1.13 - insomnia-plugin-file@1.0.13 - insomnia-plugin-hash@1.0.13 - insomnia-plugin-jsonpath@1.0.20 - insomnia-plugin-now@1.0.18 - insomnia-plugin-os@1.0.20 - insomnia-plugin-prompt@1.1.17 - insomnia-plugin-request@1.0.26 - insomnia-plugin-response@1.0.26 - insomnia-plugin-uuid@1.0.17 --- packages/insomnia-app/package.json | 36 +++++++++---------- packages/insomnia-cookies/package.json | 2 +- packages/insomnia-importers/package.json | 2 +- packages/insomnia-libcurl/package.json | 2 +- packages/insomnia-prettify/package.json | 2 +- packages/insomnia-url/package.json | 2 +- packages/insomnia-xpath/package.json | 4 +-- plugins/insomnia-plugin-base64/package.json | 2 +- .../insomnia-plugin-cookie-jar/package.json | 2 +- .../insomnia-plugin-core-themes/package.json | 2 +- .../package.json | 2 +- plugins/insomnia-plugin-file/package.json | 2 +- plugins/insomnia-plugin-hash/package.json | 2 +- plugins/insomnia-plugin-jsonpath/package.json | 2 +- plugins/insomnia-plugin-now/package.json | 2 +- plugins/insomnia-plugin-os/package.json | 2 +- plugins/insomnia-plugin-prompt/package.json | 2 +- plugins/insomnia-plugin-request/package.json | 6 ++-- plugins/insomnia-plugin-response/package.json | 4 +-- plugins/insomnia-plugin-uuid/package.json | 2 +- 20 files changed, 41 insertions(+), 41 deletions(-) diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index c620bb6da0..6be43cde0f 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "1.1.9", + "version": "1.1.10", "name": "insomnia-app", "app": { "name": "insomnia", @@ -134,23 +134,23 @@ "html-entities": "^1.2.0", "httpsnippet": "^1.19.1", "iconv-lite": "^0.4.15", - "insomnia-cookies": "^0.0.18", - "insomnia-importers": "^2.0.21", - "insomnia-libcurl": "^0.0.29", - "insomnia-plugin-base64": "^1.0.11", - "insomnia-plugin-cookie-jar": "^1.0.16", - "insomnia-plugin-core-themes": "^1.0.10", - "insomnia-plugin-file": "^1.0.12", - "insomnia-plugin-hash": "^1.0.12", - "insomnia-plugin-jsonpath": "^1.0.19", - "insomnia-plugin-now": "^1.0.17", - "insomnia-plugin-prompt": "^1.1.16", - "insomnia-plugin-request": "^1.0.25", - "insomnia-plugin-response": "^1.0.25", - "insomnia-plugin-uuid": "^1.0.16", - "insomnia-prettify": "^0.1.12", - "insomnia-url": "^0.1.11", - "insomnia-xpath": "^1.0.15", + "insomnia-cookies": "^0.0.19", + "insomnia-importers": "^2.0.22", + "insomnia-libcurl": "^0.0.30", + "insomnia-plugin-base64": "^1.0.12", + "insomnia-plugin-cookie-jar": "^1.0.17", + "insomnia-plugin-core-themes": "^1.0.11", + "insomnia-plugin-file": "^1.0.13", + "insomnia-plugin-hash": "^1.0.13", + "insomnia-plugin-jsonpath": "^1.0.20", + "insomnia-plugin-now": "^1.0.18", + "insomnia-plugin-prompt": "^1.1.17", + "insomnia-plugin-request": "^1.0.26", + "insomnia-plugin-response": "^1.0.26", + "insomnia-plugin-uuid": "^1.0.17", + "insomnia-prettify": "^0.1.13", + "insomnia-url": "^0.1.12", + "insomnia-xpath": "^1.0.16", "json-order": "^1.0.9", "jsonlint": "^1.6.3", "jsonpath": "^1.0.2", diff --git a/packages/insomnia-cookies/package.json b/packages/insomnia-cookies/package.json index dc53897f8c..8c268b6f6e 100644 --- a/packages/insomnia-cookies/package.json +++ b/packages/insomnia-cookies/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-cookies", - "version": "0.0.18", + "version": "0.0.19", "author": "Gregory Schier ", "description": "Cookie utilities", "license": "MIT", diff --git a/packages/insomnia-importers/package.json b/packages/insomnia-importers/package.json index 69faf917de..07cf82d335 100755 --- a/packages/insomnia-importers/package.json +++ b/packages/insomnia-importers/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-importers", - "version": "2.0.21", + "version": "2.0.22", "author": "Gregory Schier ", "description": "Various data importers for Insomnia", "license": "MIT", diff --git a/packages/insomnia-libcurl/package.json b/packages/insomnia-libcurl/package.json index d222460b44..e2d8114ac5 100644 --- a/packages/insomnia-libcurl/package.json +++ b/packages/insomnia-libcurl/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-libcurl", - "version": "0.0.29", + "version": "0.0.30", "author": "Gregory Schier ", "description": "Insomnia libcurl wrapper", "license": "MIT", diff --git a/packages/insomnia-prettify/package.json b/packages/insomnia-prettify/package.json index 47648b4eff..ae34cbacbe 100644 --- a/packages/insomnia-prettify/package.json +++ b/packages/insomnia-prettify/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-prettify", - "version": "0.1.12", + "version": "0.1.13", "author": "Gregory Schier ", "description": "Prettification utilities for Insomnia", "license": "MIT", diff --git a/packages/insomnia-url/package.json b/packages/insomnia-url/package.json index 0c70fb4797..c58a0c4dab 100644 --- a/packages/insomnia-url/package.json +++ b/packages/insomnia-url/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-url", - "version": "0.1.11", + "version": "0.1.12", "author": "Gregory Schier ", "description": "URL Utilities", "license": "MIT", diff --git a/packages/insomnia-xpath/package.json b/packages/insomnia-xpath/package.json index f450eb2546..82b1846191 100644 --- a/packages/insomnia-xpath/package.json +++ b/packages/insomnia-xpath/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-xpath", - "version": "1.0.15", + "version": "1.0.16", "author": "Gregory Schier ", "description": "Query XML using XPath", "license": "MIT", @@ -9,7 +9,7 @@ "test": "jest --silent" }, "dependencies": { - "insomnia-cookies": "^0.0.18", + "insomnia-cookies": "^0.0.19", "xmldom": "^0.1.27", "xpath": "0.0.27" } diff --git a/plugins/insomnia-plugin-base64/package.json b/plugins/insomnia-plugin-base64/package.json index d1c30e0e32..822b3a6433 100644 --- a/plugins/insomnia-plugin-base64/package.json +++ b/plugins/insomnia-plugin-base64/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-base64", - "version": "1.0.11", + "version": "1.0.12", "author": "Gregory Schier ", "description": "Insomnia base64 template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-cookie-jar/package.json b/plugins/insomnia-plugin-cookie-jar/package.json index 23a2a2fbe6..0554f2fac1 100644 --- a/plugins/insomnia-plugin-cookie-jar/package.json +++ b/plugins/insomnia-plugin-cookie-jar/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-cookie-jar", - "version": "1.0.16", + "version": "1.0.17", "author": "Preston Alvarado ", "description": "Insomnia cookie jar template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-core-themes/package.json b/plugins/insomnia-plugin-core-themes/package.json index a640937618..68e6a0c961 100644 --- a/plugins/insomnia-plugin-core-themes/package.json +++ b/plugins/insomnia-plugin-core-themes/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-core-themes", - "version": "1.0.10", + "version": "1.0.11", "author": "Gregory Schier ", "description": "Insomnia core themes", "license": "MIT", diff --git a/plugins/insomnia-plugin-default-headers/package.json b/plugins/insomnia-plugin-default-headers/package.json index 58b6dfbd2d..71d743f0d9 100644 --- a/plugins/insomnia-plugin-default-headers/package.json +++ b/plugins/insomnia-plugin-default-headers/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-default-headers", - "version": "1.1.12", + "version": "1.1.13", "author": "Gregory Schier ", "description": "Various data importers for Insomnia", "license": "MIT", diff --git a/plugins/insomnia-plugin-file/package.json b/plugins/insomnia-plugin-file/package.json index c58f1c63a8..a394a8bf5a 100644 --- a/plugins/insomnia-plugin-file/package.json +++ b/plugins/insomnia-plugin-file/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-file", - "version": "1.0.12", + "version": "1.0.13", "author": "Gregory Schier ", "description": "Insomnia file templte tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-hash/package.json b/plugins/insomnia-plugin-hash/package.json index ad984c9539..b14c0ecc6c 100644 --- a/plugins/insomnia-plugin-hash/package.json +++ b/plugins/insomnia-plugin-hash/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-hash", - "version": "1.0.12", + "version": "1.0.13", "author": "Gregory Schier ", "description": "Insomnia hash template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-jsonpath/package.json b/plugins/insomnia-plugin-jsonpath/package.json index 16665257a3..ce121d5e80 100644 --- a/plugins/insomnia-plugin-jsonpath/package.json +++ b/plugins/insomnia-plugin-jsonpath/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-jsonpath", - "version": "1.0.19", + "version": "1.0.20", "author": "Gregory Schier ", "description": "Template tag to pull data from JSON strings", "license": "MIT", diff --git a/plugins/insomnia-plugin-now/package.json b/plugins/insomnia-plugin-now/package.json index bd92344c4b..a4304998f6 100644 --- a/plugins/insomnia-plugin-now/package.json +++ b/plugins/insomnia-plugin-now/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-now", - "version": "1.0.17", + "version": "1.0.18", "author": "Gregory Schier ", "description": "Insomnia now template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-os/package.json b/plugins/insomnia-plugin-os/package.json index d17e9d28f5..2c2b459d4c 100644 --- a/plugins/insomnia-plugin-os/package.json +++ b/plugins/insomnia-plugin-os/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-os", - "version": "1.0.19", + "version": "1.0.20", "author": "Gregory Schier ", "description": "Template tag to get information about the OS", "license": "MIT", diff --git a/plugins/insomnia-plugin-prompt/package.json b/plugins/insomnia-plugin-prompt/package.json index f0f4dc7823..0f8c675fb8 100644 --- a/plugins/insomnia-plugin-prompt/package.json +++ b/plugins/insomnia-plugin-prompt/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-prompt", - "version": "1.1.16", + "version": "1.1.17", "author": "Gregory Schier ", "description": "Insomnia prompt template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-request/package.json b/plugins/insomnia-plugin-request/package.json index 1a6186da2f..922f55da7b 100644 --- a/plugins/insomnia-plugin-request/package.json +++ b/plugins/insomnia-plugin-request/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-request", - "version": "1.0.25", + "version": "1.0.26", "author": "Gregory Schier ", "description": "Insomnia request template tag", "license": "MIT", @@ -16,7 +16,7 @@ "test": "jest --silent" }, "dependencies": { - "insomnia-cookies": "^0.0.18", - "insomnia-url": "^0.1.11" + "insomnia-cookies": "^0.0.19", + "insomnia-url": "^0.1.12" } } diff --git a/plugins/insomnia-plugin-response/package.json b/plugins/insomnia-plugin-response/package.json index c513fe6bef..8759520b3f 100644 --- a/plugins/insomnia-plugin-response/package.json +++ b/plugins/insomnia-plugin-response/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-response", - "version": "1.0.25", + "version": "1.0.26", "author": "Gregory Schier ", "description": "Insomnia response template tag", "license": "MIT", @@ -17,7 +17,7 @@ }, "dependencies": { "iconv-lite": "^0.4.19", - "insomnia-xpath": "^1.0.15", + "insomnia-xpath": "^1.0.16", "jsonpath": "^1.0.2" } } diff --git a/plugins/insomnia-plugin-uuid/package.json b/plugins/insomnia-plugin-uuid/package.json index 92a4396cde..e8c85770bf 100644 --- a/plugins/insomnia-plugin-uuid/package.json +++ b/plugins/insomnia-plugin-uuid/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-uuid", - "version": "1.0.16", + "version": "1.0.17", "author": "Gregory Schier ", "description": "Insomnia uuid template tag", "license": "MIT", From 9bbb253a376cd4dfb0c77144fd89ad97e0268dd4 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 8 Oct 2019 12:00:58 -0700 Subject: [PATCH 038/100] Bump version --- packages/insomnia-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index 6be43cde0f..336bfabc7f 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -11,7 +11,7 @@ "synopsis": "A simple, beautiful, and free REST API client", "icon": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true", "theme": "default", - "version": "7.0.0", + "version": "7.0.1", "main": "main.min.js", "plugins": [ "insomnia-plugin-base64", From 0c53522f4612a99fd00f4bdfe6ab3226a7c0b082 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 8 Oct 2019 16:31:32 -0700 Subject: [PATCH 039/100] Add Apple Notarization --- packages/insomnia-app/.electronbuilder | 7 +- .../app/static/entitlements.mac.inherit.plist | 12 + packages/insomnia-app/package-lock.json | 773 +++++++++--------- packages/insomnia-app/package.json | 9 +- .../insomnia-app/scripts/afterSignHook.js | 35 + 5 files changed, 446 insertions(+), 390 deletions(-) create mode 100644 packages/insomnia-app/app/static/entitlements.mac.inherit.plist create mode 100644 packages/insomnia-app/scripts/afterSignHook.js diff --git a/packages/insomnia-app/.electronbuilder b/packages/insomnia-app/.electronbuilder index a4dc5da8c5..2d42ebfecb 100644 --- a/packages/insomnia-app/.electronbuilder +++ b/packages/insomnia-app/.electronbuilder @@ -1,6 +1,7 @@ { "appId": "__APP_ID__", "publish": false, + "afterSign": "./scripts/afterSignHook.js", "extraResources": [ { "from": "./bin", @@ -23,8 +24,10 @@ "output": "dist" }, "mac": { - "category": "public.app-category.developer-tools", + "hardenedRuntime": true, "icon": "./build/icon.png", + "category": "public.app-category.developer-tools", + "entitlements": "./build/static/entitlements.mac.inherit.plist", "target": [ "dmg", "zip" @@ -40,7 +43,7 @@ "zip" ] }, - "squirrelWindows":{ + "squirrelWindows": { "iconUrl": "__ICON_URL__" }, "linux": { diff --git a/packages/insomnia-app/app/static/entitlements.mac.inherit.plist b/packages/insomnia-app/app/static/entitlements.mac.inherit.plist new file mode 100644 index 0000000000..273c351b44 --- /dev/null +++ b/packages/insomnia-app/app/static/entitlements.mac.inherit.plist @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.allow-dyld-environment-variables + + + \ No newline at end of file diff --git a/packages/insomnia-app/package-lock.json b/packages/insomnia-app/package-lock.json index 7227d195ee..f6a7b7387e 100644 --- a/packages/insomnia-app/package-lock.json +++ b/packages/insomnia-app/package-lock.json @@ -1,13 +1,13 @@ { "name": "insomnia-app", - "version": "1.1.9", + "version": "1.1.10", "lockfileVersion": 1, "requires": true, "dependencies": { "7zip-bin": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-4.1.0.tgz", - "integrity": "sha512-AsnBZN3a8/JcNt+KPkGGODaA4c7l3W5+WpeKgGSbstSLxqWtTXqd1ieJGBQ8IFCtRg8DmmKUcSkIkUc0A4p3YA==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.0.3.tgz", + "integrity": "sha512-GLyWIFBbGvpKPGo55JyRZAo4lVbnBiD52cKlw/0Vt+wnmKvWJkpZvsjVoaIolyBXDeAQKSicRtqFNPem9w0WYA==", "dev": true }, "@babel/code-frame": { @@ -240,6 +240,16 @@ "to-fast-properties": "^2.0.0" } }, + "@develar/schema-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.1.0.tgz", + "integrity": "sha512-qjCqB4ctMig9Gz5bd6lkdFr3bO6arOdQqptdBSpF1ZpCnjofieCciEzkoS9ujY9cMGyllYSCSmBJ3x9OKHXzoA==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + }, "@hot-loader/react-dom": { "version": "16.8.6", "resolved": "https://registry.npmjs.org/@hot-loader/react-dom/-/react-dom-16.8.6.tgz", @@ -679,43 +689,51 @@ } }, "app-builder-bin": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-2.7.1.tgz", - "integrity": "sha512-ubIBeiL9XysjMW4HETBKxj3DC8ika6dGyC0vftPc0kZwGh1iXQ5bycsjoAqY/3t3BBEEIg0VruicvBaUl1pOSQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-3.4.3.tgz", + "integrity": "sha512-qMhayIwi3juerQEVJMQ76trObEbfQT0nhUdxZz9a26/3NLT3pE6awmQ8S1cEnrGugaaM5gYqR8OElcDezfmEsg==", "dev": true }, "app-builder-lib": { - "version": "20.44.4", - "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-20.44.4.tgz", - "integrity": "sha512-1K1xfrhyqDgnibwyuYMgvfwGilGLMF31YwOUJ8IXreyjRef9lUjWW+BZuBXqk4Uqd0C0EYPjhofgpuN0WoAQ+A==", + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-21.2.0.tgz", + "integrity": "sha512-aOX/nv77/Bti6NymJDg7p9T067xD8m1ipIEJR7B4Mm1GsJWpMm9PZdXtCRiMNRjHtQS5KIljT0g17781y6qn5A==", "dev": true, "requires": { - "7zip-bin": "~4.1.0", - "app-builder-bin": "2.7.1", + "7zip-bin": "~5.0.3", + "@develar/schema-utils": "~2.1.0", "async-exit-hook": "^2.0.1", "bluebird-lst": "^1.0.9", - "builder-util": "10.1.2", - "builder-util-runtime": "8.2.5", + "builder-util": "21.2.0", + "builder-util-runtime": "8.3.0", "chromium-pickle-js": "^0.2.0", "debug": "^4.1.1", "ejs": "^2.6.2", - "electron-osx-sign": "0.4.11", - "electron-publish": "20.44.4", - "fs-extra-p": "^8.0.2", + "electron-publish": "21.2.0", + "fs-extra": "^8.1.0", "hosted-git-info": "^2.7.1", "is-ci": "^2.0.0", - "isbinaryfile": "^4.0.1", + "isbinaryfile": "^4.0.2", "js-yaml": "^3.13.1", "lazy-val": "^1.0.4", "minimatch": "^3.0.4", "normalize-package-data": "^2.5.0", - "plist": "^3.0.1", - "read-config-file": "3.2.2", - "sanitize-filename": "^1.6.1", - "semver": "^6.1.1", - "temp-file": "^3.3.3" + "read-config-file": "5.0.0", + "sanitize-filename": "^1.6.2", + "semver": "^6.3.0", + "temp-file": "^3.3.4" }, "dependencies": { + "builder-util-runtime": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.3.0.tgz", + "integrity": "sha512-CSOdsYqf4RXIHh1HANPbrZHlZ9JQJXSuDDloblZPcWQVN62inyYoTQuSmY3KrgefME2Sv3Kn2MxHvbGQHRf8Iw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "sax": "^1.2.4" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -725,6 +743,17 @@ "ms": "^2.1.1" } }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -746,9 +775,9 @@ "dev": true }, "archiver": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.0.tgz", - "integrity": "sha512-FXYAX8Eso99q0c/Kaby/P4HxGdzwLzTxjTq7WL7dKk3FQkqAdZROmji67Xdn9C2SAXJBH5kqFQeL3UEXVDvWqw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz", + "integrity": "sha512-5Hxxcig7gw5Jod/8Gq0OneVgLYET+oNHcxgWItq4TbhOzRLKNAFUb9edAftiMKXvXfCB0vbGrJdZDNq0dWMsxg==", "dev": true, "requires": { "archiver-utils": "^2.1.0", @@ -757,7 +786,7 @@ "glob": "^7.1.4", "readable-stream": "^3.4.0", "tar-stream": "^2.1.0", - "zip-stream": "^2.1.1" + "zip-stream": "^2.1.2" }, "dependencies": { "readable-stream": { @@ -1463,24 +1492,24 @@ "dev": true }, "builder-util": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-10.1.2.tgz", - "integrity": "sha512-LQMh36Cg0r4ZfKqNlaUclndS/IXxZ3OdCgmXvw1vdP3QwYT2NkyE7LfMikAFIHpXOs6zsVH+iW+Fe/AX1jfFag==", + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-21.2.0.tgz", + "integrity": "sha512-Nd6CUb6YgDY8EXAXEIegx+1kzKqyFQ5ZM5BoYkeunAlwz/zDJoH1UCyULjoS5wQe5czNClFQy07zz2bzYD0Z4A==", "dev": true, "requires": { - "7zip-bin": "~4.1.0", + "7zip-bin": "~5.0.3", "@types/debug": "^4.1.4", - "app-builder-bin": "2.7.1", + "app-builder-bin": "3.4.3", "bluebird-lst": "^1.0.9", - "builder-util-runtime": "^8.2.5", + "builder-util-runtime": "8.3.0", "chalk": "^2.4.2", "debug": "^4.1.1", - "fs-extra-p": "^8.0.2", + "fs-extra": "^8.1.0", "is-ci": "^2.0.0", "js-yaml": "^3.13.1", - "source-map-support": "^0.5.12", + "source-map-support": "^0.5.13", "stat-mode": "^0.3.0", - "temp-file": "^3.3.3" + "temp-file": "^3.3.4" }, "dependencies": { "ansi-styles": { @@ -1492,6 +1521,16 @@ "color-convert": "^1.9.0" } }, + "builder-util-runtime": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.3.0.tgz", + "integrity": "sha512-CSOdsYqf4RXIHh1HANPbrZHlZ9JQJXSuDDloblZPcWQVN62inyYoTQuSmY3KrgefME2Sv3Kn2MxHvbGQHRf8Iw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "sax": "^1.2.4" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -1512,6 +1551,17 @@ "ms": "^2.1.1" } }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1530,21 +1580,21 @@ } }, "builder-util-runtime": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.2.5.tgz", - "integrity": "sha512-YILT+YUlxrE3yNB6mDC1tF+Q24mr1LSYdjP5U861jbBeDZfvy1/VPDzW3boMVrDtzYnDnvkYrzLJnoh6TXA75w==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-4.4.1.tgz", + "integrity": "sha512-8L2pbL6D3VdI1f8OMknlZJpw0c7KK15BRz3cY77AOUElc4XlCv2UhVV01jJM7+6Lx7henaQh80ALULp64eFYAQ==", "dev": true, "requires": { - "bluebird-lst": "^1.0.9", - "debug": "^4.1.1", - "fs-extra-p": "^8.0.2", + "bluebird-lst": "^1.0.5", + "debug": "^3.1.0", + "fs-extra-p": "^4.6.1", "sax": "^1.2.4" }, "dependencies": { "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { "ms": "^2.1.1" @@ -1885,6 +1935,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1916,13 +1972,13 @@ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "compress-commons": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-2.1.0.tgz", - "integrity": "sha512-H6DhMQxI7NpvOGAjjop90bIOsGIZ8O1ewdKuS6ZTlnFA4YMpIhyajc+8fyEz4Em0c3iLjkOVfPJ+wtvy3RksQA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-2.1.1.tgz", + "integrity": "sha512-eVw6n7CnEMFzc3duyFVrQEuY1BlHR3rYsSztyG32ibGMW722i3C6IizEGMFmfMU+A+fALvBIwxN3czffTcdA+Q==", "dev": true, "requires": { "buffer-crc32": "^0.2.13", - "crc32-stream": "^3.0.0", + "crc32-stream": "^3.0.1", "normalize-path": "^3.0.0", "readable-stream": "^2.3.6" } @@ -2622,19 +2678,40 @@ } }, "dmg-builder": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-6.7.2.tgz", - "integrity": "sha512-xfYOwhHjOSOIqkk8A0h8zcaio/WyzrAWpMTu9hzV3Z5PI4tOG0Pq6a9Lh/mHr1r3bydif8R21qGvKU1Re9CpUg==", + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-21.2.0.tgz", + "integrity": "sha512-9cJEclnGy7EyKFCoHDYDf54pub/t92CQapyiUxU0w9Bj2vUvfoDagP1PMiX4XD5rPp96141h9A+QN0OB4VgvQg==", "dev": true, "requires": { - "app-builder-lib": "~20.44.4", + "app-builder-lib": "~21.2.0", "bluebird-lst": "^1.0.9", - "builder-util": "~10.1.2", - "fs-extra-p": "^8.0.2", - "iconv-lite": "^0.4.24", + "builder-util": "~21.2.0", + "fs-extra": "^8.1.0", + "iconv-lite": "^0.5.0", "js-yaml": "^3.13.1", - "parse-color": "^1.0.0", - "sanitize-filename": "^1.6.1" + "sanitize-filename": "^1.6.2" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "iconv-lite": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.0.tgz", + "integrity": "sha512-NnEhI9hIEKHOzJ4f697DMz9IQEXr/MMJ5w64vN2/4Ai+wRnvV7SBrL0KLoRlwaKVghOc7LQ5YkPLuX146b6Ydw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } } }, "dnd-core": { @@ -2789,24 +2866,24 @@ } }, "electron-builder": { - "version": "20.44.4", - "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-20.44.4.tgz", - "integrity": "sha512-H8zzP01albkKh2Ec1zc0A7RGriUkHb5M99NJskaYtgKtGATTAGH+r9OIWVk5Hk9c1dLMVudbqEeaSlygMF2asw==", + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-21.2.0.tgz", + "integrity": "sha512-x8EXrqFbAb2L3N22YlGar3dGh8vwptbB3ovo3OF6K7NTpcsmM2zEoJv7GhFyX73rNzSG2HaWpXwGAtOp2JWiEw==", "dev": true, "requires": { - "app-builder-lib": "20.44.4", + "app-builder-lib": "21.2.0", "bluebird-lst": "^1.0.9", - "builder-util": "10.1.2", - "builder-util-runtime": "8.2.5", + "builder-util": "21.2.0", + "builder-util-runtime": "8.3.0", "chalk": "^2.4.2", - "dmg-builder": "6.7.2", - "fs-extra-p": "^8.0.2", + "dmg-builder": "21.2.0", + "fs-extra": "^8.1.0", "is-ci": "^2.0.0", "lazy-val": "^1.0.4", - "read-config-file": "3.2.2", - "sanitize-filename": "^1.6.1", - "update-notifier": "^3.0.0", - "yargs": "^13.2.4" + "read-config-file": "5.0.0", + "sanitize-filename": "^1.6.2", + "update-notifier": "^3.0.1", + "yargs": "^13.3.0" }, "dependencies": { "ansi-regex": { @@ -2824,6 +2901,16 @@ "color-convert": "^1.9.0" } }, + "builder-util-runtime": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.3.0.tgz", + "integrity": "sha512-CSOdsYqf4RXIHh1HANPbrZHlZ9JQJXSuDDloblZPcWQVN62inyYoTQuSmY3KrgefME2Sv3Kn2MxHvbGQHRf8Iw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "sax": "^1.2.4" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -2846,6 +2933,15 @@ "wrap-ansi": "^5.1.0" } }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -2855,12 +2951,29 @@ "locate-path": "^3.0.0" } }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -2982,12 +3095,6 @@ "integrity": "sha512-04sgoFSz6q5pbAxAXcxfUFPl16gJsay5b8dudFXUwQbFfS7ox2uGgbOO5LGHF0t7sM7q/N82ztGePuuCSkKZHQ==", "dev": true }, - "base64-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", - "integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", - "dev": true - }, "builder-util": { "version": "5.17.0", "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-5.17.0.tgz", @@ -3010,18 +3117,6 @@ "temp-file": "^3.1.3" } }, - "builder-util-runtime": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-4.4.1.tgz", - "integrity": "sha512-8L2pbL6D3VdI1f8OMknlZJpw0c7KK15BRz3cY77AOUElc4XlCv2UhVV01jJM7+6Lx7henaQh80ALULp64eFYAQ==", - "dev": true, - "requires": { - "bluebird-lst": "^1.0.5", - "debug": "^3.1.0", - "fs-extra-p": "^4.6.1", - "sax": "^1.2.4" - } - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3048,48 +3143,6 @@ "ms": "^2.1.1" } }, - "electron-osx-sign": { - "version": "0.4.10", - "resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz", - "integrity": "sha1-vk87ibKnWh3F8eckkIGrKSnKOiY=", - "dev": true, - "requires": { - "bluebird": "^3.5.0", - "compare-version": "^0.1.2", - "debug": "^2.6.8", - "isbinaryfile": "^3.0.2", - "minimist": "^1.2.0", - "plist": "^2.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "plist": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/plist/-/plist-2.1.0.tgz", - "integrity": "sha1-V8zbeggh3yGDEhejytVOPhRqECU=", - "dev": true, - "requires": { - "base64-js": "1.2.0", - "xmlbuilder": "8.2.2", - "xmldom": "0.1.x" - } - } - } - }, "electron-publish": { "version": "20.23.1", "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-20.23.1.tgz", @@ -3105,27 +3158,6 @@ "mime": "^2.3.1" } }, - "fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs-extra-p": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-4.6.1.tgz", - "integrity": "sha512-IsTMbUS0svZKZTvqF4vDS9c/L7Mw9n8nZQWWeSzAGacOSe+8CzowhUN0tdZEZFIJNP5HC7L9j3MMikz/G4hDeQ==", - "dev": true, - "requires": { - "bluebird-lst": "^1.0.5", - "fs-extra": "^6.0.1" - } - }, "is-ci": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", @@ -3144,12 +3176,6 @@ "buffer-alloc": "^1.2.0" } }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -3187,27 +3213,21 @@ "requires": { "has-flag": "^3.0.0" } - }, - "xmlbuilder": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", - "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=", - "dev": true } } }, "electron-builder-squirrel-windows": { - "version": "20.44.0", - "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-20.44.0.tgz", - "integrity": "sha512-tnnWBB2YFpQ3eaLSEZ7LXdueqE5STIiLGdReG0K2DnV7UacfQ9jSv3Bgc8s6K8ozXI6Z56n4mCn42d0ptKN/uQ==", + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-21.2.0.tgz", + "integrity": "sha512-y3ynky29vm/CmcHI6rLKU4S5pzeag/PHgl/9+rP35lZzgCIC7sMX5ugEtzpnhoJUVqojvo5cUD4erMw8JenILw==", "dev": true, "requires": { "7zip-bin": "~4.0.2", - "archiver": "^3.0.0", + "archiver": "^3.0.3", "bluebird-lst": "^1.0.9", - "builder-util": "~10.0.3", - "fs-extra-p": "^8.0.2", - "sanitize-filename": "^1.6.1" + "builder-util": "~21.2.0", + "fs-extra": "^8.1.0", + "sanitize-filename": "^1.6.2" }, "dependencies": { "7zip-bin": { @@ -3217,83 +3237,15 @@ "dev": true, "optional": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "requires": { - "color-convert": "^1.9.0" - } - }, - "app-builder-bin": { - "version": "2.6.13", - "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-2.6.13.tgz", - "integrity": "sha512-P8s4wUuSPp4Vuob/RCmCpsAEAdf28HuP2brGjZ3VLxaAZrBnByuDq2c7Ud7xgEPehOMwEV+EXcEg7wnM7a2H9Q==", - "dev": true - }, - "builder-util": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-10.0.4.tgz", - "integrity": "sha512-KEqMNPb6v4sKoHlrIR8KiJQwd9/fqXxpAKwLNz+g7dKYfS2r8B4SVJWRGutevPeOK7nfRrOAukUwPjByBswrtw==", - "dev": true, - "requires": { - "7zip-bin": "~4.1.0", - "@types/debug": "^4.1.4", - "app-builder-bin": "2.6.13", - "bluebird-lst": "^1.0.9", - "builder-util-runtime": "^8.2.5", - "chalk": "^2.4.2", - "debug": "^4.1.1", - "fs-extra-p": "^8.0.2", - "is-ci": "^2.0.0", - "js-yaml": "^3.13.1", - "source-map-support": "^0.5.12", - "stat-mode": "^0.3.0", - "temp-file": "^3.3.3" - }, - "dependencies": { - "7zip-bin": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-4.1.0.tgz", - "integrity": "sha512-AsnBZN3a8/JcNt+KPkGGODaA4c7l3W5+WpeKgGSbstSLxqWtTXqd1ieJGBQ8IFCtRg8DmmKUcSkIkUc0A4p3YA==", - "dev": true - } - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" } } } @@ -3373,10 +3325,48 @@ "resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-1.1.0.tgz", "integrity": "sha512-Z1qA/1oHNowGtSBIcWk0pcLEqYT/j+13xUw/MYOrBUOL4X7VN0i0KCTf5SqyvMPmW5pSPKbo28wkxMxzZ20YnQ==" }, + "electron-notarize": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-0.1.1.tgz", + "integrity": "sha512-TpKfJcz4LXl5jiGvZTs5fbEx+wUFXV5u8voeG5WCHWfY/cdgdD8lDZIZRqLVOtR3VO+drgJ9aiSHIO9TYn/fKg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "fs-extra": "^8.0.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "electron-osx-sign": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.11.tgz", - "integrity": "sha512-VVd40nrnVqymvFrY9ZkOYgHJOvexHHYTR3di/SN+mjJ0OWhR1I8BRVj3U+Yamw6hnkZZNKZp52rqL5EFAAPFkQ==", + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz", + "integrity": "sha1-vk87ibKnWh3F8eckkIGrKSnKOiY=", "dev": true, "requires": { "bluebird": "^3.5.0", @@ -3384,9 +3374,15 @@ "debug": "^2.6.8", "isbinaryfile": "^3.0.2", "minimist": "^1.2.0", - "plist": "^3.0.1" + "plist": "^2.1.0" }, "dependencies": { + "base64-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", + "dev": true + }, "isbinaryfile": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", @@ -3401,20 +3397,31 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true + }, + "plist": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/plist/-/plist-2.1.0.tgz", + "integrity": "sha1-V8zbeggh3yGDEhejytVOPhRqECU=", + "dev": true, + "requires": { + "base64-js": "1.2.0", + "xmlbuilder": "8.2.2", + "xmldom": "0.1.x" + } } } }, "electron-publish": { - "version": "20.44.4", - "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-20.44.4.tgz", - "integrity": "sha512-50NzsKOnNqOpGJzPl04vMyitdguUvp15FWKWtu4KISsHfgdLMWGgxHGZwfMphc/vf364zXvPHsYQza3MASgaEQ==", + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-21.2.0.tgz", + "integrity": "sha512-mWavuoWJe87iaeKd0I24dNWIaR+0yRzshjNVqGyK019H766fsPWl3caQJnVKFaEyrZRP397v4JZVG0e7s16AxA==", "dev": true, "requires": { "bluebird-lst": "^1.0.9", - "builder-util": "~10.1.2", - "builder-util-runtime": "^8.2.5", + "builder-util": "~21.2.0", + "builder-util-runtime": "8.3.0", "chalk": "^2.4.2", - "fs-extra-p": "^8.0.2", + "fs-extra": "^8.1.0", "lazy-val": "^1.0.4", "mime": "^2.4.4" }, @@ -3428,6 +3435,16 @@ "color-convert": "^1.9.0" } }, + "builder-util-runtime": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.3.0.tgz", + "integrity": "sha512-CSOdsYqf4RXIHh1HANPbrZHlZ9JQJXSuDDloblZPcWQVN62inyYoTQuSmY3KrgefME2Sv3Kn2MxHvbGQHRf8Iw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "sax": "^1.2.4" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3439,6 +3456,32 @@ "supports-color": "^5.3.0" } }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -3451,20 +3494,20 @@ } }, "electron-rebuild": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/electron-rebuild/-/electron-rebuild-1.8.5.tgz", - "integrity": "sha512-gDwRA3utfiPnFwBZ1z8M4SEMwsdsy6Bg4VGO2ohelMOIO0vxiCrDQ/FVdLk3h2g7fLb06QFUsQU+86jiTSmZxw==", + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/electron-rebuild/-/electron-rebuild-1.8.6.tgz", + "integrity": "sha512-4BAPcNG0XP6stByqvFXggrjmf/C47P2L6HFFrWdR2ako1VLiTDIeZAOmU4WEBuWdaXYNqstleszVmcNHdRDojA==", "dev": true, "requires": { "colors": "^1.3.3", "debug": "^4.1.1", "detect-libc": "^1.0.3", "fs-extra": "^7.0.1", - "node-abi": "^2.8.0", - "node-gyp": "^4.0.0", + "node-abi": "^2.9.0", + "node-gyp": "^5.0.1", "ora": "^3.4.0", "spawn-rx": "^3.0.0", - "yargs": "^13.2.2" + "yargs": "^13.2.4" }, "dependencies": { "ansi-regex": { @@ -3493,12 +3536,6 @@ "wrap-ansi": "^5.1.0" } }, - "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", - "dev": true - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -4385,22 +4422,22 @@ } }, "fs-extra-p": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-8.1.0.tgz", - "integrity": "sha512-sCLpU5kk5CvrWZvFM9dUlqPgHrE02AEt6XYzF7kDscr5COc7DHfhNfODTXt0bkVNmt5DkvU2uJSYjorxY3bRKA==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-4.6.1.tgz", + "integrity": "sha512-IsTMbUS0svZKZTvqF4vDS9c/L7Mw9n8nZQWWeSzAGacOSe+8CzowhUN0tdZEZFIJNP5HC7L9j3MMikz/G4hDeQ==", "dev": true, "requires": { - "bluebird-lst": "^1.0.9", - "fs-extra": "^8.1.0" + "bluebird-lst": "^1.0.5", + "fs-extra": "^6.0.1" }, "dependencies": { "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", "dev": true, "requires": { - "graceful-fs": "^4.2.0", + "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } @@ -4408,12 +4445,12 @@ } }, "fs-minipass": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz", - "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "dev": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs-readfile-promise": { @@ -6857,9 +6894,9 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "dev": true, "requires": { "safe-buffer": "^5.1.2", @@ -6867,20 +6904,20 @@ }, "dependencies": { "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true } } }, "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", "dev": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" } }, "mississippi": { @@ -7080,9 +7117,9 @@ "dev": true }, "node-abi": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.10.0.tgz", - "integrity": "sha512-OT0WepUvYHXdki6DU8LWhEkuo3M44i2paWBYtH9qXtPb9YiKlYEKa5WUII20XEcOv7UJPzfB0kZfPZdW46zdkw==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.11.0.tgz", + "integrity": "sha512-kuy/aEg75u40v378WRllQ4ZexaXJiCvB68D2scDXclp/I4cRq6togpbOoKhmN07tns9Zldu51NNERo0wehfX9g==", "dev": true, "requires": { "semver": "^5.4.1" @@ -7120,21 +7157,21 @@ "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" }, "node-gyp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-4.0.0.tgz", - "integrity": "sha512-2XiryJ8sICNo6ej8d0idXDEMKfVfFK7kekGCtJAuelGsYHQxhj13KTf95swTCN2dZ/4lTfZ84Fu31jqJEEgjWA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.0.5.tgz", + "integrity": "sha512-WABl9s4/mqQdZneZHVWVG4TVr6QQJZUC6PAx47ITSk9lreZ1n+7Z9mMAIbA3vnO4J9W20P7LhCxtzfWsAD/KDw==", "dev": true, "requires": { + "env-paths": "^1.0.0", "glob": "^7.0.3", "graceful-fs": "^4.1.2", "mkdirp": "^0.5.0", "nopt": "2 || 3", "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", "request": "^2.87.0", "rimraf": "2", "semver": "~5.3.0", - "tar": "^4.4.8", + "tar": "^4.4.12", "which": "1" }, "dependencies": { @@ -7259,9 +7296,9 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, "normalize-url": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.3.0.tgz", - "integrity": "sha512-0NLtR71o4k6GLP+mr6Ty34c5GA6CMoEsncKJxvQd8NzPxaHRJNnb5gZE8R1XF4CPIS7QPHLJ74IFszwtNVAHVQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", "dev": true }, "npm-run-path": { @@ -7553,12 +7590,6 @@ "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, "os-locale": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", @@ -7567,22 +7598,6 @@ "lcid": "^1.0.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -7702,23 +7717,6 @@ "safe-buffer": "^5.1.1" } }, - "parse-color": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-color/-/parse-color-1.0.0.tgz", - "integrity": "sha1-e3SLlag/A/FqlPU15S1/PZRlhhk=", - "dev": true, - "requires": { - "color-convert": "~0.5.0" - }, - "dependencies": { - "color-convert": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", - "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=", - "dev": true - } - } - }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -7931,6 +7929,14 @@ "base64-js": "^1.2.3", "xmlbuilder": "^9.0.7", "xmldom": "0.1.x" + }, + "dependencies": { + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", + "dev": true + } } }, "portfinder": { @@ -8465,47 +8471,46 @@ } }, "read-config-file": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-3.2.2.tgz", - "integrity": "sha512-PuFpMgZF01VB0ydH1dfitAxCP/fh+qnfbA9cYNIPoxPbz0SMngsrafCtaHDWfER7MwlDz4fmrNBhPkakxxFpTg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-5.0.0.tgz", + "integrity": "sha512-jIKUu+C84bfnKxyJ5j30CxCqgXWYjZLXuVE/NYlMEpeni+dhESgAeZOZd0JZbg1xTkMmnCdxksDoarkOyfEsOg==", "dev": true, "requires": { - "ajv": "^6.9.2", - "ajv-keywords": "^3.4.0", - "bluebird-lst": "^1.0.7", - "dotenv": "^6.2.0", - "dotenv-expand": "^4.2.0", - "fs-extra-p": "^7.0.1", - "js-yaml": "^3.12.1", + "dotenv": "^8.0.0", + "dotenv-expand": "^5.1.0", + "fs-extra": "^8.1.0", + "js-yaml": "^3.13.1", "json5": "^2.1.0", "lazy-val": "^1.0.4" }, "dependencies": { + "dotenv": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz", + "integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA==", + "dev": true + }, + "dotenv-expand": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", + "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", + "dev": true + }, "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, - "fs-extra-p": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-7.0.1.tgz", - "integrity": "sha512-yhd2OV0HnHt2oitlp+X9hl2ReX4X/7kQeL7/72qzPHTZj5eUPGzAKOvEglU02Fa1OeG2rSy/aKB4WGVaLiF8tw==", - "dev": true, - "requires": { - "bluebird-lst": "^1.0.7", - "fs-extra": "^7.0.1" - } - }, "json5": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", + "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", "dev": true, "requires": { "minimist": "^1.2.0" @@ -8936,9 +8941,9 @@ "dev": true }, "rxjs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", - "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", + "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -9832,14 +9837,14 @@ "dev": true }, "tar": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", - "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", "dev": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.5", + "minipass": "^2.8.6", "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", @@ -9847,9 +9852,9 @@ }, "dependencies": { "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true } } @@ -11813,9 +11818,9 @@ "dev": true }, "xmlbuilder": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=", "dev": true }, "xmlcreate": { @@ -11906,13 +11911,13 @@ } }, "zip-stream": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.1.tgz", - "integrity": "sha512-v54puzKSjCN5COeMZizwIfGh9vJ6V1GR8BiRgr5Y9zZ9VngzRt8EmZHsbzCb5ktZT1JqHlt9xuN2HRv634SRPw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz", + "integrity": "sha512-ykebHGa2+uzth/R4HZLkZh3XFJzivhVsjJt8bN3GvBzLaqqrUdRacu+c4QtnUgjkkQfsOuNE1JgLKMCPNmkKgg==", "dev": true, "requires": { "archiver-utils": "^2.1.0", - "compress-commons": "^2.1.0", + "compress-commons": "^2.1.1", "readable-stream": "^3.4.0" }, "dependencies": { diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index 336bfabc7f..b7a56acd9d 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -190,10 +190,11 @@ "cross-env": "^2.0.0", "css-loader": "^2.1.1", "electron": "^3.0.4", - "electron-builder": "^20.20.4", - "electron-builder-lib": "^20.20.4", - "electron-builder-squirrel-windows": "^20.20.4", - "electron-rebuild": "^1.8.4", + "electron-builder": "^21.2.0", + "electron-builder-lib": "^20.23.1", + "electron-builder-squirrel-windows": "^21.2.0", + "electron-notarize": "^0.1.1", + "electron-rebuild": "^1.8.6", "file-loader": "^3.0.1", "less": "^3.8.1", "less-loader": "^4.1.0", diff --git a/packages/insomnia-app/scripts/afterSignHook.js b/packages/insomnia-app/scripts/afterSignHook.js new file mode 100644 index 0000000000..488d12affe --- /dev/null +++ b/packages/insomnia-app/scripts/afterSignHook.js @@ -0,0 +1,35 @@ +const fs = require('fs'); +const path = require('path'); +const electronNotarize = require('electron-notarize'); +const packageJson = require('../package.json'); + +// See: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db +module.exports = async function(params) { + // Only notarize the app on Mac OS only. + if (process.platform !== 'darwin') { + return; + } + + // Same appId in electron-builder. + const { appId } = packageJson.app; + + const appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`); + if (!fs.existsSync(appPath)) { + throw new Error(`Cannot find application at: ${appPath}`); + } + + const args = { + appBundleId: appId, + appPath: appPath, + appleId: process.env.APPLE_ID, + appleIdPassword: process.env.APPLE_ID_PASSWORD, + }; + + console.log(`[afterSign] Notarizing ${appId} found at ${appPath}`); + + try { + await electronNotarize.notarize(args); + } catch (err) { + console.error(err); + } +}; From 46373fda2ee1ba9d2b9cdad8f8fb2e60202c0dad Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 8 Oct 2019 16:46:17 -0700 Subject: [PATCH 040/100] Try fix CI --- .github/workflows/main.yml | 2 +- packages/insomnia-app/app/static/entitlements.mac.inherit.plist | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd420350bb..af51478fb1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: with: version: 10 - name: Configure Visual Studio version - run: npm config set msvs_version 2017 + run: npm config set msvs_version 2015 - name: Bootstrap packages run: npm run bootstrap - name: Run tests diff --git a/packages/insomnia-app/app/static/entitlements.mac.inherit.plist b/packages/insomnia-app/app/static/entitlements.mac.inherit.plist index 273c351b44..ad77a2a1ea 100644 --- a/packages/insomnia-app/app/static/entitlements.mac.inherit.plist +++ b/packages/insomnia-app/app/static/entitlements.mac.inherit.plist @@ -8,5 +8,7 @@ com.apple.security.cs.allow-dyld-environment-variables + com.apple.security.cs.disable-library-validation + \ No newline at end of file From cad520a1dbfdcaf43f2f8af03f74160b50c69560 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 8 Oct 2019 16:47:53 -0700 Subject: [PATCH 041/100] Fix deprecated version param in GH Action --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af51478fb1..29752001d8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: - name: Install NodeJS uses: actions/setup-node@v1 with: - version: 10 + node-version: 10 - name: Configure Visual Studio version run: npm config set msvs_version 2015 - name: Bootstrap packages @@ -28,7 +28,7 @@ jobs: - name: Install NodeJS uses: actions/setup-node@v1 with: - version: 10 + node-version: 10 - name: Bootstrap packages run: npm run bootstrap - name: Run tests @@ -42,7 +42,7 @@ jobs: - name: Install NodeJS uses: actions/setup-node@v1 with: - version: 10 + node-version: 10 - name: Install OS packages run: | sudo apt-get update From eb19b2b1bc0e691ba4d9686845927fec98f4c3f8 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 9 Oct 2019 10:21:42 -0700 Subject: [PATCH 042/100] Try msvs 2017 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 29752001d8..a7a07aefd1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: with: node-version: 10 - name: Configure Visual Studio version - run: npm config set msvs_version 2015 + run: npm config set msvs_version 2017 - name: Bootstrap packages run: npm run bootstrap - name: Run tests From 78880309716ce2abe41cd1bc9d4f64366016ec7b Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 9 Oct 2019 10:36:58 -0700 Subject: [PATCH 043/100] Try setting GYP_MSVS_VERSION=2017 --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a7a07aefd1..57bd3347f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,8 @@ jobs: run: npm config set msvs_version 2017 - name: Bootstrap packages run: npm run bootstrap + env: + GYP_MSVS_VERSION: 2017 - name: Run tests run: npm test Mac: From dd7d23fc65cec1dc0f30dab1b416ff64051d832a Mon Sep 17 00:00:00 2001 From: Emerson Lopes Date: Wed, 9 Oct 2019 15:55:21 -0300 Subject: [PATCH 044/100] fix typos (#1714) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 233cc2aa52..f96309d9e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,7 +53,7 @@ commits. **Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), -otherwise you risk spending a lot of time working on something that might +otherwise, you risk spending a lot of time working on something that might not get accepted into the project. **IMPORTANT**: By submitting a patch, you agree to allow the project owner to From 153b10c2094e7eaf710ccc69b9930fc039e2583e Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 9 Oct 2019 13:31:42 -0700 Subject: [PATCH 045/100] Better Github Actions builds (#1718) * Try some things * Try docker * Specify bash in Dockerfile * Fix? * Fix dockerfile version * Fix bootstrap.sh path * Use GITHUB_WORKSPACE in docker script * Fix permissions again * Fix missing bootstrap.sh * Try again * Fix entrypoint.sh permissions * Remove Linux2 --- .github/actions/build/Dockerfile | 18 + .github/actions/build/entrypoint.sh | 18 + .github/actions/build/install-dependencies.sh | 70 ++++ .github/workflows/main.yml | 42 ++- package.json | 1 + packages/insomnia-app/package-lock.json | 342 ++++++++++++++++++ packages/insomnia-app/package.json | 3 + packages/insomnia-app/scripts/release.js | 93 +++++ 8 files changed, 571 insertions(+), 16 deletions(-) create mode 100644 .github/actions/build/Dockerfile create mode 100644 .github/actions/build/entrypoint.sh create mode 100644 .github/actions/build/install-dependencies.sh create mode 100644 packages/insomnia-app/scripts/release.js diff --git a/.github/actions/build/Dockerfile b/.github/actions/build/Dockerfile new file mode 100644 index 0000000000..ef9abff354 --- /dev/null +++ b/.github/actions/build/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:14.04 + +LABEL "name"="Insomnia-Linux" +LABEL "maintainer"="Gregory Schier " +LABEL "version"="1.0.0" + +LABEL "com.github.actions.icon"="package" +LABEL "com.github.actions.color"="blue" +LABEL "com.github.actions.name"="Insomnia Linux" +LABEL "com.github.actions.description"="Do the stuff" + +COPY entrypoint.sh /scripts/entrypoint.sh +COPY install-dependencies.sh /scripts/install-dependencies.sh + +RUN chmod +x /scripts/* +RUN /scripts/install-dependencies.sh + +ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/build/entrypoint.sh b/.github/actions/build/entrypoint.sh new file mode 100644 index 0000000000..bf2b8f4304 --- /dev/null +++ b/.github/actions/build/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Fail on any errors +set -e + +if [[ -z "$GITHUB_WORKSPACE" ]]; then + echo "Set the GITHUB_WORKSPACE env variable." + exit 1 +fi + +# Install root project dependencies +cd "$GITHUB_WORKSPACE" +npm run bootstrap +npm install --no-save 7zip-bin-linux app-builder-bin-linux + +echo "Running the stuff" +npm test +npm run app-release \ No newline at end of file diff --git a/.github/actions/build/install-dependencies.sh b/.github/actions/build/install-dependencies.sh new file mode 100644 index 0000000000..f6c83fac85 --- /dev/null +++ b/.github/actions/build/install-dependencies.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +# Fail on any errors +set -e + +# Install core deps +apt-get update +apt-get upgrade -y +apt-get install -y \ + build-essential \ + autoconf \ + libtool \ + pkg-config \ + libfontconfig1-dev \ + rpm \ + wget + +# Install Node and app-related dependencies +wget -O- https://deb.nodesource.com/setup_10.x | bash - +apt-get install -y nodejs graphicsmagick icnsutils + +# Build zlib from source (for Curl) +wget -q https://github.com/madler/zlib/archive/v1.2.11.tar.gz -O ./zlib.tar.gz +mkdir -p /src/zlib /build/zlib +tar -xf zlib.tar.gz -C /src/zlib --strip 1 +cd /src/zlib +./configure --prefix=/build/zlib +make +make install +ldconfig + +# Build OpenSSL from source (for Curl) +wget -q https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz -O ./openssl.tar.gz +mkdir -p /src/openssl /build/openssl +tar -xf openssl.tar.gz -C /src/openssl --strip 1 +cd /src/openssl +./config no-shared --static --prefix=/build/openssl --openssldir=/build/openssl +make +make install +ldconfig + +# Build nghttp2 from source (for Curl) +wget -q https://github.com/nghttp2/nghttp2/releases/download/v1.31.1/nghttp2-1.31.1.tar.gz -O ./nghttp2.tar.gz +mkdir -p /src/nghttp2 /build/nghttp2 +tar -xf nghttp2.tar.gz -C /src/nghttp2 --strip 1 +cd /src/nghttp2 +CFLAGS="-fPIC" ./configure --enable-lib-only --disable-shared --prefix=/build/nghttp2 +make +make install +ldconfig + +# Build Curl from source +wget -q https://github.com/curl/curl/releases/download/curl-7_61_1/curl-7.61.1.tar.gz -O ./curl.tar.gz +mkdir -p /src/curl +tar -xf curl.tar.gz -C /src/curl --strip 1 +cd /src/curl +./buildconf +LIBS="-ldl" CPPFLAGS="-I/build/openssl/include" LDFLAGS="-L/build/openssl/lib" \ + ./configure \ + --disable-shared \ + --enable-static \ + --with-ssl=/build/openssl \ + --with-nghttp2=/build/nghttp2 \ + --with-zlib=/build/zlib \ + --enable-ipv6 \ + --enable-unix-sockets +make +make install +ldconfig +curl --version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57bd3347f4..04c9f2e49d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,14 +13,26 @@ jobs: uses: actions/setup-node@v1 with: node-version: 10 - - name: Configure Visual Studio version - run: npm config set msvs_version 2017 + - name: Install node tools + run: npm install --global --production windows-build-tools@4.0.0 + - name: Install node-gyp + run: npm install --global node-gyp@latest + - name: Set node config to use python2.7 + run: npm config set python python2.7 + - name: Set node config to set msvs_version to 2015 + run: npm config set msvs_version 2015 + - name: Work around for Windows Server 2019 + run: set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin - name: Bootstrap packages run: npm run bootstrap - env: - GYP_MSVS_VERSION: 2017 - name: Run tests run: npm test + - name: Release app + if: startsWith(github.event.ref, 'refs/tags/v') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REF: ${{ github.event.ref }} + run: npm run app-release Mac: name: Mac runs-on: macOS-latest @@ -35,21 +47,19 @@ jobs: run: npm run bootstrap - name: Run tests run: npm test + - name: Release app + run: npm run app-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REF: ${{ github.event.ref }} Linux: name: Ubuntu runs-on: ubuntu-16.04 steps: - name: Checkout branch uses: actions/checkout@v1 - - name: Install NodeJS - uses: actions/setup-node@v1 - with: - node-version: 10 - - name: Install OS packages - run: | - sudo apt-get update - sudo apt-get install -y libcurl4-openssl-dev - - name: Bootstrap packages - run: npm run bootstrap - - name: Run tests - run: npm test + - name: Run Docker + uses: ./.github/actions/build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REF: ${{ github.event.ref }} diff --git a/package.json b/package.json index f10e2ff2db..b0724d30c2 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "app-start": "lerna run start --stream --parallel --bail", "app-build": "lerna run build --stream --parallel --bail", "app-package": "lerna run package --stream --parallel --bail", + "app-release": "lerna run release --stream --parallel --bail", "format-code": "prettier --write \"**/*.js\"" }, "husky": { diff --git a/packages/insomnia-app/package-lock.json b/packages/insomnia-app/package-lock.json index f6a7b7387e..e4041c6918 100644 --- a/packages/insomnia-app/package-lock.json +++ b/packages/insomnia-app/package-lock.json @@ -261,6 +261,127 @@ "scheduler": "^0.13.6" } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, + "@octokit/endpoint": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.4.0.tgz", + "integrity": "sha512-DWTNgEKg5KXzvNjKTzcFTnkZiL7te6pQxxumvxPjyjDpcY5V3xzywnNu1WVqySY3Ct1flF/kAoyDdZos6acq3Q==", + "dev": true, + "requires": { + "is-plain-object": "^3.0.0", + "universal-user-agent": "^4.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "dev": true, + "requires": { + "isobject": "^4.0.0" + } + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "dev": true + } + } + }, + "@octokit/request": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.1.0.tgz", + "integrity": "sha512-I15T9PwjFs4tbWyhtFU2Kq7WDPidYMvRB7spmxoQRZfxSmiqullG+Nz+KbSmpkfnlvHwTr1e31R5WReFRKMXjg==", + "dev": true, + "requires": { + "@octokit/endpoint": "^5.1.0", + "@octokit/request-error": "^1.0.1", + "deprecation": "^2.0.0", + "is-plain-object": "^3.0.0", + "node-fetch": "^2.3.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "dev": true, + "requires": { + "isobject": "^4.0.0" + } + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "dev": true + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "dev": true + } + } + }, + "@octokit/request-error": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.0.4.tgz", + "integrity": "sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig==", + "dev": true, + "requires": { + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/rest": { + "version": "16.33.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.33.0.tgz", + "integrity": "sha512-t4jMR+odsfooQwmHiREoTQixVTX2DfdbSaO+lKrW9R5XBuk0DW+5T/JdfwtxAGUAHgvDDpWY/NVVDfEPTzxD6g==", + "dev": true, + "requires": { + "@octokit/request": "^5.0.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + } + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -978,6 +1099,12 @@ "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, + "atob-lite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", + "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", + "dev": true + }, "autobind-decorator": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/autobind-decorator/-/autobind-decorator-2.4.0.tgz", @@ -1093,6 +1220,12 @@ "tweetnacl": "^0.14.3" } }, + "before-after-hook": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", + "dev": true + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -1431,6 +1564,12 @@ "pako": "~1.0.5" } }, + "btoa-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", + "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", + "dev": true + }, "buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", @@ -2632,6 +2771,12 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, "des.js": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", @@ -4154,6 +4299,73 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, + "fast-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.0.tgz", + "integrity": "sha512-TrUz3THiq2Vy3bjfQUB2wNyPdGBeGmdjbzzBLhfHN4YFurYptCKwGq/TfiRavbGywFRzY6U2CdmQ1zmsY5yYaw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -4164,6 +4376,15 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, + "fastq": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", + "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "dev": true, + "requires": { + "reusify": "^1.0.0" + } + }, "faye-websocket": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", @@ -6506,6 +6727,12 @@ "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", "dev": true }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", @@ -6541,12 +6768,24 @@ "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", "dev": true }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", + "dev": true + }, "lodash.union": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=", "dev": true }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -6633,6 +6872,12 @@ "yallist": "^2.1.2" } }, + "macos-release": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", + "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", + "dev": true + }, "make-dir": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", @@ -6792,6 +7037,12 @@ "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", "dev": true }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -7443,6 +7694,12 @@ "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", "dev": true }, + "octokit-pagination-methods": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", + "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", + "dev": true + }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -7598,6 +7855,16 @@ "lcid": "^1.0.0" } }, + "os-name": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", + "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", + "dev": true, + "requires": { + "macos-release": "^2.2.0", + "windows-release": "^3.1.0" + } + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -7874,6 +8141,12 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "dev": true + }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", @@ -8897,6 +9170,12 @@ "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -8925,6 +9204,12 @@ "inherits": "^2.0.1" } }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -10340,6 +10625,15 @@ "crypto-random-string": "^1.0.0" } }, + "universal-user-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.0.tgz", + "integrity": "sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA==", + "dev": true, + "requires": { + "os-name": "^3.1.0" + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -11761,6 +12055,54 @@ "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" }, + "windows-release": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", + "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", + "dev": true, + "requires": { + "execa": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + } + } + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index b7a56acd9d..f0e6d7e12c 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -46,6 +46,7 @@ "start": "concurrently --kill-others \"npm run start:dev-server\" \"npm run start:electron\"", "build": "node ./scripts/build.js", "package": "node ./scripts/package.js", + "release": "node ./scripts/release.js", "bootstrap": "rimraf node_modules/fsevents && rimraf node_modules/graphql-language-service-interface/dist/*.flow && electron-rebuild -f -w insomnia-libcurl" }, "dev": { @@ -186,6 +187,7 @@ }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.4.0", + "@octokit/rest": "^16.33.0", "concurrently": "^3.5.0", "cross-env": "^2.0.0", "css-loader": "^2.1.1", @@ -195,6 +197,7 @@ "electron-builder-squirrel-windows": "^21.2.0", "electron-notarize": "^0.1.1", "electron-rebuild": "^1.8.6", + "fast-glob": "^3.1.0", "file-loader": "^3.0.1", "less": "^3.8.1", "less-loader": "^4.1.0", diff --git a/packages/insomnia-app/scripts/release.js b/packages/insomnia-app/scripts/release.js new file mode 100644 index 0000000000..2ca7acffea --- /dev/null +++ b/packages/insomnia-app/scripts/release.js @@ -0,0 +1,93 @@ +const packageJson = require('../package.json'); +const glob = require('fast-glob'); +const fs = require('fs'); +const path = require('path'); +const packageTask = require('./package'); +const buildTask = require('./build'); +const Octokit = require('@octokit/rest'); + +// Configure Octokit +const octokit = new Octokit({ + auth: process.env.GITHUB_TOKEN, +}); + +// Start package if ran from CLI +if (require.main === module) { + if (!process.env.GITHUB_REF.match(/v\d{1,3}\.\d{1,3}\.\d{1,3}$/)) { + console.log(`[release] Not running release for ref ${process.env.GITHUB_REF}`); + process.exit(0); + } + + process.nextTick(async () => { + try { + await buildTask.start(); + await packageTask.start(); + await start(); + } catch (err) { + console.log('[package] ERROR:', err); + process.exit(1); + } + }); +} + +async function start() { + const tagName = `v${packageJson.app.version}`; + console.log(`[release] Creating release ${tagName}`); + + const globs = { + darwin: ['dist/**/*.zip', 'dist/**/*.dmg'], + win32: ['dist/squirrel-windows/*'], + linux: [ + 'dist/**/*.snap', + 'dist/**/*.rpm', + 'dist/**/*.deb', + 'dist/**/*.AppImage', + 'dist/**/*.tar.gz', + ], + }; + + const paths = await glob(globs[process.platform]); + + const { data } = await getOrCreateRelease(tagName); + + for (const p of paths) { + const name = path.basename(p); + console.log(`[release] Uploading ${p}`); + await octokit.request({ + method: 'POST', + url: 'https://uploads.github.com/repos/:owner/:repo/releases/:id/assets{?name,label}"', + id: data.id, + name: name, + owner: 'kong', + repo: 'studio', + headers: { + 'Content-Type': 'application/octet-stream', + }, + data: fs.readFileSync(p), + }); + } + + console.log(`[release] Release created ${data.url}`); +} + +async function getOrCreateRelease(tagName) { + try { + return await octokit.repos.getReleaseByTag({ + owner: 'kong', + repo: 'studio', + tag: tagName, + }); + } catch (err) { + // Doesn't exist + } + + return octokit.repos.createRelease({ + owner: 'kong', + repo: 'studio', + tag_name: tagName, + name: tagName, + body: `${packageJson.app.productName} ${tagName}`, + draft: false, + preRelease: true, + }); +} From 24109a05383e1ee488a053bc90c857e8270d2495 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 9 Oct 2019 13:32:36 -0700 Subject: [PATCH 046/100] Bump version' --- packages/insomnia-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index f0e6d7e12c..4993206e07 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -11,7 +11,7 @@ "synopsis": "A simple, beautiful, and free REST API client", "icon": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true", "theme": "default", - "version": "7.0.1", + "version": "7.0.2", "main": "main.min.js", "plugins": [ "insomnia-plugin-base64", From 358791abd230e8df71c549db749fcef4981a42f4 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 9 Oct 2019 14:09:16 -0700 Subject: [PATCH 047/100] Code signing GH Actions attempt --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04c9f2e49d..28c47537b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,6 +32,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} + CSC_LINK: ${{ secrets.WINDOWS_CSC_LINK }} + CSC_KEY_PASSWORD: ${{ secrets.WINDOWS_CSC_KEY_PASSWORD }} run: npm run app-release Mac: name: Mac @@ -52,6 +54,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} + CSC_LINK: ${{ secrets.MAC_CSC_LINK }} + CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} Linux: name: Ubuntu runs-on: ubuntu-16.04 From 6c67a82383bdf74b07f2ea0e4b82a9ea95cef8b6 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 9 Oct 2019 17:46:41 -0700 Subject: [PATCH 048/100] Ubuntu 14 and 16 builds --- .../{build => build-ubuntu14}/Dockerfile | 8 ++++---- .github/actions/build-ubuntu16/Dockerfile | 18 ++++++++++++++++++ .../actions/{build => common}/entrypoint.sh | 0 .../{build => common}/install-dependencies.sh | 0 .github/workflows/main.yml | 15 +++++++++++++-- 5 files changed, 35 insertions(+), 6 deletions(-) rename .github/actions/{build => build-ubuntu14}/Dockerfile (55%) create mode 100644 .github/actions/build-ubuntu16/Dockerfile rename .github/actions/{build => common}/entrypoint.sh (100%) rename .github/actions/{build => common}/install-dependencies.sh (100%) diff --git a/.github/actions/build/Dockerfile b/.github/actions/build-ubuntu14/Dockerfile similarity index 55% rename from .github/actions/build/Dockerfile rename to .github/actions/build-ubuntu14/Dockerfile index ef9abff354..165c1c1ea9 100644 --- a/.github/actions/build/Dockerfile +++ b/.github/actions/build-ubuntu14/Dockerfile @@ -1,16 +1,16 @@ FROM ubuntu:14.04 -LABEL "name"="Insomnia-Linux" +LABEL "name"="Insomnia-Ubuntu-14" LABEL "maintainer"="Gregory Schier " LABEL "version"="1.0.0" LABEL "com.github.actions.icon"="package" LABEL "com.github.actions.color"="blue" -LABEL "com.github.actions.name"="Insomnia Linux" +LABEL "com.github.actions.name"="Insomnia Ubuntu 14" LABEL "com.github.actions.description"="Do the stuff" -COPY entrypoint.sh /scripts/entrypoint.sh -COPY install-dependencies.sh /scripts/install-dependencies.sh +COPY ../common/entrypoint.sh /scripts/entrypoint.sh +COPY ../common/install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* RUN /scripts/install-dependencies.sh diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-ubuntu16/Dockerfile new file mode 100644 index 0000000000..9ac455006c --- /dev/null +++ b/.github/actions/build-ubuntu16/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:14.04 + +LABEL "name"="Insomnia-Ubuntu-16" +LABEL "maintainer"="Gregory Schier " +LABEL "version"="1.0.0" + +LABEL "com.github.actions.icon"="package" +LABEL "com.github.actions.color"="blue" +LABEL "com.github.actions.name"="Insomnia Ubuntu 16" +LABEL "com.github.actions.description"="Do the stuff" + +COPY ../common/entrypoint.sh /scripts/entrypoint.sh +COPY ../common/install-dependencies.sh /scripts/install-dependencies.sh + +RUN chmod +x /scripts/* +RUN /scripts/install-dependencies.sh && apt-get install -y snapcraft + +ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/build/entrypoint.sh b/.github/actions/common/entrypoint.sh similarity index 100% rename from .github/actions/build/entrypoint.sh rename to .github/actions/common/entrypoint.sh diff --git a/.github/actions/build/install-dependencies.sh b/.github/actions/common/install-dependencies.sh similarity index 100% rename from .github/actions/build/install-dependencies.sh rename to .github/actions/common/install-dependencies.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 28c47537b0..2b7fad8b63 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,14 +58,25 @@ jobs: CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - Linux: + Ubuntu14: name: Ubuntu runs-on: ubuntu-16.04 steps: - name: Checkout branch uses: actions/checkout@v1 - name: Run Docker - uses: ./.github/actions/build + uses: ./.github/actions/build-ubuntu14 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REF: ${{ github.event.ref }} + Ubuntu16: + name: Ubuntu + runs-on: ubuntu-16.04 + steps: + - name: Checkout branch + uses: actions/checkout@v1 + - name: Run Docker + uses: ./.github/actions/build-ubuntu16 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} From 54a524a55c30d6a85f2e7c678f11e917092d6d43 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 9 Oct 2019 17:54:44 -0700 Subject: [PATCH 049/100] Fix linux? --- .github/actions/build-ubuntu14/Dockerfile | 4 +- .../{common => build-ubuntu14}/entrypoint.sh | 0 .../install-dependencies.sh | 0 .github/actions/build-ubuntu16/Dockerfile | 4 +- .github/actions/build-ubuntu16/entrypoint.sh | 18 +++++ .../build-ubuntu16/install-dependencies.sh | 70 +++++++++++++++++++ .github/workflows/main.yml | 1 - 7 files changed, 92 insertions(+), 5 deletions(-) rename .github/actions/{common => build-ubuntu14}/entrypoint.sh (100%) rename .github/actions/{common => build-ubuntu14}/install-dependencies.sh (100%) create mode 100644 .github/actions/build-ubuntu16/entrypoint.sh create mode 100644 .github/actions/build-ubuntu16/install-dependencies.sh diff --git a/.github/actions/build-ubuntu14/Dockerfile b/.github/actions/build-ubuntu14/Dockerfile index 165c1c1ea9..6e385f59be 100644 --- a/.github/actions/build-ubuntu14/Dockerfile +++ b/.github/actions/build-ubuntu14/Dockerfile @@ -9,8 +9,8 @@ LABEL "com.github.actions.color"="blue" LABEL "com.github.actions.name"="Insomnia Ubuntu 14" LABEL "com.github.actions.description"="Do the stuff" -COPY ../common/entrypoint.sh /scripts/entrypoint.sh -COPY ../common/install-dependencies.sh /scripts/install-dependencies.sh +COPY entrypoint.sh /scripts/entrypoint.sh +COPY install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* RUN /scripts/install-dependencies.sh diff --git a/.github/actions/common/entrypoint.sh b/.github/actions/build-ubuntu14/entrypoint.sh similarity index 100% rename from .github/actions/common/entrypoint.sh rename to .github/actions/build-ubuntu14/entrypoint.sh diff --git a/.github/actions/common/install-dependencies.sh b/.github/actions/build-ubuntu14/install-dependencies.sh similarity index 100% rename from .github/actions/common/install-dependencies.sh rename to .github/actions/build-ubuntu14/install-dependencies.sh diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-ubuntu16/Dockerfile index 9ac455006c..2820bcf547 100644 --- a/.github/actions/build-ubuntu16/Dockerfile +++ b/.github/actions/build-ubuntu16/Dockerfile @@ -9,8 +9,8 @@ LABEL "com.github.actions.color"="blue" LABEL "com.github.actions.name"="Insomnia Ubuntu 16" LABEL "com.github.actions.description"="Do the stuff" -COPY ../common/entrypoint.sh /scripts/entrypoint.sh -COPY ../common/install-dependencies.sh /scripts/install-dependencies.sh +COPY entrypoint.sh /scripts/entrypoint.sh +COPY install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* RUN /scripts/install-dependencies.sh && apt-get install -y snapcraft diff --git a/.github/actions/build-ubuntu16/entrypoint.sh b/.github/actions/build-ubuntu16/entrypoint.sh new file mode 100644 index 0000000000..bf2b8f4304 --- /dev/null +++ b/.github/actions/build-ubuntu16/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Fail on any errors +set -e + +if [[ -z "$GITHUB_WORKSPACE" ]]; then + echo "Set the GITHUB_WORKSPACE env variable." + exit 1 +fi + +# Install root project dependencies +cd "$GITHUB_WORKSPACE" +npm run bootstrap +npm install --no-save 7zip-bin-linux app-builder-bin-linux + +echo "Running the stuff" +npm test +npm run app-release \ No newline at end of file diff --git a/.github/actions/build-ubuntu16/install-dependencies.sh b/.github/actions/build-ubuntu16/install-dependencies.sh new file mode 100644 index 0000000000..f6c83fac85 --- /dev/null +++ b/.github/actions/build-ubuntu16/install-dependencies.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +# Fail on any errors +set -e + +# Install core deps +apt-get update +apt-get upgrade -y +apt-get install -y \ + build-essential \ + autoconf \ + libtool \ + pkg-config \ + libfontconfig1-dev \ + rpm \ + wget + +# Install Node and app-related dependencies +wget -O- https://deb.nodesource.com/setup_10.x | bash - +apt-get install -y nodejs graphicsmagick icnsutils + +# Build zlib from source (for Curl) +wget -q https://github.com/madler/zlib/archive/v1.2.11.tar.gz -O ./zlib.tar.gz +mkdir -p /src/zlib /build/zlib +tar -xf zlib.tar.gz -C /src/zlib --strip 1 +cd /src/zlib +./configure --prefix=/build/zlib +make +make install +ldconfig + +# Build OpenSSL from source (for Curl) +wget -q https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz -O ./openssl.tar.gz +mkdir -p /src/openssl /build/openssl +tar -xf openssl.tar.gz -C /src/openssl --strip 1 +cd /src/openssl +./config no-shared --static --prefix=/build/openssl --openssldir=/build/openssl +make +make install +ldconfig + +# Build nghttp2 from source (for Curl) +wget -q https://github.com/nghttp2/nghttp2/releases/download/v1.31.1/nghttp2-1.31.1.tar.gz -O ./nghttp2.tar.gz +mkdir -p /src/nghttp2 /build/nghttp2 +tar -xf nghttp2.tar.gz -C /src/nghttp2 --strip 1 +cd /src/nghttp2 +CFLAGS="-fPIC" ./configure --enable-lib-only --disable-shared --prefix=/build/nghttp2 +make +make install +ldconfig + +# Build Curl from source +wget -q https://github.com/curl/curl/releases/download/curl-7_61_1/curl-7.61.1.tar.gz -O ./curl.tar.gz +mkdir -p /src/curl +tar -xf curl.tar.gz -C /src/curl --strip 1 +cd /src/curl +./buildconf +LIBS="-ldl" CPPFLAGS="-I/build/openssl/include" LDFLAGS="-L/build/openssl/lib" \ + ./configure \ + --disable-shared \ + --enable-static \ + --with-ssl=/build/openssl \ + --with-nghttp2=/build/nghttp2 \ + --with-zlib=/build/zlib \ + --enable-ipv6 \ + --enable-unix-sockets +make +make install +ldconfig +curl --version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b7fad8b63..8825bc4843 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,6 @@ jobs: - name: Run tests run: npm test - name: Release app - if: startsWith(github.event.ref, 'refs/tags/v') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} From 2153af7ab9a4b378d1014ca513d27db8ad4dbda6 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 10:29:49 -0700 Subject: [PATCH 050/100] Fix owner and repo in release code --- .github/workflows/main.yml | 4 ++-- packages/insomnia-app/scripts/release.js | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8825bc4843..2f3fdd3bee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,7 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} Ubuntu14: - name: Ubuntu + name: Ubuntu 14 (Snap) runs-on: ubuntu-16.04 steps: - name: Checkout branch @@ -69,7 +69,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} Ubuntu16: - name: Ubuntu + name: Ubuntu 14 runs-on: ubuntu-16.04 steps: - name: Checkout branch diff --git a/packages/insomnia-app/scripts/release.js b/packages/insomnia-app/scripts/release.js index 2ca7acffea..e8a2d355c0 100644 --- a/packages/insomnia-app/scripts/release.js +++ b/packages/insomnia-app/scripts/release.js @@ -11,6 +11,9 @@ const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN, }); +const OWNER = 'getinsomnia'; +const REPO = 'insomnia'; + // Start package if ran from CLI if (require.main === module) { if (!process.env.GITHUB_REF.match(/v\d{1,3}\.\d{1,3}\.\d{1,3}$/)) { @@ -58,8 +61,8 @@ async function start() { url: 'https://uploads.github.com/repos/:owner/:repo/releases/:id/assets{?name,label}"', id: data.id, name: name, - owner: 'kong', - repo: 'studio', + owner: OWNER, + repo: REPO, headers: { 'Content-Type': 'application/octet-stream', }, @@ -73,8 +76,8 @@ async function start() { async function getOrCreateRelease(tagName) { try { return await octokit.repos.getReleaseByTag({ - owner: 'kong', - repo: 'studio', + owner: OWNER, + repo: REPO, tag: tagName, }); } catch (err) { @@ -82,8 +85,8 @@ async function getOrCreateRelease(tagName) { } return octokit.repos.createRelease({ - owner: 'kong', - repo: 'studio', + owner: OWNER, + repo: REPO, tag_name: tagName, name: tagName, body: `${packageJson.app.productName} ${tagName}`, From 9e52bf392723d904aa40ec35661f4fccb12f9236 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 10:30:33 -0700 Subject: [PATCH 051/100] Remove TravisCI and Appveyor --- .appveyor.yml | 56 ---------------------------------------- .travis.yml | 71 --------------------------------------------------- 2 files changed, 127 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .travis.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index dc4d85bc51..0000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,56 +0,0 @@ -image: Visual Studio 2015 -build: off -test: off - -#---------------------------------# -# environment configuration # -#---------------------------------# - -shallow_clone: true -platform: x64 -environment: - NODEJS_VERSION: '10' - CSC_LINK: '%WINDOWS_CSC_LINK%' - CSC_KEY_PASSWORD: '%WINDOWS_CSC_KEY_PASSWORD%' - -# Things to install after repo clone -install: - - SET "PATH=%PATH%;C:\Program Files\Git\mingw64\libexec\git-core" # For weird git bug - - ps: Install-Product node $env:NODEJS_VERSION $env:Platform - - node --version - - npm --version - - npm config set msvs_version 2015 - - npm run bootstrap - - npm test - -cache: - - '%USERPROFILE%\.electron -> packages/insomnia-app/package.json' - -#---------------------------------# -# tests configuration # -#---------------------------------# - -build_script: - - if %APPVEYOR_REPO_TAG%==true npm run app-package - -#---------------------------------# -# artifacts configuration # -#---------------------------------# - -artifacts: - - path: packages\insomnia-app\dist\squirrel-windows\* - name: dist - -#---------------------------------# -# deployment configuration # -#---------------------------------# - -deploy: - description: '' - provider: GitHub - auth_token: - secure: Ffmgxn+wt5WSf/jgJ/L+/3mkUs4fn9Z5j4Dz73VATsgL14Rf/xUp2nOyE0ecow+1 - artifact: dist - prerelease: true - on: - appveyor_repo_tag: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0448d098d6..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,71 +0,0 @@ -language: node_js - -matrix: - include: - - os: linux - sudo: required - dist: trusty - env: - - COMPOSE_SCRIPT=package_linux - - DOCKER_COMPOSE_VERSION=1.20.1 - before_install: - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin - before_deploy: - - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - - docker-compose build - - docker-compose build $COMPOSE_SCRIPT - - docker-compose run $COMPOSE_SCRIPT - - os: linux - sudo: required - dist: trusty - env: - - COMPOSE_SCRIPT=package_snap - - DOCKER_COMPOSE_VERSION=1.20.1 - before_install: - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin - before_deploy: - - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - - docker-compose build $COMPOSE_SCRIPT - - docker-compose run $COMPOSE_SCRIPT - - os: osx - env: - - CSC_LINK=$MAC_CSC_LINK - - CSC_KEY_PASSWORD=$MAC_CSC_KEY_PASSWORD - before_deploy: - - npm run app-package - -cache: - directories: - - node_modules - - build/node_modules - - $HOME/.electron - - $HOME/.cache - -script: -- node --version -- npm --version -- npm run bootstrap -- npm test - -deploy: - provider: releases - api_key: $GITHUB_TOKEN - skip_cleanup: true - file_glob: true - prerelease: true - file: - - packages/insomnia-app/dist/**/*.zip - - packages/insomnia-app/dist/**/*.dmg - - packages/insomnia-app/dist/**/*.deb - - packages/insomnia-app/dist/**/*.snap - - packages/insomnia-app/dist/**/*.rpm - - packages/insomnia-app/dist/**/*.AppImage - - packages/insomnia-app/dist/**/*.tar.gz - on: - tags: true From 53a603052e85d8af3a18568289ec25d22114081d Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 10:40:44 -0700 Subject: [PATCH 052/100] Specify Linux build targets --- .github/workflows/main.yml | 4 ++ docker/Dockerfile.Ubuntu14 | 15 -------- docker/Dockerfile.Ubuntu16 | 15 -------- docker/bootstrap.sh | 9 ----- docker/install-dependencies.sh | 70 ---------------------------------- 5 files changed, 4 insertions(+), 109 deletions(-) delete mode 100644 docker/Dockerfile.Ubuntu14 delete mode 100644 docker/Dockerfile.Ubuntu16 delete mode 100755 docker/bootstrap.sh delete mode 100755 docker/install-dependencies.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f3fdd3bee..fd2435180b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,6 +68,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} + BUILD_TARGETS: AppImage,deb,tar.gz,rpm + NODELIBCURL_BUILD_STATIC: yes Ubuntu16: name: Ubuntu 14 runs-on: ubuntu-16.04 @@ -79,3 +81,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} + BUILD_TARGETS: snap + NODELIBCURL_BUILD_STATIC: yes diff --git a/docker/Dockerfile.Ubuntu14 b/docker/Dockerfile.Ubuntu14 deleted file mode 100644 index 388c32b5ab..0000000000 --- a/docker/Dockerfile.Ubuntu14 +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:14.04 - -ADD docker/install-dependencies.sh /scripts/install-dependencies.sh -RUN /scripts/install-dependencies.sh - -# Setup dirs -ADD . /src/insomnia -WORKDIR /src/insomnia -VOLUME /src/insomnia/packages/insomnia-app/dist - -ADD docker/bootstrap.sh /scripts/bootstrap.sh -RUN /scripts/bootstrap.sh - -# Define build command -CMD npm run app-package diff --git a/docker/Dockerfile.Ubuntu16 b/docker/Dockerfile.Ubuntu16 deleted file mode 100644 index 4f68e4ec09..0000000000 --- a/docker/Dockerfile.Ubuntu16 +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:16.04 - -ADD docker/install-dependencies.sh /scripts/install-dependencies.sh -RUN /scripts/install-dependencies.sh && apt-get install -y snapcraft - -# Setup dirs -ADD . /src/insomnia -WORKDIR /src/insomnia -VOLUME /src/insomnia/packages/insomnia-app/dist - -ADD docker/bootstrap.sh /scripts/bootstrap.sh -RUN /scripts/bootstrap.sh - -# Define build command -CMD npm run app-package diff --git a/docker/bootstrap.sh b/docker/bootstrap.sh deleted file mode 100755 index a4531e7b2d..0000000000 --- a/docker/bootstrap.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Fail on any errors -set -e - -# Install root project dependencies -npm run bootstrap -npm install --no-save 7zip-bin-linux app-builder-bin-linux - diff --git a/docker/install-dependencies.sh b/docker/install-dependencies.sh deleted file mode 100755 index ea30270092..0000000000 --- a/docker/install-dependencies.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash - -# Fail on any errors -set -e - -# Install core deps -apt-get update -apt-get upgrade -y -apt-get install -y \ - build-essential \ - autoconf \ - libtool \ - pkg-config \ - libfontconfig1-dev \ - rpm \ - wget - -# Install Node and app-related dependencies -wget -O- https://deb.nodesource.com/setup_10.x | bash - -apt-get install -y nodejs graphicsmagick icnsutils - -# Build zlib from source (for Curl) -wget -q https://github.com/madler/zlib/archive/v1.2.11.tar.gz -O ./zlib.tar.gz -mkdir -p /src/zlib /build/zlib -tar -xf zlib.tar.gz -C /src/zlib --strip 1 -cd /src/zlib -./configure --prefix=/build/zlib -make -make install -ldconfig - -# Build OpenSSL from source (for Curl) -wget -q https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz -O ./openssl.tar.gz -mkdir -p /src/openssl /build/openssl -tar -xf openssl.tar.gz -C /src/openssl --strip 1 -cd /src/openssl -./config no-shared --static --prefix=/build/openssl --openssldir=/build/openssl -make -make install -ldconfig - -# Build nghttp2 from source (for Curl) -wget -q https://github.com/nghttp2/nghttp2/releases/download/v1.31.1/nghttp2-1.31.1.tar.gz -O ./nghttp2.tar.gz -mkdir -p /src/nghttp2 /build/nghttp2 -tar -xf nghttp2.tar.gz -C /src/nghttp2 --strip 1 -cd /src/nghttp2 -CFLAGS="-fPIC" ./configure --enable-lib-only --disable-shared --prefix=/build/nghttp2 -make -make install -ldconfig - -# Build Curl from source -wget -q https://github.com/curl/curl/releases/download/curl-7_61_1/curl-7.61.1.tar.gz -O ./curl.tar.gz -mkdir -p /src/curl -tar -xf curl.tar.gz -C /src/curl --strip 1 -cd /src/curl -./buildconf -LIBS="-ldl" CPPFLAGS="-I/build/openssl/include" LDFLAGS="-L/build/openssl/lib" \ - ./configure \ - --disable-shared \ - --enable-static \ - --with-ssl=/build/openssl \ - --with-nghttp2=/build/nghttp2 \ - --with-zlib=/build/zlib \ - --enable-ipv6 \ - --enable-unix-sockets -make -make install -ldconfig -curl --version From ff976ed074775254be78eb06e3ea30ffb8fe4605 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 10:49:59 -0700 Subject: [PATCH 053/100] Fix Ubuntu 16 version --- .github/actions/build-ubuntu16/Dockerfile | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-ubuntu16/Dockerfile index 2820bcf547..e80e99dbed 100644 --- a/.github/actions/build-ubuntu16/Dockerfile +++ b/.github/actions/build-ubuntu16/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM ubuntu:16.04 LABEL "name"="Insomnia-Ubuntu-16" LABEL "maintainer"="Gregory Schier " diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd2435180b..f8e1afeb5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,7 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} Ubuntu14: - name: Ubuntu 14 (Snap) + name: Ubuntu 16 (Snap) runs-on: ubuntu-16.04 steps: - name: Checkout branch From 51d16a9fcaf4bdce46dfc1ce24c52da859f87865 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 11:34:43 -0700 Subject: [PATCH 054/100] CI fixes --- .github/actions/build-ubuntu16/Dockerfile | 4 +++- .github/workflows/main.yml | 4 ++-- packages/insomnia-app/scripts/afterSignHook.js | 8 +++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-ubuntu16/Dockerfile index e80e99dbed..8e463595e6 100644 --- a/.github/actions/build-ubuntu16/Dockerfile +++ b/.github/actions/build-ubuntu16/Dockerfile @@ -13,6 +13,8 @@ COPY entrypoint.sh /scripts/entrypoint.sh COPY install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* -RUN /scripts/install-dependencies.sh && apt-get install -y snapcraft +RUN /scripts/install-dependencies.sh \ + && apt-get install -y snapcraft \ + && sudo snap install snapcraft --classic ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8e1afeb5c..304292bdad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,7 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} Ubuntu14: - name: Ubuntu 16 (Snap) + name: Linux (Generic) runs-on: ubuntu-16.04 steps: - name: Checkout branch @@ -71,7 +71,7 @@ jobs: BUILD_TARGETS: AppImage,deb,tar.gz,rpm NODELIBCURL_BUILD_STATIC: yes Ubuntu16: - name: Ubuntu 14 + name: Linux (Snap) runs-on: ubuntu-16.04 steps: - name: Checkout branch diff --git a/packages/insomnia-app/scripts/afterSignHook.js b/packages/insomnia-app/scripts/afterSignHook.js index 488d12affe..b77e205ac7 100644 --- a/packages/insomnia-app/scripts/afterSignHook.js +++ b/packages/insomnia-app/scripts/afterSignHook.js @@ -13,9 +13,10 @@ module.exports = async function(params) { // Same appId in electron-builder. const { appId } = packageJson.app; - const appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`); + const appName = `${params.packager.appInfo.productFilename}.app`; + const appPath = path.join(params.appOutDir, appName); if (!fs.existsSync(appPath)) { - throw new Error(`Cannot find application at: ${appPath}`); + throw new Error(`Cannot find application at: ${appName}`); } const args = { @@ -25,7 +26,8 @@ module.exports = async function(params) { appleIdPassword: process.env.APPLE_ID_PASSWORD, }; - console.log(`[afterSign] Notarizing ${appId} found at ${appPath}`); + const printCreds = `${process.env.APPLE_ID}:${process.env.APPLE_ID_PASSWORD.replace(/./g, '*')}`; + console.log(`[afterSign] Notarizing ${appName} (${appId}) with ${printCreds}`); try { await electronNotarize.notarize(args); From d62b969d8737399b4eb98494facaaa6afa50f267 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 12:17:42 -0700 Subject: [PATCH 055/100] Bump version to beta --- .github/actions/build-ubuntu16/Dockerfile | 4 +--- packages/insomnia-app/package.json | 2 +- packages/insomnia-app/scripts/release.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-ubuntu16/Dockerfile index 8e463595e6..555ab5b109 100644 --- a/.github/actions/build-ubuntu16/Dockerfile +++ b/.github/actions/build-ubuntu16/Dockerfile @@ -13,8 +13,6 @@ COPY entrypoint.sh /scripts/entrypoint.sh COPY install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* -RUN /scripts/install-dependencies.sh \ - && apt-get install -y snapcraft \ - && sudo snap install snapcraft --classic +RUN /scripts/install-dependencies.sh && apt-get install -y snapd ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index 4993206e07..a3b1fb76bd 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -11,7 +11,7 @@ "synopsis": "A simple, beautiful, and free REST API client", "icon": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true", "theme": "default", - "version": "7.0.2", + "version": "7.0.2-beta.1", "main": "main.min.js", "plugins": [ "insomnia-plugin-base64", diff --git a/packages/insomnia-app/scripts/release.js b/packages/insomnia-app/scripts/release.js index e8a2d355c0..b7d9878524 100644 --- a/packages/insomnia-app/scripts/release.js +++ b/packages/insomnia-app/scripts/release.js @@ -16,7 +16,7 @@ const REPO = 'insomnia'; // Start package if ran from CLI if (require.main === module) { - if (!process.env.GITHUB_REF.match(/v\d{1,3}\.\d{1,3}\.\d{1,3}$/)) { + if (!process.env.GITHUB_REF.match(/v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?$/)) { console.log(`[release] Not running release for ref ${process.env.GITHUB_REF}`); process.exit(0); } From a65e99fb63cfaf4ad08d7871be0bec37f0758f97 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 14:05:40 -0700 Subject: [PATCH 056/100] Print snapcraft version --- .github/actions/build-ubuntu16/Dockerfile | 1 + packages/insomnia-app/package-lock.json | 1161 +++++++++++++-------- packages/insomnia-app/package.json | 1 - 3 files changed, 748 insertions(+), 415 deletions(-) diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-ubuntu16/Dockerfile index 555ab5b109..e5eedadd7a 100644 --- a/.github/actions/build-ubuntu16/Dockerfile +++ b/.github/actions/build-ubuntu16/Dockerfile @@ -14,5 +14,6 @@ COPY install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* RUN /scripts/install-dependencies.sh && apt-get install -y snapd +RUN snapcraft --version ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/packages/insomnia-app/package-lock.json b/packages/insomnia-app/package-lock.json index e4041c6918..b384581734 100644 --- a/packages/insomnia-app/package-lock.json +++ b/packages/insomnia-app/package-lock.json @@ -656,8 +656,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "accepts": { "version": "1.3.7", @@ -1015,7 +1014,6 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -1061,8 +1059,7 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "assign-symbols": { "version": "1.0.0", @@ -1091,8 +1088,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { "version": "2.1.2", @@ -1113,8 +1109,7 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { "version": "1.8.0", @@ -1215,7 +1210,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -1273,6 +1267,14 @@ } } }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "requires": { + "inherits": "~2.0.0" + } + }, "bluebird": { "version": "3.5.5", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", @@ -1579,22 +1581,6 @@ "ieee754": "^1.1.4" } }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "dev": true, - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", - "dev": true - }, "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -1606,12 +1592,6 @@ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -1718,35 +1698,6 @@ } } }, - "builder-util-runtime": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-4.4.1.tgz", - "integrity": "sha512-8L2pbL6D3VdI1f8OMknlZJpw0c7KK15BRz3cY77AOUElc4XlCv2UhVV01jJM7+6Lx7henaQh80ALULp64eFYAQ==", - "dev": true, - "requires": { - "bluebird-lst": "^1.0.5", - "debug": "^3.1.0", - "fs-extra-p": "^4.6.1", - "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", @@ -1853,6 +1804,11 @@ } } }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" + }, "camelcase": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", @@ -1871,8 +1827,7 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "catharsis": { "version": "0.8.11", @@ -1926,8 +1881,7 @@ "chownr": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", - "dev": true + "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==" }, "chrome-trace-event": { "version": "1.0.2", @@ -2099,12 +2053,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "compare-version": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz", - "integrity": "sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA=", - "dev": true - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -2563,7 +2511,6 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -2929,18 +2876,6 @@ "is-obj": "^1.0.0" } }, - "dotenv": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz", - "integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==", - "dev": true - }, - "dotenv-expand": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-4.2.0.tgz", - "integrity": "sha1-3vHxyl1gWdJKdm5YeULCEQbOEnU=", - "dev": true - }, "ducktype": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/ducktype/-/ducktype-1.2.2.tgz", @@ -2973,7 +2908,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -3185,182 +3119,6 @@ } } }, - "electron-builder-lib": { - "version": "20.23.1", - "resolved": "https://registry.npmjs.org/electron-builder-lib/-/electron-builder-lib-20.23.1.tgz", - "integrity": "sha512-9bYeANVqFPpSmswPwXv8efu9voPE1Q8hw/jNwiWGICjPeYjHyKwa4ao+Vd1beY6ZhUDVhxxXIdlJWnmvH7Mcxw==", - "dev": true, - "requires": { - "7zip-bin": "~4.0.2", - "app-builder-bin": "1.11.4", - "async-exit-hook": "^2.0.1", - "bluebird-lst": "^1.0.5", - "builder-util": "5.17.0", - "builder-util-runtime": "4.4.1", - "chromium-pickle-js": "^0.2.0", - "debug": "^3.1.0", - "ejs": "^2.6.1", - "electron-osx-sign": "0.4.10", - "electron-publish": "20.23.1", - "env-paths": "^1.0.0", - "fs-extra-p": "^4.6.1", - "hosted-git-info": "^2.7.1", - "is-ci": "^1.1.0", - "isbinaryfile": "^3.0.2", - "js-yaml": "^3.12.0", - "lazy-val": "^1.0.3", - "minimatch": "^3.0.4", - "normalize-package-data": "^2.4.0", - "plist": "^3.0.1", - "read-config-file": "3.1.0", - "sanitize-filename": "^1.6.1", - "semver": "^5.5.0", - "sumchecker": "^2.0.2", - "temp-file": "^3.1.3" - }, - "dependencies": { - "7zip-bin": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-4.0.2.tgz", - "integrity": "sha512-XtGk+IF57pr852UK1AhQJXqmm1WmSgS5uISL+LPs0z/iAxXouMvdlLJrHPeukP6gd7yR2rDTMSMkHNODgwIq7A==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "app-builder-bin": { - "version": "1.11.4", - "resolved": "https://registry.npmjs.org/app-builder-bin/-/app-builder-bin-1.11.4.tgz", - "integrity": "sha512-04sgoFSz6q5pbAxAXcxfUFPl16gJsay5b8dudFXUwQbFfS7ox2uGgbOO5LGHF0t7sM7q/N82ztGePuuCSkKZHQ==", - "dev": true - }, - "builder-util": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-5.17.0.tgz", - "integrity": "sha512-F4s0uU/H0ZBes4CXkICDvUoC3MS9eW4rv5r+wkzcijJBqDfYNV7LLXxnN50P1bOVpFXa8Cw/NUHnsq95Xf478g==", - "dev": true, - "requires": { - "7zip-bin": "~4.0.2", - "app-builder-bin": "1.11.4", - "bluebird-lst": "^1.0.5", - "builder-util-runtime": "^4.4.1", - "chalk": "^2.4.1", - "debug": "^3.1.0", - "fs-extra-p": "^4.6.1", - "is-ci": "^1.1.0", - "js-yaml": "^3.12.0", - "lazy-val": "^1.0.3", - "semver": "^5.5.0", - "source-map-support": "^0.5.6", - "stat-mode": "^0.2.2", - "temp-file": "^3.1.3" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "ci-info": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", - "dev": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "electron-publish": { - "version": "20.23.1", - "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-20.23.1.tgz", - "integrity": "sha512-FsNL5bY4/Uab5YGYWE+/7wL8znkghEPwJvDyD0985Obw0Eg9JZP1MpUbt4jUxrK8z5wTLVMFdSv7ymV8yq6ypA==", - "dev": true, - "requires": { - "bluebird-lst": "^1.0.5", - "builder-util": "~5.17.0", - "builder-util-runtime": "^4.4.1", - "chalk": "^2.4.1", - "fs-extra-p": "^4.6.1", - "lazy-val": "^1.0.3", - "mime": "^2.3.1" - } - }, - "is-ci": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", - "dev": true, - "requires": { - "ci-info": "^1.5.0" - } - }, - "isbinaryfile": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", - "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", - "dev": true, - "requires": { - "buffer-alloc": "^1.2.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "read-config-file": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-3.1.0.tgz", - "integrity": "sha512-z3VTrR9fgFu+Ll6MhTdtxbPFBKNGKgzYYnRjOcZvQeE/zwJTjPYVrps0ATgaSWU2/BnucUg3knP+Oz4zo9vEoA==", - "dev": true, - "requires": { - "ajv": "^6.5.2", - "ajv-keywords": "^3.2.0", - "bluebird-lst": "^1.0.5", - "dotenv": "^6.0.0", - "dotenv-expand": "^4.2.0", - "fs-extra-p": "^4.6.1", - "js-yaml": "^3.12.0", - "json5": "^1.0.1", - "lazy-val": "^1.0.3" - } - }, - "stat-mode": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", - "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "electron-builder-squirrel-windows": { "version": "21.2.0", "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-21.2.0.tgz", @@ -3508,54 +3266,6 @@ } } }, - "electron-osx-sign": { - "version": "0.4.10", - "resolved": "https://registry.npmjs.org/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz", - "integrity": "sha1-vk87ibKnWh3F8eckkIGrKSnKOiY=", - "dev": true, - "requires": { - "bluebird": "^3.5.0", - "compare-version": "^0.1.2", - "debug": "^2.6.8", - "isbinaryfile": "^3.0.2", - "minimist": "^1.2.0", - "plist": "^2.1.0" - }, - "dependencies": { - "base64-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", - "integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", - "dev": true - }, - "isbinaryfile": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz", - "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==", - "dev": true, - "requires": { - "buffer-alloc": "^1.2.0" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "plist": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/plist/-/plist-2.1.0.tgz", - "integrity": "sha1-V8zbeggh3yGDEhejytVOPhRqECU=", - "dev": true, - "requires": { - "base64-js": "1.2.0", - "xmlbuilder": "8.2.2", - "xmldom": "0.1.x" - } - } - } - }, "electron-publish": { "version": "21.2.0", "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-21.2.0.tgz", @@ -4195,8 +3905,7 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "extend-shallow": { "version": "3.0.2", @@ -4291,8 +4000,7 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, "fast-deep-equal": { "version": "2.0.1", @@ -4578,8 +4286,7 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "form-data": { "version": "1.0.1", @@ -4591,6 +4298,11 @@ "mime-types": "^2.1.11" } }, + "format-util": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/format-util/-/format-util-1.0.3.tgz", + "integrity": "sha1-Ay3KShFiYqEsQ/TD7IVmQWxbLZU=" + }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -4642,34 +4354,10 @@ "universalify": "^0.1.0" } }, - "fs-extra-p": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-4.6.1.tgz", - "integrity": "sha512-IsTMbUS0svZKZTvqF4vDS9c/L7Mw9n8nZQWWeSzAGacOSe+8CzowhUN0tdZEZFIJNP5HC7L9j3MMikz/G4hDeQ==", - "dev": true, - "requires": { - "bluebird-lst": "^1.0.5", - "fs-extra": "^6.0.1" - }, - "dependencies": { - "fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - } - } - }, "fs-minipass": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dev": true, "requires": { "minipass": "^2.6.0" } @@ -4716,8 +4404,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.2.9", @@ -5181,6 +4868,17 @@ } } }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, "fuzzysort": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-1.1.4.tgz", @@ -5234,7 +4932,6 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -5243,7 +4940,6 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5731,7 +5427,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -5860,7 +5555,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -5877,6 +5571,605 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, + "insomnia-cookies": { + "version": "0.0.19", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.19.tgz", + "integrity": "sha512-UXZtVwBEPdFHzhbLKh8FOIizDadC9yFrkqAxYxAm/m00opTafxadpXkWN+N59FN33tKofNEaUksByTzhy9MiRw==", + "requires": { + "tough-cookie": "^2.3.3" + } + }, + "insomnia-importers": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/insomnia-importers/-/insomnia-importers-2.0.22.tgz", + "integrity": "sha512-xrrYG8HGctEuj1nbiRV6BznWtwrDcs95V8JtRNwYijnxIfMT90up8uNIX3NxJixt53MCN5lwb51FbDTHOQBofw==", + "requires": { + "commander": "^2.20.0", + "shell-quote": "^1.6.1", + "swagger-parser": "^6.0.5", + "yaml": "^1.5.0" + } + }, + "insomnia-libcurl": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/insomnia-libcurl/-/insomnia-libcurl-0.0.30.tgz", + "integrity": "sha512-9WpnPEaOxzMT1em/wb4eACMaxHx1w0Fy2zDgA5MH5dxlgFpbOyP8ewAzhWoTyfVaCvxY9g7pXT9fkuR4C/zAcQ==", + "requires": { + "fstream": "^1.0.12", + "insomnia-node-libcurl": "^2.0.0-alpha.0-1", + "tar": "^4.4.10" + } + }, + "insomnia-node-libcurl": { + "version": "2.0.0-alpha.0-1", + "resolved": "https://registry.npmjs.org/insomnia-node-libcurl/-/insomnia-node-libcurl-2.0.0-alpha.0-1.tgz", + "integrity": "sha512-V5uCKm6RDJprRw+XmvGdyvW1LCBlA/dTkIVaQped57/DKr4H/r7WmSRXTo6jiJrbcQd7H2cz9MQSuZHMDqwZgA==", + "requires": { + "debug": "3.1.0", + "fs-extra": "5.0.0", + "nan": "2.10.0", + "node-gyp": "3.8.0", + "node-pre-gyp": "0.11.0", + "npmlog": "4.1.2" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "minipass": { + "version": "2.3.4", + "bundled": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.1", + "bundled": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" + }, + "needle": { + "version": "2.2.4", + "bundled": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "node-gyp": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "requires": { + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "^2.87.0", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^2.0.0", + "which": "1" + } + }, + "node-pre-gyp": { + "version": "0.11.0", + "bundled": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + }, + "dependencies": { + "nopt": { + "version": "4.0.1", + "bundled": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "tar": { + "version": "4.4.6", + "bundled": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.3", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + } + } + }, + "npm-bundled": { + "version": "1.0.5", + "bundled": true + }, + "npm-packlist": { + "version": "1.1.12", + "bundled": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true + }, + "sax": { + "version": "1.2.4", + "bundled": true + }, + "semver": { + "version": "5.3.0", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "tar": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "requires": { + "block-stream": "*", + "fstream": "^1.0.12", + "inherits": "2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true + } + } + }, + "insomnia-plugin-base64": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/insomnia-plugin-base64/-/insomnia-plugin-base64-1.0.12.tgz", + "integrity": "sha512-XeZONK2AcB0t1G0uozNhziW2dvxsWGGjlcmC+XcVupjT3N9UAGTxFMDbGoZlRuP8BUoU6wNiRGFSJK6R8eZLJw==" + }, + "insomnia-plugin-cookie-jar": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/insomnia-plugin-cookie-jar/-/insomnia-plugin-cookie-jar-1.0.17.tgz", + "integrity": "sha512-zrPZfeXdbx66/CRVgQXZ9oVBo1wCj8DC7wVGDU21y5JIzbXk139ildTLSGDcbX6/cRM2tIxulrSXbsSybWJMEg==", + "requires": { + "insomnia-cookies": "^0.0.5" + }, + "dependencies": { + "insomnia-cookies": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.5.tgz", + "integrity": "sha512-2VzgPwIZRuhX2+bope6tL9UkR7Urz9Y6+1I8W54du/UT4fZI7pTbKuXmoJL2kW6c998Ijg0aDBlMR7jSjYwfPQ==", + "requires": { + "tough-cookie": "^2.3.3" + } + } + } + }, + "insomnia-plugin-core-themes": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/insomnia-plugin-core-themes/-/insomnia-plugin-core-themes-1.0.11.tgz", + "integrity": "sha512-1trMGLoO5ue0NUFWppXJqdYLxS0enqhHfJuHEEmHFMzSAWkHouxLZxvwpq54f82Box38voayGt481IYkQe6M6g==" + }, + "insomnia-plugin-file": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/insomnia-plugin-file/-/insomnia-plugin-file-1.0.13.tgz", + "integrity": "sha512-ZuYkeJgeZAUldYG4vl6aFno2qY77Bm9xuLYif+ey6LhgAwjt8/PvNYKwukPB1+MiFiDeu3xR1dxWZGcBJItnJQ==" + }, + "insomnia-plugin-hash": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/insomnia-plugin-hash/-/insomnia-plugin-hash-1.0.13.tgz", + "integrity": "sha512-YkLsQaMZIkJzCCbcXXPRwhi9h4qc9zLkfVMcto09fekMtp+aKYs1LkNvybRqKSX3HvWNISe94wFFpUcNDTK9sg==" + }, + "insomnia-plugin-jsonpath": { + "version": "1.0.20", + "resolved": "https://registry.npmjs.org/insomnia-plugin-jsonpath/-/insomnia-plugin-jsonpath-1.0.20.tgz", + "integrity": "sha512-XGoII6nQjGeDTyQTUMPzucJ3aeVXoy2UQbDkIgyBrBWWw6MVdmDQK6jsOwPMDJw7vO/ptARrSYAQ0gra81YWyQ==", + "requires": { + "jsonpath": "^1.0.0" + } + }, + "insomnia-plugin-now": { + "version": "1.0.18", + "resolved": "https://registry.npmjs.org/insomnia-plugin-now/-/insomnia-plugin-now-1.0.18.tgz", + "integrity": "sha512-X3chGd5HVMeW1ixQYUvp27vW9HZ2ZszY4LNk5y1inbskVmxt7NUrTyZ7UyTHeNBSUu76JSZGuy2CZFvHnA5lkQ==", + "requires": { + "moment": "^2.21.0" + } + }, + "insomnia-plugin-prompt": { + "version": "1.1.17", + "resolved": "https://registry.npmjs.org/insomnia-plugin-prompt/-/insomnia-plugin-prompt-1.1.17.tgz", + "integrity": "sha512-L1TC9qXfCtqenZfI1kDHyMEQ+0g5bXvRBiesWZLf3yGcjJ10FJbSPharcuz+r44X2lULvGNIza9TlWYRPRL7RA==" + }, + "insomnia-plugin-request": { + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/insomnia-plugin-request/-/insomnia-plugin-request-1.0.26.tgz", + "integrity": "sha512-s3JQ5+SsIpo6VMpCdJVcWsgtmivArQeNSsKfkFmwE0P3qUCaY6q0kL/3JdCMUVfDLSCphJzjq0OfWi6kJOGkhg==", + "requires": { + "insomnia-cookies": "^0.0.19", + "insomnia-url": "^0.1.12" + } + }, + "insomnia-plugin-response": { + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/insomnia-plugin-response/-/insomnia-plugin-response-1.0.26.tgz", + "integrity": "sha512-I+Lurda8qQlDWCHN9n05k6gKrCLBpw5xmSFspAr7vwYadPuDiM+uZ2hXrh7zXhsYnavdBpRGUMZseYfzQCt4TQ==", + "requires": { + "iconv-lite": "^0.4.19", + "insomnia-xpath": "^1.0.16", + "jsonpath": "^1.0.2" + } + }, + "insomnia-plugin-uuid": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/insomnia-plugin-uuid/-/insomnia-plugin-uuid-1.0.17.tgz", + "integrity": "sha512-mv4ZoaJA4DfqQ/2e/GejdscAC0O1wo5WI5v/jGLpnq7SzwPgbCBcQElVgvEdOWSNoKccWy7rvQHOyHC3sMgGWg==", + "requires": { + "uuid": "^3.1.0" + } + }, + "insomnia-prettify": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/insomnia-prettify/-/insomnia-prettify-0.1.13.tgz", + "integrity": "sha512-A4lIFsGNGbJCkk3RUnG6yNXC8Odw2HTgyKJ8DE6FEwbCJSXwyYiBJgRsmNtXt0BGrf5kZlrPj8Y1UkdVdVI0Sg==" + }, + "insomnia-url": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/insomnia-url/-/insomnia-url-0.1.12.tgz", + "integrity": "sha512-0gxi05DaAs40v1thNW7RwWGnueYjJ1vEYW4+zaoRvvYPrYIR/ZtOA6PDNYNDaPo9FWmXthcVk3cFB7nTlpIDVw==" + }, + "insomnia-xpath": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/insomnia-xpath/-/insomnia-xpath-1.0.16.tgz", + "integrity": "sha512-6YBGWOW6lKpC1UsVmQ8lPW7pE67YWsf/wLsvaxrqyF6DYmWEu76WtkBV4oMlQr7qm0TK7nsXnaHAxcgj2JWfZA==", + "requires": { + "insomnia-cookies": "^0.0.19", + "xmldom": "^0.1.27", + "xpath": "0.0.27" + } + }, "internal-ip": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", @@ -6168,8 +6461,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-utf8": { "version": "0.2.1", @@ -6208,8 +6500,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -6219,8 +6510,7 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "iterall": { "version": "1.2.2", @@ -6317,8 +6607,17 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-ref-parser": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-6.1.0.tgz", + "integrity": "sha512-pXe9H1m6IgIpXmE5JSb8epilNTGsmTb2iPohAXpOdhqGFbQjNeHHsZxU+C8w6T81GZxSPFLeUoqDJmzxx5IGuw==", + "requires": { + "call-me-maybe": "^1.0.1", + "js-yaml": "^3.12.1", + "ono": "^4.0.11" + } }, "json-schema-traverse": { "version": "0.4.1", @@ -6328,8 +6627,7 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json3": { "version": "3.3.3", @@ -6391,6 +6689,16 @@ } } }, + "jsonschema": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.4.tgz", + "integrity": "sha512-lz1nOH69GbsVHeVgEdvyavc/33oymY1AZwtePMiMj4HZPMbP5OIKK3zT9INMWjwua/V4Z4yq7wSlBbSG+g4AEw==" + }, + "jsonschema-draft4": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/jsonschema-draft4/-/jsonschema-draft4-1.0.0.tgz", + "integrity": "sha1-8K8gBQVPDwrefqIRhhS2ncUS2GU=" + }, "jsonwebtoken": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-5.7.0.tgz", @@ -6412,7 +6720,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -6730,8 +7037,7 @@ "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, "lodash.isarguments": { "version": "3.1.0", @@ -6745,6 +7051,11 @@ "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", "dev": true }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" + }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -7148,7 +7459,6 @@ "version": "2.9.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "dev": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7157,8 +7467,7 @@ "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" } } }, @@ -7166,7 +7475,6 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "dev": true, "requires": { "minipass": "^2.9.0" } @@ -7524,7 +7832,6 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, "requires": { "abbrev": "1" } @@ -7620,8 +7927,7 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, "object-assign": { "version": "4.1.1", @@ -7719,7 +8025,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -7733,6 +8038,24 @@ "mimic-fn": "^1.0.0" } }, + "ono": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/ono/-/ono-4.0.11.tgz", + "integrity": "sha512-jQ31cORBFE6td25deYeD80wxKBMj+zBmHTrVxnc6CKhx8gho6ipmWM5zj/oeoqioZ99yqBls9Z/9Nss7J26G2g==", + "requires": { + "format-util": "^1.0.3" + } + }, + "openapi-schema-validation": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/openapi-schema-validation/-/openapi-schema-validation-0.4.2.tgz", + "integrity": "sha512-K8LqLpkUf2S04p2Nphq9L+3bGFh/kJypxIG2NVGKX0ffzT4NQI9HirhiY6Iurfej9lCu7y4Ndm4tv+lm86Ck7w==", + "requires": { + "jsonschema": "1.2.4", + "jsonschema-draft4": "^1.0.0", + "swagger-schema-official": "2.0.0-bab6bed" + } + }, "opn": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", @@ -8138,8 +8461,7 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picomatch": { "version": "2.0.7", @@ -8193,25 +8515,6 @@ } } }, - "plist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", - "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", - "dev": true, - "requires": { - "base64-js": "^1.2.3", - "xmlbuilder": "^9.0.7", - "xmldom": "0.1.x" - }, - "dependencies": { - "xmlbuilder": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", - "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", - "dev": true - } - } - }, "portfinder": { "version": "1.0.21", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.21.tgz", @@ -8518,8 +8821,7 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "querystring": { "version": "0.2.0", @@ -9004,7 +9306,6 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -9032,7 +9333,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -9042,14 +9342,12 @@ "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -9189,7 +9487,6 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -9485,6 +9782,11 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shell-quote": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", + "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==" + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -9892,7 +10194,6 @@ "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -10105,6 +10406,30 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" }, + "swagger-methods": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/swagger-methods/-/swagger-methods-1.0.8.tgz", + "integrity": "sha512-G6baCwuHA+C5jf4FNOrosE4XlmGsdjbOjdBK4yuiDDj/ro9uR4Srj3OR84oQMT8F3qKp00tYNv0YN730oTHPZA==" + }, + "swagger-parser": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-6.0.5.tgz", + "integrity": "sha512-UL47eu4+GRm5y+N7J+W6QQiqAJn2lojyqgMwS0EZgA55dXd5xmpQCsjUmH/Rf0eKDiG1kULc9VS515PxAyTDVw==", + "requires": { + "call-me-maybe": "^1.0.1", + "json-schema-ref-parser": "^6.0.3", + "ono": "^4.0.11", + "openapi-schema-validation": "^0.4.2", + "swagger-methods": "^1.0.8", + "swagger-schema-official": "2.0.0-bab6bed", + "z-schema": "^3.24.2" + } + }, + "swagger-schema-official": { + "version": "2.0.0-bab6bed", + "resolved": "https://registry.npmjs.org/swagger-schema-official/-/swagger-schema-official-2.0.0-bab6bed.tgz", + "integrity": "sha1-cAcEaNbSl3ylI3suUZyn0Gouo/0=" + }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -10125,7 +10450,6 @@ "version": "4.4.13", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "dev": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", @@ -10139,8 +10463,7 @@ "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" } } }, @@ -10441,7 +10764,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -10449,8 +10771,7 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "type-check": { "version": "0.3.2", @@ -10880,6 +11201,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "validator": { + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", + "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -10890,7 +11216,6 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -11988,7 +12313,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -12139,8 +12463,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "2.4.3", @@ -12159,12 +12482,6 @@ "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", "dev": true }, - "xmlbuilder": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", - "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=", - "dev": true - }, "xmlcreate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", @@ -12173,8 +12490,12 @@ "xmldom": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=", - "dev": true + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + }, + "xpath": { + "version": "0.0.27", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", + "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==" }, "xtend": { "version": "4.0.2", @@ -12252,6 +12573,18 @@ } } }, + "z-schema": { + "version": "3.25.1", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-3.25.1.tgz", + "integrity": "sha512-7tDlwhrBG+oYFdXNOjILSurpfQyuVgkRe3hB2q8TEssamDHB7BbLWYkYO98nTn0FibfdFroFKDjndbgufAgS/Q==", + "requires": { + "commander": "^2.7.1", + "core-js": "^2.5.7", + "lodash.get": "^4.0.0", + "lodash.isequal": "^4.0.0", + "validator": "^10.0.0" + } + }, "zip-stream": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz", diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index a3b1fb76bd..3f8a6be637 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -193,7 +193,6 @@ "css-loader": "^2.1.1", "electron": "^3.0.4", "electron-builder": "^21.2.0", - "electron-builder-lib": "^20.23.1", "electron-builder-squirrel-windows": "^21.2.0", "electron-notarize": "^0.1.1", "electron-rebuild": "^1.8.6", From 468fdd8cbac324cac207eb8d3082e4e9da310d50 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 14:17:11 -0700 Subject: [PATCH 057/100] Snapcraft install attempt 2 --- .github/actions/build-ubuntu16/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-ubuntu16/Dockerfile index e5eedadd7a..d0b68c7244 100644 --- a/.github/actions/build-ubuntu16/Dockerfile +++ b/.github/actions/build-ubuntu16/Dockerfile @@ -13,7 +13,7 @@ COPY entrypoint.sh /scripts/entrypoint.sh COPY install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* -RUN /scripts/install-dependencies.sh && apt-get install -y snapd +RUN /scripts/install-dependencies.sh && apt-get install -y snapd && snap install snapcraft --classic RUN snapcraft --version ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file From c33c7c03639239a190e86a610cbcbf5292218bab Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 16:28:04 -0700 Subject: [PATCH 058/100] Use snapcraft Docker image --- .github/actions/{build-ubuntu14 => build-linux}/Dockerfile | 0 .github/actions/{build-ubuntu14 => build-linux}/entrypoint.sh | 0 .../{build-ubuntu14 => build-linux}/install-dependencies.sh | 0 .github/actions/{build-ubuntu16 => build-snap}/Dockerfile | 4 ++-- .github/actions/{build-ubuntu16 => build-snap}/entrypoint.sh | 0 .../{build-ubuntu16 => build-snap}/install-dependencies.sh | 0 .github/workflows/main.yml | 4 ++-- 7 files changed, 4 insertions(+), 4 deletions(-) rename .github/actions/{build-ubuntu14 => build-linux}/Dockerfile (100%) rename .github/actions/{build-ubuntu14 => build-linux}/entrypoint.sh (100%) rename .github/actions/{build-ubuntu14 => build-linux}/install-dependencies.sh (100%) rename .github/actions/{build-ubuntu16 => build-snap}/Dockerfile (74%) rename .github/actions/{build-ubuntu16 => build-snap}/entrypoint.sh (100%) rename .github/actions/{build-ubuntu16 => build-snap}/install-dependencies.sh (100%) diff --git a/.github/actions/build-ubuntu14/Dockerfile b/.github/actions/build-linux/Dockerfile similarity index 100% rename from .github/actions/build-ubuntu14/Dockerfile rename to .github/actions/build-linux/Dockerfile diff --git a/.github/actions/build-ubuntu14/entrypoint.sh b/.github/actions/build-linux/entrypoint.sh similarity index 100% rename from .github/actions/build-ubuntu14/entrypoint.sh rename to .github/actions/build-linux/entrypoint.sh diff --git a/.github/actions/build-ubuntu14/install-dependencies.sh b/.github/actions/build-linux/install-dependencies.sh similarity index 100% rename from .github/actions/build-ubuntu14/install-dependencies.sh rename to .github/actions/build-linux/install-dependencies.sh diff --git a/.github/actions/build-ubuntu16/Dockerfile b/.github/actions/build-snap/Dockerfile similarity index 74% rename from .github/actions/build-ubuntu16/Dockerfile rename to .github/actions/build-snap/Dockerfile index d0b68c7244..6fe84268e9 100644 --- a/.github/actions/build-ubuntu16/Dockerfile +++ b/.github/actions/build-snap/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM snapcore/snapcraft:stable LABEL "name"="Insomnia-Ubuntu-16" LABEL "maintainer"="Gregory Schier " @@ -13,7 +13,7 @@ COPY entrypoint.sh /scripts/entrypoint.sh COPY install-dependencies.sh /scripts/install-dependencies.sh RUN chmod +x /scripts/* -RUN /scripts/install-dependencies.sh && apt-get install -y snapd && snap install snapcraft --classic +RUN /scripts/install-dependencies.sh RUN snapcraft --version ENTRYPOINT ["/scripts/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/build-ubuntu16/entrypoint.sh b/.github/actions/build-snap/entrypoint.sh similarity index 100% rename from .github/actions/build-ubuntu16/entrypoint.sh rename to .github/actions/build-snap/entrypoint.sh diff --git a/.github/actions/build-ubuntu16/install-dependencies.sh b/.github/actions/build-snap/install-dependencies.sh similarity index 100% rename from .github/actions/build-ubuntu16/install-dependencies.sh rename to .github/actions/build-snap/install-dependencies.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 304292bdad..a657070f9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,7 +64,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v1 - name: Run Docker - uses: ./.github/actions/build-ubuntu14 + uses: ./.github/actions/build-linux env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} @@ -77,7 +77,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v1 - name: Run Docker - uses: ./.github/actions/build-ubuntu16 + uses: ./.github/actions/build-snap env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} From 45aa1a563f4248238e24fe6c2c44b701dd29b848 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 10 Oct 2019 16:55:27 -0700 Subject: [PATCH 059/100] Disable snap publish --- packages/insomnia-app/.electronbuilder | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/insomnia-app/.electronbuilder b/packages/insomnia-app/.electronbuilder index 2d42ebfecb..adabfa9d1c 100644 --- a/packages/insomnia-app/.electronbuilder +++ b/packages/insomnia-app/.electronbuilder @@ -57,5 +57,8 @@ "snap", "rpm" ] + }, + "snap": { + "publish": false } } From 1b102e20c3198fd7724e228a6ca7ecd59ec59ccb Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 17 Oct 2019 14:30:22 -0400 Subject: [PATCH 060/100] Don't publish snapcraft during build --- docker-compose.yaml | 22 ------ package-lock.json | 92 +++++++++++++++++++------- packages/insomnia-app/.electronbuilder | 5 +- packages/insomnia-app/package.json | 2 +- 4 files changed, 69 insertions(+), 52 deletions(-) delete mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index eb57187c3f..0000000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' -services: - package_linux: - build: - context: '.' - dockerfile: './docker/Dockerfile.Ubuntu14' - environment: - - 'NODELIBCURL_BUILD_STATIC=yes' - - 'BUILD_TARGETS=AppImage,deb,tar.gz,rpm' - - 'KEEP_DIST_FOLDER=yes' - volumes: - - ./packages/insomnia-app/dist:/src/insomnia/packages/insomnia-app/dist - package_snap: - build: - context: '.' - dockerfile: './docker/Dockerfile.Ubuntu16' - environment: - - 'NODELIBCURL_BUILD_STATIC=yes' - - 'BUILD_TARGETS=snap' - - 'KEEP_DIST_FOLDER=yes' - volumes: - - ./packages/insomnia-app/dist:/src/insomnia/packages/insomnia-app/dist diff --git a/package-lock.json b/package-lock.json index 458662425e..dba4a79870 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,6 +74,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, + "optional": true, "requires": { "is-extendable": "^0.1.0" } @@ -111,7 +112,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -132,12 +134,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -152,17 +156,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -279,7 +286,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -291,6 +299,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -305,6 +314,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -312,12 +322,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -336,6 +348,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -416,7 +429,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -428,6 +442,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -513,7 +528,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -549,6 +565,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -568,6 +585,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -611,12 +629,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -647,7 +667,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "4.0.1", @@ -8988,7 +9009,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -9009,12 +9031,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9029,17 +9053,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -9156,7 +9183,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -9168,6 +9196,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9182,6 +9211,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -9189,12 +9219,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9213,6 +9245,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -9293,7 +9326,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -9305,6 +9339,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -9390,7 +9425,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -9426,6 +9462,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9445,6 +9482,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9488,12 +9526,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -15284,7 +15324,8 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true + "dev": true, + "optional": true }, "braces": { "version": "2.3.2", @@ -15547,7 +15588,8 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true + "dev": true, + "optional": true }, "micromatch": { "version": "3.1.10", diff --git a/packages/insomnia-app/.electronbuilder b/packages/insomnia-app/.electronbuilder index adabfa9d1c..ad9a99642b 100644 --- a/packages/insomnia-app/.electronbuilder +++ b/packages/insomnia-app/.electronbuilder @@ -1,6 +1,6 @@ { "appId": "__APP_ID__", - "publish": false, + "publish": "never", "afterSign": "./scripts/afterSignHook.js", "extraResources": [ { @@ -57,8 +57,5 @@ "snap", "rpm" ] - }, - "snap": { - "publish": false } } diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index 3f8a6be637..87b5991926 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -11,7 +11,7 @@ "synopsis": "A simple, beautiful, and free REST API client", "icon": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true", "theme": "default", - "version": "7.0.2-beta.1", + "version": "7.0.2", "main": "main.min.js", "plugins": [ "insomnia-plugin-base64", From 6d32a4875675724d113d738dabb7d0e54a4333e6 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 17 Oct 2019 14:51:55 -0400 Subject: [PATCH 061/100] Try publish: null --- packages/insomnia-app/.electronbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-app/.electronbuilder b/packages/insomnia-app/.electronbuilder index ad9a99642b..e7c4f30a88 100644 --- a/packages/insomnia-app/.electronbuilder +++ b/packages/insomnia-app/.electronbuilder @@ -1,6 +1,6 @@ { "appId": "__APP_ID__", - "publish": "never", + "publish": null, "afterSign": "./scripts/afterSignHook.js", "extraResources": [ { From 2991e871875aa4b51bf6d7d62980534b633d5812 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 17 Oct 2019 15:11:00 -0400 Subject: [PATCH 062/100] Hack publish parameter for snap --- packages/insomnia-app/scripts/package.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/insomnia-app/scripts/package.js b/packages/insomnia-app/scripts/package.js index ed9252e6f3..cf82c76658 100644 --- a/packages/insomnia-app/scripts/package.js +++ b/packages/insomnia-app/scripts/package.js @@ -57,6 +57,12 @@ async function pkg(relConfigPath) { ? process.env.BUILD_TARGETS.split(',') : config[targetPlatform].target; + // NOTE: This is likely a bug in electron-builder. Always tries to + // publish snap even when set to null. + if (target.length === 0 && target[0] === 'snap') { + config.publish = 'never'; + } + return electronBuilder.build({ config, [targetPlatform]: target, From b0e9edea9d18c1c31cd3c040a736a3519d07b542 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 17 Oct 2019 15:57:26 -0400 Subject: [PATCH 063/100] Add snapcraft login --- .github/actions/build-snap/entrypoint.sh | 4 ++++ packages/insomnia-app/scripts/package.js | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/actions/build-snap/entrypoint.sh b/.github/actions/build-snap/entrypoint.sh index bf2b8f4304..9470508f63 100644 --- a/.github/actions/build-snap/entrypoint.sh +++ b/.github/actions/build-snap/entrypoint.sh @@ -15,4 +15,8 @@ npm install --no-save 7zip-bin-linux app-builder-bin-linux echo "Running the stuff" npm test + +# Log into snapcraft for publishing +echo "$SNAPCRAFT_LOGIN_FILE" > snapcraft.txt && snapcraft login --with snapcraft.txt + npm run app-release \ No newline at end of file diff --git a/packages/insomnia-app/scripts/package.js b/packages/insomnia-app/scripts/package.js index cf82c76658..ed9252e6f3 100644 --- a/packages/insomnia-app/scripts/package.js +++ b/packages/insomnia-app/scripts/package.js @@ -57,12 +57,6 @@ async function pkg(relConfigPath) { ? process.env.BUILD_TARGETS.split(',') : config[targetPlatform].target; - // NOTE: This is likely a bug in electron-builder. Always tries to - // publish snap even when set to null. - if (target.length === 0 && target[0] === 'snap') { - config.publish = 'never'; - } - return electronBuilder.build({ config, [targetPlatform]: target, From 736e367d7b08028c6e344aeaa95b545ce4e3d8f9 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 17 Oct 2019 16:17:39 -0400 Subject: [PATCH 064/100] Fix GITHUB env check --- .github/actions/build-linux/entrypoint.sh | 2 +- .github/actions/build-snap/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-linux/entrypoint.sh b/.github/actions/build-linux/entrypoint.sh index bf2b8f4304..2802e0a5e8 100644 --- a/.github/actions/build-linux/entrypoint.sh +++ b/.github/actions/build-linux/entrypoint.sh @@ -3,7 +3,7 @@ # Fail on any errors set -e -if [[ -z "$GITHUB_WORKSPACE" ]]; then +if [ -z "$GITHUB_WORKSPACE" ]; then echo "Set the GITHUB_WORKSPACE env variable." exit 1 fi diff --git a/.github/actions/build-snap/entrypoint.sh b/.github/actions/build-snap/entrypoint.sh index 9470508f63..d247690309 100644 --- a/.github/actions/build-snap/entrypoint.sh +++ b/.github/actions/build-snap/entrypoint.sh @@ -3,7 +3,7 @@ # Fail on any errors set -e -if [[ -z "$GITHUB_WORKSPACE" ]]; then +if [ -z "$GITHUB_WORKSPACE" ]; then echo "Set the GITHUB_WORKSPACE env variable." exit 1 fi From d8d2398c8169b5bccafb4282b8dd0f76a341491f Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 17 Oct 2019 16:32:09 -0400 Subject: [PATCH 065/100] Add SNAPCRAFT_LOGIN_FILE secret --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a657070f9b..434a8fb859 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,5 +81,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REF: ${{ github.event.ref }} + SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }} BUILD_TARGETS: snap NODELIBCURL_BUILD_STATIC: yes From f554425d135e14edcc3ab92372b25c1bbda3d769 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 18 Oct 2019 10:48:39 -0400 Subject: [PATCH 066/100] Add travis back for macOS builds --- .github/workflows/main.yml | 2 +- .travis.yml | 36 ++++++++++++++++++++++++ packages/insomnia-app/package.json | 2 +- packages/insomnia-app/scripts/release.js | 2 +- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 434a8fb859..6eede8946b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: run: npm run app-release Mac: name: Mac - runs-on: macOS-latest + runs-on: macOS-10.14 steps: - name: Checkout branch uses: actions/checkout@v1 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..025df603ab --- /dev/null +++ b/.travis.yml @@ -0,0 +1,36 @@ +language: node_js + +matrix: + include: + - os: osx # High Sierra for older libcurl compatibility + osx_image: xcode9.4 + env: + - CSC_LINK=$MAC_CSC_LINK + - CSC_KEY_PASSWORD=$MAC_CSC_KEY_PASSWORD + before_deploy: + - npm run app-package + +cache: + directories: + - node_modules + - build/node_modules + - $HOME/.electron + - $HOME/.cache + +script: + - node --version + - npm --version + - npm run bootstrap + - npm test + +deploy: + provider: releases + api_key: $GITHUB_TOKEN + skip_cleanup: true + file_glob: true + prerelease: true + file: + - packages/insomnia-app/dist/**/*.zip + - packages/insomnia-app/dist/**/*.dmg + on: + tags: true diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index 87b5991926..462f6b770d 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -11,7 +11,7 @@ "synopsis": "A simple, beautiful, and free REST API client", "icon": "https://github.com/getinsomnia/insomnia/blob/master/packages/insomnia-app/app/icons/icon.ico?raw=true", "theme": "default", - "version": "7.0.2", + "version": "7.0.3", "main": "main.min.js", "plugins": [ "insomnia-plugin-base64", diff --git a/packages/insomnia-app/scripts/release.js b/packages/insomnia-app/scripts/release.js index b7d9878524..e291709639 100644 --- a/packages/insomnia-app/scripts/release.js +++ b/packages/insomnia-app/scripts/release.js @@ -89,7 +89,7 @@ async function getOrCreateRelease(tagName) { repo: REPO, tag_name: tagName, name: tagName, - body: `${packageJson.app.productName} ${tagName}`, + body: `Full changelog ⇒ https://insomnia.rest/changelog/${packageJson.app.version}`, draft: false, preRelease: true, }); From 2d03e9f170df550ef391644529aef9e5712247eb Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 18 Oct 2019 10:54:04 -0400 Subject: [PATCH 067/100] Remove Mac builds from GitHub Actions --- .github/workflows/main.yml | 47 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6eede8946b..3607463b44 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,29 +34,30 @@ jobs: CSC_LINK: ${{ secrets.WINDOWS_CSC_LINK }} CSC_KEY_PASSWORD: ${{ secrets.WINDOWS_CSC_KEY_PASSWORD }} run: npm run app-release - Mac: - name: Mac - runs-on: macOS-10.14 - steps: - - name: Checkout branch - uses: actions/checkout@v1 - - name: Install NodeJS - uses: actions/setup-node@v1 - with: - node-version: 10 - - name: Bootstrap packages - run: npm run bootstrap - - name: Run tests - run: npm test - - name: Release app - run: npm run app-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REF: ${{ github.event.ref }} - CSC_LINK: ${{ secrets.MAC_CSC_LINK }} - CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + # Disable for now in favor of TravisCI (this Mac version not old enough) + # Mac: + # name: Mac + # runs-on: macOS-10.14 + # steps: + # - name: Checkout branch + # uses: actions/checkout@v1 + # - name: Install NodeJS + # uses: actions/setup-node@v1 + # with: + # node-version: 10 + # - name: Bootstrap packages + # run: npm run bootstrap + # - name: Run tests + # run: npm test + # - name: Release app + # run: npm run app-release + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_REF: ${{ github.event.ref }} + # CSC_LINK: ${{ secrets.MAC_CSC_LINK }} + # CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} + # APPLE_ID: ${{ secrets.APPLE_ID }} + # APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} Ubuntu14: name: Linux (Generic) runs-on: ubuntu-16.04 From 8f4e57e936472fe635aaabc5a4482e459c8c5280 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 18 Oct 2019 11:08:59 -0400 Subject: [PATCH 068/100] Try newer macOS 10.13 on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 025df603ab..3c90bacb75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: node_js matrix: include: - os: osx # High Sierra for older libcurl compatibility - osx_image: xcode9.4 + osx_image: xcode10.1 env: - CSC_LINK=$MAC_CSC_LINK - CSC_KEY_PASSWORD=$MAC_CSC_KEY_PASSWORD From e1d3f153113cf8c4d4bf408bf1bdea07962476f0 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 30 Oct 2019 10:24:14 -0400 Subject: [PATCH 069/100] Better entities initialization --- .../app/ui/redux/modules/entities.js | 64 ++++++++++++++++++- .../app/ui/redux/modules/index.js | 34 ++-------- 2 files changed, 65 insertions(+), 33 deletions(-) diff --git a/packages/insomnia-app/app/ui/redux/modules/entities.js b/packages/insomnia-app/app/ui/redux/modules/entities.js index 4717600798..8886e002c6 100644 --- a/packages/insomnia-app/app/ui/redux/modules/entities.js +++ b/packages/insomnia-app/app/ui/redux/modules/entities.js @@ -1,15 +1,35 @@ +import clone from 'clone'; import * as db from '../../../common/database'; import * as models from '../../../models'; const ENTITY_CHANGES = 'entities/changes'; +const ENTITY_INITIALIZE = 'entities/initialize'; // ~~~~~~~~ // // Reducers // // ~~~~~~~~ // function getReducerName(type) { - const trailer = type.match(/s$/) ? '' : 's'; - return `${type.slice(0, 1).toLowerCase()}${type.slice(1)}${trailer}`; + let trailer = 's'; + let chop = 0; + + // Things already ending with 's' stay that way + if (type.match(/s$/)) { + trailer = ''; + chop = 0; + } + + // Things ending in 'y' convert to ies + if (type.match(/y$/)) { + trailer = 'ies'; + chop = 1; + } + + // Lowercase first letter (camel case) + const lowerFirstLetter = `${type.slice(0, 1).toLowerCase()}${type.slice(1)}`; + + // Add the trailer for pluralization + return `${lowerFirstLetter.slice(0, lowerFirstLetter.length - chop)}${trailer}`; } const initialState = {}; @@ -20,8 +40,16 @@ for (const type of models.types()) { export function reducer(state = initialState, action) { switch (action.type) { + case ENTITY_INITIALIZE: + const freshState = clone(initialState); + const { docs } = action; + for (const doc of docs) { + const referenceName = getReducerName(doc.type); + freshState[referenceName][doc._id] = doc; + } + return freshState; case ENTITY_CHANGES: - const newState = Object.assign({}, state); + const newState = clone(state); const { changes } = action; for (const [event, doc] of changes) { @@ -63,3 +91,33 @@ export function addChanges(changes) { export function addChangesSync(changes) { return { type: ENTITY_CHANGES, changes }; } + +export function initialize() { + return async dispatch => { + const docs = await allDocs(); + dispatch(initializeWith(docs)); + }; +} + +export function initializeWith(docs) { + return { type: ENTITY_INITIALIZE, docs }; +} + +export async function allDocs() { + // NOTE: This list should be from most to least specific (ie. parents above children) + return [ + ...(await models.settings.all()), + ...(await models.workspace.all()), + ...(await models.workspaceMeta.all()), + ...(await models.environment.all()), + ...(await models.cookieJar.all()), + ...(await models.requestGroup.all()), + ...(await models.requestGroupMeta.all()), + ...(await models.request.all()), + ...(await models.requestMeta.all()), + ...(await models.requestVersion.all()), + ...(await models.response.all()), + ...(await models.oAuth2Token.all()), + ...(await models.clientCertificate.all()), + ]; +} diff --git a/packages/insomnia-app/app/ui/redux/modules/index.js b/packages/insomnia-app/app/ui/redux/modules/index.js index df27604217..c93e1a2847 100644 --- a/packages/insomnia-app/app/ui/redux/modules/index.js +++ b/packages/insomnia-app/app/ui/redux/modules/index.js @@ -3,7 +3,6 @@ import * as entities from './entities'; import configureStore from '../create'; import * as global from './global'; import * as db from '../../../common/database'; -import * as models from '../../../models'; import { API_BASE_URL, getClientString } from '../../../common/constants'; import { isLoggedIn, onLoginLogout } from '../../../account/session'; import * as fetch from '../../../account/fetch'; @@ -12,14 +11,13 @@ export async function init() { const store = configureStore(); // Do things that must happen before initial render - const { addChanges, addChangesSync } = bindActionCreators(entities, store.dispatch); + const { addChanges, initializeWith: initEntities } = bindActionCreators(entities, store.dispatch); const { newCommand, loginStateChange } = bindActionCreators(global, store.dispatch); - const allDocs = await getAllDocs(); - // Link DB changes to entities reducer/actions - const changes = allDocs.map(doc => [db.CHANGE_UPDATE, doc]); - addChangesSync(changes); + const docs = await entities.allDocs(); + initEntities(docs); + db.onChange(addChanges); // Initialize login state @@ -41,27 +39,3 @@ export const reducer = combineReducers({ entities: entities.reducer, global: global.reducer, }); - -/** - * Async function to get all docs concurrently - */ -async function getAllDocs() { - // Restore docs in parent->child->grandchild order - const allDocs = [ - ...(await models.settings.all()), - ...(await models.workspace.all()), - ...(await models.workspaceMeta.all()), - ...(await models.environment.all()), - ...(await models.cookieJar.all()), - ...(await models.requestGroup.all()), - ...(await models.requestGroupMeta.all()), - ...(await models.request.all()), - ...(await models.requestMeta.all()), - ...(await models.requestVersion.all()), - ...(await models.response.all()), - ...(await models.oAuth2Token.all()), - ...(await models.clientCertificate.all()), - ]; - - return allDocs; -} From 8110caa4ff4a7cfc1b80d052c0fb36b2cca4ba1a Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 30 Oct 2019 10:24:32 -0400 Subject: [PATCH 070/100] Small tweak to build scripts --- .travis.yml | 15 +-------------- .../components/dropdowns/workspace-dropdown.js | 2 +- packages/insomnia-app/scripts/afterSignHook.js | 13 +++++++++++-- packages/insomnia-app/scripts/build.js | 5 +++++ packages/insomnia-app/scripts/release.js | 16 ++++++++-------- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c90bacb75..8efd07e05b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,6 @@ matrix: env: - CSC_LINK=$MAC_CSC_LINK - CSC_KEY_PASSWORD=$MAC_CSC_KEY_PASSWORD - before_deploy: - - npm run app-package cache: directories: @@ -22,15 +20,4 @@ script: - npm --version - npm run bootstrap - npm test - -deploy: - provider: releases - api_key: $GITHUB_TOKEN - skip_cleanup: true - file_glob: true - prerelease: true - file: - - packages/insomnia-app/dist/**/*.zip - - packages/insomnia-app/dist/**/*.dmg - on: - tags: true + - npm run app-release diff --git a/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js b/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js index 3169ea1dfa..7a0eadd246 100644 --- a/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js +++ b/packages/insomnia-app/app/ui/components/dropdowns/workspace-dropdown.js @@ -68,7 +68,7 @@ class WorkspaceDropdown extends React.PureComponent { for (const workspace of this.props.unseenWorkspaces) { const workspaceMeta = await models.workspaceMeta.getOrCreateByParentId(workspace._id); if (!workspaceMeta.hasSeen) { - models.workspaceMeta.update(workspaceMeta, { hasSeen: true }); + await models.workspaceMeta.update(workspaceMeta, { hasSeen: true }); } } } diff --git a/packages/insomnia-app/scripts/afterSignHook.js b/packages/insomnia-app/scripts/afterSignHook.js index b77e205ac7..957a2eaeb8 100644 --- a/packages/insomnia-app/scripts/afterSignHook.js +++ b/packages/insomnia-app/scripts/afterSignHook.js @@ -26,8 +26,17 @@ module.exports = async function(params) { appleIdPassword: process.env.APPLE_ID_PASSWORD, }; - const printCreds = `${process.env.APPLE_ID}:${process.env.APPLE_ID_PASSWORD.replace(/./g, '*')}`; - console.log(`[afterSign] Notarizing ${appName} (${appId}) with ${printCreds}`); + if (!process.env.APPLE_ID) { + console.log('[aftersign] APPLE_ID env variable not set. Skipping notarization'); + return; + } + + if (!process.env.APPLE_ID_PASSWORD) { + console.log('[aftersign] APPLE_ID env variable not set. Skipping notarization'); + return; + } + + console.log(`[afterSign] Notarizing ${appName} (${appId})`); try { await electronNotarize.notarize(args); diff --git a/packages/insomnia-app/scripts/build.js b/packages/insomnia-app/scripts/build.js index b6c0f7a85d..efe9a6890b 100644 --- a/packages/insomnia-app/scripts/build.js +++ b/packages/insomnia-app/scripts/build.js @@ -21,6 +21,11 @@ module.exports.start = async function() { console.log('[build] npm: ' + childProcess.spawnSync('npm', ['--version']).stdout); console.log('[build] node: ' + childProcess.spawnSync('node', ['--version']).stdout); + if (process.version.indexOf('v10.15') !== 0) { + console.log('[build] Node v10.15.x is required to build'); + process.exit(1); + } + // Remove folders first console.log('[build] Removing existing directories'); await emptyDir('../build'); diff --git a/packages/insomnia-app/scripts/release.js b/packages/insomnia-app/scripts/release.js index e291709639..61f5612995 100644 --- a/packages/insomnia-app/scripts/release.js +++ b/packages/insomnia-app/scripts/release.js @@ -11,8 +11,8 @@ const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN, }); -const OWNER = 'getinsomnia'; -const REPO = 'insomnia'; +const GITHUB_ORG = 'getinsomnia'; +const GITHUB_REPO = 'insomnia'; // Start package if ran from CLI if (require.main === module) { @@ -61,8 +61,8 @@ async function start() { url: 'https://uploads.github.com/repos/:owner/:repo/releases/:id/assets{?name,label}"', id: data.id, name: name, - owner: OWNER, - repo: REPO, + owner: GITHUB_ORG, + repo: GITHUB_REPO, headers: { 'Content-Type': 'application/octet-stream', }, @@ -76,8 +76,8 @@ async function start() { async function getOrCreateRelease(tagName) { try { return await octokit.repos.getReleaseByTag({ - owner: OWNER, - repo: REPO, + owner: GITHUB_ORG, + repo: GITHUB_REPO, tag: tagName, }); } catch (err) { @@ -85,8 +85,8 @@ async function getOrCreateRelease(tagName) { } return octokit.repos.createRelease({ - owner: OWNER, - repo: REPO, + owner: GITHUB_ORG, + repo: GITHUB_REPO, tag_name: tagName, name: tagName, body: `Full changelog ⇒ https://insomnia.rest/changelog/${packageJson.app.version}`, From b531dfbd9c1a68db509723014ac0fa177bacb6cf Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 30 Oct 2019 10:39:00 -0400 Subject: [PATCH 071/100] Fix package script env var reference --- .github/workflows/main.yml | 2 -- packages/insomnia-app/scripts/package.js | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3607463b44..c76c613f6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,8 +21,6 @@ jobs: run: npm config set python python2.7 - name: Set node config to set msvs_version to 2015 run: npm config set msvs_version 2015 - - name: Work around for Windows Server 2019 - run: set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin - name: Bootstrap packages run: npm run bootstrap - name: Run tests diff --git a/packages/insomnia-app/scripts/package.js b/packages/insomnia-app/scripts/package.js index ed9252e6f3..6b89da6b87 100644 --- a/packages/insomnia-app/scripts/package.js +++ b/packages/insomnia-app/scripts/package.js @@ -14,6 +14,14 @@ const PLATFORM_MAP = { // Start package if ran from CLI if (require.main === module) { process.nextTick(async () => { + // First check if we need to publish (uses Git tags) + const gitRefStr = process.env.GITHUB_REF || process.env.TRAVIS_TAG; + const skipPublish = !gitRefStr || !gitRefStr.match(/v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?$/); + if (skipPublish) { + console.log(`[package] Not packaging for ref=${gitRefStr}`); + process.exit(0); + } + try { await buildTask.start(); await module.exports.start(); From 76d11266a710ed2a86246acca374035ac771e079 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 30 Oct 2019 10:56:10 -0400 Subject: [PATCH 072/100] Put ref check in correct script --- packages/insomnia-app/scripts/package.js | 8 -------- packages/insomnia-app/scripts/release.js | 13 ++++++++----- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/insomnia-app/scripts/package.js b/packages/insomnia-app/scripts/package.js index 6b89da6b87..ed9252e6f3 100644 --- a/packages/insomnia-app/scripts/package.js +++ b/packages/insomnia-app/scripts/package.js @@ -14,14 +14,6 @@ const PLATFORM_MAP = { // Start package if ran from CLI if (require.main === module) { process.nextTick(async () => { - // First check if we need to publish (uses Git tags) - const gitRefStr = process.env.GITHUB_REF || process.env.TRAVIS_TAG; - const skipPublish = !gitRefStr || !gitRefStr.match(/v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?$/); - if (skipPublish) { - console.log(`[package] Not packaging for ref=${gitRefStr}`); - process.exit(0); - } - try { await buildTask.start(); await module.exports.start(); diff --git a/packages/insomnia-app/scripts/release.js b/packages/insomnia-app/scripts/release.js index 61f5612995..fe16ca4bcf 100644 --- a/packages/insomnia-app/scripts/release.js +++ b/packages/insomnia-app/scripts/release.js @@ -16,12 +16,15 @@ const GITHUB_REPO = 'insomnia'; // Start package if ran from CLI if (require.main === module) { - if (!process.env.GITHUB_REF.match(/v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?$/)) { - console.log(`[release] Not running release for ref ${process.env.GITHUB_REF}`); - process.exit(0); - } - process.nextTick(async () => { + // First check if we need to publish (uses Git tags) + const gitRefStr = process.env.GITHUB_REF || process.env.TRAVIS_TAG; + const skipPublish = !gitRefStr || !gitRefStr.match(/v\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?$/); + if (skipPublish) { + console.log(`[package] Not packaging for ref=${gitRefStr}`); + process.exit(0); + } + try { await buildTask.start(); await packageTask.start(); From db9925165a05e3e7f7cf120d20307f0ac14414e9 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 30 Oct 2019 10:58:16 -0400 Subject: [PATCH 073/100] Try update windows-build-tools --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c76c613f6a..e25f5594af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: with: node-version: 10 - name: Install node tools - run: npm install --global --production windows-build-tools@4.0.0 + run: npm install --global --production windows-build-tools - name: Install node-gyp run: npm install --global node-gyp@latest - name: Set node config to use python2.7 From 61b4c6e78dcb2bb95756382ce23dbd9a65f45b09 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 30 Oct 2019 12:30:34 -0400 Subject: [PATCH 074/100] Dropdown children now work with React.Fragment --- .../insomnia-app/app/ui/components/base/dropdown/dropdown.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js b/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js index 55aa5616ab..e5967028e0 100644 --- a/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js +++ b/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js @@ -224,7 +224,9 @@ class Dropdown extends PureComponent { continue; } - if (Array.isArray(child)) { + if (child.type === React.Fragment) { + newChildren = [...newChildren, ...this._getFlattenedChildren(child.props.children)]; + } else if (Array.isArray(child)) { newChildren = [...newChildren, ...this._getFlattenedChildren(child)]; } else { newChildren.push(child); From e8cefefa5796119bcaca2a321a417174986efc82 Mon Sep 17 00:00:00 2001 From: Elias Meire <8850410+eliasmeire@users.noreply.github.com> Date: Thu, 31 Oct 2019 16:42:42 +0100 Subject: [PATCH 075/100] [Feature] [cURL] Parse query parameters from url in importer (#1726) * feat(curl): parse parameters from url string * feat(curl): Remove trailing slash after import * feat(curl): Add exception for failing test * feat(curl): Parse params from url in curl importer --- .../app/ui/components/request-pane.js | 30 +++++++++---------- .../src/__tests__/fixtures.test.js | 2 +- .../__tests__/fixtures/curl/multi-output.json | 4 +-- .../fixtures/curl/question-mark-output.json | 6 ++-- .../fixtures/curl/simple-url-output.json | 4 +-- ...uished-input.sh => skip-squished-input.sh} | 0 .../fixtures/curl/urlencoded-output.json | 4 +-- .../insomnia-importers/src/importers/curl.js | 21 ++++++++++--- 8 files changed, 42 insertions(+), 29 deletions(-) rename packages/insomnia-importers/src/__tests__/fixtures/curl/{squished-input.sh => skip-squished-input.sh} (100%) diff --git a/packages/insomnia-app/app/ui/components/request-pane.js b/packages/insomnia-app/app/ui/components/request-pane.js index 04763bd81e..13c18ee2d1 100644 --- a/packages/insomnia-app/app/ui/components/request-pane.js +++ b/packages/insomnia-app/app/ui/components/request-pane.js @@ -9,28 +9,28 @@ import type { import type { Workspace } from '../../models/workspace'; import type { OAuth2Token } from '../../models/o-auth-2-token'; -import * as React from 'react'; import autobind from 'autobind-decorator'; -import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; -import ContentTypeDropdown from './dropdowns/content-type-dropdown'; -import AuthDropdown from './dropdowns/auth-dropdown'; -import KeyValueEditor from './key-value-editor/editor'; -import RequestHeadersEditor from './editors/request-headers-editor'; -import RenderedQueryString from './rendered-query-string'; -import BodyEditor from './editors/body/body-editor'; -import AuthWrapper from './editors/auth/auth-wrapper'; -import RequestUrlBar from './request-url-bar.js'; -import { getAuthTypeName, getContentTypeName } from '../../common/constants'; import { deconstructQueryStringToParams, extractQueryStringFromUrl } from 'insomnia-url'; +import * as React from 'react'; +import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; +import { getAuthTypeName, getContentTypeName } from '../../common/constants'; import * as db from '../../common/database'; +import { hotKeyRefs } from '../../common/hotkeys'; import * as models from '../../models'; +import AuthDropdown from './dropdowns/auth-dropdown'; +import ContentTypeDropdown from './dropdowns/content-type-dropdown'; +import AuthWrapper from './editors/auth/auth-wrapper'; +import BodyEditor from './editors/body/body-editor'; +import RequestHeadersEditor from './editors/request-headers-editor'; +import ErrorBoundary from './error-boundary'; import Hotkey from './hotkey'; +import KeyValueEditor from './key-value-editor/editor'; +import MarkdownPreview from './markdown-preview'; import { showModal } from './modals/index'; import RequestSettingsModal from './modals/request-settings-modal'; -import MarkdownPreview from './markdown-preview'; +import RenderedQueryString from './rendered-query-string'; +import RequestUrlBar from './request-url-bar.js'; import type { Settings } from '../../models/settings'; -import ErrorBoundary from './error-boundary'; -import { hotKeyRefs } from '../../common/hotkeys'; type Props = { // Functions @@ -136,7 +136,7 @@ class RequestPane extends React.PureComponent { } // Remove the search string (?foo=bar&...) from the Url - const url = request.url.replace(query, ''); + const url = request.url.replace(`?${query}`, ''); const parameters = [...request.parameters, ...deconstructQueryStringToParams(query)]; // Only update if url changed diff --git a/packages/insomnia-importers/src/__tests__/fixtures.test.js b/packages/insomnia-importers/src/__tests__/fixtures.test.js index 7225d565ef..e22b527ed9 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures.test.js +++ b/packages/insomnia-importers/src/__tests__/fixtures.test.js @@ -16,7 +16,7 @@ describe('Fixtures', () => { const prefix = input.replace(/-input\.[^.]+/, ''); const output = `${prefix}-output.json`; - if (!prefix.includes('simple')) { + if (prefix.startsWith('skip')) { continue; } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/curl/multi-output.json b/packages/insomnia-importers/src/__tests__/fixtures/curl/multi-output.json index 2d3876f86b..4a91392706 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures/curl/multi-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/curl/multi-output.json @@ -32,8 +32,8 @@ "_id": "__REQ_3__", "_type": "request", "parentId": "__WORKSPACE_ID__", - "url": "https://insomnia.rest/", - "name": "https://insomnia.rest/", + "url": "https://insomnia.rest", + "name": "https://insomnia.rest", "method": "GET", "body": {}, "parameters": [], diff --git a/packages/insomnia-importers/src/__tests__/fixtures/curl/question-mark-output.json b/packages/insomnia-importers/src/__tests__/fixtures/curl/question-mark-output.json index ceb0663e0a..814b28e3c4 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures/curl/question-mark-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/curl/question-mark-output.json @@ -8,14 +8,14 @@ "_id": "__REQ_1__", "_type": "request", "parentId": "__WORKSPACE_ID__", - "url": "http://192.168.1.1:9200/executions/_search?pretty", - "name": "http://192.168.1.1:9200/executions/_search?pretty", + "url": "http://192.168.1.1:9200/executions/_search", + "name": "http://192.168.1.1:9200/executions/_search", "method": "POST", "body": { "mimeType": "", "text": "{\"query\":{\"match_all\":{}}}" }, - "parameters": [], + "parameters": [{ "name": "pretty", "disabled": false, "value": "" }], "headers": [], "authentication": {} } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json b/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json index b5f7f2034c..64c60a5757 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/curl/simple-url-output.json @@ -8,8 +8,8 @@ "_id": "__REQ_1__", "_type": "request", "parentId": "__WORKSPACE_ID__", - "url": "https://www.google.com/", - "name": "https://www.google.com/", + "url": "https://www.google.com", + "name": "https://www.google.com", "method": "GET", "body": {}, "parameters": [], diff --git a/packages/insomnia-importers/src/__tests__/fixtures/curl/squished-input.sh b/packages/insomnia-importers/src/__tests__/fixtures/curl/skip-squished-input.sh similarity index 100% rename from packages/insomnia-importers/src/__tests__/fixtures/curl/squished-input.sh rename to packages/insomnia-importers/src/__tests__/fixtures/curl/skip-squished-input.sh diff --git a/packages/insomnia-importers/src/__tests__/fixtures/curl/urlencoded-output.json b/packages/insomnia-importers/src/__tests__/fixtures/curl/urlencoded-output.json index 12a72ef673..e41bd8fbb3 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures/curl/urlencoded-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/curl/urlencoded-output.json @@ -8,8 +8,8 @@ "_id": "__REQ_1__", "_type": "request", "parentId": "__WORKSPACE_ID__", - "url": "https://insomnia.rest/", - "name": "https://insomnia.rest/", + "url": "https://insomnia.rest", + "name": "https://insomnia.rest", "method": "POST", "body": { "mimeType": "application/x-www-form-urlencoded", diff --git a/packages/insomnia-importers/src/importers/curl.js b/packages/insomnia-importers/src/importers/curl.js index b90eb83745..38275ffdae 100755 --- a/packages/insomnia-importers/src/importers/curl.js +++ b/packages/insomnia-importers/src/importers/curl.js @@ -1,6 +1,7 @@ 'use strict'; const { parse } = require('shell-quote'); +const { URL } = require('url'); let requestCount = 1; @@ -128,8 +129,19 @@ function importArgs(args) { // Build the request // // ~~~~~~~~~~~~~~~~~ // - // Url - const url = getPairValue(pairs, singletons[0] || '', 'url'); + // Url & parameters + let parameters = []; + let url = ''; + + try { + const urlObject = new URL(getPairValue(pairs, singletons[0] || '', 'url')); + parameters = Array.from(urlObject.searchParams.entries()).map(([key, value]) => ({ + name: key, + value, + disabled: false, + })); + url = urlObject.href.replace(urlObject.search, '').replace(/\/$/, ''); + } catch (err) {} // Authentication const [username, password] = getPairValue(pairs, '', 'u', 'user').split(/:(.*)$/); @@ -191,13 +203,14 @@ function importArgs(args) { }); // Body - let parameters = []; let body = mimeType ? { mimeType: mimeType } : {}; if (textBody && bodyAsGET) { - parameters = textBody.split('&').map(v => { + const bodyParams = textBody.split('&').map(v => { const [name, value] = v.split('='); return { name: name || '', value: value || '' }; }); + + parameters.push(...bodyParams); } else if (textBody && mimeType === 'application/x-www-form-urlencoded') { body.params = textBody.split('&').map(v => { const [name, value] = v.split('='); From c88eb129b909af91cf9cccef0fea1a949f6dd783 Mon Sep 17 00:00:00 2001 From: Adam Lavin Date: Thu, 31 Oct 2019 15:58:58 +0000 Subject: [PATCH 076/100] Fetch new access tokens if refreshing token returns "invalid_grant" (#1729) --- .../app/network/o-auth-2/refresh-token.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/network/o-auth-2/refresh-token.js b/packages/insomnia-app/app/network/o-auth-2/refresh-token.js index 3d4136db2d..877d5b0209 100644 --- a/packages/insomnia-app/app/network/o-auth-2/refresh-token.js +++ b/packages/insomnia-app/app/network/o-auth-2/refresh-token.js @@ -48,6 +48,7 @@ export default async function( }); const statusCode = response.statusCode || 0; + const bodyBuffer = models.response.getBodyBuffer(response); if (statusCode === 401) { // If the refresh token was rejected due an unauthorized request, we will @@ -56,10 +57,21 @@ export default async function( return responseToObject(null, [c.P_ACCESS_TOKEN]); } else if (statusCode < 200 || statusCode >= 300) { + if (bodyBuffer && statusCode === 400) { + const response = responseToObject(bodyBuffer.toString(), [c.P_ERROR, c.P_ERROR_DESCRIPTION]); + + // If the refresh token was rejected due an oauth2 invalid_grant error, we will + // return a null access_token to trigger an authentication request to fetch + // brand new refresh and access tokens. + + if (response[c.P_ERROR] === 'invalid_grant') { + return responseToObject(null, [c.P_ACCESS_TOKEN]); + } + } + throw new Error(`[oauth2] Failed to refresh token url=${url} status=${statusCode}`); } - const bodyBuffer = models.response.getBodyBuffer(response); if (!bodyBuffer) { throw new Error(`[oauth2] No body returned from ${url}`); } From ad278ea01a9b8af3312753f3c90640959add5cc2 Mon Sep 17 00:00:00 2001 From: Nilay Majorwar Date: Thu, 31 Oct 2019 21:32:03 +0530 Subject: [PATCH 077/100] [Feature] Added request-specific followRedirects setting (#1737) * Added request-specific follow redirect setting * Added hint text to follow redirects setting --- .../app/common/__tests__/database.test.js | 2 +- packages/insomnia-app/app/common/render.js | 1 + .../app/models/__tests__/request.test.js | 3 ++ packages/insomnia-app/app/models/request.js | 2 ++ packages/insomnia-app/app/network/network.js | 15 +++++++++- .../context/__fixtures__/basic-import.json | 1 + .../plugins/context/__tests__/data.test.js | 3 ++ .../plugins/context/__tests__/request.test.js | 1 + .../app/plugins/context/request.js | 4 +++ .../modals/request-settings-modal.js | 30 +++++++++++++++++++ 10 files changed, 60 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/common/__tests__/database.test.js b/packages/insomnia-app/app/common/__tests__/database.test.js index 0a163a906b..43a2716824 100644 --- a/packages/insomnia-app/app/common/__tests__/database.test.js +++ b/packages/insomnia-app/app/common/__tests__/database.test.js @@ -100,7 +100,7 @@ describe('requestCreate()', () => { }; const r = await models.request.create(patch); - expect(Object.keys(r).length).toBe(20); + expect(Object.keys(r).length).toBe(21); expect(r._id).toMatch(/^req_[a-zA-Z0-9]{32}$/); expect(r.created).toBeGreaterThanOrEqual(now); diff --git a/packages/insomnia-app/app/common/render.js b/packages/insomnia-app/app/common/render.js index 4a02d424aa..ccfcbb616f 100644 --- a/packages/insomnia-app/app/common/render.js +++ b/packages/insomnia-app/app/common/render.js @@ -401,6 +401,7 @@ export async function getRenderedRequestAndContext( settingSendCookies: renderedRequest.settingSendCookies, settingStoreCookies: renderedRequest.settingStoreCookies, settingRebuildPath: renderedRequest.settingRebuildPath, + settingFollowRedirects: renderedRequest.settingFollowRedirects, type: renderedRequest.type, url: renderedRequest.url, }, diff --git a/packages/insomnia-app/app/models/__tests__/request.test.js b/packages/insomnia-app/app/models/__tests__/request.test.js index 628b7e859f..412ccebc28 100644 --- a/packages/insomnia-app/app/models/__tests__/request.test.js +++ b/packages/insomnia-app/app/models/__tests__/request.test.js @@ -21,6 +21,7 @@ describe('init()', () => { settingDisableRenderRequestBody: false, settingEncodeUrl: true, settingRebuildPath: true, + settingFollowRedirects: 'global', }); }); }); @@ -56,6 +57,7 @@ describe('create()', () => { settingDisableRenderRequestBody: false, settingEncodeUrl: true, settingRebuildPath: true, + settingFollowRedirects: 'global', }; expect(request).toEqual(expected); @@ -328,6 +330,7 @@ describe('migrate()', () => { settingDisableRenderRequestBody: false, settingEncodeUrl: true, settingRebuildPath: true, + settingFollowRedirects: 'global', }; const migrated = await models.initModel(models.request.type, original); diff --git a/packages/insomnia-app/app/models/request.js b/packages/insomnia-app/app/models/request.js index 259f9a72ff..63629cb7e2 100644 --- a/packages/insomnia-app/app/models/request.js +++ b/packages/insomnia-app/app/models/request.js @@ -85,6 +85,7 @@ type BaseRequest = { settingDisableRenderRequestBody: boolean, settingEncodeUrl: boolean, settingRebuildPath: boolean, + settingFollowRedirects: string, }; export type Request = BaseModel & BaseRequest; @@ -108,6 +109,7 @@ export function init(): BaseRequest { settingDisableRenderRequestBody: false, settingEncodeUrl: true, settingRebuildPath: true, + settingFollowRedirects: 'global', }; } diff --git a/packages/insomnia-app/app/network/network.js b/packages/insomnia-app/app/network/network.js index 613a738c23..0789e9b8ad 100644 --- a/packages/insomnia-app/app/network/network.js +++ b/packages/insomnia-app/app/network/network.js @@ -213,13 +213,26 @@ export async function _actuallySend( }; // Set all the basic options - setOpt(Curl.option.FOLLOWLOCATION, settings.followRedirects); setOpt(Curl.option.VERBOSE, true); // True so debug function works setOpt(Curl.option.NOPROGRESS, true); // True so curl doesn't print progress setOpt(Curl.option.ACCEPT_ENCODING, ''); // Auto decode everything enable(Curl.feature.NO_HEADER_PARSING); enable(Curl.feature.NO_DATA_PARSING); + // Set follow redirects setting + switch (renderedRequest.settingFollowRedirects) { + case 'off': + setOpt(Curl.option.FOLLOWLOCATION, false); + break; + case 'on': + setOpt(Curl.option.FOLLOWLOCATION, true); + break; + default: + // Set to global setting + setOpt(Curl.option.FOLLOWLOCATION, settings.followRedirects); + break; + } + // Set maximum amount of redirects allowed // NOTE: Setting this to -1 breaks some versions of libcurl if (settings.maxRedirects > 0) { diff --git a/packages/insomnia-app/app/plugins/context/__fixtures__/basic-import.json b/packages/insomnia-app/app/plugins/context/__fixtures__/basic-import.json index 834dae6a62..a7fbee1aa6 100644 --- a/packages/insomnia-app/app/plugins/context/__fixtures__/basic-import.json +++ b/packages/insomnia-app/app/plugins/context/__fixtures__/basic-import.json @@ -30,6 +30,7 @@ "settingEncodeUrl": true, "settingSendCookies": true, "settingStoreCookies": true, + "settingFollowRedirects": "global", "url": "https://insomnia.rest", "_type": "request" } diff --git a/packages/insomnia-app/app/plugins/context/__tests__/data.test.js b/packages/insomnia-app/app/plugins/context/__tests__/data.test.js index 8830511682..48038033c5 100644 --- a/packages/insomnia-app/app/plugins/context/__tests__/data.test.js +++ b/packages/insomnia-app/app/plugins/context/__tests__/data.test.js @@ -76,6 +76,7 @@ describe('app.import.*', () => { settingSendCookies: true, settingStoreCookies: true, settingRebuildPath: true, + settingFollowRedirects: 'global', type: 'Request', url: 'https://insomnia.rest', }, @@ -125,6 +126,7 @@ describe('app.import.*', () => { settingSendCookies: true, settingStoreCookies: true, settingRebuildPath: true, + settingFollowRedirects: 'global', type: 'Request', url: 'https://insomnia.rest', }, @@ -199,6 +201,7 @@ describe('app.export.*', () => { settingSendCookies: true, settingStoreCookies: true, settingRebuildPath: true, + settingFollowRedirects: 'global', url: 'https://insomnia.rest', }, ]), diff --git a/packages/insomnia-app/app/plugins/context/__tests__/request.test.js b/packages/insomnia-app/app/plugins/context/__tests__/request.test.js index 6596439505..59e3816ee6 100644 --- a/packages/insomnia-app/app/plugins/context/__tests__/request.test.js +++ b/packages/insomnia-app/app/plugins/context/__tests__/request.test.js @@ -52,6 +52,7 @@ describe('init()', () => { 'setUrl', 'settingDisableRenderRequestBody', 'settingEncodeUrl', + 'settingFollowRedirects', 'settingSendCookies', 'settingStoreCookies', ]); diff --git a/packages/insomnia-app/app/plugins/context/request.js b/packages/insomnia-app/app/plugins/context/request.js index ac9546a406..7f2ef86428 100644 --- a/packages/insomnia-app/app/plugins/context/request.js +++ b/packages/insomnia-app/app/plugins/context/request.js @@ -62,6 +62,9 @@ export function init( settingDisableRenderRequestBody(enabled: boolean) { renderedRequest.settingDisableRenderRequestBody = enabled; }, + settingFollowRedirects(enabled: string) { + renderedRequest.settingFollowRedirects = enabled; + }, getHeader(name: string): string | null { const headers = misc.filterHeaders(renderedRequest.headers, name); if (headers.length) { @@ -160,6 +163,7 @@ export function init( delete request.settingStoreCookies; delete request.settingEncodeUrl; delete request.settingDisableRenderRequestBody; + delete request.settingFollowRedirects; delete request.removeHeader; delete request.setHeader; delete request.addHeader; diff --git a/packages/insomnia-app/app/ui/components/modals/request-settings-modal.js b/packages/insomnia-app/app/ui/components/modals/request-settings-modal.js index aacdebc28f..78fe2ecc9c 100644 --- a/packages/insomnia-app/app/ui/components/modals/request-settings-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/request-settings-modal.js @@ -75,6 +75,20 @@ class RequestSettingsModal extends React.PureComponent { this.setState({ request }); } + async _updateRequestSettingString(e: SyntheticEvent) { + if (!this.state.request) { + // Should never happen + return; + } + + const value = e.currentTarget.value; + const setting = e.currentTarget.name; + const request = await models.request.update(this.state.request, { + [setting]: value, + }); + this.setState({ request }); + } + async _handleNameChange(name: string) { if (!this.state.request) { return; @@ -304,6 +318,22 @@ class RequestSettingsModal extends React.PureComponent { {this.renderCheckboxInput('settingRebuildPath')} + +
+
+ +

From 8387424261246e8991bfd9c20ce9424034eb7466 Mon Sep 17 00:00:00 2001 From: Jack Isherwood Date: Thu, 31 Oct 2019 09:39:11 -0700 Subject: [PATCH 078/100] Add libfontconfig-dev install for Linux dev setup (#1742) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3e3d10a912..0cdef0c9f1 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,15 @@ npm test npm run app-start ``` +If you are on Linux and have problems, you may need to install `libfontconfig-dev` + +```bash +# Install libfontconfig-dev +sudo apt-get install libfontconfig-dev +``` + If you are on Windows and have problems, you may need to install [Windows Build Tools](https://github.com/felixrieseberg/windows-build-tools) +
From 157ccac2f8064a588e93aa57bdb2a97070f1427f Mon Sep 17 00:00:00 2001 From: Nilay Majorwar Date: Thu, 31 Oct 2019 22:16:48 +0530 Subject: [PATCH 079/100] Added display support for X-Http-Method-Override (#1744) --- packages/insomnia-app/app/common/misc.js | 12 ++++++++- .../components/sidebar/sidebar-request-row.js | 14 +++++++++- .../app/ui/components/tags/method-tag.js | 26 ++++++++++++------- .../app/ui/css/components/tag.less | 7 +++++ 4 files changed, 48 insertions(+), 11 deletions(-) diff --git a/packages/insomnia-app/app/common/misc.js b/packages/insomnia-app/app/common/misc.js index 05a6061893..c912ddaadb 100644 --- a/packages/insomnia-app/app/common/misc.js +++ b/packages/insomnia-app/app/common/misc.js @@ -5,7 +5,7 @@ import fuzzysort from 'fuzzysort'; import uuid from 'uuid'; import zlib from 'zlib'; import { join as pathJoin } from 'path'; -import { DEBOUNCE_MILLIS } from './constants'; +import { METHOD_OPTIONS, METHOD_DELETE, DEBOUNCE_MILLIS } from './constants'; const ESCAPE_REGEX_MATCH = /[-[\]/{}()*+?.\\^$|]/g; @@ -117,6 +117,16 @@ export function removeVowels(str: string): string { return str.replace(/[aeiouyAEIOUY]/g, ''); } +export function formatMethodName(method: string): string { + let methodName = method; + if (method === METHOD_DELETE || method === METHOD_OPTIONS) { + methodName = method.slice(0, 3); + } else if (method.length > 4) { + methodName = removeVowels(method).slice(0, 4); + } + return methodName; +} + export function keyedDebounce(callback: Function, millis: number = DEBOUNCE_MILLIS): Function { let timeout; let results = {}; diff --git a/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js b/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js index 0f99a735f0..0fdcdc6c42 100644 --- a/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js +++ b/packages/insomnia-app/app/ui/components/sidebar/sidebar-request-row.js @@ -59,6 +59,15 @@ class SidebarRequestRow extends PureComponent { showModal(RequestSettingsModal, { request: this.props.request }); } + _getMethodOverrideHeaderValue() { + let header = this.props.request.headers.find( + h => h.name.toLowerCase() === 'x-http-method-override', + ); + if (!header || header.disabled) header = null; + else header = header.value; + return header; + } + setDragDirection(dragDirection) { if (dragDirection !== this.state.dragDirection) { this.setState({ dragDirection }); @@ -116,7 +125,10 @@ class SidebarRequestRow extends PureComponent { onClick={this._handleRequestActivate} onContextMenu={this._handleShowRequestActions}>
- + 4) { - methodName = util.removeVowels(method).slice(0, 4); - } + methodName = util.formatMethodName(method); + if (overrideName) overrideName = util.formatMethodName(override); } return ( -
- {methodName} +
+ {overrideName && ( +
+ {methodName} +
+ )} +
+ {overrideName ? overrideName : methodName} +
); } @@ -28,6 +35,7 @@ MethodTag.propTypes = { method: PropTypes.string.isRequired, // Optional + override: PropTypes.string, fullNames: PropTypes.bool, }; diff --git a/packages/insomnia-app/app/ui/css/components/tag.less b/packages/insomnia-app/app/ui/css/components/tag.less index 88bab97218..82145b7130 100644 --- a/packages/insomnia-app/app/ui/css/components/tag.less +++ b/packages/insomnia-app/app/ui/css/components/tag.less @@ -12,6 +12,13 @@ border: 1px solid rgba(0, 0, 0, 0.07); white-space: nowrap; + &.tag--superscript { + position: absolute; + font-size: 0.6em; + bottom: 0.9em; + left: -0.6em; + } + &:last-child { margin-right: 0; } From 9b804b282b223bae6cb26439ae92ee6d6592db36 Mon Sep 17 00:00:00 2001 From: Nilay Majorwar Date: Fri, 1 Nov 2019 19:32:53 +0530 Subject: [PATCH 080/100] Fix build failing (#1760) --- packages/insomnia-app/app/ui/components/tags/method-tag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/ui/components/tags/method-tag.js b/packages/insomnia-app/app/ui/components/tags/method-tag.js index fcbf80a5c4..6d97b3e3d2 100644 --- a/packages/insomnia-app/app/ui/components/tags/method-tag.js +++ b/packages/insomnia-app/app/ui/components/tags/method-tag.js @@ -24,7 +24,7 @@ class MethodTag extends PureComponent { )}
- {overrideName ? overrideName : methodName} + {overrideName || methodName}
); From 414e35ea112e4df3bf47b0f8f7bc3229330cd2bd Mon Sep 17 00:00:00 2001 From: Elias Meire <8850410+eliasmeire@users.noreply.github.com> Date: Fri, 1 Nov 2019 15:30:44 +0100 Subject: [PATCH 081/100] [Feature] [OpenAPI] Support OpenAPI 3 securitySchemes (#1725) * feat(openapi): Fix parseDocument return type * feat(openapi): Add support for apiKey and http security Add support for apiKey and http security in OpenAPI 3 parser * feat(openapi): Add env variables for OpenAPI security * feat(openapi): Restore fixture tests, add skip option for failing test * feat(openapi): Add/adapt test fixtures * feat(openapi): Improve Cookie formatting * Empty commit; trigger CI * feat(openapi): Add type basic to auth --- .../openapi3/dereferenced-output.json | 17 ++- .../dereferenced-with-tags-output.json | 17 ++- .../openapi3/endpoint-security-input.yaml | 64 ++++++++ .../openapi3/endpoint-security-output.json | 141 ++++++++++++++++++ .../openapi3/global-security-input.yaml | 42 ++++++ .../openapi3/global-security-output.json | 78 ++++++++++ .../fixtures/openapi3/petstore-output.json | 17 ++- .../openapi3/petstore-with-tags-output.json | 17 ++- .../src/importers/openapi3.js | 130 +++++++++++++++- 9 files changed, 509 insertions(+), 14 deletions(-) create mode 100644 packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-input.yaml create mode 100644 packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-output.json create mode 100644 packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-input.yaml create mode 100644 packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-output.json diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json index 06d655e606..8c6dabac44 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-output.json @@ -24,6 +24,7 @@ "_id": "env___BASE_ENVIRONMENT_ID___sub", "_type": "environment", "data": { + "apiKey": "apiKey", "base_path": "/v2", "host": "petstore.swagger.io", "scheme": "http" @@ -102,7 +103,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Find pet by ID", "parameters": [], @@ -160,7 +167,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Returns pet inventories by status", "parameters": [], diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json index 2d34d042b5..cb35525a9d 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/dereferenced-with-tags-output.json @@ -24,6 +24,7 @@ "_id": "env___BASE_ENVIRONMENT_ID___sub", "_type": "environment", "data": { + "apiKey": "apiKey", "base_path": "/v2", "host": "petstore.swagger.io", "scheme": "http" @@ -126,7 +127,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Find pet by ID", "parameters": [], @@ -184,7 +191,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Returns pet inventories by status", "parameters": [], diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-input.yaml b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-input.yaml new file mode 100644 index 0000000000..c12c81463f --- /dev/null +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-input.yaml @@ -0,0 +1,64 @@ +openapi: '3.0.2' +info: + title: Endpoint Security + version: '1.2' +servers: + - url: https://api.server.test/v1 + +components: + securitySchemes: + Basic: + type: http + scheme: basic + Key-Header: + type: apiKey + name: x-api_key + in: header + Key-Cookie: + type: apiKey + name: CookieName + in: cookie + Key-Query: + type: apiKey + name: key + in: query + +paths: + /basic: + get: + security: + - Basic: [] + responses: + '200': + description: OK + /key/header: + get: + security: + - Key-Header: [] + responses: + '200': + description: OK + /key/cookie: + get: + security: + - Key-Cookie: [] + responses: + '200': + description: OK + /key/query: + get: + security: + - Key-Query: [] + responses: + '200': + description: OK + /all: + get: + security: + - Basic: [] + - Key-Query: [] + - Key-Header: [] + - Key-Cookie: [] + responses: + '200': + description: OK diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-output.json new file mode 100644 index 0000000000..4839019209 --- /dev/null +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/endpoint-security-output.json @@ -0,0 +1,141 @@ +{ + "__export_date": "2019-10-12T17:07:14.568Z", + "__export_format": 4, + "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", + "resources": [ + { + "_id": "__WORKSPACE_ID__", + "_type": "workspace", + "description": "", + "name": "Endpoint Security 1.2", + "parentId": null + }, + { + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", + "data": { + "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" + }, + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" + }, + { + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", + "data": { + "apiKey": "apiKey", + "base_path": "/v1", + "host": "api.server.test", + "httpPassword": "password", + "httpUsername": "username", + "scheme": "https" + }, + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" + }, + { + "_id": "req___WORKSPACE_ID__4a563129", + "_type": "request", + "authentication": { + "password": "{{ httpPassword }}", + "type": "basic", + "username": "{{ httpUsername }}" + }, + "body": {}, + "headers": [], + "method": "GET", + "name": "/basic", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/basic" + }, + { + "_id": "req___WORKSPACE_ID__48bba8a5", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [ + { + "disabled": false, + "name": "x-api_key", + "value": "{{ apiKey }}" + } + ], + "method": "GET", + "name": "/key/header", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/key/header" + }, + { + "_id": "req___WORKSPACE_ID__2ea006cf", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [ + { + "disabled": false, + "name": "Cookie", + "value": "CookieName={{ apiKey }}" + } + ], + "method": "GET", + "name": "/key/cookie", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/key/cookie" + }, + { + "_id": "req___WORKSPACE_ID__0a8d5285", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "/key/query", + "parameters": [ + { + "disabled": false, + "name": "key", + "value": "{{ apiKey }}" + } + ], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/key/query" + }, + { + "_id": "req___WORKSPACE_ID__e285189c", + "_type": "request", + "authentication": { + "password": "{{ httpPassword }}", + "type": "basic", + "username": "{{ httpUsername }}" + }, + "body": {}, + "headers": [ + { + "disabled": false, + "name": "x-api_key", + "value": "{{ apiKey }}" + }, + { + "disabled": false, + "name": "Cookie", + "value": "CookieName={{ apiKey }}" + } + ], + "method": "GET", + "name": "/all", + "parameters": [ + { + "disabled": false, + "name": "key", + "value": "{{ apiKey }}" + } + ], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/all" + } + ] +} diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-input.yaml b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-input.yaml new file mode 100644 index 0000000000..d690f5b7b4 --- /dev/null +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-input.yaml @@ -0,0 +1,42 @@ +openapi: '3.0.2' +info: + title: Global Security + version: '1.2' +servers: + - url: https://api.server.test/v1 + +components: + securitySchemes: + Basic: + type: http + scheme: basic + Key-Header: + type: apiKey + name: x-api_key + in: header + Key-Cookie: + type: apiKey + name: CookieName + in: cookie + Key-Query: + type: apiKey + name: apiKeyHere + in: query + +security: + - Basic: [] + - Key-Header: [] + +paths: + /global: + get: + responses: + '200': + description: OK + /override: + get: + security: + - Key-Query: [] + responses: + '200': + description: OK diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-output.json new file mode 100644 index 0000000000..331325d76b --- /dev/null +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/global-security-output.json @@ -0,0 +1,78 @@ +{ + "__export_date": "2019-10-12T17:23:25.171Z", + "__export_format": 4, + "__export_source": "insomnia.importers:v0.1.0", + "_type": "export", + "resources": [ + { + "_id": "__WORKSPACE_ID__", + "_type": "workspace", + "description": "", + "name": "Global Security 1.2", + "parentId": null + }, + { + "_id": "__BASE_ENVIRONMENT_ID__", + "_type": "environment", + "data": { + "base_url": "{{ scheme }}://{{ host }}{{ base_path }}" + }, + "name": "Base environment", + "parentId": "__WORKSPACE_ID__" + }, + { + "_id": "env___BASE_ENVIRONMENT_ID___sub", + "_type": "environment", + "data": { + "apiKey": "apiKey", + "base_path": "/v1", + "host": "api.server.test", + "httpPassword": "password", + "httpUsername": "username", + "scheme": "https" + }, + "name": "OpenAPI env", + "parentId": "__BASE_ENVIRONMENT_ID__" + }, + { + "_id": "req___WORKSPACE_ID__21946b60", + "_type": "request", + "authentication": { + "password": "{{ httpPassword }}", + "type": "basic", + "username": "{{ httpUsername }}" + }, + "body": {}, + "headers": [ + { + "disabled": false, + "name": "x-api_key", + "value": "{{ apiKey }}" + } + ], + "method": "GET", + "name": "/global", + "parameters": [], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/global" + }, + { + "_id": "req___WORKSPACE_ID__b410454b", + "_type": "request", + "authentication": {}, + "body": {}, + "headers": [], + "method": "GET", + "name": "/override", + "parameters": [ + { + "disabled": false, + "name": "apiKeyHere", + "value": "{{ apiKey }}" + } + ], + "parentId": "__WORKSPACE_ID__", + "url": "{{ base_url }}/override" + } + ] +} diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json index 3464386785..e91dff9e27 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-output.json @@ -24,6 +24,7 @@ "_id": "env___BASE_ENVIRONMENT_ID___sub", "_type": "environment", "data": { + "apiKey": "apiKey", "base_path": "/v2", "host": "petstore.swagger.io", "scheme": "http" @@ -102,7 +103,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Find pet by ID", "parameters": [], @@ -160,7 +167,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Returns pet inventories by status", "parameters": [], diff --git a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json index 869c61dad6..8e7d6e549c 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/openapi3/petstore-with-tags-output.json @@ -24,6 +24,7 @@ "_id": "env___BASE_ENVIRONMENT_ID___sub", "_type": "environment", "data": { + "apiKey": "apiKey", "base_path": "/v2", "host": "petstore.swagger.io", "scheme": "http" @@ -126,7 +127,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Find pet by ID", "parameters": [], @@ -184,7 +191,13 @@ "_type": "request", "authentication": {}, "body": {}, - "headers": [], + "headers": [ + { + "disabled": false, + "name": "api_key", + "value": "{{ apiKey }}" + } + ], "method": "GET", "name": "Returns pet inventories by status", "parameters": [], diff --git a/packages/insomnia-importers/src/importers/openapi3.js b/packages/insomnia-importers/src/importers/openapi3.js index ad8d380276..ab2932577e 100644 --- a/packages/insomnia-importers/src/importers/openapi3.js +++ b/packages/insomnia-importers/src/importers/openapi3.js @@ -11,6 +11,13 @@ const MIMETYPE_JSON = 'application/json'; const MIMETYPE_LITERALLY_ANYTHING = '*/*'; const SUPPORTED_MIME_TYPES = [MIMETYPE_JSON, MIMETYPE_LITERALLY_ANYTHING]; const WORKSPACE_ID = '__WORKSPACE_ID__'; +const SECURITY_TYPE = { + HTTP: 'http', + API_KEY: 'apiKey', + OAUTH: 'oauth2', + OPEN_ID: 'openIdConnect', +}; +const SUPPORTED_SECURITY_TYPES = [SECURITY_TYPE.HTTP, SECURITY_TYPE.API_KEY]; let requestCounts = {}; @@ -55,6 +62,9 @@ module.exports.convert = async function(rawData) { const servers = api.servers.map(s => new URL(s.url)); const defaultServer = servers[0] || new URL('http://example.com/'); + const securityVariables = getSecurityEnvVariables( + api.components && api.components.securitySchemes, + ); const openapiEnv = { _type: 'environment', @@ -65,6 +75,7 @@ module.exports.convert = async function(rawData) { base_path: defaultServer.pathname || '', scheme: defaultServer.protocol.replace(/:$/, '') || ['http'], // note: `URL.protocol` returns with trailing `:` (i.e. "https:") host: defaultServer.host || '', + ...securityVariables, }, }; @@ -78,7 +89,7 @@ module.exports.convert = async function(rawData) { * * @param {string} rawData * - * @returns {Object|null} OpenAPI 3 object + * @returns {Promise} OpenAPI 3 object */ async function parseDocument(rawData) { try { @@ -96,6 +107,8 @@ async function parseDocument(rawData) { * @returns {Object[]} array of insomnia endpoints definitions */ function parseEndpoints(document) { + const rootSecurity = document.security; + const securitySchemes = document.components ? document.components.securitySchemes : {}; const defaultParent = WORKSPACE_ID; const paths = Object.keys(document.paths); @@ -131,7 +144,8 @@ function parseEndpoints(document) { for (const tag of tags) { const parentId = folderLookup[tag] || defaultParent; - requests.push(importRequest(endpointSchema, parentId)); + const resolvedSecurity = endpointSchema.security || rootSecurity; + requests.push(importRequest(endpointSchema, parentId, resolvedSecurity, securitySchemes)); } }); @@ -167,13 +181,20 @@ function importFolderItem(item, parentId) { * * @param {Object} endpointSchema - OpenAPI 3 endpoint schema * @param {string} parentId - id of parent category + * @param {Object} security - OpenAPI 3 security rules + * @param {Object} securitySchemes - OpenAPI 3 security schemes * @returns {Object} */ -function importRequest(endpointSchema, parentId) { +function importRequest(endpointSchema, parentId, security, securitySchemes) { const name = endpointSchema.summary || endpointSchema.path; const id = generateUniqueRequestId(endpointSchema); + const paramHeaders = prepareHeaders(endpointSchema); + const { authentication, headers: securityHeaders, parameters: securityParams } = parseSecurity( + security, + securitySchemes, + ); - return { + const request = { _type: 'request', _id: id, parentId: parentId, @@ -181,9 +202,12 @@ function importRequest(endpointSchema, parentId) { method: endpointSchema.method.toUpperCase(), url: '{{ base_url }}' + pathWithParamsAsVariables(endpointSchema.path), body: prepareBody(endpointSchema), - headers: prepareHeaders(endpointSchema), - parameters: prepareQueryParams(endpointSchema), + headers: [...paramHeaders, ...securityHeaders], + authentication, + parameters: [...prepareQueryParams(endpointSchema), ...securityParams], }; + + return request; } /** @@ -224,6 +248,100 @@ function prepareHeaders(endpointSchema) { return convertParameters(headerParameters); } +/** + * Parse OpenAPI 3 securitySchemes into insomnia definitions of authentication, headers and parameters + * + * @param {Object} security - OpenAPI 3 security rules + * @param {Object} securitySchemes - OpenAPI 3 security schemes + * @returns {Object} headers or basic http authentication details + */ +function parseSecurity(security, securitySchemes) { + if (!security || !securitySchemes) { + return { + authentication: {}, + headers: [], + parameters: [], + }; + } + + const supportedSchemes = security + .map(securityPolicy => { + const securityName = Object.keys(securityPolicy)[0]; + return securitySchemes[securityName]; + }) + .filter(schemeDetails => SUPPORTED_SECURITY_TYPES.includes(schemeDetails.type)); + + const apiKeySchemes = supportedSchemes.filter(scheme => scheme.type === SECURITY_TYPE.API_KEY); + const apiKeyHeaders = apiKeySchemes + .filter(scheme => scheme.in === 'header') + .map(scheme => { + return { + name: scheme.name, + disabled: false, + value: '{{ apiKey }}', + }; + }); + const apiKeyCookies = apiKeySchemes + .filter(scheme => scheme.in === 'cookie') + .map(scheme => `${scheme.name}={{ apiKey }}`); + const apiKeyCookieHeader = { name: 'Cookie', disabled: false, value: apiKeyCookies.join('; ') }; + const apiKeyParams = apiKeySchemes + .filter(scheme => scheme.in === 'query') + .map(scheme => { + return { + name: scheme.name, + disabled: false, + value: '{{ apiKey }}', + }; + }); + + if (apiKeyCookies.length > 0) { + apiKeyHeaders.push(apiKeyCookieHeader); + } + + const httpAuth = supportedSchemes.find( + scheme => scheme.type === SECURITY_TYPE.HTTP && scheme.scheme === 'basic', + ) + ? { type: 'basic', username: '{{ httpUsername }}', password: '{{ httpPassword }}' } + : {}; + + return { + authentication: httpAuth, + headers: apiKeyHeaders, + parameters: apiKeyParams, + }; +} + +/** + * Get Insomnia environment variables for OpenAPI securitySchemes + * + * @param {Object} securitySchemes - Open API security schemes + * @returns {Object} Insomnia environment variables containing security information + */ +function getSecurityEnvVariables(securitySchemes) { + if (!securitySchemes) { + return {}; + } + + const variables = {}; + const securitySchemesArray = Object.values(securitySchemes); + const hasApiKeyScheme = securitySchemesArray.some( + scheme => scheme.type === SECURITY_TYPE.API_KEY, + ); + const hasHttpScheme = securitySchemesArray.some(scheme => scheme.type === SECURITY_TYPE.HTTP); + + if (hasApiKeyScheme) { + variables.apiKey = 'apiKey'; + } + + if (hasHttpScheme) { + variables.httpUsername = 'username'; + variables.httpPassword = 'password'; + } + + return variables; +} + /** * Imports insomnia request body definitions, including data mock (if available) * From 0f13d4d0025f2ac09aa5c707725e178b5bf15b86 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 4 Nov 2019 20:10:14 -0500 Subject: [PATCH 082/100] Dropdown works with empty dividers --- .../app/ui/components/base/dropdown/dropdown.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js b/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js index e5967028e0..c52c6ab1f9 100644 --- a/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js +++ b/packages/insomnia-app/app/ui/components/base/dropdown/dropdown.js @@ -218,6 +218,9 @@ class Dropdown extends PureComponent { _getFlattenedChildren(children) { let newChildren = []; + // Ensure children is an array + children = Array.isArray(children) ? children : [children]; + for (const child of children) { if (!child) { // Ignore null components @@ -307,8 +310,7 @@ class Dropdown extends PureComponent { const dropdownButtons = []; const dropdownItems = []; - const listedChildren = Array.isArray(children) ? children : [children]; - const allChildren = this._getFlattenedChildren(listedChildren); + const allChildren = this._getFlattenedChildren(children); const visibleChildren = allChildren.filter((child, i) => { if (child.type.name !== DropdownItem.name) { From 49804432a5dc1729382a3ee848a615976b0f7dfb Mon Sep 17 00:00:00 2001 From: Nilay Majorwar Date: Fri, 8 Nov 2019 03:40:08 +0530 Subject: [PATCH 083/100] Added response history grouping by time (#1761) --- .../dropdowns/response-history-dropdown.js | 39 ++++++++++++++++++- packages/insomnia-app/flow-typed/moment.js | 2 + 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/dropdowns/response-history-dropdown.js b/packages/insomnia-app/app/ui/components/dropdowns/response-history-dropdown.js index cb5af70709..49692ba421 100644 --- a/packages/insomnia-app/app/ui/components/dropdowns/response-history-dropdown.js +++ b/packages/insomnia-app/app/ui/components/dropdowns/response-history-dropdown.js @@ -1,6 +1,7 @@ // @flow import * as React from 'react'; import autobind from 'autobind-decorator'; +import moment from 'moment'; import { Dropdown, DropdownButton, DropdownDivider, DropdownItem } from '../base/dropdown'; import StatusTag from '../tags/status-tag'; import URLTag from '../tags/url-tag'; @@ -82,6 +83,41 @@ class ResponseHistoryDropdown extends React.PureComponent { ); } + renderPastResponses(responses: Array) { + const now = moment(); + // Four arrays for four time groups + const categories = [[], [], [], []]; + responses.forEach(r => { + const resTime = moment(r.modified); + if (now.diff(resTime, 'minutes') < 5) { + // Five minutes ago + categories[0].push(r); + } else if (now.diff(resTime, 'hours') < 2) { + // Two hours ago + categories[1].push(r); + } else if (now.isSame(resTime, 'day')) { + // Today + categories[2].push(r); + } else if (now.isSame(resTime, 'week')) { + // This week + categories[3].push(r); + } + }); + + return ( + + 5 Minutes Ago + {categories[0].map(this.renderDropdownItem)} + 2 Hours Ago + {categories[1].map(this.renderDropdownItem)} + Today + {categories[2].map(this.renderDropdownItem)} + This Week + {categories[3].map(this.renderDropdownItem)} + + ); + } + render() { const { activeResponse, // eslint-disable-line no-unused-vars @@ -117,8 +153,7 @@ class ResponseHistoryDropdown extends React.PureComponent { Clear History - Past Responses - {responses.map(this.renderDropdownItem)} + {this.renderPastResponses(responses)} ); diff --git a/packages/insomnia-app/flow-typed/moment.js b/packages/insomnia-app/flow-typed/moment.js index fff57f7758..21b08df985 100644 --- a/packages/insomnia-app/flow-typed/moment.js +++ b/packages/insomnia-app/flow-typed/moment.js @@ -3,6 +3,8 @@ declare type moment = { fromNow: () => string, format: (fmt: string) => string, + diff: (date: any, fmt?: string, floating?: boolean) => number, + isSame: (date?: any, units?: ?string) => boolean, }; declare module 'moment' { From 3bd7a4120003ad7f56ec81284575e519bedb1f9a Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 15 Nov 2019 12:55:10 -0500 Subject: [PATCH 084/100] Fix type check on render (Fixes #1786) --- packages/insomnia-app/app/common/render.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-app/app/common/render.js b/packages/insomnia-app/app/common/render.js index ccfcbb616f..1788664ca8 100644 --- a/packages/insomnia-app/app/common/render.js +++ b/packages/insomnia-app/app/common/render.js @@ -70,7 +70,7 @@ export async function buildRenderContext( * A regular Object.assign would yield { base_url: '{{ base_url }}/foo' } and the * original base_url of google.com would be lost. */ - if (typeof renderContext[key] === 'string') { + if (typeof envObject[key] === 'string') { const isSelfRecursive = envObject[key].match(`{{ ?${key}[ |][^}]*}}`); if (isSelfRecursive) { From 62f3899e23d00c32948c97b32b92a43d11f24012 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 15 Nov 2019 15:16:00 -0500 Subject: [PATCH 085/100] Add regex JSONPath example to help dialog (Ref #1785) --- .../app/ui/components/modals/filter-help-modal.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/insomnia-app/app/ui/components/modals/filter-help-modal.js b/packages/insomnia-app/app/ui/components/modals/filter-help-modal.js index b9eb48626f..d3885f3eb3 100644 --- a/packages/insomnia-app/app/ui/components/modals/filter-help-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/filter-help-modal.js @@ -78,6 +78,17 @@ class FilterHelpModal extends PureComponent { Get the number of books in the store + + {isJson && ( + + + + $.store.books[?(@.title.match(/lord.*rings/i))] + + + Get book by title regular expression + + )} From 58eb3eaeb724d2b64a49d633933cdad9db9d5c13 Mon Sep 17 00:00:00 2001 From: kliques Date: Fri, 22 Nov 2019 17:46:54 +0200 Subject: [PATCH 086/100] feature: clipboard feature (#1776) - add import from clipboard --- package-lock.json | 92 +- .../ui/components/modals/settings-modal.js | 6 + .../ui/components/settings/import-export.js | 12 +- .../insomnia-app/app/ui/components/wrapper.js | 6 + .../insomnia-app/app/ui/containers/app.js | 1 + .../app/ui/redux/modules/global.js | 20 + packages/insomnia-app/package-lock.json | 822 ++---------------- packages/insomnia-cookies/package-lock.json | 2 +- packages/insomnia-importers/package-lock.json | 2 +- packages/insomnia-libcurl/package-lock.json | 2 +- packages/insomnia-xpath/package-lock.json | 29 +- .../package-lock.json | 2 +- .../package-lock.json | 2 +- plugins/insomnia-plugin-now/package-lock.json | 2 +- plugins/insomnia-plugin-os/package-lock.json | 2 +- .../package-lock.json | 49 +- .../insomnia-plugin-uuid/package-lock.json | 2 +- 17 files changed, 150 insertions(+), 903 deletions(-) diff --git a/package-lock.json b/package-lock.json index dba4a79870..458662425e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,7 +74,6 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, - "optional": true, "requires": { "is-extendable": "^0.1.0" } @@ -112,8 +111,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -134,14 +132,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -156,20 +152,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -286,8 +279,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -299,7 +291,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -314,7 +305,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -322,14 +312,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -348,7 +336,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -429,8 +416,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -442,7 +428,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -528,8 +513,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -565,7 +549,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -585,7 +568,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -629,14 +611,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -667,8 +647,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "4.0.1", @@ -9009,8 +8988,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -9031,14 +9009,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9053,20 +9029,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -9183,8 +9156,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -9196,7 +9168,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9211,7 +9182,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -9219,14 +9189,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9245,7 +9213,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -9326,8 +9293,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -9339,7 +9305,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -9425,8 +9390,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -9462,7 +9426,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9482,7 +9445,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9526,14 +9488,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -15324,8 +15284,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "optional": true + "dev": true }, "braces": { "version": "2.3.2", @@ -15588,8 +15547,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true, - "optional": true + "dev": true }, "micromatch": { "version": "3.1.10", diff --git a/packages/insomnia-app/app/ui/components/modals/settings-modal.js b/packages/insomnia-app/app/ui/components/modals/settings-modal.js index 80541131f8..26929791eb 100644 --- a/packages/insomnia-app/app/ui/components/modals/settings-modal.js +++ b/packages/insomnia-app/app/ui/components/modals/settings-modal.js @@ -53,6 +53,11 @@ class SettingsModal extends PureComponent { this.modal.hide(); } + _handleImportClipBoard() { + this.props.handleImportClipBoard(); + this.modal.hide(); + } + _handleImportUri(uri) { this.props.handleImportUri(uri); this.modal.hide(); @@ -134,6 +139,7 @@ class SettingsModal extends PureComponent { handleExportAll={this._handleExportAllToFile} handleShowExportRequestsModal={this._handleShowExportRequestsModal} handleImportFile={this._handleImportFile} + handleImportClipBoard={this._handleImportClipBoard} handleImportUri={this._handleImportUri} /> diff --git a/packages/insomnia-app/app/ui/components/settings/import-export.js b/packages/insomnia-app/app/ui/components/settings/import-export.js index d2cc2a1c18..d5c4060968 100644 --- a/packages/insomnia-app/app/ui/components/settings/import-export.js +++ b/packages/insomnia-app/app/ui/components/settings/import-export.js @@ -20,7 +20,12 @@ class ImportExport extends PureComponent { } render() { - const { handleImportFile, handleExportAll, handleShowExportRequestsModal } = this.props; + const { + handleImportFile, + handleImportClipBoard, + handleExportAll, + handleShowExportRequestsModal, + } = this.props; return (
@@ -64,6 +69,10 @@ class ImportExport extends PureComponent { From URL + + + From Clipboard +    @@ -78,6 +87,7 @@ class ImportExport extends PureComponent { ImportExport.propTypes = { handleImportFile: PropTypes.func.isRequired, + handleImportClipBoard: PropTypes.func.isRequired, handleImportUri: PropTypes.func.isRequired, handleExportAll: PropTypes.func.isRequired, handleShowExportRequestsModal: PropTypes.func.isRequired, diff --git a/packages/insomnia-app/app/ui/components/wrapper.js b/packages/insomnia-app/app/ui/components/wrapper.js index 5077be24f5..b88313143a 100644 --- a/packages/insomnia-app/app/ui/components/wrapper.js +++ b/packages/insomnia-app/app/ui/components/wrapper.js @@ -73,6 +73,7 @@ type Props = { handleSetSidebarFilter: Function, handleToggleMenuBar: Function, handleImportFileToWorkspace: Function, + handleImportClipBoardToWorkspace: Function, handleImportUriToWorkspace: Function, handleExportFile: Function, handleShowExportRequestsModal: Function, @@ -268,6 +269,10 @@ class Wrapper extends React.PureComponent { this.props.handleImportFileToWorkspace(this.props.activeWorkspace._id); } + _handleImportClipBoard(): void { + this.props.handleImportClipBoardToWorkspace(this.props.activeWorkspace._id); + } + _handleImportUri(uri: string): void { this.props.handleImportUriToWorkspace(this.props.activeWorkspace._id, uri); } @@ -638,6 +643,7 @@ class Wrapper extends React.PureComponent { handleShowExportRequestsModal={handleShowExportRequestsModal} handleExportAllToFile={handleExportFile} handleImportFile={this._handleImportFile} + handleImportClipBoard={this._handleImportClipBoard} handleImportUri={this._handleImportUri} handleToggleMenuBar={handleToggleMenuBar} settings={settings} diff --git a/packages/insomnia-app/app/ui/containers/app.js b/packages/insomnia-app/app/ui/containers/app.js index b160cfffc1..d730191b99 100644 --- a/packages/insomnia-app/app/ui/containers/app.js +++ b/packages/insomnia-app/app/ui/containers/app.js @@ -1269,6 +1269,7 @@ function mapDispatchToProps(dispatch) { handleSetActiveWorkspace: global.setActiveWorkspace, handleImportFileToWorkspace: global.importFile, + handleImportClipBoardToWorkspace: global.importClipBoard, handleImportUriToWorkspace: global.importUri, handleCommand: global.newCommand, handleExportFile: global.exportWorkspacesToFile, diff --git a/packages/insomnia-app/app/ui/redux/modules/global.js b/packages/insomnia-app/app/ui/redux/modules/global.js index 1645368e48..7ce9521f78 100644 --- a/packages/insomnia-app/app/ui/redux/modules/global.js +++ b/packages/insomnia-app/app/ui/redux/modules/global.js @@ -181,6 +181,26 @@ export function importFile(workspaceId) { }; } +export function importClipBoard(workspaceId) { + return async dispatch => { + dispatch(loadStart()); + const schema = electron.clipboard.readText(); + // Let's import all the paths! + let importedWorkspaces = []; + try { + const result = await importUtils.importRaw(askToImportIntoWorkspace(workspaceId), schema); + importedWorkspaces = [...importedWorkspaces, ...result.summary[models.workspace.type]]; + } catch (err) { + showModal(AlertModal, { title: 'Import Failed', message: err + '' }); + } finally { + dispatch(loadStop()); + } + if (importedWorkspaces.length === 1) { + dispatch(setActiveWorkspace(importedWorkspaces[0]._id)); + } + }; +} + export function importUri(workspaceId, uri) { return async dispatch => { dispatch(loadStart()); diff --git a/packages/insomnia-app/package-lock.json b/packages/insomnia-app/package-lock.json index b384581734..49d87bf601 100644 --- a/packages/insomnia-app/package-lock.json +++ b/packages/insomnia-app/package-lock.json @@ -656,7 +656,8 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, "accepts": { "version": "1.3.7", @@ -1014,6 +1015,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -1059,7 +1061,8 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "assign-symbols": { "version": "1.0.0", @@ -1088,7 +1091,8 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "atob": { "version": "2.1.2", @@ -1109,7 +1113,8 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.8.0", @@ -1210,6 +1215,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -1267,14 +1273,6 @@ } } }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "~2.0.0" - } - }, "bluebird": { "version": "3.5.5", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", @@ -1804,11 +1802,6 @@ } } }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" - }, "camelcase": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", @@ -1827,7 +1820,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "catharsis": { "version": "0.8.11", @@ -1881,7 +1875,8 @@ "chownr": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", - "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==" + "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", + "dev": true }, "chrome-trace-event": { "version": "1.0.2", @@ -2511,6 +2506,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -2908,6 +2904,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -3905,7 +3902,8 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "extend-shallow": { "version": "3.0.2", @@ -4000,7 +3998,8 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "fast-deep-equal": { "version": "2.0.1", @@ -4286,7 +4285,8 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "form-data": { "version": "1.0.1", @@ -4298,11 +4298,6 @@ "mime-types": "^2.1.11" } }, - "format-util": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/format-util/-/format-util-1.0.3.tgz", - "integrity": "sha1-Ay3KShFiYqEsQ/TD7IVmQWxbLZU=" - }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -4358,6 +4353,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, "requires": { "minipass": "^2.6.0" } @@ -4404,7 +4400,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "1.2.9", @@ -4868,17 +4865,6 @@ } } }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, "fuzzysort": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-1.1.4.tgz", @@ -4932,6 +4918,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -4940,6 +4927,7 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -5427,6 +5415,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -5555,6 +5544,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -5571,605 +5561,6 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, - "insomnia-cookies": { - "version": "0.0.19", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.19.tgz", - "integrity": "sha512-UXZtVwBEPdFHzhbLKh8FOIizDadC9yFrkqAxYxAm/m00opTafxadpXkWN+N59FN33tKofNEaUksByTzhy9MiRw==", - "requires": { - "tough-cookie": "^2.3.3" - } - }, - "insomnia-importers": { - "version": "2.0.22", - "resolved": "https://registry.npmjs.org/insomnia-importers/-/insomnia-importers-2.0.22.tgz", - "integrity": "sha512-xrrYG8HGctEuj1nbiRV6BznWtwrDcs95V8JtRNwYijnxIfMT90up8uNIX3NxJixt53MCN5lwb51FbDTHOQBofw==", - "requires": { - "commander": "^2.20.0", - "shell-quote": "^1.6.1", - "swagger-parser": "^6.0.5", - "yaml": "^1.5.0" - } - }, - "insomnia-libcurl": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/insomnia-libcurl/-/insomnia-libcurl-0.0.30.tgz", - "integrity": "sha512-9WpnPEaOxzMT1em/wb4eACMaxHx1w0Fy2zDgA5MH5dxlgFpbOyP8ewAzhWoTyfVaCvxY9g7pXT9fkuR4C/zAcQ==", - "requires": { - "fstream": "^1.0.12", - "insomnia-node-libcurl": "^2.0.0-alpha.0-1", - "tar": "^4.4.10" - } - }, - "insomnia-node-libcurl": { - "version": "2.0.0-alpha.0-1", - "resolved": "https://registry.npmjs.org/insomnia-node-libcurl/-/insomnia-node-libcurl-2.0.0-alpha.0-1.tgz", - "integrity": "sha512-V5uCKm6RDJprRw+XmvGdyvW1LCBlA/dTkIVaQped57/DKr4H/r7WmSRXTo6jiJrbcQd7H2cz9MQSuZHMDqwZgA==", - "requires": { - "debug": "3.1.0", - "fs-extra": "5.0.0", - "nan": "2.10.0", - "node-gyp": "3.8.0", - "node-pre-gyp": "0.11.0", - "npmlog": "4.1.2" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true - }, - "ini": { - "version": "1.3.5", - "bundled": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true - }, - "minipass": { - "version": "2.3.4", - "bundled": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.1", - "bundled": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" - }, - "needle": { - "version": "2.2.4", - "bundled": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" - } - }, - "node-pre-gyp": { - "version": "0.11.0", - "bundled": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - }, - "dependencies": { - "nopt": { - "version": "4.0.1", - "bundled": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "tar": { - "version": "4.4.6", - "bundled": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.3", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - } - } - }, - "npm-bundled": { - "version": "1.0.5", - "bundled": true - }, - "npm-packlist": { - "version": "1.1.12", - "bundled": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true - }, - "sax": { - "version": "1.2.4", - "bundled": true - }, - "semver": { - "version": "5.3.0", - "bundled": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true - }, - "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", - "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true - } - } - }, - "insomnia-plugin-base64": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/insomnia-plugin-base64/-/insomnia-plugin-base64-1.0.12.tgz", - "integrity": "sha512-XeZONK2AcB0t1G0uozNhziW2dvxsWGGjlcmC+XcVupjT3N9UAGTxFMDbGoZlRuP8BUoU6wNiRGFSJK6R8eZLJw==" - }, - "insomnia-plugin-cookie-jar": { - "version": "1.0.17", - "resolved": "https://registry.npmjs.org/insomnia-plugin-cookie-jar/-/insomnia-plugin-cookie-jar-1.0.17.tgz", - "integrity": "sha512-zrPZfeXdbx66/CRVgQXZ9oVBo1wCj8DC7wVGDU21y5JIzbXk139ildTLSGDcbX6/cRM2tIxulrSXbsSybWJMEg==", - "requires": { - "insomnia-cookies": "^0.0.5" - }, - "dependencies": { - "insomnia-cookies": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.5.tgz", - "integrity": "sha512-2VzgPwIZRuhX2+bope6tL9UkR7Urz9Y6+1I8W54du/UT4fZI7pTbKuXmoJL2kW6c998Ijg0aDBlMR7jSjYwfPQ==", - "requires": { - "tough-cookie": "^2.3.3" - } - } - } - }, - "insomnia-plugin-core-themes": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/insomnia-plugin-core-themes/-/insomnia-plugin-core-themes-1.0.11.tgz", - "integrity": "sha512-1trMGLoO5ue0NUFWppXJqdYLxS0enqhHfJuHEEmHFMzSAWkHouxLZxvwpq54f82Box38voayGt481IYkQe6M6g==" - }, - "insomnia-plugin-file": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/insomnia-plugin-file/-/insomnia-plugin-file-1.0.13.tgz", - "integrity": "sha512-ZuYkeJgeZAUldYG4vl6aFno2qY77Bm9xuLYif+ey6LhgAwjt8/PvNYKwukPB1+MiFiDeu3xR1dxWZGcBJItnJQ==" - }, - "insomnia-plugin-hash": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/insomnia-plugin-hash/-/insomnia-plugin-hash-1.0.13.tgz", - "integrity": "sha512-YkLsQaMZIkJzCCbcXXPRwhi9h4qc9zLkfVMcto09fekMtp+aKYs1LkNvybRqKSX3HvWNISe94wFFpUcNDTK9sg==" - }, - "insomnia-plugin-jsonpath": { - "version": "1.0.20", - "resolved": "https://registry.npmjs.org/insomnia-plugin-jsonpath/-/insomnia-plugin-jsonpath-1.0.20.tgz", - "integrity": "sha512-XGoII6nQjGeDTyQTUMPzucJ3aeVXoy2UQbDkIgyBrBWWw6MVdmDQK6jsOwPMDJw7vO/ptARrSYAQ0gra81YWyQ==", - "requires": { - "jsonpath": "^1.0.0" - } - }, - "insomnia-plugin-now": { - "version": "1.0.18", - "resolved": "https://registry.npmjs.org/insomnia-plugin-now/-/insomnia-plugin-now-1.0.18.tgz", - "integrity": "sha512-X3chGd5HVMeW1ixQYUvp27vW9HZ2ZszY4LNk5y1inbskVmxt7NUrTyZ7UyTHeNBSUu76JSZGuy2CZFvHnA5lkQ==", - "requires": { - "moment": "^2.21.0" - } - }, - "insomnia-plugin-prompt": { - "version": "1.1.17", - "resolved": "https://registry.npmjs.org/insomnia-plugin-prompt/-/insomnia-plugin-prompt-1.1.17.tgz", - "integrity": "sha512-L1TC9qXfCtqenZfI1kDHyMEQ+0g5bXvRBiesWZLf3yGcjJ10FJbSPharcuz+r44X2lULvGNIza9TlWYRPRL7RA==" - }, - "insomnia-plugin-request": { - "version": "1.0.26", - "resolved": "https://registry.npmjs.org/insomnia-plugin-request/-/insomnia-plugin-request-1.0.26.tgz", - "integrity": "sha512-s3JQ5+SsIpo6VMpCdJVcWsgtmivArQeNSsKfkFmwE0P3qUCaY6q0kL/3JdCMUVfDLSCphJzjq0OfWi6kJOGkhg==", - "requires": { - "insomnia-cookies": "^0.0.19", - "insomnia-url": "^0.1.12" - } - }, - "insomnia-plugin-response": { - "version": "1.0.26", - "resolved": "https://registry.npmjs.org/insomnia-plugin-response/-/insomnia-plugin-response-1.0.26.tgz", - "integrity": "sha512-I+Lurda8qQlDWCHN9n05k6gKrCLBpw5xmSFspAr7vwYadPuDiM+uZ2hXrh7zXhsYnavdBpRGUMZseYfzQCt4TQ==", - "requires": { - "iconv-lite": "^0.4.19", - "insomnia-xpath": "^1.0.16", - "jsonpath": "^1.0.2" - } - }, - "insomnia-plugin-uuid": { - "version": "1.0.17", - "resolved": "https://registry.npmjs.org/insomnia-plugin-uuid/-/insomnia-plugin-uuid-1.0.17.tgz", - "integrity": "sha512-mv4ZoaJA4DfqQ/2e/GejdscAC0O1wo5WI5v/jGLpnq7SzwPgbCBcQElVgvEdOWSNoKccWy7rvQHOyHC3sMgGWg==", - "requires": { - "uuid": "^3.1.0" - } - }, - "insomnia-prettify": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/insomnia-prettify/-/insomnia-prettify-0.1.13.tgz", - "integrity": "sha512-A4lIFsGNGbJCkk3RUnG6yNXC8Odw2HTgyKJ8DE6FEwbCJSXwyYiBJgRsmNtXt0BGrf5kZlrPj8Y1UkdVdVI0Sg==" - }, - "insomnia-url": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/insomnia-url/-/insomnia-url-0.1.12.tgz", - "integrity": "sha512-0gxi05DaAs40v1thNW7RwWGnueYjJ1vEYW4+zaoRvvYPrYIR/ZtOA6PDNYNDaPo9FWmXthcVk3cFB7nTlpIDVw==" - }, - "insomnia-xpath": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/insomnia-xpath/-/insomnia-xpath-1.0.16.tgz", - "integrity": "sha512-6YBGWOW6lKpC1UsVmQ8lPW7pE67YWsf/wLsvaxrqyF6DYmWEu76WtkBV4oMlQr7qm0TK7nsXnaHAxcgj2JWfZA==", - "requires": { - "insomnia-cookies": "^0.0.19", - "xmldom": "^0.1.27", - "xpath": "0.0.27" - } - }, "internal-ip": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", @@ -6461,7 +5852,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-utf8": { "version": "0.2.1", @@ -6500,7 +5892,8 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "isobject": { "version": "3.0.1", @@ -6510,7 +5903,8 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "iterall": { "version": "1.2.2", @@ -6607,17 +6001,8 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-ref-parser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-6.1.0.tgz", - "integrity": "sha512-pXe9H1m6IgIpXmE5JSb8epilNTGsmTb2iPohAXpOdhqGFbQjNeHHsZxU+C8w6T81GZxSPFLeUoqDJmzxx5IGuw==", - "requires": { - "call-me-maybe": "^1.0.1", - "js-yaml": "^3.12.1", - "ono": "^4.0.11" - } + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true }, "json-schema-traverse": { "version": "0.4.1", @@ -6627,7 +6012,8 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "json3": { "version": "3.3.3", @@ -6689,16 +6075,6 @@ } } }, - "jsonschema": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.4.tgz", - "integrity": "sha512-lz1nOH69GbsVHeVgEdvyavc/33oymY1AZwtePMiMj4HZPMbP5OIKK3zT9INMWjwua/V4Z4yq7wSlBbSG+g4AEw==" - }, - "jsonschema-draft4": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/jsonschema-draft4/-/jsonschema-draft4-1.0.0.tgz", - "integrity": "sha1-8K8gBQVPDwrefqIRhhS2ncUS2GU=" - }, "jsonwebtoken": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-5.7.0.tgz", @@ -6720,6 +6096,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -7037,7 +6414,8 @@ "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true }, "lodash.isarguments": { "version": "3.1.0", @@ -7051,11 +6429,6 @@ "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", "dev": true }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" - }, "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", @@ -7459,6 +6832,7 @@ "version": "2.9.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7467,7 +6841,8 @@ "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true } } }, @@ -7475,6 +6850,7 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, "requires": { "minipass": "^2.9.0" } @@ -7832,6 +7208,7 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, "requires": { "abbrev": "1" } @@ -7927,7 +7304,8 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.1.1", @@ -8025,6 +7403,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -8038,24 +7417,6 @@ "mimic-fn": "^1.0.0" } }, - "ono": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/ono/-/ono-4.0.11.tgz", - "integrity": "sha512-jQ31cORBFE6td25deYeD80wxKBMj+zBmHTrVxnc6CKhx8gho6ipmWM5zj/oeoqioZ99yqBls9Z/9Nss7J26G2g==", - "requires": { - "format-util": "^1.0.3" - } - }, - "openapi-schema-validation": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/openapi-schema-validation/-/openapi-schema-validation-0.4.2.tgz", - "integrity": "sha512-K8LqLpkUf2S04p2Nphq9L+3bGFh/kJypxIG2NVGKX0ffzT4NQI9HirhiY6Iurfej9lCu7y4Ndm4tv+lm86Ck7w==", - "requires": { - "jsonschema": "1.2.4", - "jsonschema-draft4": "^1.0.0", - "swagger-schema-official": "2.0.0-bab6bed" - } - }, "opn": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", @@ -8461,7 +7822,8 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "picomatch": { "version": "2.0.7", @@ -8821,7 +8183,8 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true }, "querystring": { "version": "0.2.0", @@ -9306,6 +8669,7 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -9333,6 +8697,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -9342,12 +8707,14 @@ "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -9487,6 +8854,7 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -9782,11 +9150,6 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "shell-quote": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", - "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==" - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -10194,6 +9557,7 @@ "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -10406,30 +9770,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" }, - "swagger-methods": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/swagger-methods/-/swagger-methods-1.0.8.tgz", - "integrity": "sha512-G6baCwuHA+C5jf4FNOrosE4XlmGsdjbOjdBK4yuiDDj/ro9uR4Srj3OR84oQMT8F3qKp00tYNv0YN730oTHPZA==" - }, - "swagger-parser": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-6.0.5.tgz", - "integrity": "sha512-UL47eu4+GRm5y+N7J+W6QQiqAJn2lojyqgMwS0EZgA55dXd5xmpQCsjUmH/Rf0eKDiG1kULc9VS515PxAyTDVw==", - "requires": { - "call-me-maybe": "^1.0.1", - "json-schema-ref-parser": "^6.0.3", - "ono": "^4.0.11", - "openapi-schema-validation": "^0.4.2", - "swagger-methods": "^1.0.8", - "swagger-schema-official": "2.0.0-bab6bed", - "z-schema": "^3.24.2" - } - }, - "swagger-schema-official": { - "version": "2.0.0-bab6bed", - "resolved": "https://registry.npmjs.org/swagger-schema-official/-/swagger-schema-official-2.0.0-bab6bed.tgz", - "integrity": "sha1-cAcEaNbSl3ylI3suUZyn0Gouo/0=" - }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -10450,6 +9790,7 @@ "version": "4.4.13", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", @@ -10463,7 +9804,8 @@ "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true } } }, @@ -10764,6 +10106,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -10771,7 +10114,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "type-check": { "version": "0.3.2", @@ -11201,11 +10545,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "validator": { - "version": "10.11.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", - "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==" - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -11216,6 +10555,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -12313,6 +11653,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "requires": { "isexe": "^2.0.0" } @@ -12463,7 +11804,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "write-file-atomic": { "version": "2.4.3", @@ -12487,16 +11829,6 @@ "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", "integrity": "sha512-MjGsXhKG8YjTKrDCXseFo3ClbMGvUD4en29H2Cev1dv4P/chlpw6KdYmlCWDkhosBVKRDjM836+3e3pm1cBNJA==" }, - "xmldom": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" - }, - "xpath": { - "version": "0.0.27", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", - "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==" - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -12573,18 +11905,6 @@ } } }, - "z-schema": { - "version": "3.25.1", - "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-3.25.1.tgz", - "integrity": "sha512-7tDlwhrBG+oYFdXNOjILSurpfQyuVgkRe3hB2q8TEssamDHB7BbLWYkYO98nTn0FibfdFroFKDjndbgufAgS/Q==", - "requires": { - "commander": "^2.7.1", - "core-js": "^2.5.7", - "lodash.get": "^4.0.0", - "lodash.isequal": "^4.0.0", - "validator": "^10.0.0" - } - }, "zip-stream": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz", diff --git a/packages/insomnia-cookies/package-lock.json b/packages/insomnia-cookies/package-lock.json index f76fa2f714..64905f257c 100644 --- a/packages/insomnia-cookies/package-lock.json +++ b/packages/insomnia-cookies/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-cookies", - "version": "0.0.18", + "version": "0.0.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-importers/package-lock.json b/packages/insomnia-importers/package-lock.json index d3daf827fb..e42d872712 100644 --- a/packages/insomnia-importers/package-lock.json +++ b/packages/insomnia-importers/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-importers", - "version": "2.0.21", + "version": "2.0.22", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-libcurl/package-lock.json b/packages/insomnia-libcurl/package-lock.json index 77f54b5efe..e45663dcee 100644 --- a/packages/insomnia-libcurl/package-lock.json +++ b/packages/insomnia-libcurl/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-libcurl", - "version": "0.0.29", + "version": "0.0.30", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/insomnia-xpath/package-lock.json b/packages/insomnia-xpath/package-lock.json index 05356baac1..fb7b53dff5 100644 --- a/packages/insomnia-xpath/package-lock.json +++ b/packages/insomnia-xpath/package-lock.json @@ -1,36 +1,9 @@ { "name": "insomnia-xpath", - "version": "1.0.15", + "version": "1.0.16", "lockfileVersion": 1, "requires": true, "dependencies": { - "insomnia-cookies": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.18.tgz", - "integrity": "sha512-NOjNaAdQooN4scL9iJTVUZaTLzWffHDnxgqEMLQH1OS0ANFpay+UQkOu5M2qoQybSKr87YwrrcKJdI7Gt6HivQ==", - "requires": { - "tough-cookie": "^2.3.3" - } - }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "xmldom": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", diff --git a/plugins/insomnia-plugin-cookie-jar/package-lock.json b/plugins/insomnia-plugin-cookie-jar/package-lock.json index 4fadfc74c7..f68dae6e3b 100644 --- a/plugins/insomnia-plugin-cookie-jar/package-lock.json +++ b/plugins/insomnia-plugin-cookie-jar/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-cookie-jar", - "version": "1.0.16", + "version": "1.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-jsonpath/package-lock.json b/plugins/insomnia-plugin-jsonpath/package-lock.json index 92755c4e6e..0fae59caf7 100644 --- a/plugins/insomnia-plugin-jsonpath/package-lock.json +++ b/plugins/insomnia-plugin-jsonpath/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-jsonpath", - "version": "1.0.19", + "version": "1.0.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-now/package-lock.json b/plugins/insomnia-plugin-now/package-lock.json index beaacaeb0a..4fbe55314b 100644 --- a/plugins/insomnia-plugin-now/package-lock.json +++ b/plugins/insomnia-plugin-now/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-now", - "version": "1.0.17", + "version": "1.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-os/package-lock.json b/plugins/insomnia-plugin-os/package-lock.json index 58b13b29d6..d7aa5f63d9 100644 --- a/plugins/insomnia-plugin-os/package-lock.json +++ b/plugins/insomnia-plugin-os/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-os", - "version": "1.0.19", + "version": "1.0.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/plugins/insomnia-plugin-response/package-lock.json b/plugins/insomnia-plugin-response/package-lock.json index 7868b7ac63..cb98b4143f 100644 --- a/plugins/insomnia-plugin-response/package-lock.json +++ b/plugins/insomnia-plugin-response/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-response", - "version": "1.0.25", + "version": "1.0.26", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -53,24 +53,6 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, - "insomnia-cookies": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/insomnia-cookies/-/insomnia-cookies-0.0.18.tgz", - "integrity": "sha512-NOjNaAdQooN4scL9iJTVUZaTLzWffHDnxgqEMLQH1OS0ANFpay+UQkOu5M2qoQybSKr87YwrrcKJdI7Gt6HivQ==", - "requires": { - "tough-cookie": "^2.3.3" - } - }, - "insomnia-xpath": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/insomnia-xpath/-/insomnia-xpath-1.0.15.tgz", - "integrity": "sha512-tqxw2vb2zVYXIZ9gkGPqTPQ/bU09Fb4ArMBEvxiQVlxEnFvXXmEP8Skm0kY2+ZiYfqHCVyEIXx/bM4XU5NEk8A==", - "requires": { - "insomnia-cookies": "^0.0.18", - "xmldom": "^0.1.27", - "xpath": "0.0.27" - } - }, "jsonpath": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.0.2.tgz", @@ -108,16 +90,6 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -132,15 +104,6 @@ "escodegen": "^1.8.1" } }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -158,16 +121,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" - }, - "xmldom": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" - }, - "xpath": { - "version": "0.0.27", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", - "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==" } } } diff --git a/plugins/insomnia-plugin-uuid/package-lock.json b/plugins/insomnia-plugin-uuid/package-lock.json index 9f0947ebbc..c9c3880244 100644 --- a/plugins/insomnia-plugin-uuid/package-lock.json +++ b/plugins/insomnia-plugin-uuid/package-lock.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-uuid", - "version": "1.0.16", + "version": "1.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { From 313de05a160943079ad07cdd111f03800dceeb88 Mon Sep 17 00:00:00 2001 From: Luca Dommes <22542231+pachisi456@users.noreply.github.com> Date: Fri, 22 Nov 2019 16:48:56 +0100 Subject: [PATCH 087/100] Make 'value' and 'header' lower case for consistency (#1790) --- .../app/ui/components/editors/request-headers-editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/editors/request-headers-editor.js b/packages/insomnia-app/app/ui/components/editors/request-headers-editor.js index 2033b955e2..063aaeead1 100644 --- a/packages/insomnia-app/app/ui/components/editors/request-headers-editor.js +++ b/packages/insomnia-app/app/ui/components/editors/request-headers-editor.js @@ -129,8 +129,8 @@ class RequestHeadersEditor extends React.PureComponent {
Date: Fri, 22 Nov 2019 10:57:33 -0500 Subject: [PATCH 088/100] OpenAPI spec check for empty properties on import --- .../insomnia-importers/src/importers/openapi3.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/insomnia-importers/src/importers/openapi3.js b/packages/insomnia-importers/src/importers/openapi3.js index ab2932577e..e0f6fcb579 100644 --- a/packages/insomnia-importers/src/importers/openapi3.js +++ b/packages/insomnia-importers/src/importers/openapi3.js @@ -132,7 +132,10 @@ function parseEndpoints(document) { return importFolderItem(tag, defaultParent); }); const folderLookup = {}; - folders.forEach(folder => (folderLookup[folder.name] = folder._id)); + + for (const folder of folders) { + folderLookup[folder.name] = folder._id; + } const requests = []; endpointsSchemas.map(endpointSchema => { @@ -427,9 +430,11 @@ function generateParameterExample(schema) { const example = {}; const { properties } = schema; - Object.keys(properties).forEach(propertyName => { - example[propertyName] = generateParameterExample(properties[propertyName]); - }); + if (properties) { + for (const propertyName of Object.keys(properties)) { + example[propertyName] = generateParameterExample(properties[propertyName]); + } + } return example; }, From 05c68ecdf60513c85656226f4edcfaeac9d96734 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 22 Nov 2019 10:58:00 -0500 Subject: [PATCH 089/100] Small tweak to setSelection in CodeEditor component --- .../insomnia-app/app/ui/components/codemirror/code-editor.js | 4 ++-- .../app/ui/components/codemirror/one-line-editor.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/codemirror/code-editor.js b/packages/insomnia-app/app/ui/components/codemirror/code-editor.js index b4ce3f0d98..c14b8c1ccb 100644 --- a/packages/insomnia-app/app/ui/components/codemirror/code-editor.js +++ b/packages/insomnia-app/app/ui/components/codemirror/code-editor.js @@ -152,9 +152,9 @@ class CodeEditor extends React.Component { } } - setSelection(chStart, chEnd, line = 0) { + setSelection(chStart, chEnd, lineStart, lineEnd) { if (this.codeMirror) { - this.codeMirror.setSelection({ line, ch: chStart }, { line, ch: chEnd }); + this.codeMirror.setSelection({ line: lineStart, ch: chStart }, { line: lineEnd, ch: chEnd }); } } diff --git a/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.js b/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.js index 72e4127c76..608f040482 100644 --- a/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.js +++ b/packages/insomnia-app/app/ui/components/codemirror/one-line-editor.js @@ -241,7 +241,7 @@ class OneLineEditor extends PureComponent { const check = () => { if (this._editor) { this._editor.focus(); - this._editor.setSelection(start, end); + this._editor.setSelection(start, end, 0, 0); } else { setTimeout(check, 40); } From 869dffbf362caa252fbebff9e83f062920f25ecc Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 22 Nov 2019 11:04:22 -0500 Subject: [PATCH 090/100] Upgrade electron-rebuild --- package-lock.json | 92 ++++++++++----- packages/insomnia-app/package-lock.json | 142 ++++++++++++++++-------- packages/insomnia-app/package.json | 2 +- 3 files changed, 166 insertions(+), 70 deletions(-) diff --git a/package-lock.json b/package-lock.json index 458662425e..dba4a79870 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,6 +74,7 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, + "optional": true, "requires": { "is-extendable": "^0.1.0" } @@ -111,7 +112,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -132,12 +134,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -152,17 +156,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -279,7 +286,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -291,6 +299,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -305,6 +314,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -312,12 +322,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -336,6 +348,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -416,7 +429,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -428,6 +442,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -513,7 +528,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -549,6 +565,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -568,6 +585,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -611,12 +629,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -647,7 +667,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "4.0.1", @@ -8988,7 +9009,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -9009,12 +9031,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9029,17 +9053,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -9156,7 +9183,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -9168,6 +9196,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9182,6 +9211,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -9189,12 +9219,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9213,6 +9245,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -9293,7 +9326,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -9305,6 +9339,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -9390,7 +9425,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -9426,6 +9462,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9445,6 +9482,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9488,12 +9526,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -15284,7 +15324,8 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true + "dev": true, + "optional": true }, "braces": { "version": "2.3.2", @@ -15547,7 +15588,8 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true + "dev": true, + "optional": true }, "micromatch": { "version": "3.1.10", diff --git a/packages/insomnia-app/package-lock.json b/packages/insomnia-app/package-lock.json index 49d87bf601..739d807037 100644 --- a/packages/insomnia-app/package-lock.json +++ b/packages/insomnia-app/package-lock.json @@ -3346,17 +3346,17 @@ } }, "electron-rebuild": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/electron-rebuild/-/electron-rebuild-1.8.6.tgz", - "integrity": "sha512-4BAPcNG0XP6stByqvFXggrjmf/C47P2L6HFFrWdR2ako1VLiTDIeZAOmU4WEBuWdaXYNqstleszVmcNHdRDojA==", + "version": "1.8.8", + "resolved": "https://registry.npmjs.org/electron-rebuild/-/electron-rebuild-1.8.8.tgz", + "integrity": "sha512-9a/VGbVpTJcuBaZa8yMcegqJ5flGPYDo363AxXDMxY4ZHPtFMLedGzQW9+720SIS1cvjX8B0zC+vMHO75ncOiA==", "dev": true, "requires": { "colors": "^1.3.3", "debug": "^4.1.1", "detect-libc": "^1.0.3", "fs-extra": "^7.0.1", - "node-abi": "^2.9.0", - "node-gyp": "^5.0.1", + "node-abi": "^2.11.0", + "node-gyp": "^6.0.1", "ora": "^3.4.0", "spawn-rx": "^3.0.0", "yargs": "^13.2.4" @@ -4420,7 +4420,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -4438,11 +4439,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4455,15 +4458,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4566,7 +4572,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4576,6 +4583,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4588,17 +4596,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4615,6 +4626,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4687,7 +4699,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4697,6 +4710,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4772,7 +4786,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4802,6 +4817,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4819,6 +4835,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4857,11 +4874,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -7052,9 +7071,9 @@ "dev": true }, "node-abi": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.11.0.tgz", - "integrity": "sha512-kuy/aEg75u40v378WRllQ4ZexaXJiCvB68D2scDXclp/I4cRq6togpbOoKhmN07tns9Zldu51NNERo0wehfX9g==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.12.0.tgz", + "integrity": "sha512-VhPBXCIcvmo/5K8HPmnWJyyhvgKxnHTUMXR/XwGHV68+wrgkzST4UmQrY/XszSWA5dtnXpNp528zkcyJ/pzVcw==", "dev": true, "requires": { "semver": "^5.4.1" @@ -7092,28 +7111,50 @@ "integrity": "sha512-vFMQIWt+J/7FLNyKouZ9TazT74PRV3wgv9UT4cRjC8BffxFbKXkgIWR42URCPSnHm/QDz6BOlb2Q0U4+VQT67Q==" }, "node-gyp": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.0.5.tgz", - "integrity": "sha512-WABl9s4/mqQdZneZHVWVG4TVr6QQJZUC6PAx47ITSk9lreZ1n+7Z9mMAIbA3vnO4J9W20P7LhCxtzfWsAD/KDw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-6.0.1.tgz", + "integrity": "sha512-udHG4hGe3Ji97AYJbJhaRwuSOuQO7KHnE4ZPH3Sox3tjRZ+bkBsDvfZ7eYA1qwD8eLWr//193x806ss3HFTPRw==", "dev": true, "requires": { - "env-paths": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.1.2", + "request": "^2.88.0", + "rimraf": "^2.6.3", + "semver": "^5.7.1", "tar": "^4.4.12", - "which": "1" + "which": "^1.3.1" }, "dependencies": { + "env-paths": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", + "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } @@ -7204,15 +7245,6 @@ } } }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -7531,6 +7563,12 @@ "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, "os-locale": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", @@ -7549,6 +7587,22 @@ "windows-release": "^3.1.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index 462f6b770d..afa7895c94 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -195,7 +195,7 @@ "electron-builder": "^21.2.0", "electron-builder-squirrel-windows": "^21.2.0", "electron-notarize": "^0.1.1", - "electron-rebuild": "^1.8.6", + "electron-rebuild": "^1.8.8", "fast-glob": "^3.1.0", "file-loader": "^3.0.1", "less": "^3.8.1", From f325aef9ffe748b2d05562782852e83b16056210 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 22 Nov 2019 11:05:46 -0500 Subject: [PATCH 091/100] Publish - insomnia-app@1.1.11 - insomnia-cookies@0.0.20 - insomnia-importers@2.0.23 - insomnia-libcurl@0.0.31 - insomnia-xpath@1.0.17 - insomnia-plugin-cookie-jar@1.0.18 - insomnia-plugin-jsonpath@1.0.21 - insomnia-plugin-now@1.0.19 - insomnia-plugin-os@1.0.21 - insomnia-plugin-request@1.0.27 - insomnia-plugin-response@1.0.27 - insomnia-plugin-uuid@1.0.18 --- packages/insomnia-app/package.json | 22 +++++++++---------- packages/insomnia-cookies/package.json | 2 +- packages/insomnia-importers/package.json | 2 +- packages/insomnia-libcurl/package.json | 2 +- packages/insomnia-xpath/package.json | 4 ++-- .../insomnia-plugin-cookie-jar/package.json | 2 +- plugins/insomnia-plugin-jsonpath/package.json | 2 +- plugins/insomnia-plugin-now/package.json | 2 +- plugins/insomnia-plugin-os/package.json | 2 +- plugins/insomnia-plugin-request/package.json | 4 ++-- plugins/insomnia-plugin-response/package.json | 4 ++-- plugins/insomnia-plugin-uuid/package.json | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/insomnia-app/package.json b/packages/insomnia-app/package.json index afa7895c94..3ed52867ac 100644 --- a/packages/insomnia-app/package.json +++ b/packages/insomnia-app/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "1.1.10", + "version": "1.1.11", "name": "insomnia-app", "app": { "name": "insomnia", @@ -135,23 +135,23 @@ "html-entities": "^1.2.0", "httpsnippet": "^1.19.1", "iconv-lite": "^0.4.15", - "insomnia-cookies": "^0.0.19", - "insomnia-importers": "^2.0.22", - "insomnia-libcurl": "^0.0.30", + "insomnia-cookies": "^0.0.20", + "insomnia-importers": "^2.0.23", + "insomnia-libcurl": "^0.0.31", "insomnia-plugin-base64": "^1.0.12", - "insomnia-plugin-cookie-jar": "^1.0.17", + "insomnia-plugin-cookie-jar": "^1.0.18", "insomnia-plugin-core-themes": "^1.0.11", "insomnia-plugin-file": "^1.0.13", "insomnia-plugin-hash": "^1.0.13", - "insomnia-plugin-jsonpath": "^1.0.20", - "insomnia-plugin-now": "^1.0.18", + "insomnia-plugin-jsonpath": "^1.0.21", + "insomnia-plugin-now": "^1.0.19", "insomnia-plugin-prompt": "^1.1.17", - "insomnia-plugin-request": "^1.0.26", - "insomnia-plugin-response": "^1.0.26", - "insomnia-plugin-uuid": "^1.0.17", + "insomnia-plugin-request": "^1.0.27", + "insomnia-plugin-response": "^1.0.27", + "insomnia-plugin-uuid": "^1.0.18", "insomnia-prettify": "^0.1.13", "insomnia-url": "^0.1.12", - "insomnia-xpath": "^1.0.16", + "insomnia-xpath": "^1.0.17", "json-order": "^1.0.9", "jsonlint": "^1.6.3", "jsonpath": "^1.0.2", diff --git a/packages/insomnia-cookies/package.json b/packages/insomnia-cookies/package.json index 8c268b6f6e..424272f809 100644 --- a/packages/insomnia-cookies/package.json +++ b/packages/insomnia-cookies/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-cookies", - "version": "0.0.19", + "version": "0.0.20", "author": "Gregory Schier ", "description": "Cookie utilities", "license": "MIT", diff --git a/packages/insomnia-importers/package.json b/packages/insomnia-importers/package.json index 07cf82d335..5b065cf5ef 100755 --- a/packages/insomnia-importers/package.json +++ b/packages/insomnia-importers/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-importers", - "version": "2.0.22", + "version": "2.0.23", "author": "Gregory Schier ", "description": "Various data importers for Insomnia", "license": "MIT", diff --git a/packages/insomnia-libcurl/package.json b/packages/insomnia-libcurl/package.json index e2d8114ac5..7eb5b93332 100644 --- a/packages/insomnia-libcurl/package.json +++ b/packages/insomnia-libcurl/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-libcurl", - "version": "0.0.30", + "version": "0.0.31", "author": "Gregory Schier ", "description": "Insomnia libcurl wrapper", "license": "MIT", diff --git a/packages/insomnia-xpath/package.json b/packages/insomnia-xpath/package.json index 82b1846191..7382a1f382 100644 --- a/packages/insomnia-xpath/package.json +++ b/packages/insomnia-xpath/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-xpath", - "version": "1.0.16", + "version": "1.0.17", "author": "Gregory Schier ", "description": "Query XML using XPath", "license": "MIT", @@ -9,7 +9,7 @@ "test": "jest --silent" }, "dependencies": { - "insomnia-cookies": "^0.0.19", + "insomnia-cookies": "^0.0.20", "xmldom": "^0.1.27", "xpath": "0.0.27" } diff --git a/plugins/insomnia-plugin-cookie-jar/package.json b/plugins/insomnia-plugin-cookie-jar/package.json index 0554f2fac1..486b6a6223 100644 --- a/plugins/insomnia-plugin-cookie-jar/package.json +++ b/plugins/insomnia-plugin-cookie-jar/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-cookie-jar", - "version": "1.0.17", + "version": "1.0.18", "author": "Preston Alvarado ", "description": "Insomnia cookie jar template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-jsonpath/package.json b/plugins/insomnia-plugin-jsonpath/package.json index ce121d5e80..74c3170aa7 100644 --- a/plugins/insomnia-plugin-jsonpath/package.json +++ b/plugins/insomnia-plugin-jsonpath/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-jsonpath", - "version": "1.0.20", + "version": "1.0.21", "author": "Gregory Schier ", "description": "Template tag to pull data from JSON strings", "license": "MIT", diff --git a/plugins/insomnia-plugin-now/package.json b/plugins/insomnia-plugin-now/package.json index a4304998f6..a4179de8ee 100644 --- a/plugins/insomnia-plugin-now/package.json +++ b/plugins/insomnia-plugin-now/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-now", - "version": "1.0.18", + "version": "1.0.19", "author": "Gregory Schier ", "description": "Insomnia now template tag", "license": "MIT", diff --git a/plugins/insomnia-plugin-os/package.json b/plugins/insomnia-plugin-os/package.json index 2c2b459d4c..7d00e7fef1 100644 --- a/plugins/insomnia-plugin-os/package.json +++ b/plugins/insomnia-plugin-os/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-os", - "version": "1.0.20", + "version": "1.0.21", "author": "Gregory Schier ", "description": "Template tag to get information about the OS", "license": "MIT", diff --git a/plugins/insomnia-plugin-request/package.json b/plugins/insomnia-plugin-request/package.json index 922f55da7b..c90b521e6e 100644 --- a/plugins/insomnia-plugin-request/package.json +++ b/plugins/insomnia-plugin-request/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-request", - "version": "1.0.26", + "version": "1.0.27", "author": "Gregory Schier ", "description": "Insomnia request template tag", "license": "MIT", @@ -16,7 +16,7 @@ "test": "jest --silent" }, "dependencies": { - "insomnia-cookies": "^0.0.19", + "insomnia-cookies": "^0.0.20", "insomnia-url": "^0.1.12" } } diff --git a/plugins/insomnia-plugin-response/package.json b/plugins/insomnia-plugin-response/package.json index 8759520b3f..645f95b98a 100644 --- a/plugins/insomnia-plugin-response/package.json +++ b/plugins/insomnia-plugin-response/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-response", - "version": "1.0.26", + "version": "1.0.27", "author": "Gregory Schier ", "description": "Insomnia response template tag", "license": "MIT", @@ -17,7 +17,7 @@ }, "dependencies": { "iconv-lite": "^0.4.19", - "insomnia-xpath": "^1.0.16", + "insomnia-xpath": "^1.0.17", "jsonpath": "^1.0.2" } } diff --git a/plugins/insomnia-plugin-uuid/package.json b/plugins/insomnia-plugin-uuid/package.json index e8c85770bf..97bede1c03 100644 --- a/plugins/insomnia-plugin-uuid/package.json +++ b/plugins/insomnia-plugin-uuid/package.json @@ -1,6 +1,6 @@ { "name": "insomnia-plugin-uuid", - "version": "1.0.17", + "version": "1.0.18", "author": "Gregory Schier ", "description": "Insomnia uuid template tag", "license": "MIT", From 0933337c1ebfd456abffca5c2380eb11db21f71c Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 22 Nov 2019 11:15:46 -0500 Subject: [PATCH 092/100] Bump versions --- packages/insomnia-cookies/package.json | 3 ++- packages/insomnia-importers/package.json | 3 ++- packages/insomnia-libcurl/package.json | 3 ++- packages/insomnia-xpath/package.json | 3 ++- plugins/insomnia-plugin-cookie-jar/package.json | 3 ++- plugins/insomnia-plugin-jsonpath/package.json | 3 ++- plugins/insomnia-plugin-now/package.json | 3 ++- plugins/insomnia-plugin-os/package.json | 3 ++- plugins/insomnia-plugin-request/package.json | 3 ++- plugins/insomnia-plugin-response/package.json | 3 ++- plugins/insomnia-plugin-uuid/package.json | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/insomnia-cookies/package.json b/packages/insomnia-cookies/package.json index 424272f809..0b11d6ccef 100644 --- a/packages/insomnia-cookies/package.json +++ b/packages/insomnia-cookies/package.json @@ -10,5 +10,6 @@ }, "dependencies": { "tough-cookie": "^2.3.3" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/packages/insomnia-importers/package.json b/packages/insomnia-importers/package.json index 5b065cf5ef..91b2a89036 100755 --- a/packages/insomnia-importers/package.json +++ b/packages/insomnia-importers/package.json @@ -20,5 +20,6 @@ "shell-quote": "^1.6.1", "swagger-parser": "^6.0.5", "yaml": "^1.5.0" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/packages/insomnia-libcurl/package.json b/packages/insomnia-libcurl/package.json index 7eb5b93332..03a4bfafb4 100644 --- a/packages/insomnia-libcurl/package.json +++ b/packages/insomnia-libcurl/package.json @@ -12,5 +12,6 @@ "fstream": "^1.0.12", "insomnia-node-libcurl": "^2.0.0-alpha.0-1", "tar": "^4.4.10" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/packages/insomnia-xpath/package.json b/packages/insomnia-xpath/package.json index 7382a1f382..9c71201699 100644 --- a/packages/insomnia-xpath/package.json +++ b/packages/insomnia-xpath/package.json @@ -12,5 +12,6 @@ "insomnia-cookies": "^0.0.20", "xmldom": "^0.1.27", "xpath": "0.0.27" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/plugins/insomnia-plugin-cookie-jar/package.json b/plugins/insomnia-plugin-cookie-jar/package.json index 486b6a6223..4f0adef013 100644 --- a/plugins/insomnia-plugin-cookie-jar/package.json +++ b/plugins/insomnia-plugin-cookie-jar/package.json @@ -17,5 +17,6 @@ }, "dependencies": { "insomnia-cookies": "^0.0.5" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/plugins/insomnia-plugin-jsonpath/package.json b/plugins/insomnia-plugin-jsonpath/package.json index 74c3170aa7..afb15120f6 100644 --- a/plugins/insomnia-plugin-jsonpath/package.json +++ b/plugins/insomnia-plugin-jsonpath/package.json @@ -15,5 +15,6 @@ }, "dependencies": { "jsonpath": "^1.0.0" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/plugins/insomnia-plugin-now/package.json b/plugins/insomnia-plugin-now/package.json index a4179de8ee..3e5c6af45e 100644 --- a/plugins/insomnia-plugin-now/package.json +++ b/plugins/insomnia-plugin-now/package.json @@ -17,5 +17,6 @@ }, "dependencies": { "moment": "^2.21.0" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/plugins/insomnia-plugin-os/package.json b/plugins/insomnia-plugin-os/package.json index 7d00e7fef1..d6ce198c07 100644 --- a/plugins/insomnia-plugin-os/package.json +++ b/plugins/insomnia-plugin-os/package.json @@ -15,5 +15,6 @@ }, "dependencies": { "jsonpath": "^1.0.0" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/plugins/insomnia-plugin-request/package.json b/plugins/insomnia-plugin-request/package.json index c90b521e6e..36b6f793dc 100644 --- a/plugins/insomnia-plugin-request/package.json +++ b/plugins/insomnia-plugin-request/package.json @@ -18,5 +18,6 @@ "dependencies": { "insomnia-cookies": "^0.0.20", "insomnia-url": "^0.1.12" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/plugins/insomnia-plugin-response/package.json b/plugins/insomnia-plugin-response/package.json index 645f95b98a..f2d45c2204 100644 --- a/plugins/insomnia-plugin-response/package.json +++ b/plugins/insomnia-plugin-response/package.json @@ -19,5 +19,6 @@ "iconv-lite": "^0.4.19", "insomnia-xpath": "^1.0.17", "jsonpath": "^1.0.2" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } diff --git a/plugins/insomnia-plugin-uuid/package.json b/plugins/insomnia-plugin-uuid/package.json index 97bede1c03..251261168f 100644 --- a/plugins/insomnia-plugin-uuid/package.json +++ b/plugins/insomnia-plugin-uuid/package.json @@ -17,5 +17,6 @@ }, "dependencies": { "uuid": "^3.1.0" - } + }, + "gitHead": "f325aef9ffe748b2d05562782852e83b16056210" } From ab990d7a4056cb9a880d829fcea34b7ef1ecffab Mon Sep 17 00:00:00 2001 From: Matthias Ramsauer Date: Fri, 22 Nov 2019 18:36:33 +0100 Subject: [PATCH 093/100] [Feature] [SwaggerV2] Body Parameter affect content-type header and implement formData type (#1722) * Body Parameter affect content-type header and implement formData type * Enable Tests and update swagger2 fixtures --- .../src/__tests__/fixtures.test.js | 1 + .../swagger2/dereferenced-output.json | 60 +++++++++++++-- .../dereferenced-with-tags-output.json | 60 +++++++++++++-- .../fixtures/swagger2/petstore-output.json | 60 +++++++++++++-- .../swagger2/petstore-with-tags-output.json | 60 +++++++++++++-- .../fixtures/swagger2/petstore-yml-input.yml | 42 ++++++++-- .../swagger2/petstore-yml-output.json | 46 +++++++++-- .../petstore-yml-with-tags-output.json | 12 +-- .../src/importers/swagger2.js | 77 +++++++++++++++---- 9 files changed, 358 insertions(+), 60 deletions(-) diff --git a/packages/insomnia-importers/src/__tests__/fixtures.test.js b/packages/insomnia-importers/src/__tests__/fixtures.test.js index e22b527ed9..1899c8fd49 100755 --- a/packages/insomnia-importers/src/__tests__/fixtures.test.js +++ b/packages/insomnia-importers/src/__tests__/fixtures.test.js @@ -21,6 +21,7 @@ describe('Fixtures', () => { } it(`Import ${name} ${input}`, async () => { + expect.assertions(5); expect(typeof input).toBe('string'); expect(typeof output).toBe('string'); diff --git a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-output.json b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-output.json index 9f8b525043..012d137926 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-output.json @@ -41,7 +41,13 @@ }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "addPet" @@ -56,7 +62,13 @@ }, "method": "PUT", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "updatePet" @@ -114,11 +126,29 @@ "name": "Updates a pet in the store with form data", "url": "{{ base_url }}/pet/{{ petId }}", "body": { - "mimeType": "application/x-www-form-urlencoded" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "disabled": true, + "name": "name", + "value": "string" + }, + { + "disabled": true, + "name": "status", + "value": "string" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/x-www-form-urlencoded" + } + ], "authentication": {}, "_type": "request", "_id": "updatePetWithForm" @@ -146,11 +176,29 @@ "name": "uploads an image", "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", "body": { - "mimeType": "multipart/form-data" + "mimeType": "multipart/form-data", + "params": [ + { + "disabled": true, + "name": "additionalMetadata", + "value": "string" + }, + { + "disabled": true, + "name": "file", + "type": "file" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "multipart/form-data" + } + ], "authentication": {}, "_type": "request", "_id": "uploadFile" diff --git a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-with-tags-output.json index 6ca90ca294..72d46b4f7a 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/dereferenced-with-tags-output.json @@ -65,7 +65,13 @@ }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "addPet" @@ -80,7 +86,13 @@ }, "method": "PUT", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "updatePet" @@ -138,11 +150,29 @@ "name": "Updates a pet in the store with form data", "url": "{{ base_url }}/pet/{{ petId }}", "body": { - "mimeType": "application/x-www-form-urlencoded" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "disabled": true, + "name": "name", + "value": "string" + }, + { + "disabled": true, + "name": "status", + "value": "string" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/x-www-form-urlencoded" + } + ], "authentication": {}, "_type": "request", "_id": "updatePetWithForm" @@ -170,11 +200,29 @@ "name": "uploads an image", "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", "body": { - "mimeType": "multipart/form-data" + "mimeType": "multipart/form-data", + "params": [ + { + "disabled": true, + "name": "additionalMetadata", + "value": "string" + }, + { + "disabled": true, + "name": "file", + "type": "file" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "multipart/form-data" + } + ], "authentication": {}, "_type": "request", "_id": "uploadFile" diff --git a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-output.json b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-output.json index 78bda25977..98c357bde9 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-output.json @@ -41,7 +41,13 @@ }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "addPet" @@ -56,7 +62,13 @@ }, "method": "PUT", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "updatePet" @@ -114,11 +126,29 @@ "name": "Updates a pet in the store with form data", "url": "{{ base_url }}/pet/{{ petId }}", "body": { - "mimeType": "application/x-www-form-urlencoded" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "disabled": true, + "name": "name", + "value": "string" + }, + { + "disabled": true, + "name": "status", + "value": "string" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/x-www-form-urlencoded" + } + ], "authentication": {}, "_type": "request", "_id": "updatePetWithForm" @@ -146,11 +176,29 @@ "name": "uploads an image", "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", "body": { - "mimeType": "multipart/form-data" + "mimeType": "multipart/form-data", + "params": [ + { + "disabled": true, + "name": "additionalMetadata", + "value": "string" + }, + { + "disabled": true, + "name": "file", + "type": "file" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "multipart/form-data" + } + ], "authentication": {}, "_type": "request", "_id": "uploadFile" diff --git a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-with-tags-output.json index c74e598e8a..d916b2513b 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-with-tags-output.json @@ -65,7 +65,13 @@ }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "addPet" @@ -80,7 +86,13 @@ }, "method": "PUT", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "updatePet" @@ -138,11 +150,29 @@ "name": "Updates a pet in the store with form data", "url": "{{ base_url }}/pet/{{ petId }}", "body": { - "mimeType": "application/x-www-form-urlencoded" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "disabled": true, + "name": "name", + "value": "string" + }, + { + "disabled": true, + "name": "status", + "value": "string" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "application/x-www-form-urlencoded" + } + ], "authentication": {}, "_type": "request", "_id": "updatePetWithForm" @@ -170,11 +200,29 @@ "name": "uploads an image", "url": "{{ base_url }}/pet/{{ petId }}/uploadImage", "body": { - "mimeType": "multipart/form-data" + "mimeType": "multipart/form-data", + "params": [ + { + "disabled": true, + "name": "additionalMetadata", + "value": "string" + }, + { + "disabled": true, + "name": "file", + "type": "file" + } + ] }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "name": "Content-Type", + "disabled": false, + "value": "multipart/form-data" + } + ], "authentication": {}, "_type": "request", "_id": "uploadFile" diff --git a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-input.yml b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-input.yml index ecd195aa60..11ca452359 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-input.yml +++ b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-input.yml @@ -1,4 +1,4 @@ -swagger: "2.0" +swagger: '2.0' info: version: 1.0.0 title: Swagger Petstore @@ -27,7 +27,7 @@ paths: type: integer format: int32 responses: - "200": + '200': description: A paged array of pets headers: x-next: @@ -44,8 +44,14 @@ paths: operationId: createPets tags: - pets + parameters: + - name: pet + in: body + required: true + schema: + $ref: '#/definitions/Pet' responses: - "201": + '201': description: Null response default: description: unexpected error @@ -64,7 +70,33 @@ paths: description: The id of the pet to retrieve type: string responses: - "200": + '200': + description: Expected response to a valid request + schema: + $ref: '#/definitions/Pets' + default: + description: unexpected error + schema: + $ref: '#/definitions/Error' + post: + summary: Update specific pet + operationId: updatePet + tags: + - pets + consumes: + - application/x-www-form-urlencoded + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + type: string + - name: name + in: formData + type: string + required: true + responses: + '200': description: Expected response to a valid request schema: $ref: '#/definitions/Pets' @@ -98,4 +130,4 @@ definitions: type: integer format: int32 message: - type: string \ No newline at end of file + type: string diff --git a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-output.json b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-output.json index a88e755856..22722ed150 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-output.json @@ -35,9 +35,7 @@ "parentId": "__WORKSPACE_ID__", "name": "List all pets", "url": "{{ base_url }}/pets", - "body": { - "mimeType": "application/json" - }, + "body": {}, "method": "GET", "parameters": [ { @@ -56,11 +54,18 @@ "name": "Create a pet", "url": "{{ base_url }}/pets", "body": { - "mimeType": "application/json" + "mimeType": "application/json", + "text": "{\n \"id\": 0,\n \"name\": \"string\",\n \"tag\": \"string\"\n}" }, "method": "POST", "parameters": [], - "headers": [], + "headers": [ + { + "disabled": false, + "name": "Content-Type", + "value": "application/json" + } + ], "authentication": {}, "_type": "request", "_id": "createPets" @@ -69,15 +74,40 @@ "parentId": "__WORKSPACE_ID__", "name": "Info for a specific pet", "url": "{{ base_url }}/pets/{{ petId }}", - "body": { - "mimeType": "application/json" - }, + "body": {}, "method": "GET", "parameters": [], "headers": [], "authentication": {}, "_type": "request", "_id": "showPetById" + }, + { + "parentId": "__WORKSPACE_ID__", + "name": "Update specific pet", + "url": "{{ base_url }}/pets/{{ petId }}", + "body": { + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "disabled": false, + "name": "name", + "value": "string" + } + ] + }, + "method": "POST", + "parameters": [], + "headers": [ + { + "disabled": false, + "name": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "authentication": {}, + "_type": "request", + "_id": "updatePet" } ] } diff --git a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-with-tags-output.json b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-with-tags-output.json index c8c10f4656..0df8ad80d0 100644 --- a/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-with-tags-output.json +++ b/packages/insomnia-importers/src/__tests__/fixtures/swagger2/petstore-yml-with-tags-output.json @@ -43,9 +43,7 @@ "parentId": "__GRP_1__", "name": "List all pets", "url": "{{ base_url }}/pets", - "body": { - "mimeType": "application/json" - }, + "body": {}, "method": "GET", "parameters": [ { @@ -63,9 +61,7 @@ "parentId": "__GRP_1__", "name": "Create a pet", "url": "{{ base_url }}/pets", - "body": { - "mimeType": "application/json" - }, + "body": {}, "method": "POST", "parameters": [], "headers": [], @@ -77,9 +73,7 @@ "parentId": "__GRP_1__", "name": "Info for a specific pet", "url": "{{ base_url }}/pets/{{ petId }}", - "body": { - "mimeType": "application/json" - }, + "body": {}, "method": "GET", "parameters": [], "headers": [], diff --git a/packages/insomnia-importers/src/importers/swagger2.js b/packages/insomnia-importers/src/importers/swagger2.js index 21663d8cc5..c9ae6b7c1b 100644 --- a/packages/insomnia-importers/src/importers/swagger2.js +++ b/packages/insomnia-importers/src/importers/swagger2.js @@ -3,7 +3,9 @@ const utils = require('../utils'); const SUPPORTED_SWAGGER_VERSION = '2.0'; const MIMETYPE_JSON = 'application/json'; -const SUPPORTED_MIME_TYPES = [MIMETYPE_JSON]; +const MIMETYPE_URLENCODED = 'application/x-www-form-urlencoded'; +const MIMETYPE_MULTIPART = 'multipart/form-data'; +const SUPPORTED_MIME_TYPES = [MIMETYPE_JSON, MIMETYPE_URLENCODED, MIMETYPE_MULTIPART]; const WORKSPACE_ID = '__WORKSPACE_ID__'; let requestCount = 1; @@ -122,7 +124,7 @@ function parseEndpoints(document) { ? `${endpointSchema.operationId}${index > 0 ? index : ''}` : `__REQUEST_${requestCount++}__`; let parentId = folderLookup[tag] || defaultParent; - requests.push(importRequest(endpointSchema, globalMimeTypes, id, parentId)); + requests.push(importRequest(document, endpointSchema, globalMimeTypes, id, parentId)); }); }); @@ -150,26 +152,36 @@ function importFolderItem(item, parentId) { /** * Return Insomnia request * - * + * @param {Object} schema - swagger 2.0 schema * @param {Object} endpointSchema - swagger 2.0 endpoint schema * @param {string[]} globalMimeTypes - list of mimeTypes available in document globally (i.e. document.consumes) * @param {string} id - id to be given to current request * @param {string} parentId - id of parent category * @returns {Object} */ -function importRequest(endpointSchema, globalMimeTypes, id, parentId) { +function importRequest(schema, endpointSchema, globalMimeTypes, id, parentId) { const name = endpointSchema.summary || `${endpointSchema.method} ${endpointSchema.path}`; - return { + const request = { _type: 'request', _id: id, parentId: parentId, name, method: endpointSchema.method.toUpperCase(), url: '{{ base_url }}' + pathWithParamsAsVariables(endpointSchema.path), - body: prepareBody(endpointSchema, globalMimeTypes), + body: prepareBody(schema, endpointSchema, globalMimeTypes), headers: prepareHeaders(endpointSchema), parameters: prepareQueryParams(endpointSchema), }; + if (request.body.mimeType && !request.headers.find(header => header.name === 'Content-Type')) { + request.headers = [ + { + name: 'Content-Type', + disabled: false, + value: request.body.mimeType, + }, + ].concat(request.headers); + } + return request; } /** @@ -210,39 +222,69 @@ function prepareHeaders(endpointSchema) { return convertParameters(headerParameters); } +function resolve$ref(schema, $ref) { + const parts = $ref.split('/'); + parts.shift(); // remove # + return parts.reduce((doc, path) => doc[path], schema); +} + /** * Imports insomnia request body definitions, including data mock (if available) * * If multiple types are available, the one for which an example can be generated will be selected first (i.e. application/json) * + * @param {Object} schema - swagger 2.0 schema * @param {Object} endpointSchema - swagger 2.0 endpoint schema * @param {string[]} globalMimeTypes - list of mimeTypes available in document globally (i.e. document.consumes) * * @return {Object} insomnia request's body definition */ -function prepareBody(endpointSchema, globalMimeTypes) { +function prepareBody(schema, endpointSchema, globalMimeTypes) { const mimeTypes = endpointSchema.consumes || globalMimeTypes || []; const isAvailable = m => mimeTypes.includes(m); const supportedMimeType = SUPPORTED_MIME_TYPES.find(isAvailable); - if (supportedMimeType === MIMETYPE_JSON) { const isSendInBody = p => p.in === 'body'; const parameters = endpointSchema.parameters || []; const bodyParameter = parameters.find(isSendInBody); if (!bodyParameter) { - return { - mimeType: supportedMimeType, - }; + return {}; + } + + const type = bodyParameter.type || 'object'; + const example = generateParameterExample(type); + let text; + if (type === 'object') { + if (bodyParameter.schema.$ref) { + const definition = resolve$ref(schema, bodyParameter.schema.$ref); + text = JSON.stringify(example(definition), null, 2); + } else { + text = JSON.stringify(example(bodyParameter.schema), null, 2); + } + } else { + text = JSON.stringify(example, null, 2); } - const example = bodyParameter ? generateParameterExample(bodyParameter.schema) : undefined; - const text = JSON.stringify(example, null, 2); return { mimeType: supportedMimeType, text, }; } + if (supportedMimeType === MIMETYPE_URLENCODED || supportedMimeType === MIMETYPE_MULTIPART) { + const isSendInFormData = p => p.in === 'formData'; + const parameters = endpointSchema.parameters || []; + const formDataParameters = parameters.filter(isSendInFormData); + + if (formDataParameters.length === 0) { + return {}; + } + return { + mimeType: supportedMimeType, + params: convertParameters(formDataParameters), + }; + } + if (mimeTypes && mimeTypes.length) { return { mimeType: mimeTypes[0] || undefined, @@ -260,7 +302,14 @@ function prepareBody(endpointSchema, globalMimeTypes) { */ function convertParameters(parameters) { return parameters.map(parameter => { - const { required, name } = parameter; + const { required, name, type } = parameter; + if (type === 'file') { + return { + name, + disabled: required !== true, + type: 'file', + }; + } return { name, disabled: required !== true, From b4b60f3565b77ce03b536158dfc0dabe18d987d1 Mon Sep 17 00:00:00 2001 From: kliques Date: Fri, 22 Nov 2019 19:38:27 +0200 Subject: [PATCH 094/100] fix(height): (#1800) - add dynamic height of window "Edit variable" - "Line preview" --- .../ui/components/templating/variable-editor.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/app/ui/components/templating/variable-editor.js b/packages/insomnia-app/app/ui/components/templating/variable-editor.js index f500d724e8..b325e07605 100644 --- a/packages/insomnia-app/app/ui/components/templating/variable-editor.js +++ b/packages/insomnia-app/app/ui/components/templating/variable-editor.js @@ -6,7 +6,7 @@ import autobind from 'autobind-decorator'; class VariableEditor extends PureComponent { constructor(props) { super(props); - + this.textAreaRef = React.createRef(); const inner = props.defaultValue.replace(/\s*}}$/, '').replace(/^{{\s*/, ''); this.state = { @@ -19,6 +19,11 @@ class VariableEditor extends PureComponent { componentDidMount() { this._update(this.state.value, true); + this._resize(); + } + + componentDidUpdate() { + this._resize(); } _handleChange(e) { @@ -26,6 +31,14 @@ class VariableEditor extends PureComponent { this._update(name); } + _resize() { + setTimeout(() => { + const element = this.textAreaRef.current; + element.style.cssText = 'height: auto, padding: 0'; + element.style.cssText = `height:${element.scrollHeight}px`; + }, 100); + } + _setSelectRef(n) { this._select = n; @@ -95,7 +108,7 @@ class VariableEditor extends PureComponent { {error ? (