@kwirthmagnify/kwirth-common-back 0.1.0
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/dist/IProvider.d.ts +25 -0
- package/dist/IProvider.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/package.json +32 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { KwirthData } from '@kwirthmagnify/kwirth-common';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal interface representing the channel side that providers interact with.
|
|
4
|
+
* Providers only need to call processProviderEvent on their subscribers.
|
|
5
|
+
*/
|
|
6
|
+
export interface IProviderSubscriber {
|
|
7
|
+
processProviderEvent(providerId: string, obj: any): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Interface that all provider plugins must implement.
|
|
11
|
+
* Use 'any' for clusterInfo to avoid pulling in kubernetes/docker dependencies.
|
|
12
|
+
*/
|
|
13
|
+
export interface IProvider {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly providesRouter: boolean;
|
|
16
|
+
readonly requiresApiKeyApi: boolean;
|
|
17
|
+
addSubscriber(c: IProviderSubscriber, data: any): Promise<void>;
|
|
18
|
+
removeSubscriber(c: IProviderSubscriber): Promise<void>;
|
|
19
|
+
startProvider(): Promise<void>;
|
|
20
|
+
stopProvider(): Promise<void>;
|
|
21
|
+
router: any;
|
|
22
|
+
routerAlias: string | undefined;
|
|
23
|
+
apiKeyApi: any | undefined;
|
|
24
|
+
}
|
|
25
|
+
export type TProviderConstructor = new (clusterInfo: any, kwirthData: KwirthData) => IProvider;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./IProvider"), exports);
|
|
18
|
+
__exportStar(require("@kwirthmagnify/kwirth-common"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kwirthmagnify/kwirth-common-back",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Backend interfaces for building Kwirth provider and channel plugins",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc"
|
|
7
|
+
},
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"main": "dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"module": "dist/index.js",
|
|
14
|
+
"types": "dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"kwirth",
|
|
20
|
+
"provider",
|
|
21
|
+
"plugin",
|
|
22
|
+
"channel"
|
|
23
|
+
],
|
|
24
|
+
"author": "Julio Fernandez",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@kwirthmagnify/kwirth-common": "^0.5.2"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript": "^5.8.3"
|
|
31
|
+
}
|
|
32
|
+
}
|