@univerjs/protocol 0.1.26-permission-8.2 → 0.1.26-permission-8.4
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.
- package/lib/types/ts/v1/authz.d.ts +160 -0
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Metadata } from "@grpc/grpc-js";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import type { Error } from "../univer/constants/errors";
|
|
4
|
+
import type { UnitAction, UnitObject, UnitPermissionStrategy, UnitRole, UnitRoleKV, User } from "../univer/permission";
|
|
5
|
+
export declare const protobufPackage = "universer.v1";
|
|
6
|
+
export interface Collaborator {
|
|
7
|
+
id: string;
|
|
8
|
+
role: UnitRole;
|
|
9
|
+
subject: User | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface PermissionPoint {
|
|
12
|
+
objectID: string;
|
|
13
|
+
unitID: string;
|
|
14
|
+
objectType: UnitObject;
|
|
15
|
+
name: string;
|
|
16
|
+
shareOn: boolean;
|
|
17
|
+
shareRole: UnitRole;
|
|
18
|
+
creator: User | undefined;
|
|
19
|
+
strategies: UnitPermissionStrategy[];
|
|
20
|
+
actions: ActionInfo[];
|
|
21
|
+
}
|
|
22
|
+
export interface CreateRequest {
|
|
23
|
+
objectType: UnitObject;
|
|
24
|
+
selectRangeObject?: CreateRequest_SelectRangeObject | undefined;
|
|
25
|
+
worksheetObject?: CreateRequest_WorksheetObject | undefined;
|
|
26
|
+
}
|
|
27
|
+
export interface CreateRequest_SelectRangeObject {
|
|
28
|
+
collaborators: Collaborator[];
|
|
29
|
+
unitID: string;
|
|
30
|
+
name: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateRequest_WorksheetObject {
|
|
33
|
+
collaborators: Collaborator[];
|
|
34
|
+
unitID: string;
|
|
35
|
+
name: string;
|
|
36
|
+
strategies: UnitPermissionStrategy[];
|
|
37
|
+
}
|
|
38
|
+
export interface CreateResponse {
|
|
39
|
+
error: Error | undefined;
|
|
40
|
+
objectID: string;
|
|
41
|
+
}
|
|
42
|
+
export interface UpdatePermPointRequest {
|
|
43
|
+
objectType: UnitObject;
|
|
44
|
+
objectID: string;
|
|
45
|
+
unitID: string;
|
|
46
|
+
share: UpdatePermPointRequest_Share | undefined;
|
|
47
|
+
name: string;
|
|
48
|
+
strategies: UnitPermissionStrategy[];
|
|
49
|
+
}
|
|
50
|
+
export interface UpdatePermPointRequest_Share {
|
|
51
|
+
on: boolean;
|
|
52
|
+
role: UnitRole;
|
|
53
|
+
}
|
|
54
|
+
export interface UpdatePermPointResponse {
|
|
55
|
+
error: Error | undefined;
|
|
56
|
+
}
|
|
57
|
+
export interface ListPermPointRequest {
|
|
58
|
+
unitID: string;
|
|
59
|
+
objectIDs: string[];
|
|
60
|
+
actions: UnitAction[];
|
|
61
|
+
}
|
|
62
|
+
export interface ListPermPointResponse {
|
|
63
|
+
error: Error | undefined;
|
|
64
|
+
objects: PermissionPoint[];
|
|
65
|
+
}
|
|
66
|
+
export interface CreateCollaboratorRequest {
|
|
67
|
+
objectID: string;
|
|
68
|
+
unitID: string;
|
|
69
|
+
collaborators: Collaborator[];
|
|
70
|
+
}
|
|
71
|
+
export interface CreateCollaboratorResponse {
|
|
72
|
+
error: Error | undefined;
|
|
73
|
+
}
|
|
74
|
+
export interface UpdateCollaboratorRequest {
|
|
75
|
+
objectID: string;
|
|
76
|
+
unitID: string;
|
|
77
|
+
collaborator: Collaborator | undefined;
|
|
78
|
+
}
|
|
79
|
+
export interface UpdateCollaboratorResponse {
|
|
80
|
+
error: Error | undefined;
|
|
81
|
+
}
|
|
82
|
+
export interface DeleteCollaboratorRequest {
|
|
83
|
+
objectID: string;
|
|
84
|
+
unitID: string;
|
|
85
|
+
collaboratorID: string;
|
|
86
|
+
}
|
|
87
|
+
export interface DeleteCollaboratorResponse {
|
|
88
|
+
error: Error | undefined;
|
|
89
|
+
}
|
|
90
|
+
export interface ListCollaboratorRequest {
|
|
91
|
+
objectID: string;
|
|
92
|
+
unitID: string;
|
|
93
|
+
}
|
|
94
|
+
export interface ListCollaboratorResponse {
|
|
95
|
+
error: Error | undefined;
|
|
96
|
+
collaborators: Collaborator[];
|
|
97
|
+
}
|
|
98
|
+
export interface AllowedRequest {
|
|
99
|
+
objectID: string;
|
|
100
|
+
objectType: UnitObject;
|
|
101
|
+
unitID: string;
|
|
102
|
+
actions: UnitAction[];
|
|
103
|
+
}
|
|
104
|
+
export interface ActionInfo {
|
|
105
|
+
action: UnitAction;
|
|
106
|
+
allowed: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface AllowedResponse {
|
|
109
|
+
error: Error | undefined;
|
|
110
|
+
actions: ActionInfo[];
|
|
111
|
+
}
|
|
112
|
+
export interface BatchAllowedRequest {
|
|
113
|
+
requests: AllowedRequest[];
|
|
114
|
+
}
|
|
115
|
+
export interface ObjectActionInfo {
|
|
116
|
+
unitID: string;
|
|
117
|
+
objectID: string;
|
|
118
|
+
actions: ActionInfo[];
|
|
119
|
+
}
|
|
120
|
+
export interface BatchAllowedResponse {
|
|
121
|
+
error: Error | undefined;
|
|
122
|
+
objectActions: ObjectActionInfo[];
|
|
123
|
+
}
|
|
124
|
+
export interface ListRolesRequest {
|
|
125
|
+
objectType: UnitObject;
|
|
126
|
+
}
|
|
127
|
+
export interface ListRolesResponse {
|
|
128
|
+
error: Error | undefined;
|
|
129
|
+
roles: UnitRoleKV[];
|
|
130
|
+
actions: UnitAction[];
|
|
131
|
+
}
|
|
132
|
+
export interface AuthzService {
|
|
133
|
+
/** create a permission mount point for specified type of object */
|
|
134
|
+
Create(request: CreateRequest, metadata?: Metadata): Observable<CreateResponse>;
|
|
135
|
+
/**
|
|
136
|
+
* update a permission mount point
|
|
137
|
+
* selectrange and worksheet may not used if unit record the permission point in mutation by itself.
|
|
138
|
+
* workbook and document use it to set share mode.
|
|
139
|
+
*/
|
|
140
|
+
Update(request: UpdatePermPointRequest, metadata?: Metadata): Observable<UpdatePermPointResponse>;
|
|
141
|
+
/**
|
|
142
|
+
* list all permission mount points for unit
|
|
143
|
+
* it may not used if unit record the permission point in mutation by itself
|
|
144
|
+
*/
|
|
145
|
+
List(request: ListPermPointRequest, metadata?: Metadata): Observable<ListPermPointResponse>;
|
|
146
|
+
/** request a couple of actions, return the allowed actions */
|
|
147
|
+
Allowed(request: AllowedRequest, metadata?: Metadata): Observable<AllowedResponse>;
|
|
148
|
+
/** barch check if the actions are allowed */
|
|
149
|
+
BatchAllowed(request: BatchAllowedRequest, metadata?: Metadata): Observable<BatchAllowedResponse>;
|
|
150
|
+
/** list object roles for specified object */
|
|
151
|
+
ListRoles(request: ListRolesRequest, metadata?: Metadata): Observable<ListRolesResponse>;
|
|
152
|
+
/** new collaborator for specified object */
|
|
153
|
+
CreateCollaborator(request: CreateCollaboratorRequest, metadata?: Metadata): Observable<CreateCollaboratorResponse>;
|
|
154
|
+
/** list all collaborators for specified object */
|
|
155
|
+
ListCollaborators(request: ListCollaboratorRequest, metadata?: Metadata): Observable<ListCollaboratorResponse>;
|
|
156
|
+
/** update collaborator for specified object */
|
|
157
|
+
UpdateCollaborator(request: UpdateCollaboratorRequest, metadata?: Metadata): Observable<UpdateCollaboratorResponse>;
|
|
158
|
+
/** delete collaborator for specified object */
|
|
159
|
+
DeleteCollaborator(request: DeleteCollaboratorRequest, metadata?: Metadata): Observable<DeleteCollaboratorResponse>;
|
|
160
|
+
}
|