mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 15:18:27 -04:00
Merge branch 'release/2023.2.0-beta.1' into develop
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
"plugins/*"
|
||||
|
||||
4
packages/insomnia-inso/package-lock.json
generated
4
packages/insomnia-inso/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-inso",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-inso",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@stoplight/spectral-core": "^1.16.0",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-inso",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"homepage": "https://insomnia.rest",
|
||||
"description": "A CLI for Insomnia - The Collaborative API Design Tool",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
@@ -71,24 +71,24 @@
|
||||
"consola": "^2.15.0",
|
||||
"cosmiconfig": "^6.0.0",
|
||||
"enquirer": "^2.3.6",
|
||||
"insomnia-plugin-base64": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-cookie-jar": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-core-themes": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-default-headers": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-file": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-hash": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-jsonpath": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-now": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-os": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-prompt": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-request": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-response": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-uuid": "^3.14.0-beta.0",
|
||||
"insomnia-send-request": "^3.14.0-beta.0",
|
||||
"insomnia-testing": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-base64": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-cookie-jar": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-core-themes": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-default-headers": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-file": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-hash": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-jsonpath": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-now": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-os": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-prompt": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-request": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-response": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-uuid": "^3.14.0-beta.1",
|
||||
"insomnia-send-request": "^3.14.0-beta.1",
|
||||
"insomnia-testing": "^3.14.0-beta.1",
|
||||
"mkdirp": "^1.0.4",
|
||||
"nedb": "^1.8.0",
|
||||
"openapi-2-kong": "^3.14.0-beta.0",
|
||||
"openapi-2-kong": "^3.14.0-beta.1",
|
||||
"string-argv": "^0.3.1",
|
||||
"yaml": "^1.10.0"
|
||||
}
|
||||
|
||||
4
packages/insomnia-send-request/package-lock.json
generated
4
packages/insomnia-send-request/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-send-request",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-send-request",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getinsomnia/node-libcurl": "2.3.5-6",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"private": true,
|
||||
"name": "insomnia-send-request",
|
||||
"license": "Apache-2.0",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/send-request/index.d.ts",
|
||||
@@ -22,7 +22,7 @@
|
||||
"hkdf": "0.0.2",
|
||||
"html-entities": "^1.3.1",
|
||||
"httpsnippet": "^1.22.0",
|
||||
"insomnia-testing": "^3.14.0-beta.0",
|
||||
"insomnia-testing": "^3.14.0-beta.1",
|
||||
"isomorphic-git": "^1.5.0",
|
||||
"jshint": "^2.11.1",
|
||||
"jsonlint-mod-fixed": "1.7.7",
|
||||
@@ -35,7 +35,7 @@
|
||||
"node-forge": "^1.3.0",
|
||||
"nunjucks": "^3.2.1",
|
||||
"oauth-1.0a": "^2.2.6",
|
||||
"openapi-2-kong": "^3.14.0-beta.0",
|
||||
"openapi-2-kong": "^3.14.0-beta.1",
|
||||
"tough-cookie": "^4.0.0",
|
||||
"ts-assert-unreachable": "^0.0.9",
|
||||
"url-join": "^4.0.1",
|
||||
|
||||
4
packages/insomnia-smoke-test/package-lock.json
generated
4
packages/insomnia-smoke-test/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-smoke-test",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-smoke-test",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@grpc/grpc-js": "^1.6.7",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/kong/insomnia/issues"
|
||||
},
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"scripts": {
|
||||
"bootstrap": "npm run build",
|
||||
"lint": "eslint . --ext .js,.ts,.tsx --cache",
|
||||
|
||||
@@ -48,7 +48,8 @@ test.describe('Dashboard', async () => {
|
||||
});
|
||||
});
|
||||
test.describe('Interactions', async () => { // Not sure about the name here
|
||||
test('Can filter through multiple collections', async ({ app, page }) => {
|
||||
// TODO(INS-2504) - we don't support importing multiple collections at this time
|
||||
test.skip('Can filter through multiple collections', async ({ app, page }) => {
|
||||
await page.getByTestId('project').click();
|
||||
await expect(page.locator('.app')).toContainText('All Files (1)');
|
||||
await expect(page.locator('.app')).not.toContainText('Setup Git Sync');
|
||||
@@ -56,7 +57,10 @@ test.describe('Dashboard', async () => {
|
||||
await page.getByRole('button', { name: 'Create' }).click();
|
||||
const text = await loadFixture('multiple-workspaces.yaml');
|
||||
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
|
||||
await page.getByRole('menuitem', { name: 'Clipboard' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Import' }).click();
|
||||
await page.getByText('Clipboard').click();
|
||||
await page.getByRole('button', { name: 'Scan' }).click();
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Check that 10 new workspaces are imported besides the default one
|
||||
const workspaceCards = page.locator('.card-badge');
|
||||
|
||||
@@ -11,53 +11,22 @@ test.describe('Design interactions', async () => {
|
||||
await expect(true).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Can import an OpenAPI 3 spec into a Design Document', async ({ app, page }) => {
|
||||
// Setup
|
||||
await page.getByTestId('project').click();
|
||||
await page.getByRole('button', { name: 'Create' }).click();
|
||||
const text = await loadFixture('openapi3.yaml');
|
||||
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
|
||||
await page.getByRole('menuitem', { name: 'Import' }).click();
|
||||
await page.getByText('Clipboard').click();
|
||||
await page.getByRole('button', { name: 'Scan' }).click();
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Renders the spec code
|
||||
const codeEditor = page.locator('.pane-one');
|
||||
await expect(codeEditor).toContainText('openapi: 3.0.0');
|
||||
|
||||
// Created requests from spec
|
||||
await page.locator('text=Debug').click();
|
||||
await expect(page.locator('.app')).toContainText('File');
|
||||
await expect(page.locator('.app')).toContainText('Misc');
|
||||
await expect(page.locator('.app')).toContainText('Auth');
|
||||
|
||||
// Created Environment from spec
|
||||
await page.getByRole('button', { name: 'OpenAPI env' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Manage Environments' }).click();
|
||||
await page.click('text=/.*"localhost:4010".*/');
|
||||
});
|
||||
|
||||
test.fixme('Can filter values in Design sidebar', async ({ page }) => {
|
||||
// TODO(filipe) implement in another PR
|
||||
await page.getByTestId('project').click();
|
||||
await expect(true).toBeTruthy();
|
||||
});
|
||||
|
||||
test.fixme('[INS-567] Requests are not duplicated when switching between tabs', async ({ page }) => {
|
||||
// TODO(filipe) implement in another PR
|
||||
await page.getByTestId('project').click();
|
||||
await expect(true).toBeTruthy();
|
||||
});
|
||||
|
||||
test('Unit Test interactions', async ({ app, page }) => {
|
||||
// Setup
|
||||
await page.getByTestId('project').click();
|
||||
await page.getByRole('button', { name: 'Create' }).click();
|
||||
const text = await loadFixture('unit-test.yaml');
|
||||
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
|
||||
await page.getByRole('menuitem', { name: 'Clipboard' }).click();
|
||||
await page.click('text=unit-test.yamljust now');
|
||||
await page.getByRole('menuitem', { name: 'Import' }).click();
|
||||
await page.getByText('Clipboard').click();
|
||||
await page.getByRole('button', { name: 'Scan' }).click();
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Switch to Test tab
|
||||
await page.click('a:has-text("Test")');
|
||||
@@ -76,7 +45,10 @@ test.describe('Design interactions', async () => {
|
||||
// Add a new test
|
||||
await page.locator('text=New Test').nth(1).click();
|
||||
await page.click('div[role="dialog"] button:has-text("New Test")');
|
||||
await page.locator('select[name="request"]').selectOption('req_17ca8bbd46374144a089f891e32842d6');
|
||||
const label = await page.locator('option', { hasText: 'Request A' }).textContent() || '';
|
||||
await page.locator('select[name="request"]').selectOption({
|
||||
label,
|
||||
});
|
||||
|
||||
await page.click('#wrapper >> text=Run Tests');
|
||||
await expect(page.locator('.app')).toContainText('Tests Passed 1/1');
|
||||
|
||||
@@ -18,7 +18,7 @@ test.describe('Environment Editor', async () => {
|
||||
|
||||
test('create a new environment', async ({ page }) => {
|
||||
// Create the environment
|
||||
await page.getByText('ExampleB').click();
|
||||
await page.getByText('ExampleA').click();
|
||||
await page.getByRole('menuitem', { name: 'Manage Environments' }).click();
|
||||
await page.getByTestId('CreateEnvironmentDropdown').click();
|
||||
await page.getByRole('menuitem', { name: 'Environment', exact: true }).click();
|
||||
@@ -26,7 +26,7 @@ test.describe('Environment Editor', async () => {
|
||||
await page.getByRole('button', { name: 'Close' }).click();
|
||||
|
||||
// Make it active one
|
||||
await page.getByText('ExampleB').click();
|
||||
await page.getByText('ExampleA').click();
|
||||
await page.getByRole('menuitem', { name: 'New Environment' }).click();
|
||||
|
||||
// Send a request check variables defaulted to base env since new env is empty
|
||||
@@ -40,32 +40,32 @@ test.describe('Environment Editor', async () => {
|
||||
// rename an existing environment
|
||||
test('Rename an existing environment', async ({ page }) => {
|
||||
// Rename the environment
|
||||
await page.getByText('ExampleB').click();
|
||||
await page.getByText('ExampleA').click();
|
||||
await page.getByRole('menuitem', { name: 'Manage Environments' }).click();
|
||||
await page.getByRole('button', { name: 'ExampleA' }).click();
|
||||
await page.getByRole('button', { name: 'ExampleB' }).click();
|
||||
await page.getByTitle('Click to edit', { exact: true }).click();
|
||||
await page.getByRole('dialog').locator('input[type="text"]').fill('Gandalf');
|
||||
await page.getByRole('button', { name: 'Close' }).click();
|
||||
|
||||
// Make it active one
|
||||
await page.getByText('ExampleB').click();
|
||||
await page.getByText('ExampleA').click();
|
||||
await page.getByRole('menuitem', { name: 'Gandalf' }).click();
|
||||
|
||||
// Send a request check variables defaulted to base env since new env is empty
|
||||
await page.getByRole('button', { name: 'GET New Request' }).click();
|
||||
await page.getByRole('button', { name: 'Send' }).click();
|
||||
await page.getByRole('tab', { name: 'Timeline' }).click();
|
||||
await page.getByText('subenvA0').click();
|
||||
await page.getByText('subenvA1').click();
|
||||
await page.getByText('subenvB0').click();
|
||||
await page.getByText('subenvB1').click();
|
||||
});
|
||||
|
||||
test('Add new variables to an existing environment', async ({ page }) => {
|
||||
// Rename the environment
|
||||
await page.getByText('ExampleB').click();
|
||||
await page.getByText('ExampleA').click();
|
||||
await page.getByRole('menuitem', { name: 'Manage Environments' }).click();
|
||||
|
||||
// add a new string environment variable
|
||||
await page.locator('pre').filter({ hasText: '"exampleNumber": 2222,' }).click();
|
||||
await page.locator('pre').filter({ hasText: '"exampleNumber": 1111,' }).click();
|
||||
await page.getByTestId('CodeEditor').getByRole('textbox').press('Enter');
|
||||
await page.getByTestId('CodeEditor').getByRole('textbox').fill('"testNumber":9000,');
|
||||
await page.getByTestId('CodeEditor').getByRole('textbox').press('Enter');
|
||||
@@ -95,7 +95,10 @@ test.describe('Environment Editor', async () => {
|
||||
await page.getByRole('tab', { name: 'Timeline' }).click();
|
||||
|
||||
// FIXME(filipe) - adding variables to request body can be so fast they don't get picked up when sending request
|
||||
|
||||
await page.locator('pre').filter({ hasText: '| 9000' }).click();
|
||||
|
||||
// NOTE - Test fails due to actual bug - the variables are not being added to the request body when the request is sent
|
||||
await page.locator('pre').filter({ hasText: '| Gandalf' }).click();
|
||||
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ test('Clone Repo with bad values', async ({ page }) => {
|
||||
|
||||
// Check a recent and old commit show up on history
|
||||
await page.getByRole('cell', { name: 'bump to OpenAPI v3.1' }).click();
|
||||
await page.getByRole('cell', { name: 'initial commit' }).click();
|
||||
await page.getByRole('cell', { name: 'Fix environments' }).click();
|
||||
await page.locator('text=Done').click();
|
||||
|
||||
// Create a branch and try to push with bad Git token
|
||||
|
||||
@@ -32,7 +32,7 @@ test.describe('gRPC interactions', () => {
|
||||
});
|
||||
|
||||
test('can send unidirectional requests', async ({ page }) => {
|
||||
await page.locator('button:has-text("gRPCUnary")').nth(1).click();
|
||||
await page.getByRole('button', { name: 'gRPC Unary', exact: true }).click();
|
||||
await page.locator('[data-testid="request-pane"] >> text=Unary').click();
|
||||
await page.click('text=Send');
|
||||
|
||||
|
||||
4
packages/insomnia-testing/package-lock.json
generated
4
packages/insomnia-testing/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-testing",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-testing",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"chai": "^4.3.4",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"private": true,
|
||||
"name": "insomnia-testing",
|
||||
"license": "Apache-2.0",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
4
packages/insomnia/package-lock.json
generated
4
packages/insomnia/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia",
|
||||
"version": "2023.2.0-beta.0",
|
||||
"version": "2023.2.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia",
|
||||
"version": "2023.2.0-beta.0",
|
||||
"version": "2023.2.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apideck/better-ajv-errors": "^0.2.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "insomnia",
|
||||
"version": "2023.2.0-beta.0",
|
||||
"version": "2023.2.0-beta.1",
|
||||
"productName": "Insomnia",
|
||||
"private": true,
|
||||
"description": "The Collaborative API Design Tool",
|
||||
@@ -72,23 +72,23 @@
|
||||
"html-entities": "^1.2.0",
|
||||
"httpsnippet": "^2.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"insomnia-plugin-base64": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-cookie-jar": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-core-themes": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-default-headers": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-file": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-hash": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-jsonpath": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-kong-declarative-config": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-kong-kubernetes-config": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-kong-portal": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-now": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-os": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-prompt": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-request": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-response": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-uuid": "^3.14.0-beta.0",
|
||||
"insomnia-testing": "^3.14.0-beta.0",
|
||||
"insomnia-plugin-base64": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-cookie-jar": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-core-themes": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-default-headers": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-file": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-hash": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-jsonpath": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-kong-declarative-config": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-kong-kubernetes-config": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-kong-portal": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-now": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-os": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-prompt": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-request": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-response": "^3.14.0-beta.1",
|
||||
"insomnia-plugin-uuid": "^3.14.0-beta.1",
|
||||
"insomnia-testing": "^3.14.0-beta.1",
|
||||
"isomorphic-git": "^1.10.4",
|
||||
"js-yaml": "^3.14.1",
|
||||
"jshint": "^2.11.1",
|
||||
@@ -103,7 +103,7 @@
|
||||
"node-forge": "^1.0.0",
|
||||
"nunjucks": "^3.2.0",
|
||||
"oauth-1.0a": "^2.2.2",
|
||||
"openapi-2-kong": "^3.14.0-beta.0",
|
||||
"openapi-2-kong": "^3.14.0-beta.1",
|
||||
"papaparse": "^5.2.0",
|
||||
"prettier": "2.4.1",
|
||||
"shell-quote": "^1.7.2",
|
||||
|
||||
@@ -168,7 +168,6 @@ export async function importResources({
|
||||
`Could not find workspace with id ${workspaceId}`
|
||||
);
|
||||
|
||||
// If we're importing into a new workspace
|
||||
// Map new IDs
|
||||
ResourceIdMap.set(workspaceId, existingWorkspace._id);
|
||||
ResourceIdMap.set('__WORKSPACE_ID__', existingWorkspace._id);
|
||||
@@ -198,11 +197,30 @@ export async function importResources({
|
||||
const model = getModel(resource.type);
|
||||
|
||||
if (model) {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
});
|
||||
// Make sure we point to the new proto file
|
||||
if (isGrpcRequest(resource)) {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
protoFileId: ResourceIdMap.get(resource.protoFileId),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
});
|
||||
|
||||
// Make sure we point unit test to the new request
|
||||
} else if (isUnitTest(resource)) {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
requestId: ResourceIdMap.get(resource.requestId),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
});
|
||||
} else {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,6 +247,7 @@ export async function importResources({
|
||||
if (apiSpec) {
|
||||
await models.apiSpec.updateOrCreateForParentId(newWorkspace._id, {
|
||||
...apiSpec,
|
||||
_id: generateId(models.apiSpec.prefix),
|
||||
fileName: workspaceName || workspace?.name,
|
||||
});
|
||||
}
|
||||
@@ -270,10 +289,47 @@ export async function importResources({
|
||||
const model = getModel(resource.type);
|
||||
|
||||
if (model) {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
// Make sure we point to the new proto file
|
||||
if (isGrpcRequest(resource)) {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
protoFileId: ResourceIdMap.get(resource.protoFileId),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
});
|
||||
} else if (isUnitTest(resource)) {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
requestId: ResourceIdMap.get(resource.requestId),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
});
|
||||
} else {
|
||||
await db.docCreate(model.type, {
|
||||
...resource,
|
||||
_id: ResourceIdMap.get(resource._id),
|
||||
parentId: ResourceIdMap.get(resource.parentId),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Use the first environment as the active one
|
||||
const subEnvironments =
|
||||
resources.filter(isEnvironment).filter(env => env.parentId.startsWith(models.environment.prefix)) || [];
|
||||
|
||||
console.log({ subEnvironments });
|
||||
|
||||
if (subEnvironments.length > 0) {
|
||||
const firstSubEnvironment = subEnvironments[0];
|
||||
|
||||
if (firstSubEnvironment) {
|
||||
const workspaceMeta = await models.workspaceMeta.getOrCreateByParentId(
|
||||
newWorkspace._id
|
||||
);
|
||||
|
||||
await models.workspaceMeta.update(workspaceMeta, {
|
||||
activeEnvironmentId: ResourceIdMap.get(firstSubEnvironment._id),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -878,9 +878,9 @@ const ImportResourcesForm = ({
|
||||
{scanResult.unitTestSuites.length === 1
|
||||
? 'Test Suite'
|
||||
: 'Test Suites'}
|
||||
{' with '}
|
||||
{scanResult.unitTests?.length}
|
||||
{' with'}
|
||||
{scanResult.unitTests?.length === 1 ? 'Test' : 'Tests'}
|
||||
{scanResult.unitTests?.length === 1 ? ' Test' : ' Tests'}
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
|
||||
4
packages/openapi-2-kong/package-lock.json
generated
4
packages/openapi-2-kong/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "openapi-2-kong",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "openapi-2-kong",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-parser": "10.1.0",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"private": true,
|
||||
"name": "openapi-2-kong",
|
||||
"license": "Apache-2.0",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-base64",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia base64 template tag",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-cookie-jar",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-cookie-jar",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tough-cookie": "^2.3.3"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-cookie-jar",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"contributors": [
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-core-themes",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia core themes",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-default-headers",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Various data importers for Insomnia",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-file",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia file templte tag",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-hash",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia hash template tag",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-jsonpath",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-jsonpath",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jsonpath-plus": "^6.0.1"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-jsonpath",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Template tag to pull data from JSON strings",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-kong-declarative-config",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-kong-declarative-config",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"yaml": "^1.8.3"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-kong-declarative-config",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"main": "index.js",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"license": "Apache-2.0",
|
||||
@@ -19,7 +19,7 @@
|
||||
"unlisted": true
|
||||
},
|
||||
"dependencies": {
|
||||
"openapi-2-kong": "^3.14.0-beta.0",
|
||||
"openapi-2-kong": "^3.14.0-beta.1",
|
||||
"yaml": "^1.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-kong-kubernetes-config",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-kong-kubernetes-config",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"yaml": "^1.8.3"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-kong-kubernetes-config",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"main": "index.js",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"license": "Apache-2.0",
|
||||
@@ -19,7 +19,7 @@
|
||||
"unlisted": true
|
||||
},
|
||||
"dependencies": {
|
||||
"openapi-2-kong": "^3.14.0-beta.0",
|
||||
"openapi-2-kong": "^3.14.0-beta.1",
|
||||
"yaml": "^1.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-kong-portal",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-kong-portal",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"url-join": "^4.0.1"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-kong-portal",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
|
||||
4
plugins/insomnia-plugin-now/package-lock.json
generated
4
plugins/insomnia-plugin-now/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-now",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-now",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"moment": "^2.21.0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-now",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia now template tag",
|
||||
"license": "MIT",
|
||||
|
||||
4
plugins/insomnia-plugin-os/package-lock.json
generated
4
plugins/insomnia-plugin-os/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-os",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-os",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jsonpath-plus": "^6.0.1"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-os",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Template tag to get information about the OS",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-prompt",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia prompt template tag",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-request",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-request",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tough-cookie": "^2.3.1"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-request",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia request template tag",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-response",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-response",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"iconv-lite": "^0.6.3",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-response",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia response template tag",
|
||||
"license": "MIT",
|
||||
|
||||
4
plugins/insomnia-plugin-uuid/package-lock.json
generated
4
plugins/insomnia-plugin-uuid/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "insomnia-plugin-uuid",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "insomnia-plugin-uuid",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"uuid": "^8.3.2"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-plugin-uuid",
|
||||
"version": "3.14.0-beta.0",
|
||||
"version": "3.14.0-beta.1",
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"description": "Insomnia uuid template tag",
|
||||
"license": "MIT",
|
||||
|
||||
Reference in New Issue
Block a user