@univerjs/protocol 0.1.49 → 0.21.0-insiders.20260422-d7fcb4d
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 +1 -3
- package/lib/cjs/index.js +463 -1
- package/lib/es/index.js +446 -36
- package/lib/index.js +447 -0
- package/lib/types/index.d.ts +41 -38
- package/lib/types/other/sheet-block.d.ts +27 -0
- package/lib/types/ts/univer/changeset.d.ts +20 -6
- package/lib/types/ts/univer/colla-msg.d.ts +176 -0
- package/lib/types/ts/univer/constants/errors.d.ts +33 -19
- package/lib/types/ts/univer/constants/univer.d.ts +15 -1
- package/lib/types/ts/univer/doc.d.ts +18 -4
- package/lib/types/ts/univer/drawing.d.ts +16 -2
- package/lib/types/ts/univer/initial-sheet.d.ts +46 -0
- package/lib/types/ts/univer/permission.d.ts +19 -5
- package/lib/types/ts/univer/range.d.ts +16 -2
- package/lib/types/ts/univer/resource.d.ts +16 -2
- package/lib/types/ts/univer/snapshot.d.ts +23 -9
- package/lib/types/ts/univer/unit-template.d.ts +23 -0
- package/lib/types/ts/univer/univer-file.d.ts +27 -0
- package/lib/types/ts/univer/workbook.d.ts +30 -53
- package/lib/types/ts/univercloud/stats/v1/stats.d.ts +34 -0
- package/lib/types/ts/univerpro/v1/apply.d.ts +129 -0
- package/lib/types/ts/univerpro/v1/helper.d.ts +36 -0
- package/lib/types/ts/univerpro/v1/ssc.d.ts +72 -0
- package/lib/types/ts/univerpro/v1/ssr.d.ts +28 -0
- package/lib/types/ts/universer/v1/access-key.d.ts +51 -0
- package/lib/types/ts/universer/v1/authz.d.ts +102 -87
- package/lib/types/ts/universer/v1/comb.d.ts +40 -61
- package/lib/types/ts/universer/v1/comment.d.ts +45 -49
- package/lib/types/ts/universer/v1/file.d.ts +57 -42
- package/lib/types/ts/universer/v1/history.d.ts +52 -49
- package/lib/types/ts/universer/v1/license.d.ts +54 -39
- package/lib/types/ts/universer/v1/snapshot.d.ts +146 -143
- package/lib/types/ts/universer/v1/user.d.ts +28 -275
- package/lib/types/utils.d.ts +17 -2
- package/lib/umd/index.js +1 -1
- package/package.json +33 -11
- package/lib/types/ts/univer/colla_msg.d.ts +0 -178
- package/lib/types/ts/univer/constants/biz.d.ts +0 -17
- package/lib/types/ts/univer/event_sync.d.ts +0 -10
- package/lib/types/ts/univer/initial_sheet.d.ts +0 -31
- package/lib/types/ts/univer/unit_template.d.ts +0 -9
- package/lib/types/ts/univer/univer_file.d.ts +0 -33
- package/lib/types/ts/universer/v1/access_key.d.ts +0 -36
- package/lib/types/ts/universer/v1/access_key_logs.d.ts +0 -43
- package/lib/types/ts/universer/v1/activity.d.ts +0 -22
- package/lib/types/ts/universer/v1/analyse_cmn.d.ts +0 -27
- package/lib/types/ts/universer/v1/analyse_data_source.d.ts +0 -86
- package/lib/types/ts/universer/v1/analyse_task.d.ts +0 -232
- package/lib/types/ts/universer/v1/clipsheet_task.d.ts +0 -72
- package/lib/types/ts/universer/v1/conf.d.ts +0 -570
- package/lib/types/ts/universer/v1/connector.d.ts +0 -74
- package/lib/types/ts/universer/v1/conversation.d.ts +0 -578
- package/lib/types/ts/universer/v1/email.d.ts +0 -28
- package/lib/types/ts/universer/v1/entitlement.d.ts +0 -663
- package/lib/types/ts/universer/v1/exchange.d.ts +0 -101
- package/lib/types/ts/universer/v1/feedback.d.ts +0 -71
- package/lib/types/ts/universer/v1/frontend_logs.d.ts +0 -36
- package/lib/types/ts/universer/v1/go_config_center.d.ts +0 -91
- package/lib/types/ts/universer/v1/inbox.d.ts +0 -59
- package/lib/types/ts/universer/v1/invite_code.d.ts +0 -47
- package/lib/types/ts/universer/v1/license_manage.d.ts +0 -157
- package/lib/types/ts/universer/v1/oauth2.d.ts +0 -24
- package/lib/types/ts/universer/v1/oidc.d.ts +0 -167
- package/lib/types/ts/universer/v1/redemption_code.d.ts +0 -32
- package/lib/types/ts/universer/v1/referral.d.ts +0 -55
- package/lib/types/ts/universer/v1/scraper.d.ts +0 -144
- package/lib/types/ts/universer/v1/source_connector/api.d.ts +0 -110
- package/lib/types/ts/universer/v1/source_connector/conf.d.ts +0 -29
- package/lib/types/ts/universer/v1/source_connector/displayer.d.ts +0 -16
- package/lib/types/ts/universer/v1/source_connector/source.d.ts +0 -46
- package/lib/types/ts/universer/v1/source_connector/stream_view.d.ts +0 -31
- package/lib/types/ts/universer/v1/survey.d.ts +0 -25
- package/lib/types/ts/universer/v1/template.d.ts +0 -48
- package/lib/types/ts/universer/v1/toolkit.d.ts +0 -23
- package/lib/types/ts/universer/v1/trigger.d.ts +0 -102
- package/lib/types/ts/universer/v1/uniscript.d.ts +0 -104
- package/lib/types/ts/universer/v1/uniscript_logs.d.ts +0 -157
- package/lib/types/ts/universer/v1/univer_go_template.d.ts +0 -65
- package/lib/types/ts/universer/v1/user_event.d.ts +0 -23
- package/lib/types/ts/universer/v1/user_settings.d.ts +0 -22
- package/lib/types/ts/universer/v1/usip.d.ts +0 -62
- package/lib/types/ts/universer/v1/video_task.d.ts +0 -196
- package/lib/types/ts/universer/v1/workspace.d.ts +0 -273
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IDocumentMeta } from './doc';
|
|
17
|
+
import type { IResource } from './resource';
|
|
4
18
|
export declare enum CellValueType {
|
|
5
19
|
UNKNOWN = 0,
|
|
6
20
|
STRING = 1,
|
|
@@ -9,7 +23,7 @@ export declare enum CellValueType {
|
|
|
9
23
|
FORCE_STRING = 4,
|
|
10
24
|
UNRECOGNIZED = -1
|
|
11
25
|
}
|
|
12
|
-
export interface
|
|
26
|
+
export interface IWorksheetMeta {
|
|
13
27
|
type: number;
|
|
14
28
|
id: string;
|
|
15
29
|
name: string;
|
|
@@ -18,7 +32,7 @@ export interface WorksheetMeta {
|
|
|
18
32
|
/** The original meta data in JSON format. Cell data is excluded. */
|
|
19
33
|
originalMeta: Uint8Array;
|
|
20
34
|
}
|
|
21
|
-
export interface
|
|
35
|
+
export interface IWorkbookMeta {
|
|
22
36
|
unitID: string;
|
|
23
37
|
rev: number;
|
|
24
38
|
creator: string;
|
|
@@ -26,71 +40,33 @@ export interface WorkbookMeta {
|
|
|
26
40
|
sheetOrder: string[];
|
|
27
41
|
/** The key is sheet id */
|
|
28
42
|
sheets: {
|
|
29
|
-
[key: string]:
|
|
43
|
+
[key: string]: IWorksheetMeta;
|
|
30
44
|
};
|
|
31
45
|
/**
|
|
32
46
|
* Questions: should snapshot server read the celldata?
|
|
33
|
-
* map<string, univer.
|
|
47
|
+
* map<string, univer.IResource> resources = 8; // The key is sheet id
|
|
34
48
|
*/
|
|
35
|
-
resources:
|
|
49
|
+
resources: IResource[];
|
|
36
50
|
/** The key is sheet id */
|
|
37
51
|
blockMeta: {
|
|
38
|
-
[key: string]:
|
|
52
|
+
[key: string]: ISheetBlockMeta;
|
|
39
53
|
};
|
|
40
54
|
/** The original meta data in JSON format. Cell data is excluded. */
|
|
41
55
|
originalMeta: Uint8Array;
|
|
42
56
|
}
|
|
43
|
-
|
|
44
|
-
key: string;
|
|
45
|
-
value: WorksheetMeta | undefined;
|
|
46
|
-
}
|
|
47
|
-
export interface WorkbookMeta_BlockMetaEntry {
|
|
48
|
-
key: string;
|
|
49
|
-
value: SheetBlockMeta | undefined;
|
|
50
|
-
}
|
|
51
|
-
/** import/export would use this message */
|
|
52
|
-
export interface CellDataMatrix {
|
|
53
|
-
/** The key is the row number */
|
|
54
|
-
rows: {
|
|
55
|
-
[key: number]: RowData;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export interface CellDataMatrix_RowsEntry {
|
|
59
|
-
key: number;
|
|
60
|
-
value: RowData | undefined;
|
|
61
|
-
}
|
|
62
|
-
export interface RowData {
|
|
63
|
-
rowNumber: number;
|
|
64
|
-
/** The key is the column number */
|
|
65
|
-
items: {
|
|
66
|
-
[key: number]: CellItem;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export interface RowData_ItemsEntry {
|
|
70
|
-
key: number;
|
|
71
|
-
value: CellItem | undefined;
|
|
72
|
-
}
|
|
73
|
-
export interface CellItem {
|
|
74
|
-
cell?: CellData | undefined;
|
|
75
|
-
data?: SomeData | undefined;
|
|
76
|
-
}
|
|
77
|
-
export interface SomeData {
|
|
78
|
-
id: string;
|
|
79
|
-
name: string;
|
|
80
|
-
}
|
|
81
|
-
export interface CellValue {
|
|
57
|
+
interface ICellValue {
|
|
82
58
|
strV?: string | undefined;
|
|
83
59
|
numV?: number | undefined;
|
|
84
60
|
boolV?: boolean | undefined;
|
|
85
61
|
}
|
|
86
62
|
/** Represents the data for a cell. */
|
|
87
|
-
export interface
|
|
63
|
+
export interface ICellData {
|
|
88
64
|
/** The value of the cell. */
|
|
89
|
-
v:
|
|
65
|
+
v: ICellValue | undefined;
|
|
90
66
|
/** The type of the cell value. */
|
|
91
67
|
t: CellValueType;
|
|
92
68
|
/** univer doc */
|
|
93
|
-
p:
|
|
69
|
+
p: IDocumentMeta | undefined;
|
|
94
70
|
/** style */
|
|
95
71
|
s: string;
|
|
96
72
|
/** formula */
|
|
@@ -102,15 +78,16 @@ export interface CellData {
|
|
|
102
78
|
/** New Excel formulas need to add prefixes for differentiation, e.g., _xlfn._xlws. _xlfn. _xlws. _xludf. */
|
|
103
79
|
xf: string;
|
|
104
80
|
}
|
|
105
|
-
export interface
|
|
81
|
+
export interface ISheetBlock {
|
|
106
82
|
/** block id, generate by backend server */
|
|
107
83
|
id: string;
|
|
108
84
|
startRow: number;
|
|
109
85
|
endRow: number;
|
|
110
86
|
data: Uint8Array;
|
|
111
87
|
}
|
|
112
|
-
export interface
|
|
88
|
+
export interface ISheetBlockMeta {
|
|
113
89
|
sheetID: string;
|
|
114
90
|
/** sheet block ids */
|
|
115
91
|
blocks: string[];
|
|
116
92
|
}
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum IRecordType {
|
|
17
|
+
/** Unknown - don't use */
|
|
18
|
+
Unknown = 0,
|
|
19
|
+
Colla = 1,
|
|
20
|
+
Import = 2,
|
|
21
|
+
Export = 3,
|
|
22
|
+
ICreateUnit = 4,
|
|
23
|
+
UNRECOGNIZED = -1
|
|
24
|
+
}
|
|
25
|
+
export interface IRecord {
|
|
26
|
+
/** name: key */
|
|
27
|
+
k: IRecordType;
|
|
28
|
+
/** name: label */
|
|
29
|
+
l: {
|
|
30
|
+
[key: string]: string;
|
|
31
|
+
};
|
|
32
|
+
/** name: value */
|
|
33
|
+
v: number;
|
|
34
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IChangeset, ICommand, IMutation } from '../../univer/changeset';
|
|
17
|
+
import type { IError } from '../../univer/constants/errors';
|
|
18
|
+
import type { UniverType } from '../../univer/constants/univer';
|
|
19
|
+
import type { IInitialSheet } from '../../univer/initial-sheet';
|
|
20
|
+
import type { ISnapshot } from '../../univer/snapshot';
|
|
21
|
+
import type { ICustomCellTemplate } from '../../univer/unit-template';
|
|
22
|
+
export interface IForkUnitRequest {
|
|
23
|
+
sourceUnitId: string;
|
|
24
|
+
targetUnitId: string;
|
|
25
|
+
type: UniverType;
|
|
26
|
+
}
|
|
27
|
+
export interface IForkUnitResponse {
|
|
28
|
+
error: IError | undefined;
|
|
29
|
+
snapshot: ISnapshot | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface IGetUnitRawContentRequest {
|
|
32
|
+
unitID: string;
|
|
33
|
+
type: UniverType;
|
|
34
|
+
subUnitID: string;
|
|
35
|
+
}
|
|
36
|
+
export interface IGetUnitRawContentResponse {
|
|
37
|
+
error: IError | undefined;
|
|
38
|
+
initialSheet: IInitialSheet | undefined;
|
|
39
|
+
dataStream: string;
|
|
40
|
+
}
|
|
41
|
+
/** The meta required to create a new unit. */
|
|
42
|
+
export interface IWorkbookCreateMeta {
|
|
43
|
+
/**
|
|
44
|
+
* If you want to create an empty sheet, make this undefined or a empty
|
|
45
|
+
* string.
|
|
46
|
+
*/
|
|
47
|
+
templateID?: string | undefined;
|
|
48
|
+
/** Name of the unit. It should be localized. */
|
|
49
|
+
name: string;
|
|
50
|
+
/** Locale of the unit. */
|
|
51
|
+
locale: string;
|
|
52
|
+
customCell?: ICustomCellTemplate | undefined;
|
|
53
|
+
/** Other meta in the future. */
|
|
54
|
+
docContent: string;
|
|
55
|
+
}
|
|
56
|
+
export interface ICreateUnitRequest {
|
|
57
|
+
unitID: string;
|
|
58
|
+
type: UniverType;
|
|
59
|
+
name: string;
|
|
60
|
+
creator: string;
|
|
61
|
+
/** If `type` is UniverType.UNIVER_SHEEET, this is requried. */
|
|
62
|
+
workbookMeta?: IWorkbookCreateMeta | undefined;
|
|
63
|
+
/** Other meta for other types of univer. */
|
|
64
|
+
initialSheets: IInitialSheet[];
|
|
65
|
+
workbookDataJson: string;
|
|
66
|
+
}
|
|
67
|
+
export interface ICreateUnitResponse {
|
|
68
|
+
error: IError | undefined;
|
|
69
|
+
sheetOrder: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* IApplyRequest is almost the same as a IChangeset.
|
|
73
|
+
* See `changeset.proto` for details.
|
|
74
|
+
*/
|
|
75
|
+
export interface IApplyRequest {
|
|
76
|
+
unitID: string;
|
|
77
|
+
type: UniverType;
|
|
78
|
+
/** changeset to apply */
|
|
79
|
+
changeset: IChangeset | undefined;
|
|
80
|
+
/** changsetset to fast forward to, these cs has been applied to the document */
|
|
81
|
+
fastForward: IChangeset[];
|
|
82
|
+
}
|
|
83
|
+
export interface IApplyResponse {
|
|
84
|
+
error: IError | undefined;
|
|
85
|
+
/** The revision of the document right now */
|
|
86
|
+
revision: number;
|
|
87
|
+
}
|
|
88
|
+
export interface IDirectWriteRequest {
|
|
89
|
+
unitID: string;
|
|
90
|
+
type: UniverType;
|
|
91
|
+
body: IDirectWriteBody | undefined;
|
|
92
|
+
userID: string;
|
|
93
|
+
}
|
|
94
|
+
interface IDirectWriteBody {
|
|
95
|
+
unitID: string;
|
|
96
|
+
type: UniverType;
|
|
97
|
+
userID: string;
|
|
98
|
+
/** ICommand to be executed. Not that you must provide a on of commands or mutations, not both. */
|
|
99
|
+
commands: ICommand[];
|
|
100
|
+
/** ICommand to be executed. Not that you must provide a on of commands or mutations, not both. */
|
|
101
|
+
mutations: IMutation[];
|
|
102
|
+
}
|
|
103
|
+
export interface IDirectWriteResponse {
|
|
104
|
+
error: IError | undefined;
|
|
105
|
+
revision: number;
|
|
106
|
+
}
|
|
107
|
+
export interface IDisposeRequest {
|
|
108
|
+
unitID: string;
|
|
109
|
+
}
|
|
110
|
+
export interface IDisposeResponse {
|
|
111
|
+
error: IError | undefined;
|
|
112
|
+
}
|
|
113
|
+
export interface IEnsureSnapshotRequest {
|
|
114
|
+
unitID: string;
|
|
115
|
+
type: UniverType;
|
|
116
|
+
revision: number;
|
|
117
|
+
}
|
|
118
|
+
export interface IEnsureSnapshotResponse {
|
|
119
|
+
error: IError | undefined;
|
|
120
|
+
snapshot: ISnapshot | undefined;
|
|
121
|
+
}
|
|
122
|
+
export interface IPreloadUnitRequest {
|
|
123
|
+
unitID: string;
|
|
124
|
+
type: UniverType;
|
|
125
|
+
}
|
|
126
|
+
export interface IPreloadUnitResponse {
|
|
127
|
+
error: IError | undefined;
|
|
128
|
+
}
|
|
129
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { Metadata } from '@grpc/grpc-js';
|
|
17
|
+
import type { Observable } from 'rxjs';
|
|
18
|
+
import type { IError } from '../../univer/constants/errors';
|
|
19
|
+
import type { UniverType } from '../../univer/constants/univer';
|
|
20
|
+
import type { IEnsureSnapshotRequest, IEnsureSnapshotResponse } from './apply';
|
|
21
|
+
export interface ICreateLatestSnapshotInBackgroundRequest {
|
|
22
|
+
unitID: string;
|
|
23
|
+
type: UniverType;
|
|
24
|
+
}
|
|
25
|
+
export interface ICreateLatestSnapshotInBackgroundResponse {
|
|
26
|
+
error: IError | undefined;
|
|
27
|
+
}
|
|
28
|
+
export interface ICollaborationHelperService {
|
|
29
|
+
/**
|
|
30
|
+
* Ensure the snapshot at a given number would be saved to the snapshot service
|
|
31
|
+
* without fetching it back. Normally used for background saving.
|
|
32
|
+
*/
|
|
33
|
+
CreateLatestSnapshotInBackground(request: ICreateLatestSnapshotInBackgroundRequest, metadata?: Metadata): Observable<ICreateLatestSnapshotInBackgroundResponse>;
|
|
34
|
+
/** from IApplyService */
|
|
35
|
+
EnsureSnapshot(request: IEnsureSnapshotRequest, metadata?: Metadata): Observable<IEnsureSnapshotResponse>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IError } from '../../univer/constants/errors';
|
|
17
|
+
import type { IRange } from '../../univer/range';
|
|
18
|
+
import type { ITableInfo } from '../../univer/snapshot';
|
|
19
|
+
import type { ISheetBlockMeta } from '../../univer/workbook';
|
|
20
|
+
export declare enum responseDataMode {
|
|
21
|
+
/** none - no data, default */
|
|
22
|
+
none = 0,
|
|
23
|
+
/** all - all data */
|
|
24
|
+
all = 1,
|
|
25
|
+
/** sample - sample data */
|
|
26
|
+
sample = 2,
|
|
27
|
+
UNRECOGNIZED = -1
|
|
28
|
+
}
|
|
29
|
+
export interface IGetPreprocessRangesRequest {
|
|
30
|
+
unitId: string;
|
|
31
|
+
rev: number;
|
|
32
|
+
/** use string, see responseDataMode enum, default is "none" */
|
|
33
|
+
responseDataMode?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface ITableInfoList {
|
|
36
|
+
tableInfos: ITableInfo[];
|
|
37
|
+
}
|
|
38
|
+
export interface IGetPreprocessRangesResponse {
|
|
39
|
+
error: IError | undefined;
|
|
40
|
+
tableInfo: {
|
|
41
|
+
[key: string]: ITableInfoList;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface IGetValuesRequest {
|
|
45
|
+
workbookId: string;
|
|
46
|
+
worksheetId: string;
|
|
47
|
+
range: IRange | undefined;
|
|
48
|
+
}
|
|
49
|
+
export interface IGetValuesResponse {
|
|
50
|
+
error: IError | undefined;
|
|
51
|
+
/** A matrix of values in JSON format. */
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IComputeRequest {
|
|
55
|
+
/** The id of the unit to be computed. */
|
|
56
|
+
workbookId: string;
|
|
57
|
+
/**
|
|
58
|
+
* The revision of the unit to be computed. If not specified or set to 0, the SSC service
|
|
59
|
+
* will fetch the latest version at the request time.
|
|
60
|
+
*/
|
|
61
|
+
revision: number;
|
|
62
|
+
/** Timeout in milliseconds. Default is 30s. */
|
|
63
|
+
timeout: number;
|
|
64
|
+
}
|
|
65
|
+
export interface IComputeResponse {
|
|
66
|
+
error: IError | undefined;
|
|
67
|
+
/** Of which revision the unit is processed on. */
|
|
68
|
+
revision: number;
|
|
69
|
+
sscBlock: {
|
|
70
|
+
[key: string]: ISheetBlockMeta;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IError } from '../../univer/constants/errors';
|
|
17
|
+
import type { UniverType } from '../../univer/constants/univer';
|
|
18
|
+
export interface IGetSSRRequest {
|
|
19
|
+
unitId: string;
|
|
20
|
+
type: UniverType;
|
|
21
|
+
/** It is the id of a worksheet for Univer Sheet, or the id of a page for Univer Slide. */
|
|
22
|
+
subUnitId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IGetSSRResponse {
|
|
25
|
+
error: IError | undefined;
|
|
26
|
+
/** PNG Image encoded in base64 format. */
|
|
27
|
+
imageEncoded: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { Metadata } from '@grpc/grpc-js';
|
|
17
|
+
import type { Observable } from 'rxjs';
|
|
18
|
+
import type { IError } from '../../univer/constants/errors';
|
|
19
|
+
interface IAccessKey {
|
|
20
|
+
recordId: string;
|
|
21
|
+
accessKey: string;
|
|
22
|
+
createdAt: number;
|
|
23
|
+
agent: boolean;
|
|
24
|
+
description: string;
|
|
25
|
+
}
|
|
26
|
+
interface ICreateAccessKeyRequest {
|
|
27
|
+
agent: boolean;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
interface ICreateAccessKeyResponse {
|
|
31
|
+
error: IError | undefined;
|
|
32
|
+
accessKey: IAccessKey | undefined;
|
|
33
|
+
}
|
|
34
|
+
interface IListAccessKeysRequest {
|
|
35
|
+
}
|
|
36
|
+
interface IListAccessKeysResponse {
|
|
37
|
+
error: IError | undefined;
|
|
38
|
+
accessKeys: IAccessKey[];
|
|
39
|
+
}
|
|
40
|
+
interface IDeleteAccessKeyRequest {
|
|
41
|
+
recordId: string;
|
|
42
|
+
}
|
|
43
|
+
interface IDeleteAccessKeyResponse {
|
|
44
|
+
error: IError | undefined;
|
|
45
|
+
}
|
|
46
|
+
export interface IAccessKeyService {
|
|
47
|
+
CreateAccessKey(request: ICreateAccessKeyRequest, metadata?: Metadata): Observable<ICreateAccessKeyResponse>;
|
|
48
|
+
ListAccessKeys(request: IListAccessKeysRequest, metadata?: Metadata): Observable<IListAccessKeysResponse>;
|
|
49
|
+
DeleteAccessKey(request: IDeleteAccessKeyRequest, metadata?: Metadata): Observable<IDeleteAccessKeyResponse>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|