@stolostron/multicluster-sdk 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/index.d.ts +3 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/index.js +20 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/resource-link.d.ts +4 -0
- package/lib/api/resource-link.d.ts.map +1 -0
- package/lib/api/resource-link.js +27 -0
- package/lib/api/resource-link.js.map +1 -0
- package/lib/api/use-k8s-watch-resource.d.ts +4 -0
- package/lib/api/use-k8s-watch-resource.d.ts.map +1 -0
- package/lib/api/use-k8s-watch-resource.js +14 -0
- package/lib/api/use-k8s-watch-resource.js.map +1 -0
- package/lib/extensions/index.d.ts +2 -0
- package/lib/extensions/index.d.ts.map +1 -0
- package/lib/extensions/index.js +19 -0
- package/lib/extensions/index.js.map +1 -0
- package/lib/extensions/resource.d.ts +41 -0
- package/lib/extensions/resource.d.ts.map +1 -0
- package/lib/extensions/resource.js +15 -0
- package/lib/extensions/resource.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/hooks/index.d.ts +2 -0
- package/lib/internal/hooks/index.d.ts.map +1 -0
- package/lib/internal/hooks/index.js +19 -0
- package/lib/internal/hooks/index.js.map +1 -0
- package/lib/internal/hooks/multicluster-sdk.d.ts +2 -0
- package/lib/internal/hooks/multicluster-sdk.d.ts.map +1 -0
- package/lib/internal/hooks/multicluster-sdk.js +12 -0
- package/lib/internal/hooks/multicluster-sdk.js.map +1 -0
- package/lib/internal/index.d.ts +4 -0
- package/lib/internal/index.d.ts.map +1 -0
- package/lib/internal/index.js +21 -0
- package/lib/internal/index.js.map +1 -0
- package/lib/internal/types/index.d.ts +2 -0
- package/lib/internal/types/index.d.ts.map +1 -0
- package/lib/internal/types/index.js +19 -0
- package/lib/internal/types/index.js.map +1 -0
- package/lib/internal/types/multicluster-sdk.d.ts +19 -0
- package/lib/internal/types/multicluster-sdk.d.ts.map +1 -0
- package/lib/internal/types/multicluster-sdk.js +10 -0
- package/lib/internal/types/multicluster-sdk.js.map +1 -0
- package/lib/internal/utils/index.d.ts +2 -0
- package/lib/internal/utils/index.d.ts.map +1 -0
- package/lib/internal/utils/index.js +19 -0
- package/lib/internal/utils/index.js.map +1 -0
- package/lib/internal/utils/should-override.d.ts +3 -0
- package/lib/internal/utils/should-override.d.ts.map +1 -0
- package/lib/internal/utils/should-override.js +8 -0
- package/lib/internal/utils/should-override.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/with-cluster.d.ts +5 -0
- package/lib/types/with-cluster.d.ts.map +1 -0
- package/lib/types/with-cluster.js +3 -0
- package/lib/types/with-cluster.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA"}
|
package/lib/api/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
18
|
+
__exportStar(require("./resource-link"), exports);
|
|
19
|
+
__exportStar(require("./use-k8s-watch-resource"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,kDAA+B;AAC/B,2DAAwC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ResourceLinkProps } from "@openshift-console/dynamic-plugin-sdk";
|
|
2
|
+
import { PropsWithCluster } from "../types/with-cluster";
|
|
3
|
+
export declare const ResourceLink: ({ cluster, ...props }: PropsWithCluster<ResourceLinkProps>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=resource-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-link.d.ts","sourceRoot":"","sources":["../../src/api/resource-link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAuC,MAAM,uCAAuC,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIzD,eAAO,MAAM,YAAY,0BAAyB,gBAAgB,CAAC,iBAAiB,CAAC,4CAIpF,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ResourceLink = void 0;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
17
|
+
const dynamic_plugin_sdk_1 = require("@openshift-console/dynamic-plugin-sdk");
|
|
18
|
+
const multicluster_sdk_1 = require("../internal/hooks/multicluster-sdk");
|
|
19
|
+
const should_override_1 = require("../internal/utils/should-override");
|
|
20
|
+
const ResourceLink = (_a) => {
|
|
21
|
+
var { cluster } = _a, props = __rest(_a, ["cluster"]);
|
|
22
|
+
const sdkProvider = (0, multicluster_sdk_1.useMulticlusterSDKProvider)();
|
|
23
|
+
const ResourceLinkComponent = sdkProvider && (0, should_override_1.shouldOverride)(cluster, sdkProvider) ? sdkProvider.getResourceLink(cluster) : dynamic_plugin_sdk_1.ResourceLink;
|
|
24
|
+
return (0, jsx_runtime_1.jsx)(ResourceLinkComponent, Object.assign({}, props));
|
|
25
|
+
};
|
|
26
|
+
exports.ResourceLink = ResourceLink;
|
|
27
|
+
//# sourceMappingURL=resource-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-link.js","sourceRoot":"","sources":["../../src/api/resource-link.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,8EAA+G;AAE/G,yEAAgF;AAChF,uEAAmE;AAE5D,MAAM,YAAY,GAAG,CAAC,EAAwD,EAAE,EAAE;QAA5D,EAAC,OAAO,OAAgD,EAA3C,KAAK,cAAlB,WAAmB,CAAD;IAC7C,MAAM,WAAW,GAAG,IAAA,6CAA0B,GAAE,CAAA;IAChD,MAAM,qBAAqB,GAAG,WAAW,IAAI,IAAA,gCAAc,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iCAAmB,CAAA;IAC9I,OAAO,uBAAC,qBAAqB,oBAAK,KAAK,EAAG,CAAA;AAC5C,CAAC,CAAA;AAJY,QAAA,YAAY,gBAIxB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UseK8sWatchResource } from "@openshift-console/dynamic-plugin-sdk";
|
|
2
|
+
import { FunctionWithClusterParam } from "../types/with-cluster";
|
|
3
|
+
export declare const useK8sWatchResource: FunctionWithClusterParam<UseK8sWatchResource>;
|
|
4
|
+
//# sourceMappingURL=use-k8s-watch-resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-k8s-watch-resource.d.ts","sourceRoot":"","sources":["../../src/api/use-k8s-watch-resource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAqD,MAAM,uCAAuC,CAAC;AAC/H,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAIjE,eAAO,MAAM,mBAAmB,EAAE,wBAAwB,CAAC,mBAAmB,CAI7E,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useK8sWatchResource = void 0;
|
|
4
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
5
|
+
const dynamic_plugin_sdk_1 = require("@openshift-console/dynamic-plugin-sdk");
|
|
6
|
+
const multicluster_sdk_1 = require("../internal/hooks/multicluster-sdk");
|
|
7
|
+
const should_override_1 = require("../internal/utils/should-override");
|
|
8
|
+
const useK8sWatchResource = (cluster, ...args) => {
|
|
9
|
+
const sdkProvider = (0, multicluster_sdk_1.useMulticlusterSDKProvider)();
|
|
10
|
+
const useK8sWatchResourceHook = sdkProvider && (0, should_override_1.shouldOverride)(cluster, sdkProvider) ? sdkProvider.getUseK8sWatchResource(cluster) : dynamic_plugin_sdk_1.useK8sWatchResource;
|
|
11
|
+
return useK8sWatchResourceHook(...args);
|
|
12
|
+
};
|
|
13
|
+
exports.useK8sWatchResource = useK8sWatchResource;
|
|
14
|
+
//# sourceMappingURL=use-k8s-watch-resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-k8s-watch-resource.js","sourceRoot":"","sources":["../../src/api/use-k8s-watch-resource.ts"],"names":[],"mappings":";;;AAAA,mEAAmE;AACnE,8EAA+H;AAE/H,yEAAgF;AAChF,uEAAmE;AAE5D,MAAM,mBAAmB,GAAkD,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE;IACrG,MAAM,WAAW,GAAG,IAAA,6CAA0B,GAAE,CAAA;IAChD,MAAM,uBAAuB,GAAG,WAAW,IAAI,IAAA,gCAAc,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,wCAA0B,CAAA;IAC9J,OAAO,uBAAuB,CAAC,GAAG,IAAI,CAAC,CAAA;AACzC,CAAC,CAAA;AAJY,QAAA,mBAAmB,uBAI/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
18
|
+
__exportStar(require("./resource"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,6CAA0B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CodeRef, Extension, ExtensionDeclaration } from '@openshift-console/dynamic-plugin-sdk/lib/types';
|
|
2
|
+
import { ExtensionK8sGroupKindModel, ExtensionK8sModel, K8sResourceCommon } from '@openshift-console/dynamic-plugin-sdk';
|
|
3
|
+
import { PropsWithCluster } from '../types/with-cluster';
|
|
4
|
+
declare const RESOURCE_DETAILS_TYPE = "acm.resource/details";
|
|
5
|
+
declare const RESOURCE_TAB_TYPE = "acm.resource/tab";
|
|
6
|
+
export type ResourceTabComponent = React.ComponentType<{
|
|
7
|
+
/** The cluster where the resource is located. */
|
|
8
|
+
cluster: string;
|
|
9
|
+
/** The namespace where the resource is located (if the resource is namespace-scoped). */
|
|
10
|
+
namespace?: string;
|
|
11
|
+
/** The name of the resource. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The resource, augmented with cluster property. */
|
|
14
|
+
resource: PropsWithCluster<K8sResourceCommon>;
|
|
15
|
+
/** The model for the resource. */
|
|
16
|
+
model: ExtensionK8sModel;
|
|
17
|
+
}>;
|
|
18
|
+
export type ResourceTabProps = {
|
|
19
|
+
/** The model for which this details component should be used. */
|
|
20
|
+
model: ExtensionK8sGroupKindModel;
|
|
21
|
+
/** The component to be rendered for the details tab of a matching resource. */
|
|
22
|
+
component: CodeRef<ResourceTabComponent>;
|
|
23
|
+
};
|
|
24
|
+
export type ResourceTabMetadataProps = {
|
|
25
|
+
/** A unique identifier for this resource tab. */
|
|
26
|
+
id: string;
|
|
27
|
+
/** The name of the tab. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** Insert this item before the item referenced here. For arrays, the first one found in order is used. */
|
|
30
|
+
insertBefore?: string | string[];
|
|
31
|
+
/** Insert this item after the item referenced here. For arrays, the first one found in order is used. `insertBefore` takes precedence. */
|
|
32
|
+
insertAfter?: string | string[];
|
|
33
|
+
};
|
|
34
|
+
/** This extension allows plugins to replace the contents of the ACM resource details tab. */
|
|
35
|
+
export type ResourceDetails = ExtensionDeclaration<typeof RESOURCE_DETAILS_TYPE, ResourceTabProps>;
|
|
36
|
+
/** This extension allows plugins to add tabs to the ACM resource details page. */
|
|
37
|
+
export type ResourceTab = ExtensionDeclaration<typeof RESOURCE_TAB_TYPE, ResourceTabComponent & ResourceTabMetadataProps>;
|
|
38
|
+
export declare const isResourceDetails: (e: Extension) => e is ResourceDetails;
|
|
39
|
+
export declare const isResourceTab: (e: Extension) => e is ResourceDetails;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/extensions/resource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAC1G,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,QAAA,MAAM,qBAAqB,yBAAyB,CAAA;AACpD,QAAA,MAAM,iBAAiB,qBAAqB,CAAA;AAG5C,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAC;IACrD,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAA;IACf,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,qDAAqD;IACrD,QAAQ,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAC7C,kCAAkC;IAClC,KAAK,EAAE,iBAAiB,CAAA;CACzB,CAAC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iEAAiE;IACjE,KAAK,EAAE,0BAA0B,CAAA;IACjC,+EAA+E;IAC/E,SAAS,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAA;IACV,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,0GAA0G;IAC1G,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAChC,0IAA0I;IAC1I,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAChC,CAAA;AAED,6FAA6F;AAC7F,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAElG,kFAAkF;AAClF,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC,OAAO,iBAAiB,EAAE,oBAAoB,GAAG,wBAAwB,CAAC,CAAA;AAGzH,eAAO,MAAM,iBAAiB,MAAO,SAAS,KAAG,CAAC,IAAI,eAErD,CAAA;AAED,eAAO,MAAM,aAAa,MAAO,SAAS,KAAG,CAAC,IAAI,eAEjD,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isResourceTab = exports.isResourceDetails = void 0;
|
|
4
|
+
const RESOURCE_DETAILS_TYPE = 'acm.resource/details';
|
|
5
|
+
const RESOURCE_TAB_TYPE = 'acm.resource/tab';
|
|
6
|
+
// Type guards
|
|
7
|
+
const isResourceDetails = (e) => {
|
|
8
|
+
return e.type === RESOURCE_DETAILS_TYPE;
|
|
9
|
+
};
|
|
10
|
+
exports.isResourceDetails = isResourceDetails;
|
|
11
|
+
const isResourceTab = (e) => {
|
|
12
|
+
return e.type === RESOURCE_TAB_TYPE;
|
|
13
|
+
};
|
|
14
|
+
exports.isResourceTab = isResourceTab;
|
|
15
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/extensions/resource.ts"],"names":[],"mappings":";;;AAKA,MAAM,qBAAqB,GAAG,sBAAsB,CAAA;AACpD,MAAM,iBAAiB,GAAG,kBAAkB,CAAA;AAwC5C,cAAc;AACP,MAAM,iBAAiB,GAAG,CAAC,CAAY,EAAwB,EAAE;IACtE,OAAO,CAAC,CAAC,IAAI,KAAK,qBAAqB,CAAA;AACzC,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B;AAEM,MAAM,aAAa,GAAG,CAAC,CAAY,EAAwB,EAAE;IAClE,OAAO,CAAC,CAAC,IAAI,KAAK,iBAAiB,CAAA;AACrC,CAAC,CAAA;AAFY,QAAA,aAAa,iBAEzB"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
18
|
+
__exportStar(require("./api"), exports);
|
|
19
|
+
__exportStar(require("./extensions"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,wCAAqB;AACrB,+CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/hooks/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
18
|
+
__exportStar(require("./multicluster-sdk"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,qDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multicluster-sdk.d.ts","sourceRoot":"","sources":["../../../src/internal/hooks/multicluster-sdk.ts"],"names":[],"mappings":"AAKA,wBAAgB,0BAA0B,4EAIzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useMulticlusterSDKProvider = useMulticlusterSDKProvider;
|
|
5
|
+
const dynamic_plugin_sdk_1 = require("@openshift-console/dynamic-plugin-sdk");
|
|
6
|
+
const multicluster_sdk_1 = require("../types/multicluster-sdk");
|
|
7
|
+
function useMulticlusterSDKProvider() {
|
|
8
|
+
const [multiclusterSDKs, resolved] = (0, dynamic_plugin_sdk_1.useResolvedExtensions)(multicluster_sdk_1.isMulticlusterSDK);
|
|
9
|
+
// TODO: Choose best compatible version
|
|
10
|
+
return resolved && multiclusterSDKs.length ? multiclusterSDKs[0].properties.sdkProvider : undefined;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=multicluster-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multicluster-sdk.js","sourceRoot":"","sources":["../../../src/internal/hooks/multicluster-sdk.ts"],"names":[],"mappings":";AAAA,mEAAmE;;AAKnE,gEAIC;AAPD,8EAA8E;AAC9E,gEAA8D;AAE9D,SAAgB,0BAA0B;IACxC,MAAM,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG,IAAA,0CAAqB,EAAC,oCAAiB,CAAC,CAAA;IAC7E,uCAAuC;IACvC,OAAO,QAAQ,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAA;AACrG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
18
|
+
__exportStar(require("./hooks"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
20
|
+
__exportStar(require("./utils"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,0CAAuB;AACvB,0CAAuB;AACvB,0CAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/types/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
18
|
+
__exportStar(require("./multicluster-sdk"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,qDAAkC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResourceLink, useAccessReview, UseK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk';
|
|
2
|
+
import { CodeRef, Extension, ExtensionDeclaration } from '@openshift-console/dynamic-plugin-sdk/lib/types';
|
|
3
|
+
declare const MULTICLUSTER_SDK_TYPE = "acm.multicluster-sdk";
|
|
4
|
+
type ClusterScopedFactory<T> = (cluster: string) => T;
|
|
5
|
+
export type MulticlusterSDKProvider = {
|
|
6
|
+
getHubClusterName: () => string;
|
|
7
|
+
getK8sAPIPath: (cluster: string) => string;
|
|
8
|
+
getResourceLink: ClusterScopedFactory<typeof ResourceLink>;
|
|
9
|
+
getUseAccessReview: ClusterScopedFactory<typeof useAccessReview>;
|
|
10
|
+
getUseK8sWatchResource: ClusterScopedFactory<UseK8sWatchResource>;
|
|
11
|
+
};
|
|
12
|
+
export type MulticlusterSDKExtensionProperties = {
|
|
13
|
+
version: string;
|
|
14
|
+
sdkProvider: CodeRef<MulticlusterSDKProvider>;
|
|
15
|
+
};
|
|
16
|
+
export type MulticlusterSDKExtension = ExtensionDeclaration<typeof MULTICLUSTER_SDK_TYPE, MulticlusterSDKExtensionProperties>;
|
|
17
|
+
export declare const isMulticlusterSDK: (e: Extension) => e is MulticlusterSDKExtension;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=multicluster-sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multicluster-sdk.d.ts","sourceRoot":"","sources":["../../../src/internal/types/multicluster-sdk.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,mBAAmB,EACpB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAE1G,QAAA,MAAM,qBAAqB,yBAAyB,CAAA;AAEpD,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,KAAK,CAAC,CAAA;AAErD,MAAM,MAAM,uBAAuB,GAAG;IAEpC,iBAAiB,EAAE,MAAM,MAAM,CAAA;IAC/B,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IAG1C,eAAe,EAAE,oBAAoB,CAAC,OAAO,YAAY,CAAC,CAAA;IAC1D,kBAAkB,EAAE,oBAAoB,CAAC,OAAO,eAAe,CAAC,CAAA;IAChE,sBAAsB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,CAAA;CAKlE,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC9C,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CACzD,OAAO,qBAAqB,EAC5B,kCAAkC,CACnC,CAAA;AAGD,eAAO,MAAM,iBAAiB,MAAO,SAAS,KAAG,CAAC,IAAI,wBAErD,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMulticlusterSDK = void 0;
|
|
4
|
+
const MULTICLUSTER_SDK_TYPE = 'acm.multicluster-sdk';
|
|
5
|
+
// Type guards
|
|
6
|
+
const isMulticlusterSDK = (e) => {
|
|
7
|
+
return e.type === MULTICLUSTER_SDK_TYPE;
|
|
8
|
+
};
|
|
9
|
+
exports.isMulticlusterSDK = isMulticlusterSDK;
|
|
10
|
+
//# sourceMappingURL=multicluster-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multicluster-sdk.js","sourceRoot":"","sources":["../../../src/internal/types/multicluster-sdk.ts"],"names":[],"mappings":";;;AAQA,MAAM,qBAAqB,GAAG,sBAAsB,CAAA;AA6BpD,cAAc;AACP,MAAM,iBAAiB,GAAG,CAAC,CAAY,EAAiC,EAAE;IAC/E,OAAO,CAAC,CAAC,IAAI,KAAK,qBAAqB,CAAA;AACzC,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
18
|
+
__exportStar(require("./should-override"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,oDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-override.d.ts","sourceRoot":"","sources":["../../../src/internal/utils/should-override.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,uBAAuB,GAAG,OAAO,IAAI,MAAM,CAEnH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright Contributors to the Open Cluster Management project */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.shouldOverride = shouldOverride;
|
|
5
|
+
function shouldOverride(cluster, sdkProvider) {
|
|
6
|
+
return !!(cluster && cluster !== (sdkProvider === null || sdkProvider === void 0 ? void 0 : sdkProvider.getHubClusterName()));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=should-override.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-override.js","sourceRoot":"","sources":["../../../src/internal/utils/should-override.ts"],"names":[],"mappings":";AAAA,mEAAmE;;AAInE,wCAEC;AAFD,SAAgB,cAAc,CAAC,OAA2B,EAAE,WAAoC;IAC9F,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,OAAO,MAAK,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,iBAAiB,EAAE,CAAA,CAAC,CAAA;AACpE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/index.ts","../src/api/index.ts","../src/api/resource-link.tsx","../src/api/use-k8s-watch-resource.ts","../src/extensions/index.ts","../src/extensions/resource.ts","../src/internal/index.ts","../src/internal/hooks/index.ts","../src/internal/hooks/multicluster-sdk.ts","../src/internal/types/index.ts","../src/internal/types/multicluster-sdk.ts","../src/internal/utils/index.ts","../src/internal/utils/should-override.ts","../src/types/with-cluster.ts"],"version":"5.6.3"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-cluster.d.ts","sourceRoot":"","sources":["../../src/types/with-cluster.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAC1D,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-cluster.js","sourceRoot":"","sources":["../../src/types/with-cluster.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stolostron/multicluster-sdk",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Provides extensions and APIs that dynamic plugins can use to leverage multicluster capabilities provided by Red Hat Advanced Cluster Management.",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/stolostron/console.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"multicluster",
|
|
16
|
+
"RHACM",
|
|
17
|
+
"ACM",
|
|
18
|
+
"SDK",
|
|
19
|
+
"OpenShift",
|
|
20
|
+
"dynamic plugin",
|
|
21
|
+
"Red Hat"
|
|
22
|
+
],
|
|
23
|
+
"license": "Apache-2.0",
|
|
24
|
+
"homepage": "https://github.com/stolostron/console/tree/main/frontend/packages/multicluster-sdk#readme",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc --build",
|
|
27
|
+
"tsc": "tsc --no-emit",
|
|
28
|
+
"prettier": "prettier --check src",
|
|
29
|
+
"prettier:fix": "prettier --write src"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@openshift-console/dynamic-plugin-sdk": "1.x"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"prettier": "^3.2.5",
|
|
36
|
+
"typescript": "^5.6.3"
|
|
37
|
+
},
|
|
38
|
+
"prettier": "@stolostron/prettier-config"
|
|
39
|
+
}
|