@univerjs/protocol 0.1.45 → 0.1.46-alpha.2
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/cjs/index.js +1 -1
- package/lib/es/index.js +22 -20
- package/lib/types/index.d.ts +3 -1
- package/lib/types/ts/univer/constants/errors.d.ts +4 -0
- package/lib/types/ts/univer/initial_sheet.d.ts +8 -0
- package/lib/types/ts/v1/access_key.d.ts +32 -0
- package/lib/types/ts/v1/analyse_task.d.ts +173 -0
- package/lib/types/ts/v1/comment.d.ts +97 -0
- package/lib/types/ts/v1/conf.d.ts +424 -0
- package/lib/types/ts/v1/connector.d.ts +74 -0
- package/lib/types/ts/v1/conversation.d.ts +279 -0
- package/lib/types/ts/v1/email.d.ts +18 -0
- package/lib/types/ts/v1/entitlement.d.ts +318 -0
- package/lib/types/ts/v1/exchange.d.ts +90 -0
- package/lib/types/ts/v1/feedback.d.ts +26 -0
- package/lib/types/ts/v1/file.d.ts +2 -0
- package/lib/types/ts/v1/go_config_center.d.ts +91 -0
- package/lib/types/ts/v1/invite_code.d.ts +47 -0
- package/lib/types/ts/v1/license.d.ts +35 -0
- package/lib/types/ts/v1/license_manage.d.ts +103 -0
- package/lib/types/ts/v1/oauth2.d.ts +24 -0
- package/lib/types/ts/v1/oidc.d.ts +80 -0
- package/lib/types/ts/v1/source_connector/api.d.ts +110 -0
- package/lib/types/ts/v1/source_connector/conf.d.ts +29 -0
- package/lib/types/ts/v1/source_connector/displayer.d.ts +16 -0
- package/lib/types/ts/v1/source_connector/source.d.ts +46 -0
- package/lib/types/ts/v1/source_connector/stream_view.d.ts +31 -0
- package/lib/types/ts/v1/ssc.d.ts +238 -0
- package/lib/types/ts/v1/ssr.d.ts +25 -0
- package/lib/types/ts/v1/survey.d.ts +25 -0
- package/lib/types/ts/v1/template.d.ts +48 -0
- package/lib/types/ts/v1/trigger.d.ts +102 -0
- package/lib/types/ts/v1/uniscript.d.ts +104 -0
- package/lib/types/ts/v1/uniscript_logs.d.ts +157 -0
- package/lib/types/ts/v1/univer_go_template.d.ts +65 -0
- package/lib/types/ts/v1/user.d.ts +33 -0
- package/lib/types/ts/v1/user_settings.d.ts +22 -0
- package/lib/types/ts/v1/usip.d.ts +55 -0
- package/lib/types/ts/v1/workspace.d.ts +272 -0
- package/lib/umd/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Error } from '../univer/constants/errors';
|
|
4
|
+
export declare const protobufPackage = "univerpro.v1";
|
|
5
|
+
/** 数字过滤器枚举 */
|
|
6
|
+
export declare enum NumberFilterEnum {
|
|
7
|
+
valueBetween = 0,
|
|
8
|
+
valueEqual = 1,
|
|
9
|
+
valueGreaterThan = 2,
|
|
10
|
+
valueGreaterThanOrEqual = 3,
|
|
11
|
+
valueLessThan = 4,
|
|
12
|
+
valueLessThanOrEqual = 5,
|
|
13
|
+
valueNotBetween = 6,
|
|
14
|
+
valueNotEqual = 7,
|
|
15
|
+
UNRECOGNIZED = -1
|
|
16
|
+
}
|
|
17
|
+
export interface GetValuesRequest {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
waitForComputing: boolean;
|
|
20
|
+
workbookId: string;
|
|
21
|
+
worksheetId: string;
|
|
22
|
+
range: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GetValuesResponse {
|
|
25
|
+
error: Error | undefined;
|
|
26
|
+
/** A matrix of values in JSON format. */
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
export interface SetValueRequest {
|
|
30
|
+
sessionId: string;
|
|
31
|
+
waitForComputing: boolean;
|
|
32
|
+
workbookId: string;
|
|
33
|
+
worksheetId: string;
|
|
34
|
+
range: string;
|
|
35
|
+
/** A value in JSON format. */
|
|
36
|
+
value: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SetValueResponse {
|
|
39
|
+
error: Error | undefined;
|
|
40
|
+
/** A matrix of values in JSON format. */
|
|
41
|
+
value: string;
|
|
42
|
+
}
|
|
43
|
+
export interface SetValuesRequest {
|
|
44
|
+
sessionId: string;
|
|
45
|
+
waitForComputing: boolean;
|
|
46
|
+
workbookId: string;
|
|
47
|
+
worksheetId: string;
|
|
48
|
+
range: string;
|
|
49
|
+
/** A matrix of values in JSON format. */
|
|
50
|
+
values: string;
|
|
51
|
+
}
|
|
52
|
+
export interface SetValuesResponse {
|
|
53
|
+
error: Error | undefined;
|
|
54
|
+
/** A matrix of values in JSON format. */
|
|
55
|
+
value: string;
|
|
56
|
+
}
|
|
57
|
+
export interface MergeRequest {
|
|
58
|
+
sessionId: string;
|
|
59
|
+
workbookId: string;
|
|
60
|
+
worksheetId: string;
|
|
61
|
+
range: string;
|
|
62
|
+
}
|
|
63
|
+
export interface MergeResponse {
|
|
64
|
+
error: Error | undefined;
|
|
65
|
+
}
|
|
66
|
+
export interface SetBorderRequest {
|
|
67
|
+
sessionId: string;
|
|
68
|
+
workbookId: string;
|
|
69
|
+
worksheetId: string;
|
|
70
|
+
range: string;
|
|
71
|
+
/** JSON serialized IBorderInfo. */
|
|
72
|
+
data: string;
|
|
73
|
+
}
|
|
74
|
+
export interface SetBorderResponse {
|
|
75
|
+
error: Error | undefined;
|
|
76
|
+
}
|
|
77
|
+
export interface SetBackgroundColorRequest {
|
|
78
|
+
sessionId: string;
|
|
79
|
+
workbookId: string;
|
|
80
|
+
worksheetId: string;
|
|
81
|
+
range: string;
|
|
82
|
+
color: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SetBackgroundColorResponse {
|
|
85
|
+
error: Error | undefined;
|
|
86
|
+
}
|
|
87
|
+
export interface SetWorkbookNameRequest {
|
|
88
|
+
sessionId: string;
|
|
89
|
+
workbookId: string;
|
|
90
|
+
name: string;
|
|
91
|
+
}
|
|
92
|
+
export interface SetWorkbookNameResponse {
|
|
93
|
+
error: Error | undefined;
|
|
94
|
+
}
|
|
95
|
+
export interface CreateWorkbookRequest {
|
|
96
|
+
sessionId: string;
|
|
97
|
+
name: string;
|
|
98
|
+
}
|
|
99
|
+
export interface CreateWorkbookResponse {
|
|
100
|
+
error: Error | undefined;
|
|
101
|
+
}
|
|
102
|
+
export interface CloseSessionRequest {
|
|
103
|
+
sessionId: string;
|
|
104
|
+
}
|
|
105
|
+
export interface CloseSessionResponse {
|
|
106
|
+
error: Error | undefined;
|
|
107
|
+
}
|
|
108
|
+
export interface GetAggregationParamsRequest {
|
|
109
|
+
sessionId: string;
|
|
110
|
+
unitIds: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface GetAggregationParamsResponse {
|
|
113
|
+
error: Error | undefined;
|
|
114
|
+
views: View[];
|
|
115
|
+
}
|
|
116
|
+
/** unit 维度的视图 */
|
|
117
|
+
export interface View {
|
|
118
|
+
unitId: string;
|
|
119
|
+
/** 视图 */
|
|
120
|
+
views: ViewDetail[];
|
|
121
|
+
/** 方体 */
|
|
122
|
+
cuboids: Cuboid[];
|
|
123
|
+
}
|
|
124
|
+
/** 视图 */
|
|
125
|
+
export interface ViewDetail {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
description: string;
|
|
129
|
+
unitId: string;
|
|
130
|
+
/** multiple tables join */
|
|
131
|
+
tableIds: string[];
|
|
132
|
+
fields: Field[];
|
|
133
|
+
}
|
|
134
|
+
/** 方体 */
|
|
135
|
+
export interface Cuboid {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
description: string;
|
|
139
|
+
unitId: string;
|
|
140
|
+
/** multiple tables join */
|
|
141
|
+
tableId: string;
|
|
142
|
+
fields: Field[];
|
|
143
|
+
}
|
|
144
|
+
/** 字段 */
|
|
145
|
+
export interface Field {
|
|
146
|
+
id: string;
|
|
147
|
+
/** multiple tables join */
|
|
148
|
+
tableId: string;
|
|
149
|
+
/** workbook id */
|
|
150
|
+
unitId: string;
|
|
151
|
+
name: string;
|
|
152
|
+
/** string, number, boolean, date */
|
|
153
|
+
type: string;
|
|
154
|
+
description: string;
|
|
155
|
+
/** only for type string */
|
|
156
|
+
dataItems: string[];
|
|
157
|
+
}
|
|
158
|
+
export interface RunAggregationRequest {
|
|
159
|
+
sessionId: string;
|
|
160
|
+
/** view id */
|
|
161
|
+
viewId: string;
|
|
162
|
+
/** workbook id */
|
|
163
|
+
unitId: string;
|
|
164
|
+
dimensions: Dimension[];
|
|
165
|
+
measures: Measure[];
|
|
166
|
+
}
|
|
167
|
+
export interface Measure {
|
|
168
|
+
/** field id */
|
|
169
|
+
id: string;
|
|
170
|
+
/** table id */
|
|
171
|
+
tableId: string;
|
|
172
|
+
/** sum, avg, count, max, min */
|
|
173
|
+
aggregation: string;
|
|
174
|
+
}
|
|
175
|
+
export interface Dimension {
|
|
176
|
+
/** field id */
|
|
177
|
+
fieldId: string;
|
|
178
|
+
/** table id */
|
|
179
|
+
tableId: string;
|
|
180
|
+
filterNumber: FilterNumber | undefined;
|
|
181
|
+
filterString: FilterString | undefined;
|
|
182
|
+
}
|
|
183
|
+
export interface FilterString {
|
|
184
|
+
/** filter string param */
|
|
185
|
+
list: string[];
|
|
186
|
+
/** select all */
|
|
187
|
+
isAll: boolean;
|
|
188
|
+
}
|
|
189
|
+
export interface FilterNumber {
|
|
190
|
+
operator: NumberFilterEnum;
|
|
191
|
+
value: number;
|
|
192
|
+
/** only for valueBetween */
|
|
193
|
+
values: number[];
|
|
194
|
+
}
|
|
195
|
+
/** 获取方体的请求 */
|
|
196
|
+
export interface GetCuboidsByIdRequest {
|
|
197
|
+
sessionId: string;
|
|
198
|
+
/** view id, or cuboid id */
|
|
199
|
+
id: string;
|
|
200
|
+
/** workbook id */
|
|
201
|
+
unitId: string;
|
|
202
|
+
}
|
|
203
|
+
/** 方体的返回结果 */
|
|
204
|
+
export interface GetCuboidsByIdResponse {
|
|
205
|
+
error: Error | undefined;
|
|
206
|
+
id: string;
|
|
207
|
+
unitId: string;
|
|
208
|
+
param: RunAggregationRequest | undefined;
|
|
209
|
+
cuboids: CuboidData[];
|
|
210
|
+
}
|
|
211
|
+
export interface CuboidData {
|
|
212
|
+
id: string;
|
|
213
|
+
name: string;
|
|
214
|
+
unitId: string;
|
|
215
|
+
/** JSON 化的数据矩阵,每一行是一个字符串数组 */
|
|
216
|
+
data: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* This service is used to get the SSC (Server-Side Computing) data for a given session.
|
|
220
|
+
* It is implemented in Node.js. See `univer-pro/apps/univer-collaboration-server`.
|
|
221
|
+
*/
|
|
222
|
+
export interface SSCService {
|
|
223
|
+
/** Get value from the worksheet. */
|
|
224
|
+
GetValues(request: GetValuesRequest, metadata?: Metadata): Observable<GetValuesResponse>;
|
|
225
|
+
SetValue(request: SetValueRequest, metadata?: Metadata): Observable<SetValueResponse>;
|
|
226
|
+
SetValues(request: SetValuesRequest, metadata?: Metadata): Observable<SetValuesResponse>;
|
|
227
|
+
Merge(request: MergeRequest, metadata?: Metadata): Observable<MergeResponse>;
|
|
228
|
+
SetBorder(request: SetBorderRequest, metadata?: Metadata): Observable<SetBorderResponse>;
|
|
229
|
+
SetBackgroundColor(request: SetBackgroundColorRequest, metadata?: Metadata): Observable<SetBackgroundColorResponse>;
|
|
230
|
+
SetWorkbookName(request: SetWorkbookNameRequest, metadata?: Metadata): Observable<SetWorkbookNameResponse>;
|
|
231
|
+
CreateWorkbook(request: CreateWorkbookRequest, metadata?: Metadata): Observable<CreateWorkbookResponse>;
|
|
232
|
+
/** Close the session and release resources allocated for this session. */
|
|
233
|
+
CloseSession(request: CloseSessionRequest, metadata?: Metadata): Observable<CloseSessionResponse>;
|
|
234
|
+
/** 获取视图或者方体的 meta 信息,让 AI 判断需要如何处理数据 */
|
|
235
|
+
GetAggregationParams(request: GetAggregationParamsRequest, metadata?: Metadata): Observable<GetAggregationParamsResponse>;
|
|
236
|
+
RunAggregation(request: RunAggregationRequest, metadata?: Metadata): Observable<GetCuboidsByIdResponse>;
|
|
237
|
+
GetCuboidsById(request: GetCuboidsByIdRequest, metadata?: Metadata): Observable<GetCuboidsByIdResponse>;
|
|
238
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Error } from '../univer/constants/errors';
|
|
4
|
+
import { UniverType } from '../univer/constants/univer';
|
|
5
|
+
export declare const protobufPackage = "univerpro.v1";
|
|
6
|
+
export interface GetSSRRequest {
|
|
7
|
+
unitId: string;
|
|
8
|
+
type: UniverType;
|
|
9
|
+
/** It is the id of a worksheet for Univer Sheet, or the id of a page for Univer Slide. */
|
|
10
|
+
subUnitId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GetSSRResponse {
|
|
13
|
+
error: Error | undefined;
|
|
14
|
+
/** PNG Image encoded in base64 format. */
|
|
15
|
+
imageEncoded: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* This service is used to get the SSR (Server-Side Rendering) data for a given
|
|
19
|
+
* unit and maybe a given Worksheet as well.
|
|
20
|
+
* It is implemented in Node.js. See `univer-pro/apps/univer-collaboration-server`.
|
|
21
|
+
*/
|
|
22
|
+
export interface SSRService {
|
|
23
|
+
/** Get a snapshot with given `unitId` (perhaps with `subUnitId` as well) of its latest revision. */
|
|
24
|
+
GetSnapshot(request: GetSSRRequest, metadata?: Metadata): Observable<GetSSRResponse>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Error } from '../univer/constants/errors';
|
|
4
|
+
export declare const protobufPackage = "universer.v1";
|
|
5
|
+
export interface CreateSurveyRequest {
|
|
6
|
+
product: string;
|
|
7
|
+
email: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateSurveyResponse {
|
|
11
|
+
error: Error | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface CaptureEventRequest {
|
|
14
|
+
distinctId: string;
|
|
15
|
+
eventName: string;
|
|
16
|
+
/** a JSON string */
|
|
17
|
+
properties: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CaptureEventResponse {
|
|
20
|
+
error: Error | undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface SurveyService {
|
|
23
|
+
Create(request: CreateSurveyRequest, metadata?: Metadata): Observable<CreateSurveyResponse>;
|
|
24
|
+
CaptureEvent(request: CaptureEventRequest, metadata?: Metadata): Observable<CaptureEventResponse>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Error } from '../univer/constants/errors';
|
|
4
|
+
import { UniverType } from '../univer/constants/univer';
|
|
5
|
+
export declare const protobufPackage = "universer.v1";
|
|
6
|
+
export interface DeleteTemplateRequest {
|
|
7
|
+
templateId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DeleteTemplateResponse {
|
|
10
|
+
error: Error | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface GetTemplateRequest {
|
|
13
|
+
type: UniverType;
|
|
14
|
+
length: number;
|
|
15
|
+
lastLabel: string;
|
|
16
|
+
category: string;
|
|
17
|
+
}
|
|
18
|
+
export interface GetTemplateResponse {
|
|
19
|
+
error: Error | undefined;
|
|
20
|
+
hasMore: boolean;
|
|
21
|
+
lastLabel: string;
|
|
22
|
+
data: Template[];
|
|
23
|
+
}
|
|
24
|
+
export interface CreateTemplateRequest {
|
|
25
|
+
type: UniverType;
|
|
26
|
+
unitId: string;
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
coverImgUrl: string;
|
|
30
|
+
category: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateTemplateResponse {
|
|
33
|
+
error: Error | undefined;
|
|
34
|
+
templateId: string;
|
|
35
|
+
}
|
|
36
|
+
export interface Template {
|
|
37
|
+
type: UniverType;
|
|
38
|
+
templateId: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
coverImgUrl: string;
|
|
42
|
+
category: string;
|
|
43
|
+
}
|
|
44
|
+
export interface TemplateService {
|
|
45
|
+
GetTemplateList(request: GetTemplateRequest, metadata?: Metadata): Observable<GetTemplateResponse>;
|
|
46
|
+
CreateTemplate(request: CreateTemplateRequest, metadata?: Metadata): Observable<CreateTemplateResponse>;
|
|
47
|
+
DeleteTemplate(request: DeleteTemplateRequest, metadata?: Metadata): Observable<DeleteTemplateResponse>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Error } from '../univer/constants/errors';
|
|
4
|
+
import { ExecutionStatus, ExecutionTriggerType } from './uniscript_logs';
|
|
5
|
+
export declare const protobufPackage = "universer.v1";
|
|
6
|
+
export declare enum TriggerIntervalUnit {
|
|
7
|
+
UNDEFINED_Unit = 0,
|
|
8
|
+
SECOND = 1,
|
|
9
|
+
MINUTE = 2,
|
|
10
|
+
HOUR = 3,
|
|
11
|
+
DAY = 4,
|
|
12
|
+
WEEK = 5,
|
|
13
|
+
MONTH = 6,
|
|
14
|
+
YEAR = 7,
|
|
15
|
+
UNRECOGNIZED = -1
|
|
16
|
+
}
|
|
17
|
+
export declare enum TriggerStatus {
|
|
18
|
+
TriggerStatusEnable = 0,
|
|
19
|
+
TriggerStatusDISABLED = 1,
|
|
20
|
+
TriggerStatusDelete = 2,
|
|
21
|
+
UNRECOGNIZED = -1
|
|
22
|
+
}
|
|
23
|
+
export interface Trigger {
|
|
24
|
+
triggerId: string;
|
|
25
|
+
workspaceId: string;
|
|
26
|
+
/** scriptId, unitId etc */
|
|
27
|
+
sourceId: string;
|
|
28
|
+
triggerName: string;
|
|
29
|
+
functionName: string;
|
|
30
|
+
source: ExecutionTriggerType;
|
|
31
|
+
startTime: string;
|
|
32
|
+
endTime: string;
|
|
33
|
+
intervalTime: number;
|
|
34
|
+
intervalUnit: TriggerIntervalUnit;
|
|
35
|
+
description: string;
|
|
36
|
+
/** begin time, timestamp seconds */
|
|
37
|
+
lastRunTime: string;
|
|
38
|
+
lastRunResult: ExecutionStatus;
|
|
39
|
+
creator: string;
|
|
40
|
+
createTime: string;
|
|
41
|
+
updateTime: string;
|
|
42
|
+
}
|
|
43
|
+
export interface CreateTriggerRequest {
|
|
44
|
+
workspaceId: string;
|
|
45
|
+
sourceId: string;
|
|
46
|
+
triggerName: string;
|
|
47
|
+
functionName: string;
|
|
48
|
+
source: ExecutionTriggerType;
|
|
49
|
+
startTime: string;
|
|
50
|
+
endTime: string;
|
|
51
|
+
intervalTime: number;
|
|
52
|
+
intervalUnit: TriggerIntervalUnit;
|
|
53
|
+
description: string;
|
|
54
|
+
}
|
|
55
|
+
export interface CreateTriggerResponse {
|
|
56
|
+
error: Error | undefined;
|
|
57
|
+
triggerId: string;
|
|
58
|
+
}
|
|
59
|
+
export interface UpdateTriggerRequest {
|
|
60
|
+
triggerId: string;
|
|
61
|
+
sourceId?: string | undefined;
|
|
62
|
+
triggerName?: string | undefined;
|
|
63
|
+
functionName?: string | undefined;
|
|
64
|
+
source?: ExecutionTriggerType | undefined;
|
|
65
|
+
startTime?: string | undefined;
|
|
66
|
+
endTime?: string | undefined;
|
|
67
|
+
intervalTime?: number | undefined;
|
|
68
|
+
intervalUnit?: TriggerIntervalUnit | undefined;
|
|
69
|
+
description?: string | undefined;
|
|
70
|
+
/** only use enable/disable trigger */
|
|
71
|
+
status?: TriggerStatus | undefined;
|
|
72
|
+
}
|
|
73
|
+
export interface UpdateTriggerResponse {
|
|
74
|
+
error: Error | undefined;
|
|
75
|
+
}
|
|
76
|
+
export interface DeleteTriggersRequest {
|
|
77
|
+
triggerIds: string[];
|
|
78
|
+
}
|
|
79
|
+
export interface DeleteTriggersResponse {
|
|
80
|
+
error: Error | undefined;
|
|
81
|
+
}
|
|
82
|
+
export interface ListTriggersRequest {
|
|
83
|
+
workspaceId: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ListTriggersResponse {
|
|
86
|
+
error: Error | undefined;
|
|
87
|
+
triggers: Trigger[];
|
|
88
|
+
}
|
|
89
|
+
export interface GetTriggerRequest {
|
|
90
|
+
triggerId: string;
|
|
91
|
+
}
|
|
92
|
+
export interface GetTriggerResponse {
|
|
93
|
+
error: Error | undefined;
|
|
94
|
+
trigger: Trigger | undefined;
|
|
95
|
+
}
|
|
96
|
+
export interface TriggerService {
|
|
97
|
+
CreateTrigger(request: CreateTriggerRequest, metadata?: Metadata): Observable<CreateTriggerResponse>;
|
|
98
|
+
UpdateTrigger(request: UpdateTriggerRequest, metadata?: Metadata): Observable<UpdateTriggerResponse>;
|
|
99
|
+
DeleteTriggers(request: DeleteTriggersRequest, metadata?: Metadata): Observable<DeleteTriggersResponse>;
|
|
100
|
+
ListTriggers(request: ListTriggersRequest, metadata?: Metadata): Observable<ListTriggersResponse>;
|
|
101
|
+
GetTrigger(request: GetTriggerRequest, metadata?: Metadata): Observable<GetTriggerResponse>;
|
|
102
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Error } from '../univer/constants/errors';
|
|
4
|
+
export declare const protobufPackage = "universer.v1";
|
|
5
|
+
export declare enum UniscriptEnv {
|
|
6
|
+
UNDEFINED_ENV = 0,
|
|
7
|
+
NODE = 1,
|
|
8
|
+
BROWSER = 2,
|
|
9
|
+
PYTHON = 3,
|
|
10
|
+
/** REQUIREMENTS_TXT - requirements.txt for python */
|
|
11
|
+
REQUIREMENTS_TXT = 4,
|
|
12
|
+
/** WORKSPACE_ENV_VARS - script defined environment variables within the workspace */
|
|
13
|
+
WORKSPACE_ENV_VARS = 5,
|
|
14
|
+
UNRECOGNIZED = -1
|
|
15
|
+
}
|
|
16
|
+
export interface InstallPackagesRequest {
|
|
17
|
+
workspaceId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface InstallPackagesResponse {
|
|
20
|
+
error: Error | undefined;
|
|
21
|
+
status: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface Uniscript {
|
|
25
|
+
scriptId: string;
|
|
26
|
+
workspaceId: string;
|
|
27
|
+
name: string;
|
|
28
|
+
script: string;
|
|
29
|
+
env: UniscriptEnv;
|
|
30
|
+
creator: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateUniscriptRequest {
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
name: string;
|
|
35
|
+
script: string;
|
|
36
|
+
env: UniscriptEnv;
|
|
37
|
+
}
|
|
38
|
+
export interface CreateUniscriptResponse {
|
|
39
|
+
error: Error | undefined;
|
|
40
|
+
scriptId: string;
|
|
41
|
+
}
|
|
42
|
+
export interface UpdateUniscriptRequest {
|
|
43
|
+
scriptId: string;
|
|
44
|
+
script?: string | undefined;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
}
|
|
47
|
+
export interface UpdateUniscriptResponse {
|
|
48
|
+
error: Error | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface ListUniscriptsRequest {
|
|
51
|
+
workspaceId?: string | undefined;
|
|
52
|
+
scriptIds: string[];
|
|
53
|
+
unitId?: string | undefined;
|
|
54
|
+
env?: UniscriptEnv | undefined;
|
|
55
|
+
}
|
|
56
|
+
export interface ListUniscriptsResponse {
|
|
57
|
+
error: Error | undefined;
|
|
58
|
+
uniscripts: Uniscript[];
|
|
59
|
+
}
|
|
60
|
+
export interface DeleteUniscriptsRequest {
|
|
61
|
+
scriptIds: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface DeleteUniscriptsResponse {
|
|
64
|
+
error: Error | undefined;
|
|
65
|
+
}
|
|
66
|
+
export interface RunUniscriptRequest {
|
|
67
|
+
/** find script by scriptId or scriptName */
|
|
68
|
+
scriptId: string;
|
|
69
|
+
scriptName: string;
|
|
70
|
+
/** ONLY run SERVER script in IDE do not need unitId */
|
|
71
|
+
unitId: string;
|
|
72
|
+
/**
|
|
73
|
+
* runId is required if you want to run uniscript on browser context;
|
|
74
|
+
* runId is optional if you want to run uniscript on node context
|
|
75
|
+
*/
|
|
76
|
+
runId: string;
|
|
77
|
+
/** name of function to run */
|
|
78
|
+
function: string;
|
|
79
|
+
/**
|
|
80
|
+
* argsOfFunction is a json string, it should be a list of arguments
|
|
81
|
+
* e.g. '[123, "hello", true, {"a": 1, "b": 2}]'
|
|
82
|
+
*/
|
|
83
|
+
argsOfFunction?: string | undefined;
|
|
84
|
+
/** executionId, unique id of one execution, pass this id for execution logs record. */
|
|
85
|
+
executionId: string;
|
|
86
|
+
/** when client script invoke server script, use invokeId to associate their logs. */
|
|
87
|
+
invokeId: string;
|
|
88
|
+
/** env, not used now. */
|
|
89
|
+
env: UniscriptEnv;
|
|
90
|
+
/** is a string of compiled scrip */
|
|
91
|
+
compiledScript: string;
|
|
92
|
+
}
|
|
93
|
+
export interface RunUniscriptResponse {
|
|
94
|
+
error: Error | undefined;
|
|
95
|
+
result: string;
|
|
96
|
+
}
|
|
97
|
+
export interface UniscriptService {
|
|
98
|
+
CreateUniscript(request: CreateUniscriptRequest, metadata?: Metadata): Observable<CreateUniscriptResponse>;
|
|
99
|
+
UpdateUniscript(request: UpdateUniscriptRequest, metadata?: Metadata): Observable<UpdateUniscriptResponse>;
|
|
100
|
+
ListUniscripts(request: ListUniscriptsRequest, metadata?: Metadata): Observable<ListUniscriptsResponse>;
|
|
101
|
+
DeleteUniscripts(request: DeleteUniscriptsRequest, metadata?: Metadata): Observable<DeleteUniscriptsResponse>;
|
|
102
|
+
RunUniscript(request: RunUniscriptRequest, metadata?: Metadata): Observable<RunUniscriptResponse>;
|
|
103
|
+
InstallPackages(request: InstallPackagesRequest, metadata?: Metadata): Observable<InstallPackagesResponse>;
|
|
104
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Metadata } from '@grpc/grpc-js';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Error } from '../univer/constants/errors';
|
|
4
|
+
export declare const protobufPackage = "universer.v1";
|
|
5
|
+
export declare enum ExecutionTriggerType {
|
|
6
|
+
ExecutionTriggerType_None = 0,
|
|
7
|
+
/** ExecutionTriggerType_IDE - trigger by IDE debug/run */
|
|
8
|
+
ExecutionTriggerType_IDE = 1,
|
|
9
|
+
/** ExecutionTriggerType_UI - trigger by self-designed UI components */
|
|
10
|
+
ExecutionTriggerType_UI = 2,
|
|
11
|
+
/** ExecutionTriggerType_HOOKS - trigger by pre-designed hooks */
|
|
12
|
+
ExecutionTriggerType_HOOKS = 3,
|
|
13
|
+
/** ExecutionTriggerType_TriggerCron - triggered by triggerCron */
|
|
14
|
+
ExecutionTriggerType_TriggerCron = 4,
|
|
15
|
+
/** ExecutionTriggerType_TriggerSheet - triggered by triggerSheet */
|
|
16
|
+
ExecutionTriggerType_TriggerSheet = 5,
|
|
17
|
+
UNRECOGNIZED = -1
|
|
18
|
+
}
|
|
19
|
+
export declare enum ExecutionStatus {
|
|
20
|
+
ExecutionStatus_None = 0,
|
|
21
|
+
ExecutionStatus_Executing = 1,
|
|
22
|
+
ExecutionStatus_Success = 2,
|
|
23
|
+
ExecutionStatus_Fail = 3,
|
|
24
|
+
ExecutionStatus_Cancelled = 4,
|
|
25
|
+
ExecutionStatus_Timeout = 5,
|
|
26
|
+
UNRECOGNIZED = -1
|
|
27
|
+
}
|
|
28
|
+
export declare enum LogSource {
|
|
29
|
+
LogSource_None = 0,
|
|
30
|
+
LogSource_ClientScript = 1,
|
|
31
|
+
LogSource_NodeScript = 2,
|
|
32
|
+
LogSource_PythonScript = 3,
|
|
33
|
+
UNRECOGNIZED = -1
|
|
34
|
+
}
|
|
35
|
+
export declare enum ExecutionEvent {
|
|
36
|
+
ExecutionEvent_None = 0,
|
|
37
|
+
/** ExecutionEvent_Begin - execution begin */
|
|
38
|
+
ExecutionEvent_Begin = 1,
|
|
39
|
+
/** ExecutionEvent_Success - execution completed success */
|
|
40
|
+
ExecutionEvent_Success = 2,
|
|
41
|
+
/** ExecutionEvent_Fail - execution complete with fail */
|
|
42
|
+
ExecutionEvent_Fail = 3,
|
|
43
|
+
/** ExecutionEvent_Cancelled - execution cancelled */
|
|
44
|
+
ExecutionEvent_Cancelled = 4,
|
|
45
|
+
/** ExecutionEvent_Timeout - execute timeout & killed */
|
|
46
|
+
ExecutionEvent_Timeout = 5,
|
|
47
|
+
UNRECOGNIZED = -1
|
|
48
|
+
}
|
|
49
|
+
export interface Execution {
|
|
50
|
+
executionId: string;
|
|
51
|
+
triggerType: ExecutionTriggerType;
|
|
52
|
+
workspaceId: string;
|
|
53
|
+
functionName: string;
|
|
54
|
+
/** should set triggerId if triggerType in(TriggerCron, TriggerSheet) */
|
|
55
|
+
triggerId: string;
|
|
56
|
+
/** timestamp milli-seconds */
|
|
57
|
+
beginTime: string;
|
|
58
|
+
/** timestamp milli-seconds */
|
|
59
|
+
endTime: string;
|
|
60
|
+
/** DO NOT set this field when call UpsertExecution */
|
|
61
|
+
status: ExecutionStatus;
|
|
62
|
+
}
|
|
63
|
+
export interface LogEntry {
|
|
64
|
+
executionId: string;
|
|
65
|
+
source: LogSource;
|
|
66
|
+
/**
|
|
67
|
+
* should generate a log with non-empty invokeId
|
|
68
|
+
* when client script call server script,
|
|
69
|
+
* otherwise, left it's empty
|
|
70
|
+
*/
|
|
71
|
+
invokeId: string;
|
|
72
|
+
/**
|
|
73
|
+
* when server script called by client script
|
|
74
|
+
* fill the parentInvokeId with the invokeId of the system script call log.
|
|
75
|
+
*/
|
|
76
|
+
parentInvokeId: string;
|
|
77
|
+
/**
|
|
78
|
+
* timestamp of the log entry generated
|
|
79
|
+
* precision: milli-seconds
|
|
80
|
+
*/
|
|
81
|
+
timestamp: string;
|
|
82
|
+
level: string;
|
|
83
|
+
/** raw log entry message */
|
|
84
|
+
message: string;
|
|
85
|
+
/** extra infos explain by js/python it's self. */
|
|
86
|
+
extra: string;
|
|
87
|
+
}
|
|
88
|
+
export interface UpsertExecutionRequest {
|
|
89
|
+
event: ExecutionEvent;
|
|
90
|
+
execution: Execution | undefined;
|
|
91
|
+
}
|
|
92
|
+
export interface UpsertExecutionResponse {
|
|
93
|
+
error: Error | undefined;
|
|
94
|
+
}
|
|
95
|
+
export interface AppendExecutionLogsRequest {
|
|
96
|
+
logs: LogEntry[];
|
|
97
|
+
}
|
|
98
|
+
export interface AppendExecutionLogsResponse {
|
|
99
|
+
error: Error | undefined;
|
|
100
|
+
}
|
|
101
|
+
export interface ListExecutionsRequest {
|
|
102
|
+
/** workspaceId is needed */
|
|
103
|
+
workspaceId: string;
|
|
104
|
+
/**
|
|
105
|
+
* execution time range, timestamp seconds
|
|
106
|
+
* empty means no limit, end should GE begin.
|
|
107
|
+
*/
|
|
108
|
+
timeRangeBegin: string;
|
|
109
|
+
timeRangeEnd: string;
|
|
110
|
+
status: ExecutionStatus[];
|
|
111
|
+
triggerTypes: ExecutionTriggerType[];
|
|
112
|
+
triggerId: string;
|
|
113
|
+
functionName: string;
|
|
114
|
+
/** pageNo, start with 1. */
|
|
115
|
+
pageNo: number;
|
|
116
|
+
pageSize: number;
|
|
117
|
+
}
|
|
118
|
+
export interface ListExecutionsResponse {
|
|
119
|
+
executions: Execution[];
|
|
120
|
+
totalCnt: number;
|
|
121
|
+
error: Error | undefined;
|
|
122
|
+
}
|
|
123
|
+
export interface ListExecutionLogsRequest {
|
|
124
|
+
executionId: string;
|
|
125
|
+
/** batchId, 1st batch set empty */
|
|
126
|
+
batchId: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ListExecutionLogsResponse {
|
|
129
|
+
logs: LogEntry[];
|
|
130
|
+
hasMore: boolean;
|
|
131
|
+
/** if hasMore=true, return nextBatchId */
|
|
132
|
+
nextBatchId: string;
|
|
133
|
+
error: Error | undefined;
|
|
134
|
+
}
|
|
135
|
+
export interface GetExecutionProgressRequest {
|
|
136
|
+
executionId: string;
|
|
137
|
+
/** logsPoint fetched to, set to empty in the 1st query */
|
|
138
|
+
logsPoint: string;
|
|
139
|
+
}
|
|
140
|
+
export interface GetExecutionProgressResponse {
|
|
141
|
+
/** newest execution data */
|
|
142
|
+
execution: Execution | undefined;
|
|
143
|
+
/** newly logs */
|
|
144
|
+
newlyLogs: LogEntry[];
|
|
145
|
+
/** nextLogsPoint, use this point in the next query. */
|
|
146
|
+
nextLogsPoint: string;
|
|
147
|
+
error: Error | undefined;
|
|
148
|
+
}
|
|
149
|
+
export interface UniscriptLogService {
|
|
150
|
+
UpsertExecution(request: UpsertExecutionRequest, metadata?: Metadata): Observable<UpsertExecutionResponse>;
|
|
151
|
+
AppendExecutionLogs(request: AppendExecutionLogsRequest, metadata?: Metadata): Observable<AppendExecutionLogsResponse>;
|
|
152
|
+
/** order by execution start-time desc default. */
|
|
153
|
+
ListExecutions(request: ListExecutionsRequest, metadata?: Metadata): Observable<ListExecutionsResponse>;
|
|
154
|
+
/** order by log time asc default. */
|
|
155
|
+
ListExecutionLogs(request: ListExecutionLogsRequest, metadata?: Metadata): Observable<ListExecutionLogsResponse>;
|
|
156
|
+
GetExecutionProgress(request: GetExecutionProgressRequest, metadata?: Metadata): Observable<GetExecutionProgressResponse>;
|
|
157
|
+
}
|