Skip to content

Commit b583d56

Browse files
Upgrade react router version to prevent CVE scanning warning (#56)
* Upgrade react router version to prevent CVE scanning warning * Bump up github action version
1 parent 761046e commit b583d56

13 files changed

+55
-31
lines changed

.github/workflows/package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Package Extension
2828
run: npm run package
2929
- name: Upload Artifact
30-
uses: actions/upload-artifact@v3
30+
uses: actions/upload-artifact@v4
3131
with:
3232
name: build-${{ github.sha }}
3333
path: oic-rapid-adapter-builder-*.vsix

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# registry="https://artifacthub-iad.oci.oraclecorp.com/artifactory/api/npm/npmjs-registry"
2+
registry="https://registry.npmjs.org"

src/providers/copilot-webview.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ function handleWebviewLifecycle() {
238238
}
239239

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

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export namespace workspace {
139139
const specFile = JSON.parse(doc.getText()) as OpenAPINS.Root;
140140
return !!specFile && !!specFile.openapi && !!specFile.info?.version && !!specFile.paths;
141141
},
142-
(file) => from(showErrorMessage(`The offered file is not a valid postman collection. File: ['${fs.parseFilename(file)}']`))
142+
(file) => from(showErrorMessage(`The offered file is not a valid OpenAPI spec json. File: ['${fs.parseFilename(file)}']`))
143143
)
144144
.pipe(
145145
switchMap(

src/webview-shared-lib.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export namespace SharedNs {
88
export const WebviewCommandEnum = {
99
webviewRouterReady: 'webviewRouterReady' as 'webviewRouterReady',
1010
webviewLifecycle: 'webviewLifecycle' as 'webviewLifecycle',
11+
webviewMessagePreflight: 'webviewMessagePreflight' as 'webviewMessagePreflight',
1112

1213
postmanSelectRequests: 'postmanSelectRequests' as 'postmanSelectRequests',
1314
postmanDoneConvertDocument: 'postmanDoneConvertDocument' as 'postmanDoneConvertDocument',
@@ -22,9 +23,14 @@ export namespace SharedNs {
2223
rabAddSave: 'rabAddSave' as 'rabAddSave',
2324

2425
}
26+
27+
export type WebviewCommandEnumKey = keyof typeof WebviewCommandEnum;
28+
2529
export const ExtensionCommandEnum = {
30+
2631
openCopilotPostmanConvert: 'orab.webview.copilot.open.postman.convert' as 'openCopilotPostmanConvert',
2732
openPostmanConvertConverDocument: 'orab.convert.postman.document' as 'openPostmanConvertConverDocument',
33+
openADDCompress: 'orab.add.compress' as 'openADDCompress',
2834
openOpenAPIConvertNewDocument: 'orab.add.convert' as 'openOpenAPIConvertNewDocument',
2935
openOpenAPIConvertAppendDocument: 'orab.add.convert.append' as 'openOpenAPIConvertAppendDocument',
3036
openCopilotAssistant: 'orab.webview.copilot.open.assistant' as 'openCopilotAssistant',
@@ -35,6 +41,9 @@ export namespace SharedNs {
3541
routerNavigateTo: 'routerNavigateTo' as 'routerNavigateTo',
3642
}
3743

44+
export type ExtensionCommandEnumKey = keyof typeof ExtensionCommandEnum;
45+
46+
3847
export enum WebviewRouteEnum {
3948
Root = `/`,
4049
PostmanAdd = `postman/add`,
@@ -51,18 +60,32 @@ export namespace SharedNs {
5160
items: string[];
5261
selectedItemForTestConnection?: string;
5362
}
63+
export enum WebviewCommandPayloadADDCompressRequestEnum {
64+
remove_dangling = 'remove_dangling'
65+
}
66+
export type WebviewCommandPayloadADDCompressRequests = {
67+
[WebviewCommandPayloadADDCompressRequestEnum.remove_dangling]?: boolean
68+
}
69+
5470
export type WebviewCommandPayloadOpenAPISelectRequests = OpenAPINS.UIStateForBackend
5571
export interface WebviewCommandPayloadRabAddSave {
5672
addToSave: RabAddNs.Root;
5773
vsCodeEditorConfig?: VsCoderEditorConfig;
5874
}
5975

76+
export type MessagePreflightPayload = {
77+
ack?: (typeof ExtensionCommandEnum)[ExtensionCommandEnumKey] | (typeof WebviewCommandEnum)[WebviewCommandEnumKey]
78+
isUnlisten?: boolean
79+
};
80+
6081
export type WebviewCommandPayload = {
6182
webviewRouterReady: WebviewCommandPayloadWebviewRouterReady;
6283
webviewLifecycle: {
6384
type: 'close'
6485
};
6586

87+
webviewMessagePreflight: MessagePreflightPayload;
88+
6689
postmanSelectRequests: Omit<WebviewCommandPayloadPostmanSelectRequests, "selectedItemForTestConnection">;
6790
postmanDoneConvertDocument: WebviewCommandPayloadPostmanSelectRequests;
6891
postmanSelectReady: any;
@@ -84,10 +107,14 @@ export namespace SharedNs {
84107
}
85108

86109
export type VscodeCommandPayload = {
110+
87111
openCopilotPostmanConvert: any;
88112
openCopilotAssistant: any;
89113

90-
updatePostmanRawData: PostmanNs.Root;
114+
updatePostmanRawData: {
115+
postman: PostmanNs.Root,
116+
add?: RabAddNs.Root,
117+
};
91118
updateOpenAPIRawData: {
92119
openapi: OpenAPINS.Root,
93120
add?: RabAddNs.Root,
@@ -96,6 +123,7 @@ export namespace SharedNs {
96123
updateEntryType: VscodeCommandPayloadEntryType;
97124

98125
openPostmanConvertConverDocument: any;
126+
openADDCompress: any;
99127

100128
openOpenAPIConvertNewDocument: any;
101129
openOpenAPIConvertAppendDocument: any;
@@ -115,6 +143,9 @@ export namespace SharedNs {
115143
endOffset?: number
116144
}
117145

146+
147+
export const delayInSeconds = async (timeInSeconds: number) => new Promise(resolve => setTimeout(() => resolve(true), timeInSeconds * 1000));
148+
118149
}
119150

120151
export namespace RabAddUtilNs {

webview/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<!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">
66
<link rel="stylesheet" type="text/css" href="styles/theme-redwood/15.1.0/web/theme.css">
77

8-
<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>
8+
<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>

webview/js/libs/index.c503ed20880785365d34.js renamed to webview/js/libs/index.fbee0a9e7bb54ef7b5d0.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview/js/libs/index.c503ed20880785365d34.js.LICENSE.txt renamed to webview/js/libs/index.fbee0a9e7bb54ef7b5d0.js.LICENSE.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@
240240
*/
241241

242242
/**
243-
* @remix-run/router v1.9.0
243+
* react-router v7.11.0
244244
*
245245
* Copyright (c) Remix Software Inc.
246246
*
@@ -251,18 +251,7 @@
251251
*/
252252

253253
/**
254-
* React Router DOM v6.16.0
255-
*
256-
* Copyright (c) Remix Software Inc.
257-
*
258-
* This source code is licensed under the MIT license found in the
259-
* LICENSE.md file in the root directory of this source tree.
260-
*
261-
* @license MIT
262-
*/
263-
264-
/**
265-
* React Router v6.16.0
254+
* react-router-dom v7.11.0
266255
*
267256
* Copyright (c) Remix Software Inc.
268257
*

webview/js/main.c503ed20880785365d34.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

webview/js/main.fbee0a9e7bb54ef7b5d0.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)