tale-js-sdk 0.1.3 → 1.0.0
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/dist/acl/index.d.ts +232 -102
- package/dist/acl/index.js +431 -489
- package/dist/acl/types.d.ts +95 -161
- package/dist/auth/types.d.ts +3 -3
- package/dist/common/types.d.ts +66 -57
- package/dist/common/types.js +0 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/rbac/index.d.ts +464 -2
- package/dist/rbac/index.js +1123 -2
- package/dist/rbac/types.d.ts +73 -304
- package/dist/user/index.d.ts +165 -2
- package/dist/user/index.js +451 -0
- package/dist/user/types.d.ts +70 -17
- package/dist/user-group/types.d.ts +22 -19
- package/package.json +14 -12
package/dist/acl/types.d.ts
CHANGED
|
@@ -1,208 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
pageNumber: number;
|
|
7
|
-
pageSize: number;
|
|
8
|
-
paged: boolean;
|
|
9
|
-
unpaged: boolean;
|
|
10
|
-
};
|
|
11
|
-
last: boolean;
|
|
12
|
-
totalPages: number;
|
|
13
|
-
totalElements: number;
|
|
14
|
-
size: number;
|
|
15
|
-
number: number;
|
|
16
|
-
sort: Sort;
|
|
17
|
-
first: boolean;
|
|
18
|
-
numberOfElements: number;
|
|
19
|
-
empty: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface Sort {
|
|
22
|
-
empty: boolean;
|
|
23
|
-
sorted: boolean;
|
|
24
|
-
unsorted: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface CommonOptions {
|
|
27
|
-
baseUrl?: string;
|
|
28
|
-
appKey?: string;
|
|
29
|
-
appSecret?: string;
|
|
30
|
-
appToken?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface AclOptions extends CommonOptions {
|
|
33
|
-
include_records?: boolean;
|
|
34
|
-
include_templates?: boolean;
|
|
35
|
-
effect_type?: 'allow' | 'deny' | 'inherit';
|
|
36
|
-
priority_range?: {
|
|
37
|
-
min: number;
|
|
38
|
-
max: number;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
1
|
+
import type { CommonOptions } from "../common/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* ACL Record (Access Control List Record)
|
|
4
|
+
* Represents a single access control rule
|
|
5
|
+
*/
|
|
41
6
|
export interface AclRecord {
|
|
42
7
|
record_id: string;
|
|
43
8
|
app_id: string;
|
|
44
|
-
template_id
|
|
45
|
-
subject_type:
|
|
9
|
+
template_id?: string;
|
|
10
|
+
subject_type: string;
|
|
46
11
|
subject_id?: string;
|
|
47
12
|
subject_identifier?: string;
|
|
48
13
|
resource_type: string;
|
|
49
14
|
resource_id?: string;
|
|
50
15
|
resource_identifier?: string;
|
|
51
|
-
effect_type:
|
|
52
|
-
priority
|
|
53
|
-
data_scope?: Record<string,
|
|
54
|
-
description?: string;
|
|
55
|
-
created_at?: string;
|
|
56
|
-
updated_at?: string;
|
|
57
|
-
}
|
|
58
|
-
export interface AclTemplate {
|
|
59
|
-
template_id: string;
|
|
60
|
-
app_id: string;
|
|
61
|
-
template_name: string;
|
|
62
|
-
template_code: string;
|
|
63
|
-
subject_filter?: Record<string, any>;
|
|
64
|
-
resource_filter?: Record<string, any>;
|
|
65
|
-
effect_type?: 'allow' | 'deny' | 'inherit';
|
|
66
|
-
default_priority?: number;
|
|
16
|
+
effect_type: string;
|
|
17
|
+
priority?: number;
|
|
18
|
+
data_scope?: Record<string, unknown>;
|
|
67
19
|
description?: string;
|
|
68
|
-
created_at
|
|
69
|
-
updated_at
|
|
20
|
+
created_at: string;
|
|
21
|
+
updated_at: string;
|
|
70
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Request for creating an ACL record
|
|
25
|
+
*/
|
|
71
26
|
export interface CreateAclRecordRequest {
|
|
72
|
-
template_id
|
|
73
|
-
subject_type:
|
|
27
|
+
template_id?: string;
|
|
28
|
+
subject_type: string;
|
|
74
29
|
subject_id?: string;
|
|
75
30
|
subject_identifier?: string;
|
|
76
31
|
resource_type: string;
|
|
77
32
|
resource_id?: string;
|
|
78
33
|
resource_identifier?: string;
|
|
79
|
-
effect_type:
|
|
34
|
+
effect_type: string;
|
|
80
35
|
priority?: number;
|
|
81
|
-
data_scope?: Record<string,
|
|
36
|
+
data_scope?: Record<string, unknown>;
|
|
82
37
|
description?: string;
|
|
83
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Request for updating an ACL record
|
|
41
|
+
*/
|
|
84
42
|
export interface UpdateAclRecordRequest {
|
|
85
43
|
template_id?: string;
|
|
86
|
-
effect_type?:
|
|
44
|
+
effect_type?: string;
|
|
87
45
|
priority?: number;
|
|
88
|
-
data_scope?: Record<string,
|
|
46
|
+
data_scope?: Record<string, unknown>;
|
|
89
47
|
description?: string;
|
|
90
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Request for listing ACL records
|
|
51
|
+
*/
|
|
91
52
|
export interface ListAclRecordsRequest {
|
|
53
|
+
page?: number;
|
|
54
|
+
size?: number;
|
|
92
55
|
template_id?: string;
|
|
93
|
-
subject_type?:
|
|
56
|
+
subject_type?: string;
|
|
94
57
|
subject_id?: string;
|
|
95
58
|
subject_identifier?: string;
|
|
96
59
|
resource_type?: string;
|
|
97
60
|
resource_id?: string;
|
|
98
61
|
resource_identifier?: string;
|
|
99
|
-
page?: number;
|
|
100
|
-
size?: number;
|
|
101
|
-
sort_by?: string;
|
|
102
|
-
sort_direction?: 'asc' | 'desc';
|
|
103
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Batch creation response for ACL records
|
|
65
|
+
*/
|
|
66
|
+
export interface AclBatchCreateResponse {
|
|
67
|
+
success_count: number;
|
|
68
|
+
failure_count: number;
|
|
69
|
+
success_records: AclRecord[];
|
|
70
|
+
failures: AclBatchFailure[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Failure details for batch creation
|
|
74
|
+
*/
|
|
75
|
+
export interface AclBatchFailure {
|
|
76
|
+
index: number;
|
|
77
|
+
request: CreateAclRecordRequest;
|
|
78
|
+
error_message: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* ACL Template
|
|
82
|
+
* Represents a reusable ACL configuration template
|
|
83
|
+
*/
|
|
84
|
+
export interface AclTemplate {
|
|
85
|
+
template_id: string;
|
|
86
|
+
app_id: string;
|
|
87
|
+
template_name: string;
|
|
88
|
+
template_code: string;
|
|
89
|
+
subject_type?: string;
|
|
90
|
+
subject_filter?: Record<string, unknown>;
|
|
91
|
+
resource_type?: string;
|
|
92
|
+
resource_filter?: Record<string, unknown>;
|
|
93
|
+
effect_type?: string;
|
|
94
|
+
priority?: number;
|
|
95
|
+
data_scope?: Record<string, unknown>;
|
|
96
|
+
description?: string;
|
|
97
|
+
created_at: string;
|
|
98
|
+
updated_at: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Request for creating an ACL template
|
|
102
|
+
*/
|
|
104
103
|
export interface CreateAclTemplateRequest {
|
|
105
104
|
template_name: string;
|
|
106
105
|
template_code: string;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
subject_type?: string;
|
|
107
|
+
subject_filter?: Record<string, unknown>;
|
|
108
|
+
resource_type?: string;
|
|
109
|
+
resource_filter?: Record<string, unknown>;
|
|
110
|
+
effect_type?: string;
|
|
111
|
+
priority?: number;
|
|
112
|
+
data_scope?: Record<string, unknown>;
|
|
111
113
|
description?: string;
|
|
112
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Request for updating an ACL template
|
|
117
|
+
*/
|
|
113
118
|
export interface UpdateAclTemplateRequest {
|
|
114
119
|
template_name?: string;
|
|
115
|
-
subject_filter?: Record<string,
|
|
116
|
-
resource_filter?: Record<string,
|
|
117
|
-
effect_type?:
|
|
118
|
-
|
|
120
|
+
subject_filter?: Record<string, unknown>;
|
|
121
|
+
resource_filter?: Record<string, unknown>;
|
|
122
|
+
effect_type?: string;
|
|
123
|
+
priority?: number;
|
|
124
|
+
data_scope?: Record<string, unknown>;
|
|
119
125
|
description?: string;
|
|
120
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Request for listing ACL templates
|
|
129
|
+
*/
|
|
121
130
|
export interface ListAclTemplatesRequest {
|
|
122
|
-
resource_type?: string;
|
|
123
|
-
subject_type?: 'user' | 'role' | 'group';
|
|
124
131
|
page?: number;
|
|
125
132
|
size?: number;
|
|
126
133
|
sort_by?: string;
|
|
127
|
-
sort_direction?:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
record: AclRecord;
|
|
131
|
-
message?: string;
|
|
132
|
-
}
|
|
133
|
-
export interface CreateAclRecordJson {
|
|
134
|
-
data: CreateAclRecordResponse;
|
|
135
|
-
code: number;
|
|
136
|
-
msg: string;
|
|
137
|
-
}
|
|
138
|
-
export interface UpdateAclRecordResponse {
|
|
139
|
-
record: AclRecord;
|
|
140
|
-
message?: string;
|
|
141
|
-
}
|
|
142
|
-
export interface UpdateAclRecordJson {
|
|
143
|
-
data: UpdateAclRecordResponse;
|
|
144
|
-
code: number;
|
|
145
|
-
msg: string;
|
|
146
|
-
}
|
|
147
|
-
export interface DeleteAclRecordResponse {
|
|
148
|
-
deleted: boolean;
|
|
149
|
-
record_id: string;
|
|
150
|
-
}
|
|
151
|
-
export interface DeleteAclRecordJson {
|
|
152
|
-
data: DeleteAclRecordResponse;
|
|
153
|
-
code: number;
|
|
154
|
-
msg: string;
|
|
155
|
-
}
|
|
156
|
-
export interface GetAclRecordResponse {
|
|
157
|
-
record: AclRecord;
|
|
158
|
-
}
|
|
159
|
-
export interface GetAclRecordJson {
|
|
160
|
-
data: GetAclRecordResponse;
|
|
161
|
-
code: number;
|
|
162
|
-
msg: string;
|
|
163
|
-
}
|
|
164
|
-
export interface ListAclRecordsJson {
|
|
165
|
-
data: PaginatedResponse<AclRecord>;
|
|
166
|
-
code: number;
|
|
167
|
-
msg: string;
|
|
168
|
-
}
|
|
169
|
-
export interface CreateAclTemplateResponse {
|
|
170
|
-
template: AclTemplate;
|
|
171
|
-
message?: string;
|
|
172
|
-
}
|
|
173
|
-
export interface CreateAclTemplateJson {
|
|
174
|
-
data: CreateAclTemplateResponse;
|
|
175
|
-
code: number;
|
|
176
|
-
msg: string;
|
|
177
|
-
}
|
|
178
|
-
export interface UpdateAclTemplateResponse {
|
|
179
|
-
template: AclTemplate;
|
|
180
|
-
message?: string;
|
|
181
|
-
}
|
|
182
|
-
export interface UpdateAclTemplateJson {
|
|
183
|
-
data: UpdateAclTemplateResponse;
|
|
184
|
-
code: number;
|
|
185
|
-
msg: string;
|
|
186
|
-
}
|
|
187
|
-
export interface DeleteAclTemplateResponse {
|
|
188
|
-
deleted: boolean;
|
|
189
|
-
template_id: string;
|
|
190
|
-
}
|
|
191
|
-
export interface DeleteAclTemplateJson {
|
|
192
|
-
data: DeleteAclTemplateResponse;
|
|
193
|
-
code: number;
|
|
194
|
-
msg: string;
|
|
195
|
-
}
|
|
196
|
-
export interface GetAclTemplateResponse {
|
|
197
|
-
template: AclTemplate;
|
|
198
|
-
}
|
|
199
|
-
export interface GetAclTemplateJson {
|
|
200
|
-
data: GetAclTemplateResponse;
|
|
201
|
-
code: number;
|
|
202
|
-
msg: string;
|
|
134
|
+
sort_direction?: "asc" | "desc";
|
|
135
|
+
resource_type?: string;
|
|
136
|
+
subject_type?: string;
|
|
203
137
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Options for ACL operations
|
|
140
|
+
*/
|
|
141
|
+
export interface AclOptions extends CommonOptions {
|
|
208
142
|
}
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AppInfo,
|
|
1
|
+
import type { AppInfo, User, UserGroup, Role, Privilege, CommonOptions } from "../common/types.js";
|
|
2
2
|
export type { AppInfo, UserGroup };
|
|
3
3
|
/**
|
|
4
|
-
* Auth user information (extends
|
|
4
|
+
* Auth user information (extends User with non-null remark)
|
|
5
5
|
*/
|
|
6
|
-
export interface AuthUser extends Omit<
|
|
6
|
+
export interface AuthUser extends Omit<User, "remark"> {
|
|
7
7
|
remark: string;
|
|
8
8
|
}
|
|
9
9
|
/**
|
package/dist/common/types.d.ts
CHANGED
|
@@ -1,76 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export interface AppInfo {
|
|
5
|
-
app_id: string;
|
|
6
|
-
org_id: string;
|
|
7
|
-
app_key: string;
|
|
8
|
-
app_name: string;
|
|
1
|
+
export interface CommonOptions {
|
|
2
|
+
baseUrl?: string;
|
|
3
|
+
appToken?: string;
|
|
9
4
|
}
|
|
10
5
|
/**
|
|
11
|
-
*
|
|
6
|
+
* Spring Boot Page serialization format
|
|
7
|
+
*
|
|
8
|
+
* This matches the default JSON serialization format of Spring Data's Page object
|
|
9
|
+
*
|
|
10
|
+
* @see https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/Page.html
|
|
12
11
|
*/
|
|
13
|
-
export interface
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
export interface PageResponse<T> {
|
|
13
|
+
/** Page content */
|
|
14
|
+
content: T[];
|
|
15
|
+
/** Pagination information */
|
|
16
|
+
pageable: {
|
|
17
|
+
pageNumber: number;
|
|
18
|
+
pageSize: number;
|
|
19
|
+
sort: {
|
|
20
|
+
sorted: boolean;
|
|
21
|
+
unsorted: boolean;
|
|
22
|
+
empty: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** Total number of pages */
|
|
26
|
+
totalPages: number;
|
|
27
|
+
/** Total number of elements */
|
|
28
|
+
totalElements: number;
|
|
29
|
+
/** Whether this is the last page */
|
|
30
|
+
last: boolean;
|
|
31
|
+
/** Whether this is the first page */
|
|
32
|
+
first: boolean;
|
|
33
|
+
/** Number of elements in current page */
|
|
34
|
+
numberOfElements: number;
|
|
35
|
+
/** Page size */
|
|
36
|
+
size: number;
|
|
37
|
+
/** Current page number */
|
|
38
|
+
number: number;
|
|
39
|
+
/** Whether the page is empty */
|
|
40
|
+
empty: boolean;
|
|
24
41
|
}
|
|
25
|
-
/**
|
|
26
|
-
* User group information
|
|
27
|
-
*/
|
|
28
42
|
export interface UserGroup {
|
|
29
43
|
group_id: string;
|
|
30
44
|
group_name: string;
|
|
31
45
|
description?: string;
|
|
46
|
+
remark?: string;
|
|
32
47
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Role information
|
|
35
|
-
*/
|
|
36
48
|
export interface Role {
|
|
37
49
|
role_id: string;
|
|
38
50
|
role_name: string;
|
|
39
|
-
|
|
51
|
+
role_type?: string;
|
|
52
|
+
role_property?: Record<string, unknown>;
|
|
53
|
+
role_privileges?: Privilege[];
|
|
54
|
+
privilege_ids?: string[];
|
|
55
|
+
resource_ids?: string[];
|
|
56
|
+
expired_at?: string;
|
|
57
|
+
remark?: string;
|
|
40
58
|
}
|
|
41
|
-
/**
|
|
42
|
-
* Privilege information
|
|
43
|
-
*/
|
|
44
59
|
export interface Privilege {
|
|
45
60
|
privilege_id: string;
|
|
46
61
|
privilege_name: string;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export interface Sort {
|
|
53
|
-
empty: boolean;
|
|
54
|
-
sorted: boolean;
|
|
55
|
-
unsorted: boolean;
|
|
62
|
+
privilege_type?: string;
|
|
63
|
+
privilege_property?: Record<string, unknown>;
|
|
64
|
+
resource_ids?: string[];
|
|
65
|
+
expired_at?: string;
|
|
66
|
+
remark?: string;
|
|
56
67
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
sort: Sort;
|
|
62
|
-
offset: number;
|
|
63
|
-
pageNumber: number;
|
|
64
|
-
pageSize: number;
|
|
65
|
-
paged: boolean;
|
|
66
|
-
unpaged: boolean;
|
|
68
|
+
export interface AppInfo {
|
|
69
|
+
app_id: string;
|
|
70
|
+
app_key: string;
|
|
71
|
+
app_name: string;
|
|
67
72
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
export interface User {
|
|
74
|
+
user_id: string;
|
|
75
|
+
open_id: string;
|
|
76
|
+
username: string;
|
|
77
|
+
nick_name: string;
|
|
78
|
+
email: string;
|
|
79
|
+
phone: string;
|
|
80
|
+
avatar_url?: string;
|
|
81
|
+
is_frozen: boolean;
|
|
82
|
+
created_at: string;
|
|
83
|
+
updated_at: string;
|
|
84
|
+
remark?: string;
|
|
76
85
|
}
|
package/dist/common/types.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export * from "./token.js";
|
|
|
3
3
|
export * from "./user/index.js";
|
|
4
4
|
export * from "./auth/index.js";
|
|
5
5
|
export * from "./user-group/index.js";
|
|
6
|
+
export * from "./rbac/index.js";
|
|
7
|
+
export * from "./acl/index.js";
|
|
6
8
|
export * from "./errors.js";
|
|
7
|
-
export
|
|
9
|
+
export type { CommonOptions, PageResponse, UserGroup, Role, Privilege, AppInfo, User } from "./common/types.js";
|
package/dist/index.js
CHANGED
|
@@ -3,5 +3,6 @@ export * from "./token.js";
|
|
|
3
3
|
export * from "./user/index.js";
|
|
4
4
|
export * from "./auth/index.js";
|
|
5
5
|
export * from "./user-group/index.js";
|
|
6
|
+
export * from "./rbac/index.js";
|
|
7
|
+
export * from "./acl/index.js";
|
|
6
8
|
export * from "./errors.js";
|
|
7
|
-
export * from "./common/types.js";
|