- Modified:
  - renaming the following constants in  `lib/types/ui/editor/INodes`:
    - NODE_TYPE_CONSTANT = "node:data:constant";
    - NODE_TYPE_DATA_TO_TOKEN = "node:logic:data-to-token";
    - NODE_TYPE_FLOW_OPERATION = "node:logic:flow";
    - NODE_TYPE_PLACE = "node:logic:place";
    - NODE_TYPE_TOKEN_TO_DATA = "node:logic:token-to-data";
    - NODE_TYPE_TRANSITION = "node:logic:transition";
    - NODE_TYPE_VAR = "node:data:constant";
    - NODE_TYPE_MODULE = "node:module";
  - updating `TServiceGetPortsReturn` (adding `label` and removing `type`)and `IServiceEditPage` (remove `getPorts`) in  `lib/types/ui/editor/IServiceEditPage`
  - relocating `IUiDefinition` to `lib/types/ui/helpers.interface`
    - influences `lib/ui/helpers.browser` and `lib/ui/helpers.nodejs`

- fixing Link.bat
This commit is contained in:
Martin Karkowski 2022-07-15 15:56:16 +02:00
parent 39d7fe720e
commit a919968f9c
10 changed files with 116 additions and 63 deletions

View File

@ -1,4 +1,4 @@
@echo off
set DIR=%~dp0 set DIR=%~dp0
cd "%DIR%" cd "%DIR%"
@ -7,8 +7,8 @@ if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
(npm link) && ( (npm link) && (
node contribute/toLinkBrowser.js node contribute/toLinkBrowser.js
cp ./package.json ./build/package.json copy .\\package.json .\\build\\package.json
cp -r .\dist-browser\ .\build\dist-browser copy -r .\dist-browser\ .\build\dist-browser
cd ./build cd ./build
@ -22,8 +22,8 @@ if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
) || ( ) || (
node contribute/toLinkBrowser.js node contribute/toLinkBrowser.js
cp ./package.json ./build/package.json copy ./package.json ./build/package.json
cp -r .\dist-browser\ .\build\dist-browser copy -r .\dist-browser\ .\build\dist-browser
cd ./build cd ./build
@ -35,3 +35,5 @@ if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
node contribute/toNodejs.js node contribute/toNodejs.js
) )
) )
pause

View File

@ -141,3 +141,19 @@ Inital commit, which is working with the browser
- Renamed `NODE_TYPE_COMPOSED` to `NODE_TYPE_GROUP` - Renamed `NODE_TYPE_COMPOSED` to `NODE_TYPE_GROUP`
- Adapted `TRenderConfigureServicePage`, `TRenderInstancePage` and `TInstanceManagerPage` by adding `Extension`-Type - Adapted `TRenderConfigureServicePage`, `TRenderInstancePage` and `TInstanceManagerPage` by adding `Extension`-Type
- Adapted `TRenderFunction` removing the args setting. - Adapted `TRenderFunction` removing the args setting.
# 1.2.2
- Modified:
- renaming the following constants in `lib/types/ui/editor/INodes`:
- NODE_TYPE_CONSTANT = "node:data:constant";
- NODE_TYPE_DATA_TO_TOKEN = "node:logic:data-to-token";
- NODE_TYPE_FLOW_OPERATION = "node:logic:flow";
- NODE_TYPE_PLACE = "node:logic:place";
- NODE_TYPE_TOKEN_TO_DATA = "node:logic:token-to-data";
- NODE_TYPE_TRANSITION = "node:logic:transition";
- NODE_TYPE_VAR = "node:data:constant";
- NODE_TYPE_MODULE = "node:module";
- updating `TServiceGetPortsReturn` (adding `label` and removing `type`)and `IServiceEditPage` (remove `getPorts`) in `lib/types/ui/editor/IServiceEditPage`
- relocating `IUiDefinition` to `lib/types/ui/helpers.interface`
- influences `lib/ui/helpers.browser` and `lib/ui/helpers.nodejs`

View File

@ -1 +1 @@
1.2.1 1.2.2

View File

@ -23,13 +23,14 @@ export type VALID_PORTS =
| PORT_REQUIRE_TOKEN; | PORT_REQUIRE_TOKEN;
export type NODE_TYPE_GROUP = "node:group"; export type NODE_TYPE_GROUP = "node:group";
export type NODE_TYPE_CONSTANT = "data:constant"; export type NODE_TYPE_CONSTANT = "node:data:constant";
export type NODE_TYPE_DATA_TO_TOKEN = "logic:data-to-token"; export type NODE_TYPE_DATA_TO_TOKEN = "node:logic:data-to-token";
export type NODE_TYPE_FLOW_OPERATION = "logic:flow"; export type NODE_TYPE_FLOW_OPERATION = "node:logic:flow";
export type NODE_TYPE_PLACE = "logic:place"; export type NODE_TYPE_PLACE = "node:logic:place";
export type NODE_TYPE_TOKEN_TO_DATA = "logic:token-to-data"; export type NODE_TYPE_TOKEN_TO_DATA = "node:logic:token-to-data";
export type NODE_TYPE_TRANSITION = "logic:transition"; export type NODE_TYPE_TRANSITION = "node:logic:transition";
export type NODE_TYPE_VAR = "data:constant"; export type NODE_TYPE_VAR = "node:data:constant";
export type NODE_TYPE_MODULE = "node:module";
export type VALID_NODES = export type VALID_NODES =
| NODE_TYPE_GROUP | NODE_TYPE_GROUP
@ -40,6 +41,7 @@ export type VALID_NODES =
| NODE_TYPE_TOKEN_TO_DATA | NODE_TYPE_TOKEN_TO_DATA
| NODE_TYPE_TRANSITION | NODE_TYPE_TRANSITION
| NODE_TYPE_VAR | NODE_TYPE_VAR
| NODE_TYPE_MODULE
| VALID_PORTS; | VALID_PORTS;
export const PORT_AVOID_TOKEN: PORT_AVOID_TOKEN = "flow.input.avoid"; export const PORT_AVOID_TOKEN: PORT_AVOID_TOKEN = "flow.input.avoid";
@ -63,15 +65,18 @@ export const VALID_PORTS: Array<VALID_PORTS> = [
]; ];
export const NODE_TYPE_GROUP: NODE_TYPE_GROUP = "node:group"; export const NODE_TYPE_GROUP: NODE_TYPE_GROUP = "node:group";
export const NODE_TYPE_CONSTANT: NODE_TYPE_CONSTANT = "data:constant"; export const NODE_TYPE_CONSTANT: NODE_TYPE_CONSTANT = "node:data:constant";
export const NODE_TYPE_DATA_TO_TOKEN: NODE_TYPE_DATA_TO_TOKEN = export const NODE_TYPE_DATA_TO_TOKEN: NODE_TYPE_DATA_TO_TOKEN =
"logic:data-to-token"; "node:logic:data-to-token";
export const NODE_TYPE_FLOW_OPERATION: NODE_TYPE_FLOW_OPERATION = "logic:flow"; export const NODE_TYPE_FLOW_OPERATION: NODE_TYPE_FLOW_OPERATION =
export const NODE_TYPE_PLACE: NODE_TYPE_PLACE = "logic:place"; "node:logic:flow";
export const NODE_TYPE_PLACE: NODE_TYPE_PLACE = "node:logic:place";
export const NODE_TYPE_TOKEN_TO_DATA: NODE_TYPE_TOKEN_TO_DATA = export const NODE_TYPE_TOKEN_TO_DATA: NODE_TYPE_TOKEN_TO_DATA =
"logic:token-to-data"; "node:logic:token-to-data";
export const NODE_TYPE_TRANSITION: NODE_TYPE_TRANSITION = "logic:transition"; export const NODE_TYPE_TRANSITION: NODE_TYPE_TRANSITION =
export const NODE_TYPE_VAR: NODE_TYPE_VAR = "data:constant"; "node:logic:transition";
export const NODE_TYPE_VAR: NODE_TYPE_VAR = "node:data:constant";
export const NODE_TYPE_MODULE: NODE_TYPE_MODULE = "node:module";
export const VALID_NODES: Array<VALID_NODES> = [ export const VALID_NODES: Array<VALID_NODES> = [
NODE_TYPE_GROUP, NODE_TYPE_GROUP,
@ -81,6 +86,7 @@ export const VALID_NODES: Array<VALID_NODES> = [
NODE_TYPE_PLACE, NODE_TYPE_PLACE,
NODE_TYPE_TOKEN_TO_DATA, NODE_TYPE_TOKEN_TO_DATA,
NODE_TYPE_TRANSITION, NODE_TYPE_TRANSITION,
NODE_TYPE_MODULE,
NODE_TYPE_VAR, NODE_TYPE_VAR,
]; ];
VALID_PORTS.map((id) => VALID_NODES.push(id)); VALID_PORTS.map((id) => VALID_NODES.push(id));

View File

@ -4,7 +4,6 @@
*/ */
import { TRenderFunctionResult } from "../layout.interface"; import { TRenderFunctionResult } from "../layout.interface";
import { IPort } from "./INodes";
/** /**
* Type to define the Ports of a UI: * Type to define the Ports of a UI:
@ -12,13 +11,11 @@ import { IPort } from "./INodes";
export type TServiceGetPortsReturn = { export type TServiceGetPortsReturn = {
inputs: { inputs: {
id: string; id: string;
label: String; label: string;
type: IPort["type"];
}[]; }[];
outputs: { outputs: {
id: string; id: string;
label: String; label: string;
type: IPort["type"];
}[]; }[];
}; };
@ -48,9 +45,4 @@ export interface IServiceEditPage<T = any> extends TRenderFunctionResult {
* Element showing the type of the edit panel. * Element showing the type of the edit panel.
*/ */
type: "node" | "edge"; type: "node" | "edge";
/**
* Helper to define the Ports.
*/
getPorts?: TGetPorts;
} }

View File

@ -7,7 +7,12 @@ import * as go from "gojs";
import { ILogger } from "js-logger"; import { ILogger } from "js-logger";
import * as plotly from "plotly.js"; import * as plotly from "plotly.js";
import { IJsonSchema } from "../IJSONSchema"; import { IJsonSchema } from "../IJSONSchema";
import { INopeDispatcher, INopeObservable } from "../nope/index"; import {
IClassDescription,
IFunctionOptions,
INopeDispatcher,
INopeObservable,
} from "../nope/index";
import { import {
IMinProvidedDataSet, IMinProvidedDataSet,
IPanel, IPanel,
@ -142,6 +147,59 @@ export type TcreateLayoutOptions = {
colors?: any; colors?: any;
}; };
export interface IUiDefinition {
/**
* Contains the ui-defintions of the Functions
*/
functions: {
/**
* index - Function ID:
*/
[index: string]: {
/**
* The provided UI-Functions
*/
ui: IFunctionOptions["ui"];
/**
* Original ID of the Function.
*/
id: string;
};
};
/**
* Contains all UIs for the class
*/
classes: {
/**
* Index = Class-Identifier.
*/
[index: string]: {
/**
* The UI Defintion of the Class.
*/
ui?: IClassDescription["ui"];
/**
* Name of the Package
*/
package: string;
/**
* Path of the defintio file.
*/
path?: string;
/**
* Class identifier
*/
class: string;
/**
* The Methods of the class
*/
methods: {
[index: string]: IFunctionOptions["ui"];
};
};
};
}
export type IUiTheme = { export type IUiTheme = {
colors: { colors: {
primary: string; primary: string;
@ -439,6 +497,10 @@ export interface IRenderData {
getTheme(): IUiTheme; getTheme(): IUiTheme;
}; };
}; };
/**
* Contains the information about the session.
*/
session: IUiDefinition;
logger: ILogger; logger: ILogger;
dispatcher: INopeDispatcher; dispatcher: INopeDispatcher;
libraries: TLibraries; libraries: TLibraries;

View File

@ -1,10 +1,5 @@
import { stringifyWithFunctions } from "../helpers/jsonMethods"; import { stringifyWithFunctions } from "../helpers/jsonMethods";
import { import { IGenericNopeModule, INopeModule } from "../types";
IClassDescription,
IFunctionOptions,
IGenericNopeModule,
INopeModule,
} from "../types";
import { TRenderInstancePage } from "../types/ui"; import { TRenderInstancePage } from "../types/ui";
/** /**
@ -21,23 +16,3 @@ export function convertInstanceRenderPage<I extends INopeModule>(
): string { ): string {
return stringifyWithFunctions(callback); return stringifyWithFunctions(callback);
} }
export interface IUiDefinition {
functions: {
[index: string]: {
ui: IFunctionOptions["ui"];
id: string;
};
};
classes: {
[index: string]: {
ui?: IClassDescription["ui"];
package: string;
class: string;
path: string;
methods: {
[index: string]: IFunctionOptions["ui"];
};
};
};
}

View File

@ -13,7 +13,7 @@ import {
stringifyWithFunctions, stringifyWithFunctions,
} from "../index.browser"; } from "../index.browser";
import { listFunctions, listPackages } from "../index.nodejs"; import { listFunctions, listPackages } from "../index.nodejs";
import { IUiDefinition } from "./helpers.browser"; import { IUiDefinition } from "../types/ui";
/** /**
* Helper Function to write a default configuration. * Helper Function to write a default configuration.

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "nope", "name": "nope",
"version": "1.2.0", "version": "1.2.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "nope", "name": "nope",
"version": "1.2.0", "version": "1.2.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"argparse": "^2.0.1", "argparse": "^2.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "nope", "name": "nope",
"version": "1.2.1", "version": "1.2.2",
"description": "NoPE Runtime for Nodejs. For Browser-Support please use nope-browser", "description": "NoPE Runtime for Nodejs. For Browser-Support please use nope-browser",
"files": [ "files": [
"dist-nodejs/**/*", "dist-nodejs/**/*",