GitRoot
Craft your forge, Build your project, Grow your community freely
1// SPDX-FileCopyrightText: 2026 Romain Maneschi <romain@gitroot.dev>
2//
3// SPDX-License-Identifier: MIT
4
5import { JSON } from "json-as";
6
7@json
8export class PluginRun {
9 constructor(
10 public path: string,
11 public branch: Array<string>,
12 public when: Array<PluginRunWhen>,
13 public schedule: string,
14 public func: Array<PluginFunc>,
15 public write: PluginWrite,
16 public configuration: JSON.Raw,
17 ) {}
18}
19
20@json
21export class PluginFunc {
22 constructor(
23 public funcName: string,
24 public args: Array<string>,
25 public res: Array<string>,
26 ) {}
27}
28
29@json
30export class PluginWrite {
31 constructor(
32 public git: Array<PluginWriteRight>,
33 public web: Array<PluginWriteRight>,
34 public exec: Array<PluginExecRight>,
35 public callFunc: Array<PluginCallFuncRight>,
36 ) {}
37}
38
39@json
40export class PluginWriteRight {
41 constructor(
42 public path: string,
43 public can: Array<PluginWriteRightCan>,
44 ) {}
45}
46
47@json
48export class PluginExecRight {
49 constructor(public command: string) {}
50}
51
52@json
53export class PluginCallFuncRight {
54 constructor(
55 public pluginPURL: string,
56 public funcName: string,
57 public configuration: JSON.Raw,
58 ) {}
59}
60
61export namespace PluginRunWhen {
62 export const Add = "add";
63 export const Mod = "mod";
64 export const Del = "del";
65}
66
67export type PluginRunWhen = string;
68
69export namespace PluginWriteRightCan {
70 export const Add = "add";
71 export const Mod = "mod";
72 export const Del = "del";
73 export const Append = "append";
74}
75
76export type PluginWriteRightCan = string;