tale-js-sdk 0.1.4 → 1.1.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 +446 -510
- package/dist/acl/types.d.ts +96 -161
- package/dist/common/types.d.ts +5 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- 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 +2 -2
- package/dist/user/types.d.ts +3 -7
- package/dist/user-attribute/index.d.ts +194 -0
- package/dist/user-attribute/index.js +628 -0
- package/dist/user-attribute/types.d.ts +108 -0
- package/dist/user-attribute/types.js +1 -0
- package/package.json +1 -1
package/dist/acl/types.d.ts
CHANGED
|
@@ -1,208 +1,143 @@
|
|
|
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;
|
|
55
|
+
sort?: string;
|
|
92
56
|
template_id?: string;
|
|
93
|
-
subject_type?:
|
|
57
|
+
subject_type?: string;
|
|
94
58
|
subject_id?: string;
|
|
95
59
|
subject_identifier?: string;
|
|
96
60
|
resource_type?: string;
|
|
97
61
|
resource_id?: string;
|
|
98
62
|
resource_identifier?: string;
|
|
99
|
-
page?: number;
|
|
100
|
-
size?: number;
|
|
101
|
-
sort_by?: string;
|
|
102
|
-
sort_direction?: 'asc' | 'desc';
|
|
103
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Batch creation response for ACL records
|
|
66
|
+
*/
|
|
67
|
+
export interface AclBatchCreateResponse {
|
|
68
|
+
success_count: number;
|
|
69
|
+
failure_count: number;
|
|
70
|
+
success_records: AclRecord[];
|
|
71
|
+
failures: AclBatchFailure[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Failure details for batch creation
|
|
75
|
+
*/
|
|
76
|
+
export interface AclBatchFailure {
|
|
77
|
+
index: number;
|
|
78
|
+
request: CreateAclRecordRequest;
|
|
79
|
+
error_message: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* ACL Template
|
|
83
|
+
* Represents a reusable ACL configuration template
|
|
84
|
+
*/
|
|
85
|
+
export interface AclTemplate {
|
|
86
|
+
template_id: string;
|
|
87
|
+
app_id: string;
|
|
88
|
+
template_name: string;
|
|
89
|
+
template_code: string;
|
|
90
|
+
subject_type?: string;
|
|
91
|
+
subject_filter?: Record<string, unknown>;
|
|
92
|
+
resource_type?: string;
|
|
93
|
+
resource_filter?: Record<string, unknown>;
|
|
94
|
+
effect_type?: string;
|
|
95
|
+
priority?: number;
|
|
96
|
+
data_scope?: Record<string, unknown>;
|
|
97
|
+
description?: string;
|
|
98
|
+
created_at: string;
|
|
99
|
+
updated_at: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Request for creating an ACL template
|
|
103
|
+
*/
|
|
104
104
|
export interface CreateAclTemplateRequest {
|
|
105
105
|
template_name: string;
|
|
106
106
|
template_code: string;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
subject_type?: string;
|
|
108
|
+
subject_filter?: Record<string, unknown>;
|
|
109
|
+
resource_type?: string;
|
|
110
|
+
resource_filter?: Record<string, unknown>;
|
|
111
|
+
effect_type?: string;
|
|
112
|
+
priority?: number;
|
|
113
|
+
data_scope?: Record<string, unknown>;
|
|
111
114
|
description?: string;
|
|
112
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Request for updating an ACL template
|
|
118
|
+
*/
|
|
113
119
|
export interface UpdateAclTemplateRequest {
|
|
114
120
|
template_name?: string;
|
|
115
|
-
subject_filter?: Record<string,
|
|
116
|
-
resource_filter?: Record<string,
|
|
117
|
-
effect_type?:
|
|
118
|
-
|
|
121
|
+
subject_filter?: Record<string, unknown>;
|
|
122
|
+
resource_filter?: Record<string, unknown>;
|
|
123
|
+
effect_type?: string;
|
|
124
|
+
priority?: number;
|
|
125
|
+
data_scope?: Record<string, unknown>;
|
|
119
126
|
description?: string;
|
|
120
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Request for listing ACL templates
|
|
130
|
+
*/
|
|
121
131
|
export interface ListAclTemplatesRequest {
|
|
122
|
-
resource_type?: string;
|
|
123
|
-
subject_type?: 'user' | 'role' | 'group';
|
|
124
132
|
page?: number;
|
|
125
133
|
size?: number;
|
|
126
134
|
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;
|
|
135
|
+
sort_direction?: "asc" | "desc";
|
|
136
|
+
resource_type?: string;
|
|
137
|
+
subject_type?: string;
|
|
203
138
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Options for ACL operations
|
|
141
|
+
*/
|
|
142
|
+
export interface AclOptions extends CommonOptions {
|
|
208
143
|
}
|
package/dist/common/types.d.ts
CHANGED
|
@@ -50,15 +50,18 @@ export interface Role {
|
|
|
50
50
|
role_name: string;
|
|
51
51
|
role_type?: string;
|
|
52
52
|
role_property?: Record<string, unknown>;
|
|
53
|
-
|
|
53
|
+
role_privileges?: Privilege[];
|
|
54
|
+
privilege_ids?: string[];
|
|
55
|
+
resource_ids?: string[];
|
|
54
56
|
expired_at?: string;
|
|
57
|
+
remark?: string;
|
|
55
58
|
}
|
|
56
59
|
export interface Privilege {
|
|
57
60
|
privilege_id: string;
|
|
58
61
|
privilege_name: string;
|
|
59
62
|
privilege_type?: string;
|
|
60
63
|
privilege_property?: Record<string, unknown>;
|
|
61
|
-
|
|
64
|
+
resource_ids?: string[];
|
|
62
65
|
expired_at?: string;
|
|
63
66
|
remark?: string;
|
|
64
67
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,8 @@ 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";
|
|
8
|
+
export * from "./user-attribute/index.js";
|
|
6
9
|
export * from "./errors.js";
|
|
7
10
|
export type { CommonOptions, PageResponse, UserGroup, Role, Privilege, AppInfo, User } from "./common/types.js";
|
package/dist/index.js
CHANGED
|
@@ -3,4 +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";
|
|
8
|
+
export * from "./user-attribute/index.js";
|
|
6
9
|
export * from "./errors.js";
|