New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@openshift-console/dynamic-plugin-sdk

Package Overview
Dependencies
Maintainers
0
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openshift-console/dynamic-plugin-sdk - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

lib/app/core/actions/index.d.ts

54

docs/api.md

@@ -70,6 +70,7 @@ # OpenShift Console API

67. [useActiveNamespace](#useactivenamespace)
68. [DEPRECATED] [PerspectiveContext](#perspectivecontext)
69. [DEPRECATED] [useAccessReviewAllowed](#useaccessreviewallowed)
70. [DEPRECATED] [useSafetyFirst](#usesafetyfirst)
71. [DEPRECATED] [YAMLEditor](#yamleditor)
68. [useUserSettings](#useusersettings)
69. [DEPRECATED] [PerspectiveContext](#perspectivecontext)
70. [DEPRECATED] [useAccessReviewAllowed](#useaccessreviewallowed)
71. [DEPRECATED] [useSafetyFirst](#usesafetyfirst)
72. [DEPRECATED] [YAMLEditor](#yamleditor)

@@ -540,2 +541,4 @@ ---

| `rowData` | (optional) data specific to row |
| `sortColumnIndex` | (optional) The index of the column to sort. The default is `0` |
| `sortDirection` | (optional) The direction of the sort. The default is `SortByDirection.asc` |

@@ -1208,3 +1211,2 @@

| `timeout` | The timeout in milliseconds |
| `isEntireResponse` | The flag to control whether to return the entire content of the response or response body. The default is the response body. |

@@ -1215,3 +1217,3 @@

A promise that resolves to the response as text, response JSON object or entire content of the HTTP response.
A promise that resolves to the response as text or JSON object.

@@ -1237,3 +1239,2 @@

| `timeout` | The timeout in milliseconds |
| `isEntireResponse` | The flag to control whether to return the entire content of the response or response body. The default is the response body. |

@@ -1244,3 +1245,3 @@

A promise that resolves to the response as text, response JSON object or entire content of the HTTP response.
A promise that resolves to the response as text or JSON object.

@@ -2413,2 +2414,39 @@

## `useUserSettings`
### Summary
Hook that provides a user setting value and a callback for setting the user setting value.
### Example
```tsx
const Component: React.FC = (props) => {
const [state, setState, loaded] = useUserSettings(
'devconsole.addPage.showDetails',
true,
true,
);
return loaded ? (
<WrappedComponent {...props} userSettingState={state} setUserSettingState={setState} />
) : null;
};
```
### Returns
A tuple containing the user setting value, a setter callback, and a loaded boolean.
---
## `PerspectiveContext`

@@ -2415,0 +2453,0 @@

import * as React from 'react';
import { ActionServiceProviderProps } from '../extensions/actions';
import { CodeEditorProps, CodeEditorRef, ErrorBoundaryFallbackProps, HorizontalNavProps, InventoryItemBodyProps, InventoryItemStatusProps, InventoryItemTitleProps, ListPageCreateButtonProps, ListPageCreateDropdownProps, ListPageCreateLinkProps, ListPageCreateProps, ListPageFilterProps, ListPageHeaderProps, NamespaceBarProps, OverviewGridProps, OverviewProps, QueryBrowserProps, ResourceEventStreamProps, ResourceIconProps, ResourceLinkProps, ResourceYAMLEditorProps, TableDataProps, TimestampProps, UseActiveColumns, UseAnnotationsModal, UseDeleteModal, UseLabelsModal, UseListPageFilter, UsePrometheusPoll, UseResolvedExtensions, VirtualizedTableFC, UseActiveNamespace } from '../extensions/console-types';
import { CodeEditorProps, CodeEditorRef, ErrorBoundaryFallbackProps, HorizontalNavProps, InventoryItemBodyProps, InventoryItemStatusProps, InventoryItemTitleProps, ListPageCreateButtonProps, ListPageCreateDropdownProps, ListPageCreateLinkProps, ListPageCreateProps, ListPageFilterProps, ListPageHeaderProps, NamespaceBarProps, OverviewGridProps, OverviewProps, QueryBrowserProps, ResourceEventStreamProps, ResourceIconProps, ResourceLinkProps, ResourceYAMLEditorProps, TableDataProps, TimestampProps, UseActiveColumns, UseAnnotationsModal, UseDeleteModal, UseLabelsModal, UseListPageFilter, UsePrometheusPoll, UseResolvedExtensions, VirtualizedTableFC, UseActiveNamespace, UseUserSettings } from '../extensions/console-types';
import { StatusPopupSectionProps, StatusPopupItemProps } from '../extensions/dashboard-types';

@@ -57,2 +57,4 @@ export * from '../app/components';

* @param {R} [rowData] - (optional) data specific to row
* @param {number} [sortColumnIndex] - (optional) The index of the column to sort. The default is `0`
* @param {SortByDirection.asc | SortByDirection.desc} [sortDirection] - (optional) The direction of the sort. The default is `SortByDirection.asc`
* @example

@@ -742,1 +744,19 @@ * ```ts

export declare const useActiveNamespace: UseActiveNamespace;
/**
* Hook that provides a user setting value and a callback for setting the user setting value.
* @returns A tuple containing the user setting value, a setter callback, and a loaded boolean.
* @example
* ```tsx
* const Component: React.FC = (props) => {
* const [state, setState, loaded] = useUserSettings(
* 'devconsole.addPage.showDetails',
* true,
* true,
* );
* return loaded ? (
* <WrappedComponent {...props} userSettingState={state} setUserSettingState={setState} />
* ) : null;
* };
* ```
*/
export declare const useUserSettings: UseUserSettings;

@@ -55,2 +55,4 @@ export * from '../app/components';

* @param {R} [rowData] - (optional) data specific to row
* @param {number} [sortColumnIndex] - (optional) The index of the column to sort. The default is `0`
* @param {SortByDirection.asc | SortByDirection.desc} [sortDirection] - (optional) The direction of the sort. The default is `SortByDirection.asc`
* @example

@@ -777,2 +779,21 @@ * ```ts

.useActiveNamespace;
/**
* Hook that provides a user setting value and a callback for setting the user setting value.
* @returns A tuple containing the user setting value, a setter callback, and a loaded boolean.
* @example
* ```tsx
* const Component: React.FC = (props) => {
* const [state, setState, loaded] = useUserSettings(
* 'devconsole.addPage.showDetails',
* true,
* true,
* );
* return loaded ? (
* <WrappedComponent {...props} userSettingState={state} setUserSettingState={setState} />
* ) : null;
* };
* ```
*/
export const useUserSettings = require('@console/shared/src/hooks/useUserSettings')
.useUserSettings;
//# sourceMappingURL=dynamic-core-api.js.map

1

lib/api/internal-types.d.ts

@@ -240,3 +240,2 @@ /// <reference types="node" />

};
export declare type UseUserSettings = <T>(key: string, defaultValue?: T, sync?: boolean) => [T, React.Dispatch<React.SetStateAction<T>>, boolean];
export declare type QuickStartsLoaderProps = {

@@ -243,0 +242,0 @@ children: (quickStarts: QuickStart[], loaded: boolean) => React.ReactNode;

import { ActionType as Action } from 'typesafe-actions';
import { UserInfo } from '../../../extensions';
import { AdmissionWebhookWarning } from '../../redux-types';
export declare enum ActionType {

@@ -7,3 +8,5 @@ SetUser = "setUser",

EndImpersonate = "endImpersonate",
SetActiveCluster = "setActiveCluster"
SetActiveCluster = "setActiveCluster",
SetAdmissionWebhookWarning = "setAdmissionWebhookWarning",
RemoveAdmissionWebhookWarning = "removeAdmissionWebhookWarning"
}

@@ -27,2 +30,15 @@ export declare const setUser: (userInfo: UserInfo) => {

};
export declare const setAdmissionWebhookWarning: (id: string, warning: AdmissionWebhookWarning) => {
type: ActionType.SetAdmissionWebhookWarning;
payload: {
id: string;
warning: AdmissionWebhookWarning;
};
};
export declare const removeAdmissionWebhookWarning: (id: any) => {
type: ActionType.RemoveAdmissionWebhookWarning;
payload: {
id: any;
};
};
declare const coreActions: {

@@ -46,4 +62,17 @@ setUser: (userInfo: UserInfo) => {

};
setAdmissionWebhookWarning: (id: string, warning: AdmissionWebhookWarning) => {
type: ActionType.SetAdmissionWebhookWarning;
payload: {
id: string;
warning: AdmissionWebhookWarning;
};
};
removeAdmissionWebhookWarning: (id: any) => {
type: ActionType.RemoveAdmissionWebhookWarning;
payload: {
id: any;
};
};
};
export declare type CoreAction = Action<typeof coreActions>;
export {};

@@ -8,2 +8,4 @@ import { action } from 'typesafe-actions';

ActionType["SetActiveCluster"] = "setActiveCluster";
ActionType["SetAdmissionWebhookWarning"] = "setAdmissionWebhookWarning";
ActionType["RemoveAdmissionWebhookWarning"] = "removeAdmissionWebhookWarning";
})(ActionType || (ActionType = {}));

@@ -13,2 +15,4 @@ export const setUser = (userInfo) => action(ActionType.SetUser, { userInfo });

export const endImpersonate = () => action(ActionType.EndImpersonate);
export const setAdmissionWebhookWarning = (id, warning) => action(ActionType.SetAdmissionWebhookWarning, { id, warning });
export const removeAdmissionWebhookWarning = (id) => action(ActionType.RemoveAdmissionWebhookWarning, { id });
const coreActions = {

@@ -18,3 +22,5 @@ setUser,

endImpersonate,
setAdmissionWebhookWarning,
removeAdmissionWebhookWarning,
};
//# sourceMappingURL=core.js.map

@@ -0,1 +1,2 @@

import { Map as ImmutableMap } from 'immutable';
import { ActionType } from '../actions/core';

@@ -11,3 +12,6 @@ /**

*/
export const coreReducer = (state = { user: {} }, action) => {
export const coreReducer = (state = {
user: {},
admissionWebhookWarnings: ImmutableMap(),
}, action) => {
switch (action.type) {

@@ -31,2 +35,6 @@ case ActionType.BeginImpersonate:

return Object.assign(Object.assign({}, state), { user: action.payload.userInfo });
case ActionType.SetAdmissionWebhookWarning:
return Object.assign(Object.assign({}, state), { admissionWebhookWarnings: state.admissionWebhookWarnings.set(action.payload.id, action.payload.warning) });
case ActionType.RemoveAdmissionWebhookWarning:
return Object.assign(Object.assign({}, state), { admissionWebhookWarnings: state.admissionWebhookWarnings.remove(action.payload.id) });
default:

@@ -33,0 +41,0 @@ return state;

@@ -0,5 +1,7 @@

import { Map as ImmutableMap } from 'immutable';
import { UserInfo } from '../../../extensions';
import { ImpersonateKind, SDKStoreState } from '../../redux-types';
import { ImpersonateKind, SDKStoreState, AdmissionWebhookWarning } from '../../redux-types';
declare type GetImpersonate = (state: SDKStoreState) => ImpersonateKind;
declare type GetUser = (state: SDKStoreState) => UserInfo;
declare type GetAdmissionWebhookWarnings = (state: SDKStoreState) => ImmutableMap<string, AdmissionWebhookWarning>;
/**

@@ -25,2 +27,8 @@ * It provides impersonation details from the redux store.

export declare const getUser: GetUser;
/**
* It provides admission webhook warning data from the redux store.
* @param state the root state
* @returns The the admissionWebhookWarning state.
*/
export declare const getAdmissionWebhookWarnings: GetAdmissionWebhookWarnings;
export {};

@@ -21,2 +21,8 @@ /**

export const getUser = (state) => state.sdkCore.user;
/**
* It provides admission webhook warning data from the redux store.
* @param state the root state
* @returns The the admissionWebhookWarning state.
*/
export const getAdmissionWebhookWarnings = (state) => state.sdkCore.admissionWebhookWarnings;
//# sourceMappingURL=coreSelectors.js.map
import { Map as ImmutableMap } from 'immutable';
import { UserInfo } from '../extensions/console-types';
export declare type K8sState = ImmutableMap<string, any>;
export declare type AdmissionWebhookWarning = {
kind: string;
name: string;
warning: string;
};
export declare type ImpersonateKind = {

@@ -12,2 +17,3 @@ kind: string;

impersonate?: ImpersonateKind;
admissionWebhookWarnings?: ImmutableMap<string, AdmissionWebhookWarning>;
};

@@ -14,0 +20,0 @@ export declare type SDKStoreState = {

@@ -217,9 +217,9 @@ import * as React from 'react';

export declare type UseResolvedExtensions = <E extends Extension>(...typeGuards: ExtensionTypeGuard<E>[]) => [ResolvedExtension<E>[], boolean, any[]];
export declare type ConsoleFetch = (url: string, options?: RequestInit, timeout?: number, isEntireResponse?: boolean) => Promise<Response>;
export declare type ConsoleFetch = (url: string, options?: RequestInit, timeout?: number) => Promise<Response>;
export declare type ConsoleFetchJSON<T = any> = {
(url: string, method?: string, options?: RequestInit, timeout?: number, isEntireResponse?: boolean): Promise<T>;
(url: string, method?: string, options?: RequestInit, timeout?: number): Promise<T>;
delete(url: string, json?: any, options?: RequestInit, timeout?: number): Promise<T>;
post(url: string, json: any, options?: RequestInit, timeout?: number, isEntireResponse?: boolean): Promise<T>;
put(url: string, json: any, options?: RequestInit, timeout?: number, isEntireResponse?: boolean): Promise<T>;
patch(url: string, json: any, options?: RequestInit, timeout?: number, isEntireResponse?: boolean): Promise<T>;
post(url: string, json: any, options?: RequestInit, timeout?: number): Promise<T>;
put(url: string, json: any, options?: RequestInit, timeout?: number): Promise<T>;
patch(url: string, json: any, options?: RequestInit, timeout?: number): Promise<T>;
};

@@ -264,2 +264,4 @@ export declare type ConsoleFetchText<T = any> = (...args: Parameters<ConsoleFetch>) => Promise<T>;

mock?: boolean;
sortColumnIndex?: number;
sortDirection?: SortByDirection;
};

@@ -596,2 +598,3 @@ export declare type VirtualizedTableFC = <D, R extends any = {}>(props: VirtualizedTableProps<D, R>) => JSX.Element;

export declare type UseActiveNamespace = () => [string, (ns: string) => void];
export declare type UseUserSettings = <T>(key: string, defaultValue?: T, sync?: boolean) => [T, React.Dispatch<React.SetStateAction<T>>, boolean];
export declare type TaintEffect = '' | 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';

@@ -598,0 +601,0 @@ export declare type Taint = {

@@ -21,4 +21,3 @@ import 'whatwg-fetch';

* @param timeout The timeout in milliseconds
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response as text, response JSON object or entire content of the HTTP response.
* @returns A promise that resolves to the response as text or JSON object.
*/

@@ -34,5 +33,4 @@ export declare const consoleFetchJSON: ConsoleFetchJSON;

* @param timeout The timeout in milliseconds
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response as text, response JSON object or entire content of the HTTP response.
* @returns A promise that resolves to the response as text or JSON object.
*/
export declare const consoleFetchText: ConsoleFetchText;

@@ -13,2 +13,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { getUtilsConfig } from '../../app/configSetup';
import { setAdmissionWebhookWarning } from '../../app/core/actions';
import storeHandler from '../../app/storeHandler';
import { TimeoutError } from '../error/http-error';

@@ -42,3 +44,9 @@ import { getConsoleRequestHeaders } from './console-fetch-utils';

});
const consoleFetchCommon = (url, method = 'GET', options = {}, timeout, isEntireResponse) => __awaiter(void 0, void 0, void 0, function* () {
const handleAdmissionWebhookWarning = (warning, kind, name) => {
const store = storeHandler.getStore();
const id = `${kind}_${name}_${warning}`;
const warningData = { kind, name, warning };
store.dispatch(setAdmissionWebhookWarning(id, warningData));
};
const consoleFetchCommon = (url, method = 'GET', options = {}, timeout) => __awaiter(void 0, void 0, void 0, function* () {
const headers = getConsoleRequestHeaders();

@@ -48,3 +56,12 @@ // Pass headers last to let callers to override Accept.

const response = yield consoleFetch(url, allOptions, timeout);
return isEntireResponse ? response : parseData(response);
const dataPromise = parseData(response);
const warning = response.headers.get('Warning');
// If the response has a warning header, store it in the redux store.
if (response.ok && warning && method !== 'GET') {
// Do nothing on error since this is a side-effect. Caller will handle the error.
dataPromise
.then((data) => { var _a; return handleAdmissionWebhookWarning(warning, data.kind, (_a = data.metadata) === null || _a === void 0 ? void 0 : _a.name); })
.catch(() => { });
}
return dataPromise;
});

@@ -60,10 +77,9 @@ /**

* @param timeout The timeout in milliseconds
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response as text, response JSON object or entire content of the HTTP response.
* @returns A promise that resolves to the response as text or JSON object.
*/
export const consoleFetchJSON = (url, method = 'GET', options = {}, timeout, isEntireResponse) => {
export const consoleFetchJSON = (url, method = 'GET', options = {}, timeout) => {
const allOptions = _.defaultsDeep({}, options, {
headers: { Accept: 'application/json' },
});
return consoleFetchCommon(url, method, allOptions, timeout, isEntireResponse);
return consoleFetchCommon(url, method, allOptions, timeout);
};

@@ -78,9 +94,8 @@ /**

* @param timeout The timeout in milliseconds
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response as text, response JSON object or entire content of the HTTP response.
* @returns A promise that resolves to the response as text or JSON object.
*/
export const consoleFetchText = (url, options = {}, timeout, isEntireResponse) => {
return consoleFetchCommon(url, 'GET', options, timeout, isEntireResponse);
export const consoleFetchText = (url, options = {}, timeout) => {
return consoleFetchCommon(url, 'GET', options, timeout);
};
const consoleFetchSendJSON = (url, method, json = null, options = {}, timeout, isEntireResponse) => {
const consoleFetchSendJSON = (url, method, json = null, options = {}, timeout) => {
const allOptions = {

@@ -95,3 +110,3 @@ headers: {

}
return consoleFetchJSON(url, method, _.defaultsDeep(allOptions, options), timeout, isEntireResponse);
return consoleFetchJSON(url, method, _.defaultsDeep(allOptions, options), timeout);
};

@@ -118,5 +133,4 @@ /**

* @param timeout The timeout in milliseconds
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
*/
consoleFetchJSON.post = (url, json, options = {}, timeout, isEntireResponse) => consoleFetchSendJSON(url, 'POST', json, options, timeout, isEntireResponse);
consoleFetchJSON.post = (url, json, options = {}, timeout) => consoleFetchSendJSON(url, 'POST', json, options, timeout);
/**

@@ -129,5 +143,4 @@ * A custom PUT method of consoleFetchJSON.

* @param timeout The timeout in milliseconds
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
*/
consoleFetchJSON.put = (url, json, options = {}, timeout, isEntireResponse) => consoleFetchSendJSON(url, 'PUT', json, options, timeout, isEntireResponse);
consoleFetchJSON.put = (url, json, options = {}, timeout) => consoleFetchSendJSON(url, 'PUT', json, options, timeout);
/**

@@ -140,5 +153,4 @@ * A custom PATCH method of consoleFetchJSON.

* @param timeout The timeout in milliseconds
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
*/
consoleFetchJSON.patch = (url, json, options = {}, timeout, isEntireResponse) => consoleFetchSendJSON(url, 'PATCH', json, options, timeout, isEntireResponse);
consoleFetchJSON.patch = (url, json, options = {}, timeout) => consoleFetchSendJSON(url, 'PATCH', json, options, timeout);
//# sourceMappingURL=console-fetch.js.map

@@ -19,3 +19,2 @@ import { K8sModel } from '../../api/common-types';

* @param requestInit The fetch init object to use. This can have request headers, method, redirect, etc.
* @param isEntireResponse The flag to cotrol whether to return full or partial response. The default is partial.
* See more at https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.requestinit.html

@@ -50,7 +49,6 @@ * @returns A promise that resolves to the response as JSON object with a resource if the name is provided

* @param opts The options to pass.
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response of the resource created.
* In case of failure promise gets rejected with HTTP error response.
*/
export declare const k8sCreate: <R extends K8sResourceCommon>(model: K8sModel, data: R, opts?: Options, isEntireResponse?: boolean) => Promise<any>;
export declare const k8sCreate: <R extends K8sResourceCommon>(model: K8sModel, data: R, opts?: Options) => Promise<any>;
declare type OptionsCreate<R> = BaseOptions & {

@@ -82,7 +80,6 @@ model: K8sModel;

* @param opts The options to pass
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response of the resource updated.
* In case of failure promise gets rejected with HTTP error response.
*/
export declare const k8sUpdate: <R extends K8sResourceCommon>(model: K8sModel, data: R, ns?: string, name?: string, opts?: Options, isEntireResponse?: boolean) => Promise<R>;
export declare const k8sUpdate: <R extends K8sResourceCommon>(model: K8sModel, data: R, ns?: string, name?: string, opts?: Options) => Promise<R>;
declare type OptionsUpdate<R> = BaseOptions & {

@@ -118,7 +115,6 @@ model: K8sModel;

* @param opts The options to pass
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response of the resource patched.
* In case of failure promise gets rejected with HTTP error response.
*/
export declare const k8sPatch: <R extends K8sResourceCommon>(model: K8sModel, resource: R, data: Patch[], opts?: Options, isEntireResponse?: boolean) => Promise<any>;
export declare const k8sPatch: <R extends K8sResourceCommon>(model: K8sModel, resource: R, data: Patch[], opts?: Options) => Promise<any>;
declare type OptionsPatch<R> = BaseOptions & {

@@ -125,0 +121,0 @@ model: K8sModel;

@@ -32,3 +32,2 @@ import * as _ from 'lodash';

* @param requestInit The fetch init object to use. This can have request headers, method, redirect, etc.
* @param isEntireResponse The flag to cotrol whether to return full or partial response. The default is partial.
* See more at https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules_typedoc_node_modules_typescript_lib_lib_dom_d_.requestinit.html

@@ -64,9 +63,8 @@ * @returns A promise that resolves to the response as JSON object with a resource if the name is provided

* @param opts The options to pass.
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response of the resource created.
* In case of failure promise gets rejected with HTTP error response.
*/
export const k8sCreate = (model, data, opts = {}, isEntireResponse) => {
export const k8sCreate = (model, data, opts = {}) => {
var _a;
return coFetchJSON.post(resourceURL(model, Object.assign({ ns: (_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.namespace }, opts)), data, null, null, isEntireResponse);
return coFetchJSON.post(resourceURL(model, Object.assign({ ns: (_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.namespace }, opts)), data, null, null);
};

@@ -98,9 +96,8 @@ /**

* @param opts The options to pass
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response of the resource updated.
* In case of failure promise gets rejected with HTTP error response.
*/
export const k8sUpdate = (model, data, ns, name, opts, isEntireResponse) => {
export const k8sUpdate = (model, data, ns, name, opts) => {
var _a, _b;
return coFetchJSON.put(resourceURL(model, Object.assign({ ns: ns || ((_a = data.metadata) === null || _a === void 0 ? void 0 : _a.namespace), name: name || ((_b = data.metadata) === null || _b === void 0 ? void 0 : _b.name) }, opts)), data, null, null, isEntireResponse);
return coFetchJSON.put(resourceURL(model, Object.assign({ ns: ns || ((_a = data.metadata) === null || _a === void 0 ? void 0 : _a.namespace), name: name || ((_b = data.metadata) === null || _b === void 0 ? void 0 : _b.name) }, opts)), data, null, null);
};

@@ -138,7 +135,6 @@ /**

* @param opts The options to pass
* @param isEntireResponse The flag to control whether to return the entire content of the response or response body. The default is the response body.
* @returns A promise that resolves to the response of the resource patched.
* In case of failure promise gets rejected with HTTP error response.
*/
export const k8sPatch = (model, resource, data, opts = {}, isEntireResponse) => {
export const k8sPatch = (model, resource, data, opts = {}) => {
const patches = _.compact(data);

@@ -151,3 +147,3 @@ if (_.isEmpty(patches)) {

name: resource.metadata.name,
}, opts)), patches, null, null, isEntireResponse);
}, opts)), patches, null, null);
};

@@ -154,0 +150,0 @@ /**

{
"name": "@openshift-console/dynamic-plugin-sdk",
"version": "1.3.0",
"version": "1.4.0",
"main": "lib/lib-core.js",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -78,3 +78,3 @@ # OpenShift Console Dynamic Plugins

Refer to [PatternFly Upgrade Notes](./upgrade-PatternFly.md) containing links to PatternFly documentation.
Refer to [PatternFly Upgrade Notes][console-pf-upgrade-notes] containing links to PatternFly documentation.

@@ -113,3 +113,3 @@ ## Shared modules

- Added `react-router-dom-v5-compat` to allow plugins to migrate to React Router v6. Check the
- Added `react-router-dom-v5-compat` module to allow plugins to migrate to React Router v6. Check the
[Official v5 to v6 Migration Guide](https://github.com/remix-run/react-router/discussions/8753)

@@ -121,4 +121,12 @@ (section "Migration Strategy" and beyond) for details.

- The Console application now uses React Router v6 code internally. Plugins that only target OpenShift
Console 4.15 or later should fully upgrade to React Router v6 via `react-router-dom-v5-compat`.
Console 4.15 or later should fully upgrade to React Router v6 via `react-router-dom-v5-compat` module.
#### Console 4.16.x
- Removed `react-helmet` module.
- All Console provided PatternFly 4.x shared modules are deprecated and will be removed in the future.
See [PatternFly Upgrade Notes][console-pf-upgrade-notes] for details on upgrading to PatternFly 5.
- All Console provided React Router v5 shared modules are deprecated and will be removed in the future.
Plugins should upgrade to React Router v6 via `react-router-dom-v5-compat` module.
### PatternFly dynamic modules

@@ -418,6 +426,14 @@

- `react-helmet`
- Console provided PatternFly 4.x shared modules
- `@patternfly/react-core`
- `@patternfly/react-table`
- `@patternfly/quickstarts`
- Console provided React Router v5 shared modules
- `react-router`
- `react-router-dom`
[console-doc-extensions]: ./docs/console-extensions.md
[console-doc-api]: ./docs/api.md
[console-doc-feature-page]: https://github.com/openshift/enhancements/blob/master/enhancements/console/dynamic-plugins.md
[console-pf-upgrade-notes]: ./upgrade-PatternFly.md

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc