sy-page-sdk 0.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/README.md +444 -0
- package/dist/chunk-R77DYKUJ.js +1034 -0
- package/dist/index.cjs +1060 -0
- package/dist/index.d.cts +729 -0
- package/dist/index.d.ts +729 -0
- package/dist/index.js +6 -0
- package/dist/react/index.cjs +1383 -0
- package/dist/react/index.d.cts +77 -0
- package/dist/react/index.d.ts +77 -0
- package/dist/react/index.js +307 -0
- package/package.json +40 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
type PageQueryValue = string | string[];
|
|
2
|
+
type PageHttpMethod = "get" | "post" | "put" | "delete" | "patch";
|
|
3
|
+
type PageScope = "platform" | "app";
|
|
4
|
+
type PageUiPermissionType = "route" | "button";
|
|
5
|
+
interface FieldPermissionDto {
|
|
6
|
+
componentName: string;
|
|
7
|
+
fieldName: string;
|
|
8
|
+
label: string;
|
|
9
|
+
value: "FORM_FILED_EDIT" | "FORM_FILED_VIEW" | "FORM_FILED_HIDDEN";
|
|
10
|
+
}
|
|
11
|
+
type ViewFieldPermissionValue = "FORM_FILED_EDIT" | "FORM_FILED_VIEW" | "FORM_FILED_HIDDEN";
|
|
12
|
+
interface DataPermissionRuleDto {
|
|
13
|
+
field: string;
|
|
14
|
+
componentType?: string;
|
|
15
|
+
op: string;
|
|
16
|
+
value: unknown;
|
|
17
|
+
}
|
|
18
|
+
interface DataPermissionConditionDto {
|
|
19
|
+
logic: "AND" | "OR";
|
|
20
|
+
rules?: DataPermissionRuleDto[];
|
|
21
|
+
conditions?: DataPermissionConditionDto[];
|
|
22
|
+
}
|
|
23
|
+
interface DataPermissionDto {
|
|
24
|
+
type: "condition" | "sql";
|
|
25
|
+
condition?: DataPermissionConditionDto;
|
|
26
|
+
logic?: "AND" | "OR";
|
|
27
|
+
rules?: DataPermissionRuleDto[];
|
|
28
|
+
expression?: string;
|
|
29
|
+
}
|
|
30
|
+
type SearchLogic = "AND" | "OR";
|
|
31
|
+
type SearchOperator = "EQ" | "NEQ" | "LIKE" | "ILIKE" | "MATCH" | "CONTAINS" | "NOT_CONTAINS" | "IN" | "IS_NULL" | "IS_NOT_NULL" | "GT" | "GTE" | "GE" | "LT" | "LTE" | "LE" | "BETWEEN" | "EXISTS" | "NOT_EXISTS" | "PATH_EQ" | string;
|
|
32
|
+
type SearchComponentName = "TextField" | "TextareaField" | "EditorField" | "SerialNumberField" | "NumberField" | "DateField" | "CascadeDateField" | "SelectField" | "RadioField" | "MultiSelectField" | "CheckboxField" | "CascadeSelectField" | "DepartmentSelectField" | "EmployeeSelectField" | "UserSelectField" | "JSONField" | "SubFormField" | string;
|
|
33
|
+
type SearchSystemField = "createTime" | "modifiedTime" | "processInstanceId" | "processInstanceTitle" | "originator" | "originatorName" | "originatorCorp" | "created_at" | "updated_at" | "form_instance_id" | "instance_title" | "created_by" | "created_by_name" | "created_by_department_id";
|
|
34
|
+
type SearchFieldKey = SearchSystemField | string;
|
|
35
|
+
type InstanceStatus = "pending" | "running" | "completed" | "terminated" | "waiting" | "withdrawn";
|
|
36
|
+
interface PageAppInfo {
|
|
37
|
+
appType: string;
|
|
38
|
+
tenantId: string;
|
|
39
|
+
}
|
|
40
|
+
interface PageRouteInfo {
|
|
41
|
+
pathname: string;
|
|
42
|
+
fullPath: string;
|
|
43
|
+
params: Record<string, string | undefined>;
|
|
44
|
+
query: Record<string, PageQueryValue>;
|
|
45
|
+
hash: string;
|
|
46
|
+
}
|
|
47
|
+
interface PageDepartmentInfo {
|
|
48
|
+
id?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
}
|
|
51
|
+
type PageUserType = "normal" | "guest";
|
|
52
|
+
interface PageUserInfo {
|
|
53
|
+
id: string;
|
|
54
|
+
username: string;
|
|
55
|
+
name?: string;
|
|
56
|
+
jobNumber?: string;
|
|
57
|
+
phone?: string | null;
|
|
58
|
+
email?: string | null;
|
|
59
|
+
avatar?: string | null;
|
|
60
|
+
departments?: PageDepartmentInfo[];
|
|
61
|
+
tenantId: string;
|
|
62
|
+
isGuest?: boolean;
|
|
63
|
+
userType?: PageUserType;
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
interface PagePermissionInfo {
|
|
67
|
+
canView: boolean;
|
|
68
|
+
hasFullAccess: boolean;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
interface SearchSortItem {
|
|
72
|
+
id: string;
|
|
73
|
+
isAsc: "y" | "n";
|
|
74
|
+
}
|
|
75
|
+
interface SearchRule {
|
|
76
|
+
key: SearchFieldKey;
|
|
77
|
+
componentName?: Exclude<SearchComponentName, "SubFormField">;
|
|
78
|
+
operator?: Exclude<SearchOperator, "EXISTS" | "NOT_EXISTS">;
|
|
79
|
+
value?: unknown;
|
|
80
|
+
type?: string;
|
|
81
|
+
}
|
|
82
|
+
interface SearchGroup {
|
|
83
|
+
logic?: SearchLogic;
|
|
84
|
+
rules?: Array<SearchRule | SubFormRule>;
|
|
85
|
+
conditions?: SearchGroup[];
|
|
86
|
+
}
|
|
87
|
+
interface SubFormRule {
|
|
88
|
+
key: string;
|
|
89
|
+
componentName: "SubFormField";
|
|
90
|
+
operator?: "EXISTS" | "NOT_EXISTS" | "IS_NULL" | "IS_NOT_NULL";
|
|
91
|
+
value?: SearchGroup;
|
|
92
|
+
type?: string;
|
|
93
|
+
}
|
|
94
|
+
type SearchExpression = SearchRule | SubFormRule | Array<SearchRule | SubFormRule> | Array<Record<string, unknown>> | SearchGroup | Record<string, unknown>;
|
|
95
|
+
interface PageDataSourceDescriptor {
|
|
96
|
+
key: string;
|
|
97
|
+
type: string;
|
|
98
|
+
formUuid?: string;
|
|
99
|
+
fields?: string[];
|
|
100
|
+
permission?: "read" | "write" | string;
|
|
101
|
+
defaultFilter?: SearchExpression | string;
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
}
|
|
104
|
+
interface PageInfo {
|
|
105
|
+
id: string;
|
|
106
|
+
code: string;
|
|
107
|
+
name: string;
|
|
108
|
+
type: string;
|
|
109
|
+
rendererType: string;
|
|
110
|
+
routeKey: string;
|
|
111
|
+
legacyFormUuid?: string;
|
|
112
|
+
status: string;
|
|
113
|
+
props: Record<string, unknown>;
|
|
114
|
+
route: Record<string, unknown> | object;
|
|
115
|
+
dataSources: PageDataSourceDescriptor[];
|
|
116
|
+
capabilities: Record<string, unknown>;
|
|
117
|
+
version?: string;
|
|
118
|
+
buildId?: string;
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
}
|
|
121
|
+
interface PageMessageApi {
|
|
122
|
+
success(text: string): void;
|
|
123
|
+
error(text: string): void;
|
|
124
|
+
warning(text: string): void;
|
|
125
|
+
info(text: string): void;
|
|
126
|
+
loading(text: string): () => void;
|
|
127
|
+
}
|
|
128
|
+
interface PageModalApi {
|
|
129
|
+
confirm(input: {
|
|
130
|
+
title: string;
|
|
131
|
+
content: string;
|
|
132
|
+
}): Promise<boolean>;
|
|
133
|
+
}
|
|
134
|
+
interface PageNavigationApi {
|
|
135
|
+
/**
|
|
136
|
+
* pageKey accepts legacy formUuid, routeKey, or pageCode.
|
|
137
|
+
* Custom pages should prefer routeKey/pageCode over hard-coded legacy formUuid.
|
|
138
|
+
*/
|
|
139
|
+
pushPage(pageKey: string, query?: Record<string, unknown>): void;
|
|
140
|
+
replacePage(pageKey: string, query?: Record<string, unknown>): void;
|
|
141
|
+
updateQuery(query: Record<string, unknown>): void;
|
|
142
|
+
setHash(hash: string): void;
|
|
143
|
+
back(): void;
|
|
144
|
+
}
|
|
145
|
+
interface PageBridgeApi {
|
|
146
|
+
invoke<T = unknown>(method: string, payload?: unknown): Promise<T>;
|
|
147
|
+
subscribe?(event: string, listener: (payload: unknown) => void): () => void;
|
|
148
|
+
}
|
|
149
|
+
interface PageSdkMeta {
|
|
150
|
+
packageName?: string;
|
|
151
|
+
version?: string | null;
|
|
152
|
+
supportedBridgeMethods?: string[];
|
|
153
|
+
}
|
|
154
|
+
interface PageApiResponse<TResult = unknown, TRaw = TResult> {
|
|
155
|
+
code: number;
|
|
156
|
+
success: boolean;
|
|
157
|
+
message?: string;
|
|
158
|
+
result: TResult | null;
|
|
159
|
+
data?: TRaw;
|
|
160
|
+
raw?: unknown;
|
|
161
|
+
}
|
|
162
|
+
interface PageBinaryResponse {
|
|
163
|
+
blob: Blob;
|
|
164
|
+
fileName?: string;
|
|
165
|
+
contentType?: string;
|
|
166
|
+
headers?: Record<string, string | undefined>;
|
|
167
|
+
raw?: unknown;
|
|
168
|
+
}
|
|
169
|
+
interface PageListResult<TItem = unknown> {
|
|
170
|
+
currentPage: number;
|
|
171
|
+
data: TItem[];
|
|
172
|
+
totalCount: number;
|
|
173
|
+
}
|
|
174
|
+
interface PageOffsetListResult<TItem = unknown> {
|
|
175
|
+
items: TItem[];
|
|
176
|
+
total: number;
|
|
177
|
+
page: number;
|
|
178
|
+
limit: number;
|
|
179
|
+
}
|
|
180
|
+
interface PageContext {
|
|
181
|
+
protocolVersion: string;
|
|
182
|
+
app: PageAppInfo;
|
|
183
|
+
page: PageInfo;
|
|
184
|
+
user: PageUserInfo;
|
|
185
|
+
route: PageRouteInfo;
|
|
186
|
+
env: Record<string, unknown>;
|
|
187
|
+
permissions: PagePermissionInfo;
|
|
188
|
+
capabilities: string[];
|
|
189
|
+
ui: {
|
|
190
|
+
message: PageMessageApi;
|
|
191
|
+
modal: PageModalApi;
|
|
192
|
+
};
|
|
193
|
+
navigation: PageNavigationApi;
|
|
194
|
+
bridge: PageBridgeApi;
|
|
195
|
+
sdk?: PageSdkMeta;
|
|
196
|
+
}
|
|
197
|
+
interface PageRequestOptions<TQuery = Record<string, unknown>, TBody = unknown> {
|
|
198
|
+
path: string;
|
|
199
|
+
method: PageHttpMethod;
|
|
200
|
+
query?: TQuery;
|
|
201
|
+
body?: TBody;
|
|
202
|
+
headers?: Record<string, string>;
|
|
203
|
+
}
|
|
204
|
+
interface PageTransportRequestPayload<TBody = unknown> {
|
|
205
|
+
path: string;
|
|
206
|
+
method: PageHttpMethod;
|
|
207
|
+
query?: string;
|
|
208
|
+
body?: TBody;
|
|
209
|
+
headers?: Record<string, string>;
|
|
210
|
+
}
|
|
211
|
+
interface PageTransportDownloadPayload<TBody = unknown> {
|
|
212
|
+
path: string;
|
|
213
|
+
method: PageHttpMethod;
|
|
214
|
+
query?: string;
|
|
215
|
+
body?: TBody;
|
|
216
|
+
headers?: Record<string, string>;
|
|
217
|
+
}
|
|
218
|
+
interface PageSdkError extends Error {
|
|
219
|
+
method?: string;
|
|
220
|
+
path?: string;
|
|
221
|
+
response?: PageApiResponse<unknown>;
|
|
222
|
+
raw?: unknown;
|
|
223
|
+
}
|
|
224
|
+
interface FormGetDetailParams {
|
|
225
|
+
formUuid: string;
|
|
226
|
+
formInstId?: string;
|
|
227
|
+
formInstanceId?: string;
|
|
228
|
+
appType?: string;
|
|
229
|
+
}
|
|
230
|
+
interface FormCreateParams {
|
|
231
|
+
formUuid: string;
|
|
232
|
+
appType?: string;
|
|
233
|
+
data: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
interface FormUpdateParams {
|
|
236
|
+
formUuid: string;
|
|
237
|
+
appType?: string;
|
|
238
|
+
formInstId?: string;
|
|
239
|
+
formInstanceId?: string;
|
|
240
|
+
data?: Record<string, unknown>;
|
|
241
|
+
updateFormDataJson?: string;
|
|
242
|
+
}
|
|
243
|
+
interface FormRemoveParams {
|
|
244
|
+
formUuid: string;
|
|
245
|
+
appType?: string;
|
|
246
|
+
formInstId?: string;
|
|
247
|
+
formInstanceId?: string;
|
|
248
|
+
}
|
|
249
|
+
interface FormChangeRecordParams {
|
|
250
|
+
formUuid: string;
|
|
251
|
+
appType?: string;
|
|
252
|
+
formInstId?: string;
|
|
253
|
+
formInstanceId?: string;
|
|
254
|
+
page?: number;
|
|
255
|
+
pageSize?: number;
|
|
256
|
+
}
|
|
257
|
+
interface FormSearchParams {
|
|
258
|
+
formUuid: string;
|
|
259
|
+
appType?: string;
|
|
260
|
+
search?: SearchExpression;
|
|
261
|
+
currentPage?: number;
|
|
262
|
+
pageSize?: number;
|
|
263
|
+
originatorId?: string;
|
|
264
|
+
createFrom?: string;
|
|
265
|
+
createTo?: string;
|
|
266
|
+
modifiedFrom?: string;
|
|
267
|
+
modifiedTo?: string;
|
|
268
|
+
dynamicOrder?: string | SearchSortItem;
|
|
269
|
+
instanceStatus?: InstanceStatus;
|
|
270
|
+
}
|
|
271
|
+
interface FormAdvancedSearchParams {
|
|
272
|
+
formUuid: string;
|
|
273
|
+
appType?: string;
|
|
274
|
+
filters?: SearchExpression;
|
|
275
|
+
conditionType?: SearchLogic;
|
|
276
|
+
searchKeyWord?: string;
|
|
277
|
+
currentPage?: number;
|
|
278
|
+
pageSize?: number;
|
|
279
|
+
order?: SearchSortItem | SearchSortItem[];
|
|
280
|
+
instanceStatus?: InstanceStatus;
|
|
281
|
+
}
|
|
282
|
+
interface FormExportParams extends FormAdvancedSearchParams {
|
|
283
|
+
exportAll?: "y" | "n";
|
|
284
|
+
embedImages?: "y" | "n";
|
|
285
|
+
exportFields?: string[];
|
|
286
|
+
}
|
|
287
|
+
interface FormImportParams {
|
|
288
|
+
formUuid: string;
|
|
289
|
+
appType?: string;
|
|
290
|
+
fileBase64: string;
|
|
291
|
+
fileName?: string;
|
|
292
|
+
}
|
|
293
|
+
interface ImportExportRecordQuery {
|
|
294
|
+
formUuid: string;
|
|
295
|
+
appType?: string;
|
|
296
|
+
currentPage?: number;
|
|
297
|
+
pageSize?: number;
|
|
298
|
+
}
|
|
299
|
+
interface ImportExportRecordDownloadParams {
|
|
300
|
+
appType?: string;
|
|
301
|
+
recordId: string;
|
|
302
|
+
}
|
|
303
|
+
interface DataManagementFilterState {
|
|
304
|
+
filters?: SearchExpression;
|
|
305
|
+
conditionType?: SearchLogic;
|
|
306
|
+
searchKeyWord?: string;
|
|
307
|
+
}
|
|
308
|
+
interface PageDataManagementConfig {
|
|
309
|
+
sort?: SearchSortItem[];
|
|
310
|
+
showFields?: string[];
|
|
311
|
+
filter?: DataManagementFilterState;
|
|
312
|
+
widths?: Record<string, number>;
|
|
313
|
+
lockFieldIds?: string[];
|
|
314
|
+
lineHeight?: number;
|
|
315
|
+
[key: string]: unknown;
|
|
316
|
+
}
|
|
317
|
+
interface DataManagementConfigParams {
|
|
318
|
+
formUuid: string;
|
|
319
|
+
appType?: string;
|
|
320
|
+
}
|
|
321
|
+
interface SaveDataManagementConfigParams extends DataManagementConfigParams {
|
|
322
|
+
config: PageDataManagementConfig;
|
|
323
|
+
}
|
|
324
|
+
interface PageUserRecord extends PageUserInfo {
|
|
325
|
+
phone?: string | null;
|
|
326
|
+
email?: string | null;
|
|
327
|
+
avatar?: string | null;
|
|
328
|
+
status?: string;
|
|
329
|
+
createdAt?: string;
|
|
330
|
+
updatedAt?: string;
|
|
331
|
+
validFrom?: string | null;
|
|
332
|
+
validTo?: string | null;
|
|
333
|
+
}
|
|
334
|
+
interface CreateUserParams {
|
|
335
|
+
id?: string;
|
|
336
|
+
username?: string;
|
|
337
|
+
password?: string;
|
|
338
|
+
phone?: string;
|
|
339
|
+
email?: string;
|
|
340
|
+
name: string;
|
|
341
|
+
avatar?: string;
|
|
342
|
+
departmentIds?: string[];
|
|
343
|
+
validFrom?: string | Date | null;
|
|
344
|
+
validTo?: string | Date | null;
|
|
345
|
+
}
|
|
346
|
+
interface UpdateUserParams extends Partial<CreateUserParams> {
|
|
347
|
+
id: string;
|
|
348
|
+
}
|
|
349
|
+
interface UserListParams {
|
|
350
|
+
ids?: string[];
|
|
351
|
+
departmentIds?: string[];
|
|
352
|
+
name?: string;
|
|
353
|
+
username?: string;
|
|
354
|
+
phone?: string;
|
|
355
|
+
email?: string;
|
|
356
|
+
page?: number;
|
|
357
|
+
pageSize?: number;
|
|
358
|
+
}
|
|
359
|
+
interface ValidateUserParams {
|
|
360
|
+
username: string;
|
|
361
|
+
password: string;
|
|
362
|
+
}
|
|
363
|
+
interface PageRoleRecord {
|
|
364
|
+
id: string;
|
|
365
|
+
name: string;
|
|
366
|
+
code: string;
|
|
367
|
+
scope: PageScope;
|
|
368
|
+
appType?: string;
|
|
369
|
+
description?: string;
|
|
370
|
+
createdAt?: string;
|
|
371
|
+
updatedAt?: string;
|
|
372
|
+
}
|
|
373
|
+
interface CreateRoleParams {
|
|
374
|
+
name: string;
|
|
375
|
+
code: string;
|
|
376
|
+
scope: PageScope;
|
|
377
|
+
appType?: string;
|
|
378
|
+
description?: string;
|
|
379
|
+
}
|
|
380
|
+
type UpdateRoleParams = Partial<CreateRoleParams>;
|
|
381
|
+
interface RoleListParams {
|
|
382
|
+
appType?: string;
|
|
383
|
+
name?: string;
|
|
384
|
+
code?: string;
|
|
385
|
+
page?: number;
|
|
386
|
+
limit?: number;
|
|
387
|
+
scope?: PageScope;
|
|
388
|
+
}
|
|
389
|
+
interface RoleUsersParams {
|
|
390
|
+
page?: number;
|
|
391
|
+
limit?: number;
|
|
392
|
+
keyword?: string;
|
|
393
|
+
}
|
|
394
|
+
interface AssignRolesParams {
|
|
395
|
+
userId: string;
|
|
396
|
+
roleIds: string[];
|
|
397
|
+
}
|
|
398
|
+
interface ChangeUserRoleParams {
|
|
399
|
+
userId: string;
|
|
400
|
+
roleId: string;
|
|
401
|
+
}
|
|
402
|
+
interface BatchAddUsersToRoleParams {
|
|
403
|
+
roleId: string;
|
|
404
|
+
userIds: string[];
|
|
405
|
+
}
|
|
406
|
+
interface GetUserRolesParams {
|
|
407
|
+
scope?: PageScope;
|
|
408
|
+
appType?: string;
|
|
409
|
+
}
|
|
410
|
+
interface SwitchPlatformRoleParams {
|
|
411
|
+
roleId: string;
|
|
412
|
+
}
|
|
413
|
+
interface SwitchAppRoleParams {
|
|
414
|
+
roleId: string;
|
|
415
|
+
appType?: string;
|
|
416
|
+
}
|
|
417
|
+
interface PageApiPermissionRecord {
|
|
418
|
+
id: string;
|
|
419
|
+
name: string;
|
|
420
|
+
code: string;
|
|
421
|
+
scope: PageScope;
|
|
422
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "ANY";
|
|
423
|
+
path?: string;
|
|
424
|
+
appType?: string;
|
|
425
|
+
description?: string;
|
|
426
|
+
parentId?: string;
|
|
427
|
+
children?: PageApiPermissionRecord[];
|
|
428
|
+
}
|
|
429
|
+
interface PageUiPermissionRecord {
|
|
430
|
+
id: string;
|
|
431
|
+
name: string;
|
|
432
|
+
code: string;
|
|
433
|
+
type: PageUiPermissionType;
|
|
434
|
+
scope: PageScope;
|
|
435
|
+
appType?: string;
|
|
436
|
+
description?: string;
|
|
437
|
+
parentId?: string;
|
|
438
|
+
children?: PageUiPermissionRecord[];
|
|
439
|
+
}
|
|
440
|
+
interface CreateApiPermissionParams {
|
|
441
|
+
name: string;
|
|
442
|
+
code: string;
|
|
443
|
+
scope: PageScope;
|
|
444
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "ANY";
|
|
445
|
+
path: string;
|
|
446
|
+
description?: string;
|
|
447
|
+
parentId?: string;
|
|
448
|
+
appType?: string;
|
|
449
|
+
}
|
|
450
|
+
type UpdateApiPermissionParams = Partial<CreateApiPermissionParams>;
|
|
451
|
+
interface ApiPermissionListParams {
|
|
452
|
+
code?: string;
|
|
453
|
+
scope?: PageScope;
|
|
454
|
+
appType?: string;
|
|
455
|
+
page?: number;
|
|
456
|
+
limit?: number;
|
|
457
|
+
}
|
|
458
|
+
interface AssignPermissionsParams {
|
|
459
|
+
roleId: string;
|
|
460
|
+
permissionIds: string[];
|
|
461
|
+
}
|
|
462
|
+
interface CreateUiPermissionParams {
|
|
463
|
+
name: string;
|
|
464
|
+
code: string;
|
|
465
|
+
type: PageUiPermissionType;
|
|
466
|
+
scope: PageScope;
|
|
467
|
+
appType?: string;
|
|
468
|
+
description?: string;
|
|
469
|
+
parentId?: string;
|
|
470
|
+
}
|
|
471
|
+
type UpdateUiPermissionParams = Partial<CreateUiPermissionParams>;
|
|
472
|
+
interface UiPermissionListParams extends ApiPermissionListParams {
|
|
473
|
+
type?: PageUiPermissionType;
|
|
474
|
+
}
|
|
475
|
+
interface FormPermissionGroup {
|
|
476
|
+
id: string;
|
|
477
|
+
appType: string;
|
|
478
|
+
formUuid: string;
|
|
479
|
+
name: string;
|
|
480
|
+
type: "submit" | "view";
|
|
481
|
+
roles: string[];
|
|
482
|
+
dataScope?: "all" | "self";
|
|
483
|
+
operations?: string[];
|
|
484
|
+
fieldPermissions?: FieldPermissionDto[];
|
|
485
|
+
dataPermission?: DataPermissionDto;
|
|
486
|
+
createdAt?: string;
|
|
487
|
+
updatedAt?: string;
|
|
488
|
+
}
|
|
489
|
+
type ViewOperationPermission = "view" | "edit" | "delete" | "change_records" | "workflow";
|
|
490
|
+
interface ViewPermissionSummary {
|
|
491
|
+
fieldPermissions: Record<string, ViewFieldPermissionValue>;
|
|
492
|
+
operations: ViewOperationPermission[];
|
|
493
|
+
}
|
|
494
|
+
interface CreateFormPermissionGroupDto {
|
|
495
|
+
appType: string;
|
|
496
|
+
formUuid: string;
|
|
497
|
+
name: string;
|
|
498
|
+
type: "submit" | "view";
|
|
499
|
+
roles: string[];
|
|
500
|
+
dataScope?: "all" | "self";
|
|
501
|
+
operations?: string[];
|
|
502
|
+
fieldPermissions?: FieldPermissionDto[];
|
|
503
|
+
dataPermission?: DataPermissionDto;
|
|
504
|
+
}
|
|
505
|
+
interface UpdateFormPermissionGroupDto {
|
|
506
|
+
appType?: string;
|
|
507
|
+
formUuid?: string;
|
|
508
|
+
name?: string;
|
|
509
|
+
type?: "submit" | "view";
|
|
510
|
+
roles?: string[];
|
|
511
|
+
dataScope?: "all" | "self";
|
|
512
|
+
operations?: string[];
|
|
513
|
+
fieldPermissions?: FieldPermissionDto[];
|
|
514
|
+
dataPermission?: DataPermissionDto;
|
|
515
|
+
}
|
|
516
|
+
interface QueryFormPermissionGroupDto {
|
|
517
|
+
appType?: string;
|
|
518
|
+
formUuid?: string;
|
|
519
|
+
type?: "submit" | "view";
|
|
520
|
+
name?: string;
|
|
521
|
+
page?: number;
|
|
522
|
+
limit?: number;
|
|
523
|
+
}
|
|
524
|
+
interface PagePermissionGroup {
|
|
525
|
+
id: string;
|
|
526
|
+
appType: string;
|
|
527
|
+
name: string;
|
|
528
|
+
roles: string[];
|
|
529
|
+
menuFormUuids: string[];
|
|
530
|
+
createdAt?: string;
|
|
531
|
+
updatedAt?: string;
|
|
532
|
+
}
|
|
533
|
+
interface CreatePagePermissionGroupDto {
|
|
534
|
+
appType: string;
|
|
535
|
+
name: string;
|
|
536
|
+
roles: string[];
|
|
537
|
+
menuFormUuids: string[];
|
|
538
|
+
}
|
|
539
|
+
interface UpdatePagePermissionGroupDto {
|
|
540
|
+
appType?: string;
|
|
541
|
+
name?: string;
|
|
542
|
+
roles?: string[];
|
|
543
|
+
menuFormUuids?: string[];
|
|
544
|
+
}
|
|
545
|
+
interface QueryPagePermissionGroupDto {
|
|
546
|
+
appType?: string;
|
|
547
|
+
name?: string;
|
|
548
|
+
page?: number;
|
|
549
|
+
limit?: number;
|
|
550
|
+
}
|
|
551
|
+
interface UserMenuPermissionsResponse {
|
|
552
|
+
appType: string;
|
|
553
|
+
menuFormUuids: string[];
|
|
554
|
+
hasFullAccess: boolean;
|
|
555
|
+
}
|
|
556
|
+
type NotificationChannel = "inapp" | "email" | "dingding" | "wechat" | "thirdparty_todo";
|
|
557
|
+
interface SendNotificationByTypeParams {
|
|
558
|
+
notificationType: string;
|
|
559
|
+
recipientId: string;
|
|
560
|
+
appType?: string;
|
|
561
|
+
formUuid?: string;
|
|
562
|
+
payload: Record<string, unknown>;
|
|
563
|
+
channels?: NotificationChannel[];
|
|
564
|
+
}
|
|
565
|
+
interface BatchSendNotificationByTypeParams {
|
|
566
|
+
notificationType: string;
|
|
567
|
+
appType?: string;
|
|
568
|
+
formUuid?: string;
|
|
569
|
+
recipients: Array<{
|
|
570
|
+
recipientId: string;
|
|
571
|
+
payload: Record<string, unknown>;
|
|
572
|
+
channels?: NotificationChannel[];
|
|
573
|
+
}>;
|
|
574
|
+
}
|
|
575
|
+
interface NotificationMessageRecord {
|
|
576
|
+
id?: string;
|
|
577
|
+
messageId?: string;
|
|
578
|
+
channel?: NotificationChannel | string;
|
|
579
|
+
status?: "pending" | "sent" | "failed" | string;
|
|
580
|
+
recipientId?: string;
|
|
581
|
+
[key: string]: unknown;
|
|
582
|
+
}
|
|
583
|
+
interface SendNotificationResult {
|
|
584
|
+
messages: NotificationMessageRecord[];
|
|
585
|
+
}
|
|
586
|
+
type ProcessApproveAction = "approved" | "rejected" | "returned";
|
|
587
|
+
interface GetProcessInstanceParams {
|
|
588
|
+
appType?: string;
|
|
589
|
+
instanceId: string;
|
|
590
|
+
}
|
|
591
|
+
interface TerminateProcessInstanceParams {
|
|
592
|
+
appType?: string;
|
|
593
|
+
processInstanceId: string;
|
|
594
|
+
reason?: string;
|
|
595
|
+
}
|
|
596
|
+
interface ApproveTaskParams {
|
|
597
|
+
instanceId: string;
|
|
598
|
+
action: ProcessApproveAction;
|
|
599
|
+
comments?: string;
|
|
600
|
+
formUuid: string;
|
|
601
|
+
appType?: string;
|
|
602
|
+
updateFormDataJson?: string;
|
|
603
|
+
}
|
|
604
|
+
interface TriggerCallbackTaskParams {
|
|
605
|
+
appType?: string;
|
|
606
|
+
taskId: string;
|
|
607
|
+
payload?: unknown;
|
|
608
|
+
}
|
|
609
|
+
interface PageSdk {
|
|
610
|
+
context: PageContext;
|
|
611
|
+
request<TResult = unknown, TRaw = TResult>(options: PageRequestOptions): Promise<PageApiResponse<TResult, TRaw>>;
|
|
612
|
+
download(options: PageRequestOptions): Promise<PageBinaryResponse>;
|
|
613
|
+
transport: {
|
|
614
|
+
request<TResult = unknown, TRaw = TResult>(options: PageRequestOptions): Promise<PageApiResponse<TResult, TRaw>>;
|
|
615
|
+
download(options: PageRequestOptions): Promise<PageBinaryResponse>;
|
|
616
|
+
};
|
|
617
|
+
form: {
|
|
618
|
+
getDetail<T = unknown>(params: FormGetDetailParams): Promise<PageApiResponse<T>>;
|
|
619
|
+
create<T = unknown, TRaw = unknown>(params: FormCreateParams): Promise<PageApiResponse<T, TRaw>>;
|
|
620
|
+
update<T = unknown, TRaw = unknown>(params: FormUpdateParams): Promise<PageApiResponse<T, TRaw>>;
|
|
621
|
+
remove<T = unknown, TRaw = unknown>(params: FormRemoveParams): Promise<PageApiResponse<T, TRaw>>;
|
|
622
|
+
getChangeRecords<T = unknown>(params: FormChangeRecordParams): Promise<PageApiResponse<T>>;
|
|
623
|
+
search<T = unknown>(params: FormSearchParams): Promise<PageApiResponse<PageListResult<T>>>;
|
|
624
|
+
searchIds<T = string>(params: FormSearchParams): Promise<PageApiResponse<PageListResult<T>>>;
|
|
625
|
+
advancedSearch<T = unknown>(params: FormAdvancedSearchParams): Promise<PageApiResponse<PageListResult<T>>>;
|
|
626
|
+
advancedExport(params: FormExportParams): Promise<PageBinaryResponse>;
|
|
627
|
+
downloadImportTemplate(params: DataManagementConfigParams): Promise<PageBinaryResponse>;
|
|
628
|
+
importPreview<T = unknown>(params: FormImportParams): Promise<PageApiResponse<T>>;
|
|
629
|
+
importExcel<T = unknown>(params: FormImportParams): Promise<PageApiResponse<T>>;
|
|
630
|
+
getImportRecords<T = unknown>(params: ImportExportRecordQuery): Promise<PageApiResponse<T>>;
|
|
631
|
+
getExportRecords<T = unknown>(params: ImportExportRecordQuery): Promise<PageApiResponse<T>>;
|
|
632
|
+
downloadImportSource(params: ImportExportRecordDownloadParams): Promise<PageBinaryResponse>;
|
|
633
|
+
downloadImportFailed(params: ImportExportRecordDownloadParams): Promise<PageBinaryResponse>;
|
|
634
|
+
downloadExportRecord(params: ImportExportRecordDownloadParams): Promise<PageBinaryResponse>;
|
|
635
|
+
getDataManagementConfig<T = PageDataManagementConfig | null>(params: DataManagementConfigParams): Promise<PageApiResponse<T>>;
|
|
636
|
+
saveDataManagementConfig<T = PageDataManagementConfig>(params: SaveDataManagementConfigParams): Promise<PageApiResponse<T>>;
|
|
637
|
+
};
|
|
638
|
+
user: {
|
|
639
|
+
create<T = PageUserRecord>(params: CreateUserParams): Promise<PageApiResponse<T>>;
|
|
640
|
+
update<T = PageUserRecord>(params: UpdateUserParams): Promise<PageApiResponse<T>>;
|
|
641
|
+
remove<T = boolean>(id: string): Promise<PageApiResponse<T>>;
|
|
642
|
+
get<T = PageUserRecord>(id?: string): Promise<PageApiResponse<T>>;
|
|
643
|
+
getCurrent<T = PageUserRecord>(): Promise<PageApiResponse<T>>;
|
|
644
|
+
getByUsername<T = PageUserRecord>(username: string): Promise<PageApiResponse<T>>;
|
|
645
|
+
list<T = PageOffsetListResult<PageUserRecord>>(params?: UserListParams): Promise<PageApiResponse<T>>;
|
|
646
|
+
search<T = PageUserRecord[]>(keyword?: string): Promise<PageApiResponse<T>>;
|
|
647
|
+
listAll<T = PageUserRecord[]>(): Promise<PageApiResponse<T>>;
|
|
648
|
+
listByDepartment<T = PageUserRecord[]>(departmentId: string): Promise<PageApiResponse<T>>;
|
|
649
|
+
validate<T = unknown>(params: ValidateUserParams): Promise<PageApiResponse<T>>;
|
|
650
|
+
};
|
|
651
|
+
role: {
|
|
652
|
+
create<T = PageRoleRecord>(params: CreateRoleParams): Promise<PageApiResponse<T>>;
|
|
653
|
+
update<T = PageRoleRecord>(id: string, params: UpdateRoleParams): Promise<PageApiResponse<T>>;
|
|
654
|
+
remove<T = boolean>(id: string): Promise<PageApiResponse<T>>;
|
|
655
|
+
get<T = PageRoleRecord | null>(id: string): Promise<PageApiResponse<T>>;
|
|
656
|
+
list<T = PageOffsetListResult<PageRoleRecord>>(params?: RoleListParams): Promise<PageApiResponse<T>>;
|
|
657
|
+
listUsers<T = PageOffsetListResult<PageUserRecord>>(roleId: string, params?: RoleUsersParams): Promise<PageApiResponse<T>>;
|
|
658
|
+
assignRoles<T = PageUserRecord>(params: AssignRolesParams): Promise<PageApiResponse<T>>;
|
|
659
|
+
addUserRole<T = boolean>(params: ChangeUserRoleParams): Promise<PageApiResponse<T>>;
|
|
660
|
+
removeUserRole<T = boolean>(params: ChangeUserRoleParams): Promise<PageApiResponse<T>>;
|
|
661
|
+
batchAddUsers<T = unknown>(params: BatchAddUsersToRoleParams): Promise<PageApiResponse<T>>;
|
|
662
|
+
getMyRoles<T = PageRoleRecord[]>(params?: GetUserRolesParams): Promise<PageApiResponse<T>>;
|
|
663
|
+
getCurrentRole<T = PageRoleRecord | null>(params?: GetUserRolesParams): Promise<PageApiResponse<T>>;
|
|
664
|
+
switchPlatformRole<T = boolean>(params: SwitchPlatformRoleParams): Promise<PageApiResponse<T>>;
|
|
665
|
+
switchAppRole<T = boolean>(params: SwitchAppRoleParams): Promise<PageApiResponse<T>>;
|
|
666
|
+
};
|
|
667
|
+
permission: {
|
|
668
|
+
formGroup: {
|
|
669
|
+
create<T = FormPermissionGroup>(params: CreateFormPermissionGroupDto): Promise<PageApiResponse<T>>;
|
|
670
|
+
update<T = FormPermissionGroup>(id: string, params: UpdateFormPermissionGroupDto): Promise<PageApiResponse<T>>;
|
|
671
|
+
remove<T = boolean>(id: string): Promise<PageApiResponse<T>>;
|
|
672
|
+
get<T = FormPermissionGroup | null>(id: string): Promise<PageApiResponse<T>>;
|
|
673
|
+
list<T = PageOffsetListResult<FormPermissionGroup>>(params?: QueryFormPermissionGroupDto): Promise<PageApiResponse<T>>;
|
|
674
|
+
getViewFieldPermissions<T = Record<string, ViewFieldPermissionValue>>(params: {
|
|
675
|
+
appType?: string;
|
|
676
|
+
formUuid: string;
|
|
677
|
+
}): Promise<PageApiResponse<T>>;
|
|
678
|
+
getViewPermissionSummary<T = ViewPermissionSummary>(params: {
|
|
679
|
+
appType?: string;
|
|
680
|
+
formUuid: string;
|
|
681
|
+
}): Promise<PageApiResponse<T>>;
|
|
682
|
+
};
|
|
683
|
+
pageGroup: {
|
|
684
|
+
create<T = PagePermissionGroup>(params: CreatePagePermissionGroupDto): Promise<PageApiResponse<T>>;
|
|
685
|
+
update<T = PagePermissionGroup>(id: string, params: UpdatePagePermissionGroupDto): Promise<PageApiResponse<T>>;
|
|
686
|
+
remove<T = boolean>(id: string): Promise<PageApiResponse<T>>;
|
|
687
|
+
get<T = PagePermissionGroup | null>(id: string): Promise<PageApiResponse<T>>;
|
|
688
|
+
list<T = PageOffsetListResult<PagePermissionGroup>>(params?: QueryPagePermissionGroupDto): Promise<PageApiResponse<T>>;
|
|
689
|
+
getUserMenuPermissions<T = UserMenuPermissionsResponse>(appType?: string): Promise<PageApiResponse<T>>;
|
|
690
|
+
};
|
|
691
|
+
api: {
|
|
692
|
+
create<T = PageApiPermissionRecord>(params: CreateApiPermissionParams): Promise<PageApiResponse<T>>;
|
|
693
|
+
update<T = PageApiPermissionRecord>(id: string, params: UpdateApiPermissionParams): Promise<PageApiResponse<T>>;
|
|
694
|
+
remove<T = boolean>(id: string): Promise<PageApiResponse<T>>;
|
|
695
|
+
list<T = PageOffsetListResult<PageApiPermissionRecord>>(params?: ApiPermissionListParams): Promise<PageApiResponse<T>>;
|
|
696
|
+
assign<T = boolean>(params: AssignPermissionsParams): Promise<PageApiResponse<T>>;
|
|
697
|
+
getByRole<T = PageApiPermissionRecord[]>(roleId: string): Promise<PageApiResponse<T>>;
|
|
698
|
+
getRolesByPermission<T = PageRoleRecord[]>(permissionId: string): Promise<PageApiResponse<T>>;
|
|
699
|
+
};
|
|
700
|
+
ui: {
|
|
701
|
+
create<T = PageUiPermissionRecord>(params: CreateUiPermissionParams): Promise<PageApiResponse<T>>;
|
|
702
|
+
update<T = PageUiPermissionRecord>(id: string, params: UpdateUiPermissionParams): Promise<PageApiResponse<T>>;
|
|
703
|
+
remove<T = boolean>(id: string): Promise<PageApiResponse<T>>;
|
|
704
|
+
list<T = PageOffsetListResult<PageUiPermissionRecord>>(params?: UiPermissionListParams): Promise<PageApiResponse<T>>;
|
|
705
|
+
assign<T = boolean>(params: AssignPermissionsParams): Promise<PageApiResponse<T>>;
|
|
706
|
+
getMyPlatform<T = PageUiPermissionRecord[]>(): Promise<PageApiResponse<T>>;
|
|
707
|
+
getMyApp<T = PageUiPermissionRecord[]>(appType?: string): Promise<PageApiResponse<T>>;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
process: {
|
|
711
|
+
getInstance<T = unknown>(params: GetProcessInstanceParams): Promise<PageApiResponse<T>>;
|
|
712
|
+
terminateInstance<T = unknown>(params: TerminateProcessInstanceParams): Promise<PageApiResponse<T>>;
|
|
713
|
+
approveTask<T = unknown>(params: ApproveTaskParams): Promise<PageApiResponse<T>>;
|
|
714
|
+
triggerCallbackTask<T = unknown>(params: TriggerCallbackTaskParams): Promise<PageApiResponse<T>>;
|
|
715
|
+
};
|
|
716
|
+
dataSource: {
|
|
717
|
+
run<TResult = unknown, TRaw = TResult>(name: string, params?: Record<string, unknown>): Promise<PageApiResponse<TResult, TRaw>>;
|
|
718
|
+
};
|
|
719
|
+
notification: {
|
|
720
|
+
sendByType<T = SendNotificationResult>(params: SendNotificationByTypeParams): Promise<PageApiResponse<T>>;
|
|
721
|
+
batchSendByType<T = SendNotificationResult>(params: BatchSendNotificationByTypeParams): Promise<PageApiResponse<T>>;
|
|
722
|
+
};
|
|
723
|
+
navigation: PageNavigationApi;
|
|
724
|
+
ui: PageContext["ui"];
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
declare const createPageSdk: (context: PageContext) => PageSdk;
|
|
728
|
+
|
|
729
|
+
export { type ApiPermissionListParams, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type FieldPermissionDto, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type GetProcessInstanceParams, type GetUserRolesParams, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type NotificationChannel, type NotificationMessageRecord, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type ProcessApproveAction, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RoleListParams, type RoleUsersParams, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createPageSdk };
|