Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Package Extension
run: npm run package
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}
path: oic-rapid-adapter-builder-*.vsix
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# registry="https://artifacthub-iad.oci.oraclecorp.com/artifactory/api/npm/npmjs-registry"
registry="https://registry.npmjs.org"
4 changes: 3 additions & 1 deletion src/providers/copilot-webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ function handleWebviewLifecycle() {
}

const notifyPostmanWebview = (file: vscode.Uri, entryType: SharedNs.VscodeCommandPayload["updateEntryType"]) => {
UtilsNs.notifyWebview(SharedNs.ExtensionCommandEnum.updatePostmanRawData, JSON.parse(readFileSync(file.fsPath, 'utf8')) as PostmanNs.Root);
UtilsNs.notifyWebview(SharedNs.ExtensionCommandEnum.updatePostmanRawData, {
postman: JSON.parse(readFileSync(file.fsPath, 'utf8')) as PostmanNs.Root
});
UtilsNs.notifyWebview(SharedNs.ExtensionCommandEnum.updateEntryType, entryType);
};

Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export namespace workspace {
const specFile = JSON.parse(doc.getText()) as OpenAPINS.Root;
return !!specFile && !!specFile.openapi && !!specFile.info?.version && !!specFile.paths;
},
(file) => from(showErrorMessage(`The offered file is not a valid postman collection. File: ['${fs.parseFilename(file)}']`))
(file) => from(showErrorMessage(`The offered file is not a valid OpenAPI spec json. File: ['${fs.parseFilename(file)}']`))
)
.pipe(
switchMap(
Expand Down
33 changes: 32 additions & 1 deletion src/webview-shared-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export namespace SharedNs {
export const WebviewCommandEnum = {
webviewRouterReady: 'webviewRouterReady' as 'webviewRouterReady',
webviewLifecycle: 'webviewLifecycle' as 'webviewLifecycle',
webviewMessagePreflight: 'webviewMessagePreflight' as 'webviewMessagePreflight',

postmanSelectRequests: 'postmanSelectRequests' as 'postmanSelectRequests',
postmanDoneConvertDocument: 'postmanDoneConvertDocument' as 'postmanDoneConvertDocument',
Expand All @@ -22,9 +23,14 @@ export namespace SharedNs {
rabAddSave: 'rabAddSave' as 'rabAddSave',

}

export type WebviewCommandEnumKey = keyof typeof WebviewCommandEnum;

export const ExtensionCommandEnum = {

openCopilotPostmanConvert: 'orab.webview.copilot.open.postman.convert' as 'openCopilotPostmanConvert',
openPostmanConvertConverDocument: 'orab.convert.postman.document' as 'openPostmanConvertConverDocument',
openADDCompress: 'orab.add.compress' as 'openADDCompress',
openOpenAPIConvertNewDocument: 'orab.add.convert' as 'openOpenAPIConvertNewDocument',
openOpenAPIConvertAppendDocument: 'orab.add.convert.append' as 'openOpenAPIConvertAppendDocument',
openCopilotAssistant: 'orab.webview.copilot.open.assistant' as 'openCopilotAssistant',
Expand All @@ -35,6 +41,9 @@ export namespace SharedNs {
routerNavigateTo: 'routerNavigateTo' as 'routerNavigateTo',
}

export type ExtensionCommandEnumKey = keyof typeof ExtensionCommandEnum;


export enum WebviewRouteEnum {
Root = `/`,
PostmanAdd = `postman/add`,
Expand All @@ -51,18 +60,32 @@ export namespace SharedNs {
items: string[];
selectedItemForTestConnection?: string;
}
export enum WebviewCommandPayloadADDCompressRequestEnum {
remove_dangling = 'remove_dangling'
}
export type WebviewCommandPayloadADDCompressRequests = {
[WebviewCommandPayloadADDCompressRequestEnum.remove_dangling]?: boolean
}

export type WebviewCommandPayloadOpenAPISelectRequests = OpenAPINS.UIStateForBackend
export interface WebviewCommandPayloadRabAddSave {
addToSave: RabAddNs.Root;
vsCodeEditorConfig?: VsCoderEditorConfig;
}

export type MessagePreflightPayload = {
ack?: (typeof ExtensionCommandEnum)[ExtensionCommandEnumKey] | (typeof WebviewCommandEnum)[WebviewCommandEnumKey]
isUnlisten?: boolean
};

export type WebviewCommandPayload = {
webviewRouterReady: WebviewCommandPayloadWebviewRouterReady;
webviewLifecycle: {
type: 'close'
};

webviewMessagePreflight: MessagePreflightPayload;

postmanSelectRequests: Omit<WebviewCommandPayloadPostmanSelectRequests, "selectedItemForTestConnection">;
postmanDoneConvertDocument: WebviewCommandPayloadPostmanSelectRequests;
postmanSelectReady: any;
Expand All @@ -84,10 +107,14 @@ export namespace SharedNs {
}

export type VscodeCommandPayload = {

openCopilotPostmanConvert: any;
openCopilotAssistant: any;

updatePostmanRawData: PostmanNs.Root;
updatePostmanRawData: {
postman: PostmanNs.Root,
add?: RabAddNs.Root,
};
updateOpenAPIRawData: {
openapi: OpenAPINS.Root,
add?: RabAddNs.Root,
Expand All @@ -96,6 +123,7 @@ export namespace SharedNs {
updateEntryType: VscodeCommandPayloadEntryType;

openPostmanConvertConverDocument: any;
openADDCompress: any;

openOpenAPIConvertNewDocument: any;
openOpenAPIConvertAppendDocument: any;
Expand All @@ -115,6 +143,9 @@ export namespace SharedNs {
endOffset?: number
}


export const delayInSeconds = async (timeInSeconds: number) => new Promise(resolve => setTimeout(() => resolve(true), timeInSeconds * 1000));

}

export namespace RabAddUtilNs {
Expand Down
2 changes: 1 addition & 1 deletion webview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<!doctype html><html lang="en-us"><head><title>Oracle JET VDOM Starter Template - Basic</title><meta charset="UTF-8"/><meta name="viewport" content="viewport-fit=cover,width=device-width,initial-scale=1"/><link rel="icon" href="styles/images/JET-Favicon-Red-32x32.png" type="image/x-icon"/><base href="/"/><link rel="stylesheet" type="text/css" href="styles/redwood/15.1.0/web/redwood.min.css">
<link rel="stylesheet" type="text/css" href="styles/theme-redwood/15.1.0/web/theme.css">

<link rel="stylesheet" type="text/css" href="styles/app.css"><link rel="stylesheet" id="uxiconFont" href="https://static.oracle.com/cdn/fnd/gallery/2310.0.1/images/iconfont/ojuxIconFont.min.css"/><link href="styles/main.c503ed20880785365d34.css" rel="stylesheet"></head><body class="oj-web-applayout-body" data-oj-binding-provider="none"><app-root></app-root><script defer="defer" src="js/runtime.c503ed20880785365d34.js"></script><script defer="defer" src="js/libs/index.c503ed20880785365d34.js"></script><script defer="defer" src="js/main.c503ed20880785365d34.js"></script></body></html>
<link rel="stylesheet" type="text/css" href="styles/app.css"><link rel="stylesheet" id="uxiconFont" href="https://static.oracle.com/cdn/fnd/gallery/2310.0.1/images/iconfont/ojuxIconFont.min.css"/><link href="styles/main.fbee0a9e7bb54ef7b5d0.css" rel="stylesheet"></head><body class="oj-web-applayout-body" data-oj-binding-provider="none"><app-root></app-root><script defer="defer" src="js/runtime.fbee0a9e7bb54ef7b5d0.js"></script><script defer="defer" src="js/libs/index.fbee0a9e7bb54ef7b5d0.js"></script><script defer="defer" src="js/main.fbee0a9e7bb54ef7b5d0.js"></script></body></html>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
*/

/**
* @remix-run/router v1.9.0
* react-router v7.11.0
*
* Copyright (c) Remix Software Inc.
*
Expand All @@ -251,18 +251,7 @@
*/

/**
* React Router DOM v6.16.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router v6.16.0
* react-router-dom v7.11.0
*
* Copyright (c) Remix Software Inc.
*
Expand Down
6 changes: 0 additions & 6 deletions webview/js/main.c503ed20880785365d34.js

This file was deleted.

6 changes: 6 additions & 0 deletions webview/js/main.fbee0a9e7bb54ef7b5d0.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions webview/styles/main.c503ed20880785365d34.css

This file was deleted.

3 changes: 3 additions & 0 deletions webview/styles/main.fbee0a9e7bb54ef7b5d0.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading