verteilen-core 1.3.4 → 1.3.6
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.
|
@@ -72,5 +72,6 @@ export interface UserProfileClient {
|
|
|
72
72
|
export interface ServerSetting {
|
|
73
73
|
open_guest: boolean;
|
|
74
74
|
}
|
|
75
|
+
export declare const CreateRootLocalPermission: () => LocalPermission;
|
|
75
76
|
export declare const CreateRootPermission: () => GlobalPermission;
|
|
76
77
|
export declare const CreateRootUser: () => UserProfile;
|
package/dist/interface/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateRootUser = exports.CreateRootPermission = exports.PermissionType = exports.UserType = exports.ACLType = void 0;
|
|
3
|
+
exports.CreateRootUser = exports.CreateRootPermission = exports.CreateRootLocalPermission = exports.PermissionType = exports.UserType = exports.ACLType = void 0;
|
|
4
4
|
const uuid_1 = require("uuid");
|
|
5
5
|
var ACLType;
|
|
6
6
|
(function (ACLType) {
|
|
@@ -27,6 +27,15 @@ var PermissionType;
|
|
|
27
27
|
PermissionType[PermissionType["LIB"] = 7] = "LIB";
|
|
28
28
|
PermissionType[PermissionType["LOG"] = 8] = "LOG";
|
|
29
29
|
})(PermissionType || (exports.PermissionType = PermissionType = {}));
|
|
30
|
+
const CreateRootLocalPermission = () => {
|
|
31
|
+
return {
|
|
32
|
+
view: true,
|
|
33
|
+
create: true,
|
|
34
|
+
edit: true,
|
|
35
|
+
delete: true,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports.CreateRootLocalPermission = CreateRootLocalPermission;
|
|
30
39
|
const CreateRootPermission = () => {
|
|
31
40
|
const perl = {
|
|
32
41
|
view: true,
|
|
@@ -9,6 +9,7 @@ export declare class Project_Module {
|
|
|
9
9
|
ProjectJobCount(uuid: string): number;
|
|
10
10
|
PopulateProject(uuid: string): Project | undefined;
|
|
11
11
|
PopulateTask(uuid: string): Task | undefined;
|
|
12
|
-
CascadeDeleteProject(uuid: string): void;
|
|
12
|
+
CascadeDeleteProject(uuid: string, bind: boolean): void;
|
|
13
13
|
CascadeDeleteTask(uuid: string): void;
|
|
14
|
+
Delete_Database_Idle(uuid: string): Promise<void>;
|
|
14
15
|
}
|
|
@@ -42,14 +42,17 @@ class Project_Module {
|
|
|
42
42
|
}
|
|
43
43
|
return buffer;
|
|
44
44
|
}
|
|
45
|
-
CascadeDeleteProject(uuid) {
|
|
45
|
+
CascadeDeleteProject(uuid, bind) {
|
|
46
46
|
const p = this.memory.projects.find(p => p.uuid == uuid);
|
|
47
47
|
if (!p)
|
|
48
48
|
return;
|
|
49
49
|
p.tasks_uuid.forEach(t_uuid => {
|
|
50
50
|
this.CascadeDeleteTask(t_uuid);
|
|
51
51
|
});
|
|
52
|
+
const db = p.database_uuid;
|
|
52
53
|
this.loader.project.delete(p.uuid);
|
|
54
|
+
if (bind)
|
|
55
|
+
this.Delete_Database_Idle(db);
|
|
53
56
|
}
|
|
54
57
|
CascadeDeleteTask(uuid) {
|
|
55
58
|
const p = this.memory.tasks.find(p => p.uuid == uuid);
|
|
@@ -60,5 +63,13 @@ class Project_Module {
|
|
|
60
63
|
});
|
|
61
64
|
this.loader.task.delete(p.uuid);
|
|
62
65
|
}
|
|
66
|
+
async Delete_Database_Idle(uuid) {
|
|
67
|
+
return this.loader.project.load_all().then(() => {
|
|
68
|
+
const f = this.memory.projects.find(x => x.database_uuid == uuid);
|
|
69
|
+
if (f == undefined) {
|
|
70
|
+
this.loader.database.delete(uuid);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
63
74
|
}
|
|
64
75
|
exports.Project_Module = Project_Module;
|
package/package.json
CHANGED
package/src/interface/server.ts
CHANGED
|
@@ -111,6 +111,15 @@ export interface ServerSetting {
|
|
|
111
111
|
open_guest: boolean
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
export const CreateRootLocalPermission = ():LocalPermission => {
|
|
115
|
+
return {
|
|
116
|
+
view: true,
|
|
117
|
+
create: true,
|
|
118
|
+
edit: true,
|
|
119
|
+
delete: true,
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
114
123
|
export const CreateRootPermission = ():GlobalPermission => {
|
|
115
124
|
const perl:LocalPermission = {
|
|
116
125
|
view: true,
|
|
@@ -59,13 +59,15 @@ export class Project_Module {
|
|
|
59
59
|
* Delete project related data and project itself
|
|
60
60
|
* @param uuid Project UUID
|
|
61
61
|
*/
|
|
62
|
-
CascadeDeleteProject(uuid:string){
|
|
62
|
+
CascadeDeleteProject(uuid:string, bind:boolean){
|
|
63
63
|
const p:Project | undefined = this.memory.projects.find(p=> p.uuid == uuid)
|
|
64
64
|
if(!p) return
|
|
65
65
|
p.tasks_uuid.forEach(t_uuid => {
|
|
66
66
|
this.CascadeDeleteTask(t_uuid)
|
|
67
67
|
})
|
|
68
|
+
const db = p.database_uuid
|
|
68
69
|
this.loader.project.delete(p.uuid)
|
|
70
|
+
if(bind) this.Delete_Database_Idle(db)
|
|
69
71
|
}
|
|
70
72
|
/**
|
|
71
73
|
* Delete Task related data and project itself
|
|
@@ -79,4 +81,16 @@ export class Project_Module {
|
|
|
79
81
|
})
|
|
80
82
|
this.loader.task.delete(p.uuid)
|
|
81
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Delete idle database
|
|
86
|
+
* @param uuid Database UUID
|
|
87
|
+
*/
|
|
88
|
+
async Delete_Database_Idle(uuid:string){
|
|
89
|
+
return this.loader.project.load_all().then(() => {
|
|
90
|
+
const f = this.memory.projects.find(x => x.database_uuid == uuid)
|
|
91
|
+
if(f == undefined){
|
|
92
|
+
this.loader.database.delete(uuid)
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
}
|
|
82
96
|
}
|