Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func main() {

// Setup the plugin systems
resourceController := resource.NewController(log, settingsProvider, stateDir.PluginStore)
graphService := resource.NewGraphService(resourceController.Graph())

settingsController := settings.NewController(log, settingsProvider, settingsStore)

Expand Down Expand Up @@ -256,6 +257,7 @@ func main() {
services := []application.Service{
// 1. Controllers — need ctx before plugin loading
application.NewService(&resource.ServiceWrapper{Ctrl: resourceController}),
application.NewService(graphService),
application.NewService(&settings.ServiceWrapper{Ctrl: settingsController}),
application.NewService(&exec.ServiceWrapper{Ctrl: execController}),
application.NewService(&networker.ServiceWrapper{Ctrl: networkerController}),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

export {
DependencyNode,
DependencyTree,
GraphEdge,
GraphNode
} from "./models.js";

export type {
RelationshipType
} from "./models.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as resource$0 from "../../../../../../plugin-sdk/pkg/v1/resource/models.js";

export class DependencyNode {
"edge": GraphEdge;
"children": DependencyNode[];

/** Creates a new DependencyNode instance. */
constructor($$source: Partial<DependencyNode> = {}) {
if (!("edge" in $$source)) {
this["edge"] = (new GraphEdge());
}
if (!("children" in $$source)) {
this["children"] = [];
}

Object.assign(this, $$source);
}

/**
* Creates a new DependencyNode instance from a string or object.
*/
static createFrom($$source: any = {}): DependencyNode {
const $$createField0_0 = $$createType0;
const $$createField1_0 = $$createType2;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("edge" in $$parsedSource) {
$$parsedSource["edge"] = $$createField0_0($$parsedSource["edge"]);
}
if ("children" in $$parsedSource) {
$$parsedSource["children"] = $$createField1_0($$parsedSource["children"]);
}
return new DependencyNode($$parsedSource as Partial<DependencyNode>);
}
}

export class DependencyTree {
"root": GraphNode;
"children": DependencyNode[];

/** Creates a new DependencyTree instance. */
constructor($$source: Partial<DependencyTree> = {}) {
if (!("root" in $$source)) {
this["root"] = (new GraphNode());
}
if (!("children" in $$source)) {
this["children"] = [];
}

Object.assign(this, $$source);
}

/**
* Creates a new DependencyTree instance from a string or object.
*/
static createFrom($$source: any = {}): DependencyTree {
const $$createField0_0 = $$createType3;
const $$createField1_0 = $$createType2;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("root" in $$parsedSource) {
$$parsedSource["root"] = $$createField0_0($$parsedSource["root"]);
}
if ("children" in $$parsedSource) {
$$parsedSource["children"] = $$createField1_0($$parsedSource["children"]);
}
return new DependencyTree($$parsedSource as Partial<DependencyTree>);
}
}

export class GraphEdge {
"source": GraphNode;
"target": GraphNode;
"type": RelationshipType;
"label": string;

/** Creates a new GraphEdge instance. */
constructor($$source: Partial<GraphEdge> = {}) {
if (!("source" in $$source)) {
this["source"] = (new GraphNode());
}
if (!("target" in $$source)) {
this["target"] = (new GraphNode());
}
if (!("type" in $$source)) {
this["type"] = resource$0.RelationshipType.$zero;
}
if (!("label" in $$source)) {
this["label"] = "";
}

Object.assign(this, $$source);
}

/**
* Creates a new GraphEdge instance from a string or object.
*/
static createFrom($$source: any = {}): GraphEdge {
const $$createField0_0 = $$createType3;
const $$createField1_0 = $$createType3;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("source" in $$parsedSource) {
$$parsedSource["source"] = $$createField0_0($$parsedSource["source"]);
}
if ("target" in $$parsedSource) {
$$parsedSource["target"] = $$createField1_0($$parsedSource["target"]);
}
return new GraphEdge($$parsedSource as Partial<GraphEdge>);
}
}

/**
* GraphNode identifies a specific resource instance in the graph.
*/
export class GraphNode {
"pluginId": string;
"connectionId": string;
"resourceKey": string;
"id": string;
"namespace"?: string;

/** Creates a new GraphNode instance. */
constructor($$source: Partial<GraphNode> = {}) {
if (!("pluginId" in $$source)) {
this["pluginId"] = "";
}
if (!("connectionId" in $$source)) {
this["connectionId"] = "";
}
if (!("resourceKey" in $$source)) {
this["resourceKey"] = "";
}
if (!("id" in $$source)) {
this["id"] = "";
}

Object.assign(this, $$source);
}

/**
* Creates a new GraphNode instance from a string or object.
*/
static createFrom($$source: any = {}): GraphNode {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new GraphNode($$parsedSource as Partial<GraphNode>);
}
}

/**
* RelationshipType re-exports from SDK for convenience.
*/
export type RelationshipType = resource$0.RelationshipType;

// Private type creation functions
const $$createType0 = GraphEdge.createFrom;
const $$createType1 = DependencyNode.createFrom;
const $$createType2 = $Create.Array($$createType1);
const $$createType3 = GraphNode.createFrom;
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

/**
* GraphService exposes graph query methods to the frontend via Wails binding.
* @module
*/

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as graph$0 from "./graph/models.js";

/**
* GetDependencyTree follows all outgoing edges recursively.
*/
export function GetDependencyTree(pluginID: string, connectionID: string, resourceKey: string, $namespace: string, id: string, maxDepth: number): $CancellablePromise<graph$0.DependencyTree | null> {
return $Call.ByID(3749557463, pluginID, connectionID, resourceKey, $namespace, id, maxDepth).then(($result: any) => {
return $$createType1($result);
});
}

/**
* GetRelated returns edges connected to the given node.
*/
export function GetRelated(pluginID: string, connectionID: string, resourceKey: string, $namespace: string, id: string, direction: string, relType: string | null): $CancellablePromise<graph$0.GraphEdge[]> {
return $Call.ByID(3912521777, pluginID, connectionID, resourceKey, $namespace, id, direction, relType).then(($result: any) => {
return $$createType3($result);
});
}

/**
* GetRelationshipChain follows edges of a specific type up to maxDepth hops.
*/
export function GetRelationshipChain(pluginID: string, connectionID: string, resourceKey: string, $namespace: string, id: string, relType: string, maxDepth: number): $CancellablePromise<graph$0.GraphEdge[][]> {
return $Call.ByID(1916045973, pluginID, connectionID, resourceKey, $namespace, id, relType, maxDepth).then(($result: any) => {
return $$createType4($result);
});
}

// Private type creation functions
const $$createType0 = graph$0.DependencyTree.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = graph$0.GraphEdge.createFrom;
const $$createType3 = $Create.Array($$createType2);
const $$createType4 = $Create.Array($$createType3);
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

import * as GraphService from "./graphservice.js";
import * as ServiceWrapper from "./servicewrapper.js";
export {
GraphService,
ServiceWrapper
};

Expand Down
Loading