init: fuzzygraph app from fn_registry

This commit is contained in:
2026-04-06 00:56:50 +02:00
commit 23198eee0c
42 changed files with 5539 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {main} from '../models';
import {fn_operations} from '../models';
export function AddAssertion(arg1:main.AssertionInput):Promise<string>;
export function AddEntity(arg1:main.EntityInput):Promise<string>;
export function AddRelation(arg1:main.RelationInputDTO):Promise<string>;
export function CreateProject(arg1:string):Promise<main.ProjectInfo>;
export function DeleteAssertion(arg1:string):Promise<void>;
export function DeleteEntity(arg1:string):Promise<void>;
export function DeleteProject(arg1:string):Promise<void>;
export function DeleteRelation(arg1:string):Promise<void>;
export function EvalAssertions(arg1:string):Promise<Array<fn_operations.AssertionResult>>;
export function GetCurrentProject():Promise<string>;
export function GetEntity(arg1:string):Promise<fn_operations.Entity>;
export function GetEntityNeighbors(arg1:string,arg2:number):Promise<main.GraphData>;
export function GetEntityPresets():Promise<Array<main.EntityTypePreset>>;
export function GetFilteredGraph(arg1:Array<string>):Promise<main.GraphData>;
export function GetGraphData():Promise<main.GraphData>;
export function GetRelationPresets():Promise<Array<string>>;
export function ListAssertions(arg1:string):Promise<Array<fn_operations.Assertion>>;
export function ListEntities():Promise<Array<fn_operations.Entity>>;
export function ListProjects():Promise<Array<main.ProjectInfo>>;
export function ListRelations():Promise<Array<fn_operations.Relation>>;
export function SearchEntities(arg1:string):Promise<Array<fn_operations.Entity>>;
export function SearchGraph(arg1:string):Promise<main.GraphData>;
export function SwitchProject(arg1:string):Promise<void>;
export function UpdateEntity(arg1:string,arg2:main.EntityInput):Promise<void>;
export function UpdateRelation(arg1:string,arg2:main.RelationInputDTO):Promise<void>;
+103
View File
@@ -0,0 +1,103 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function AddAssertion(arg1) {
return window['go']['main']['App']['AddAssertion'](arg1);
}
export function AddEntity(arg1) {
return window['go']['main']['App']['AddEntity'](arg1);
}
export function AddRelation(arg1) {
return window['go']['main']['App']['AddRelation'](arg1);
}
export function CreateProject(arg1) {
return window['go']['main']['App']['CreateProject'](arg1);
}
export function DeleteAssertion(arg1) {
return window['go']['main']['App']['DeleteAssertion'](arg1);
}
export function DeleteEntity(arg1) {
return window['go']['main']['App']['DeleteEntity'](arg1);
}
export function DeleteProject(arg1) {
return window['go']['main']['App']['DeleteProject'](arg1);
}
export function DeleteRelation(arg1) {
return window['go']['main']['App']['DeleteRelation'](arg1);
}
export function EvalAssertions(arg1) {
return window['go']['main']['App']['EvalAssertions'](arg1);
}
export function GetCurrentProject() {
return window['go']['main']['App']['GetCurrentProject']();
}
export function GetEntity(arg1) {
return window['go']['main']['App']['GetEntity'](arg1);
}
export function GetEntityNeighbors(arg1, arg2) {
return window['go']['main']['App']['GetEntityNeighbors'](arg1, arg2);
}
export function GetEntityPresets() {
return window['go']['main']['App']['GetEntityPresets']();
}
export function GetFilteredGraph(arg1) {
return window['go']['main']['App']['GetFilteredGraph'](arg1);
}
export function GetGraphData() {
return window['go']['main']['App']['GetGraphData']();
}
export function GetRelationPresets() {
return window['go']['main']['App']['GetRelationPresets']();
}
export function ListAssertions(arg1) {
return window['go']['main']['App']['ListAssertions'](arg1);
}
export function ListEntities() {
return window['go']['main']['App']['ListEntities']();
}
export function ListProjects() {
return window['go']['main']['App']['ListProjects']();
}
export function ListRelations() {
return window['go']['main']['App']['ListRelations']();
}
export function SearchEntities(arg1) {
return window['go']['main']['App']['SearchEntities'](arg1);
}
export function SearchGraph(arg1) {
return window['go']['main']['App']['SearchGraph'](arg1);
}
export function SwitchProject(arg1) {
return window['go']['main']['App']['SwitchProject'](arg1);
}
export function UpdateEntity(arg1, arg2) {
return window['go']['main']['App']['UpdateEntity'](arg1, arg2);
}
export function UpdateRelation(arg1, arg2) {
return window['go']['main']['App']['UpdateRelation'](arg1, arg2);
}
+408
View File
@@ -0,0 +1,408 @@
export namespace fn_operations {
export class Assertion {
id: string;
entity_id: string;
name: string;
kind: string;
rule: string;
severity: string;
description: string;
active: boolean;
// Go type: time
created_at: any;
static createFrom(source: any = {}) {
return new Assertion(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.entity_id = source["entity_id"];
this.name = source["name"];
this.kind = source["kind"];
this.rule = source["rule"];
this.severity = source["severity"];
this.description = source["description"];
this.active = source["active"];
this.created_at = this.convertValues(source["created_at"], null);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class AssertionResult {
id: string;
assertion_id: string;
execution_id: string;
status: string;
value: Record<string, any>;
message: string;
// Go type: time
evaluated_at: any;
static createFrom(source: any = {}) {
return new AssertionResult(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.assertion_id = source["assertion_id"];
this.execution_id = source["execution_id"];
this.status = source["status"];
this.value = source["value"];
this.message = source["message"];
this.evaluated_at = this.convertValues(source["evaluated_at"], null);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class Entity {
id: string;
name: string;
type_ref: string;
status: string;
description: string;
domain: string;
tags: string[];
source: string;
metadata: Record<string, any>;
notes: string;
// Go type: time
created_at: any;
// Go type: time
updated_at: any;
static createFrom(source: any = {}) {
return new Entity(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.name = source["name"];
this.type_ref = source["type_ref"];
this.status = source["status"];
this.description = source["description"];
this.domain = source["domain"];
this.tags = source["tags"];
this.source = source["source"];
this.metadata = source["metadata"];
this.notes = source["notes"];
this.created_at = this.convertValues(source["created_at"], null);
this.updated_at = this.convertValues(source["updated_at"], null);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class Relation {
id: string;
name: string;
from_entity: string;
to_entity: string;
via: string;
description: string;
purity: string;
direction: string;
weight?: number;
status: string;
// Go type: time
started_at?: any;
// Go type: time
ended_at?: any;
order?: number;
tags: string[];
notes: string;
// Go type: time
created_at: any;
// Go type: time
updated_at: any;
static createFrom(source: any = {}) {
return new Relation(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.name = source["name"];
this.from_entity = source["from_entity"];
this.to_entity = source["to_entity"];
this.via = source["via"];
this.description = source["description"];
this.purity = source["purity"];
this.direction = source["direction"];
this.weight = source["weight"];
this.status = source["status"];
this.started_at = this.convertValues(source["started_at"], null);
this.ended_at = this.convertValues(source["ended_at"], null);
this.order = source["order"];
this.tags = source["tags"];
this.notes = source["notes"];
this.created_at = this.convertValues(source["created_at"], null);
this.updated_at = this.convertValues(source["updated_at"], null);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}
export namespace main {
export class AssertionInput {
entity_id: string;
name: string;
kind: string;
rule: string;
severity: string;
description: string;
static createFrom(source: any = {}) {
return new AssertionInput(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.entity_id = source["entity_id"];
this.name = source["name"];
this.kind = source["kind"];
this.rule = source["rule"];
this.severity = source["severity"];
this.description = source["description"];
}
}
export class EntityInput {
name: string;
type_ref: string;
description: string;
tags: string[];
metadata: Record<string, any>;
notes: string;
static createFrom(source: any = {}) {
return new EntityInput(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
this.type_ref = source["type_ref"];
this.description = source["description"];
this.tags = source["tags"];
this.metadata = source["metadata"];
this.notes = source["notes"];
}
}
export class EntityTypePreset {
type_ref: string;
label: string;
color: string;
metadata_fields: string[];
static createFrom(source: any = {}) {
return new EntityTypePreset(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.type_ref = source["type_ref"];
this.label = source["label"];
this.color = source["color"];
this.metadata_fields = source["metadata_fields"];
}
}
export class GraphEdge {
id: string;
source: string;
target: string;
label: string;
color: string;
size: number;
type: string;
static createFrom(source: any = {}) {
return new GraphEdge(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.source = source["source"];
this.target = source["target"];
this.label = source["label"];
this.color = source["color"];
this.size = source["size"];
this.type = source["type"];
}
}
export class GraphNode {
id: string;
label: string;
type: string;
color: string;
size: number;
x: number;
y: number;
extra?: Record<string, any>;
static createFrom(source: any = {}) {
return new GraphNode(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.label = source["label"];
this.type = source["type"];
this.color = source["color"];
this.size = source["size"];
this.x = source["x"];
this.y = source["y"];
this.extra = source["extra"];
}
}
export class GraphData {
nodes: GraphNode[];
edges: GraphEdge[];
static createFrom(source: any = {}) {
return new GraphData(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.nodes = this.convertValues(source["nodes"], GraphNode);
this.edges = this.convertValues(source["edges"], GraphEdge);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class ProjectInfo {
name: string;
description: string;
entity_count: number;
relation_count: number;
static createFrom(source: any = {}) {
return new ProjectInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
this.description = source["description"];
this.entity_count = source["entity_count"];
this.relation_count = source["relation_count"];
}
}
export class RelationInputDTO {
name: string;
from_entity: string;
to_entity: string;
description: string;
weight?: number;
tags: string[];
notes: string;
static createFrom(source: any = {}) {
return new RelationInputDTO(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
this.from_entity = source["from_entity"];
this.to_entity = source["to_entity"];
this.description = source["description"];
this.weight = source["weight"];
this.tags = source["tags"];
this.notes = source["notes"];
}
}
}