@univerjs/protocol 0.1.19 → 0.1.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/protocol",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "private": false,
5
5
  "description": "A protocol of Univer repos",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -1,15 +0,0 @@
1
- export { isError } from './utils';
2
- export type { Changeset as IChangeset, Mutation as IMutation } from './ts/univer/changeset';
3
- export { ErrorCode, type Error as IError } from './ts/univer/constants/errors';
4
- export { UniverType } from './ts/univer/constants/univer';
5
- export type { DocumentMeta as IDocumentMeta } from './ts/univer/doc';
6
- export type { Resource as IResource } from './ts/univer/resource';
7
- export type { Snapshot as ISnapshot } from './ts/univer/snapshot';
8
- export { CellValueType, type CellData as ICellData, type CellValue as ICellValue, type RowData as IRowData, type RowData_ItemsEntry as IRowDataItemsEntry, type SheetBlock as ISheetBlock, type SheetBlockMeta as ISheetBlockMeta, type WorkbookMeta as IWorkbookMeta, type WorkbookMeta_BlockMetaEntry as IWorkbookMeta_BlockMetaEntry, type WorkbookMeta_SheetsEntry as IWorkbookMeta_SheetsEntry, type WorksheetMeta as IWorksheetMeta, } from './ts/univer/workbook';
9
- export { type ApplyRequest as IApplyRequest, type ApplyResponse as IApplyResponse, type CreateUnitRequest as ICreateUnitRequest, type CreateUnitResponse as ICreateUnitResponse, type DisposeRequest as IDisposeRequest, type DisposeResponse as IDisposeResponse, type WorkbookCreateMeta as IWorkbookCreateMeta, type EnsureSnapshotRequest as IEnsureSnapshotRequest, type EnsureSnapshotResponse as IEnsureSnapshotResponse, } from './ts/v1/apply';
10
- export { CmdRspCode, CombCmd, type CombInfoResponse as ICombInfoResponse, type CombJoinInfo as ICombJoinInfo, type CombJoinRequest as ICombJoinRequest, type CombJoinResponse as ICombJoinResponse, type CombJoinResponse_RoomInfo as ICombJoinResponseRoomInfo, type CombJoinResponse_RoomInfosEntry as ICombJoinResponseRoomInfosEntry, type CombLeaveRequest as ICombLeaveRequest, type CombService as ICombService, type ConnectResponse as IConnectResponse, type Member as IMember, type NewChangesRequest as INewChangesRequest, type NewChangesResponse as INewChangesResponse, } from './ts/v1/comb';
11
- export { type FetchMissingChangesetsRequest as IFetchMissingChangesetsRequest, type FetchMissingChangesetsResponse as IFetchMissingChangesetsResponse, type GetResourcesRequest as IGetResourcesRequest, type GetResourcesResponse as IGetResourcesResponse, type GetSheetBlockRequest as IGetSheetBlockRequest, type GetSheetBlockResponse as IGetSheetBlockResponse, type GetSnapshotRequest as IGetSnapshotRequest, type GetSnapshotResponse as IGetSnapshotResponse, type GetUnitOnRevRequest as IGetUnitOnRevRequest, type GetUnitOnRevResponse as IGetUnitOnRevResponse, type SaveChangesetRequest as ISaveChangesetRequest, type SaveChangesetResponse as ISaveChangesetResponse, type SaveSheetBlockRequest as ISaveSheetBlockRequest, type SaveSheetBlockResponse as ISaveSheetBlockResponse, type SaveSnapshotRequest as ISaveSnapshotRequest, type SaveSnapshotResponse as ISaveSnapshotResponse, type SnapshotService as ISnapshotService, } from './ts/v1/snapshot';
12
- export { type CollaMsg as ICollaMsg, type CollaMsgJoin as ICollaMsgJoin, type CollaMsgLeave as ICollaMsgLeave, type UpdateCursor as IUpdateCursor, type LiveShareRequestHost as ILiveShareRequestHost, type LiveShareNewHost as ILiveShareNewHost, type LiveShareOperation as ILiveShareOperation, type LiveShareOperation_Operation as ILiveShareOperation_Operation, type LiveShareOperation_OperationsEntry as ILiveShareOperation_OperationsEntry, type LiveShareTerminate as ILiveShareTerminate, type CollaMsgErrorEvent as ICollaMsgErrorEvent, } from './ts/univer/colla_msg';
13
- export { type FileService as IFileService, type FileUploadMeta as IuploadFileRequestMeta, type FileUploadRequest as IFileUploadRequest, type UploadResponse as IUploadResponse, } from './ts/v1/file';
14
- export type { GetUserResponse as IGetUserResponse, User as IUser, GetUserRequest as IGetUserRequest } from './ts/v1/user';
15
- export type { Collaborator as ICollaborator, CreateRequest as ICreateRequest, CreateRequest_SelectRangeObject as ICreateRequest_SelectRangeObject, CreateRequest_WorksheetObject as ICreateRequest_WorksheetObject, CreateResponse as ICreateResponse, CreateCollaboratorRequest as ICreateCollaboratorRequest, CreateCollaboratorResponse as ICreateCollaboratorResponse, UpdateCollaboratorRequest as IUpdateCollaboratorRequest, UpdateCollaboratorResponse as IUpdateCollaboratorResponse, DeleteCollaboratorRequest as IDeleteCollaboratorRequest, DeleteCollaboratorResponse as IDeleteCollaboratorResponse, ListCollaboratorRequest as IListCollaboratorRequest, ListCollaboratorResponse as IListCollaboratorResponse, AllowedRequest as IAllowedRequest, ActionInfo as IActionInfo, ActionInfo_InfoEntry as IActionInfo_InfoEntry, AllowedResponse as IAllowedResponse, AuthzService as IAuthzService, } from './ts/v1/authz';
@@ -1 +0,0 @@
1
- export declare const protobufPackage = "google.api";
@@ -1,352 +0,0 @@
1
- export declare const protobufPackage = "google.api";
2
- /**
3
- * Defines the HTTP configuration for an API service. It contains a list of
4
- * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
5
- * to one or more HTTP REST API methods.
6
- */
7
- export interface Http {
8
- /**
9
- * A list of HTTP configuration rules that apply to individual API methods.
10
- *
11
- * **NOTE:** All service configuration rules follow "last one wins" order.
12
- */
13
- rules: HttpRule[];
14
- /**
15
- * When set to true, URL path parameters will be fully URI-decoded except in
16
- * cases of single segment matches in reserved expansion, where "%2F" will be
17
- * left encoded.
18
- *
19
- * The default behavior is to not decode RFC 6570 reserved characters in multi
20
- * segment matches.
21
- */
22
- fullyDecodeReservedExpansion: boolean;
23
- }
24
- /**
25
- * # gRPC Transcoding
26
- *
27
- * gRPC Transcoding is a feature for mapping between a gRPC method and one or
28
- * more HTTP REST endpoints. It allows developers to build a single API service
29
- * that supports both gRPC APIs and REST APIs. Many systems, including [Google
30
- * APIs](https://github.com/googleapis/googleapis),
31
- * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
32
- * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
33
- * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
34
- * and use it for large scale production services.
35
- *
36
- * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
37
- * how different portions of the gRPC request message are mapped to the URL
38
- * path, URL query parameters, and HTTP request body. It also controls how the
39
- * gRPC response message is mapped to the HTTP response body. `HttpRule` is
40
- * typically specified as an `google.api.http` annotation on the gRPC method.
41
- *
42
- * Each mapping specifies a URL path template and an HTTP method. The path
43
- * template may refer to one or more fields in the gRPC request message, as long
44
- * as each field is a non-repeated field with a primitive (non-message) type.
45
- * The path template controls how fields of the request message are mapped to
46
- * the URL path.
47
- *
48
- * Example:
49
- *
50
- * service Messaging {
51
- * rpc GetMessage(GetMessageRequest) returns (Message) {
52
- * option (google.api.http) = {
53
- * get: "/v1/{name=messages/*}"
54
- * };
55
- * }
56
- * }
57
- * message GetMessageRequest {
58
- * string name = 1; // Mapped to URL path.
59
- * }
60
- * message Message {
61
- * string text = 1; // The resource content.
62
- * }
63
- *
64
- * This enables an HTTP REST to gRPC mapping as below:
65
- *
66
- * HTTP | gRPC
67
- * -----|-----
68
- * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
69
- *
70
- * Any fields in the request message which are not bound by the path template
71
- * automatically become HTTP query parameters if there is no HTTP request body.
72
- * For example:
73
- *
74
- * service Messaging {
75
- * rpc GetMessage(GetMessageRequest) returns (Message) {
76
- * option (google.api.http) = {
77
- * get:"/v1/messages/{message_id}"
78
- * };
79
- * }
80
- * }
81
- * message GetMessageRequest {
82
- * message SubMessage {
83
- * string subfield = 1;
84
- * }
85
- * string message_id = 1; // Mapped to URL path.
86
- * int64 revision = 2; // Mapped to URL query parameter `revision`.
87
- * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
88
- * }
89
- *
90
- * This enables a HTTP JSON to RPC mapping as below:
91
- *
92
- * HTTP | gRPC
93
- * -----|-----
94
- * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
95
- * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
96
- * "foo"))`
97
- *
98
- * Note that fields which are mapped to URL query parameters must have a
99
- * primitive type or a repeated primitive type or a non-repeated message type.
100
- * In the case of a repeated type, the parameter can be repeated in the URL
101
- * as `...?param=A&param=B`. In the case of a message type, each field of the
102
- * message is mapped to a separate parameter, such as
103
- * `...?foo.a=A&foo.b=B&foo.c=C`.
104
- *
105
- * For HTTP methods that allow a request body, the `body` field
106
- * specifies the mapping. Consider a REST update method on the
107
- * message resource collection:
108
- *
109
- * service Messaging {
110
- * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
111
- * option (google.api.http) = {
112
- * patch: "/v1/messages/{message_id}"
113
- * body: "message"
114
- * };
115
- * }
116
- * }
117
- * message UpdateMessageRequest {
118
- * string message_id = 1; // mapped to the URL
119
- * Message message = 2; // mapped to the body
120
- * }
121
- *
122
- * The following HTTP JSON to RPC mapping is enabled, where the
123
- * representation of the JSON in the request body is determined by
124
- * protos JSON encoding:
125
- *
126
- * HTTP | gRPC
127
- * -----|-----
128
- * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
129
- * "123456" message { text: "Hi!" })`
130
- *
131
- * The special name `*` can be used in the body mapping to define that
132
- * every field not bound by the path template should be mapped to the
133
- * request body. This enables the following alternative definition of
134
- * the update method:
135
- *
136
- * service Messaging {
137
- * rpc UpdateMessage(Message) returns (Message) {
138
- * option (google.api.http) = {
139
- * patch: "/v1/messages/{message_id}"
140
- * body: "*"
141
- * };
142
- * }
143
- * }
144
- * message Message {
145
- * string message_id = 1;
146
- * string text = 2;
147
- * }
148
- *
149
- * The following HTTP JSON to RPC mapping is enabled:
150
- *
151
- * HTTP | gRPC
152
- * -----|-----
153
- * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
154
- * "123456" text: "Hi!")`
155
- *
156
- * Note that when using `*` in the body mapping, it is not possible to
157
- * have HTTP parameters, as all fields not bound by the path end in
158
- * the body. This makes this option more rarely used in practice when
159
- * defining REST APIs. The common usage of `*` is in custom methods
160
- * which don't use the URL at all for transferring data.
161
- *
162
- * It is possible to define multiple HTTP methods for one RPC by using
163
- * the `additional_bindings` option. Example:
164
- *
165
- * service Messaging {
166
- * rpc GetMessage(GetMessageRequest) returns (Message) {
167
- * option (google.api.http) = {
168
- * get: "/v1/messages/{message_id}"
169
- * additional_bindings {
170
- * get: "/v1/users/{user_id}/messages/{message_id}"
171
- * }
172
- * };
173
- * }
174
- * }
175
- * message GetMessageRequest {
176
- * string message_id = 1;
177
- * string user_id = 2;
178
- * }
179
- *
180
- * This enables the following two alternative HTTP JSON to RPC mappings:
181
- *
182
- * HTTP | gRPC
183
- * -----|-----
184
- * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
185
- * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
186
- * "123456")`
187
- *
188
- * ## Rules for HTTP mapping
189
- *
190
- * 1. Leaf request fields (recursive expansion nested messages in the request
191
- * message) are classified into three categories:
192
- * - Fields referred by the path template. They are passed via the URL path.
193
- * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP
194
- * request body.
195
- * - All other fields are passed via the URL query parameters, and the
196
- * parameter name is the field path in the request message. A repeated
197
- * field can be represented as multiple query parameters under the same
198
- * name.
199
- * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields
200
- * are passed via URL path and HTTP request body.
201
- * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
202
- * fields are passed via URL path and URL query parameters.
203
- *
204
- * ### Path template syntax
205
- *
206
- * Template = "/" Segments [ Verb ] ;
207
- * Segments = Segment { "/" Segment } ;
208
- * Segment = "*" | "**" | LITERAL | Variable ;
209
- * Variable = "{" FieldPath [ "=" Segments ] "}" ;
210
- * FieldPath = IDENT { "." IDENT } ;
211
- * Verb = ":" LITERAL ;
212
- *
213
- * The syntax `*` matches a single URL path segment. The syntax `**` matches
214
- * zero or more URL path segments, which must be the last part of the URL path
215
- * except the `Verb`.
216
- *
217
- * The syntax `Variable` matches part of the URL path as specified by its
218
- * template. A variable template must not contain other variables. If a variable
219
- * matches a single path segment, its template may be omitted, e.g. `{var}`
220
- * is equivalent to `{var=*}`.
221
- *
222
- * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
223
- * contains any reserved character, such characters should be percent-encoded
224
- * before the matching.
225
- *
226
- * If a variable contains exactly one path segment, such as `"{var}"` or
227
- * `"{var=*}"`, when such a variable is expanded into a URL path on the client
228
- * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
229
- * server side does the reverse decoding. Such variables show up in the
230
- * [Discovery
231
- * Document](https://developers.google.com/discovery/v1/reference/apis) as
232
- * `{var}`.
233
- *
234
- * If a variable contains multiple path segments, such as `"{var=foo/*}"`
235
- * or `"{var=**}"`, when such a variable is expanded into a URL path on the
236
- * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
237
- * The server side does the reverse decoding, except "%2F" and "%2f" are left
238
- * unchanged. Such variables show up in the
239
- * [Discovery
240
- * Document](https://developers.google.com/discovery/v1/reference/apis) as
241
- * `{+var}`.
242
- *
243
- * ## Using gRPC API Service Configuration
244
- *
245
- * gRPC API Service Configuration (service config) is a configuration language
246
- * for configuring a gRPC service to become a user-facing product. The
247
- * service config is simply the YAML representation of the `google.api.Service`
248
- * proto message.
249
- *
250
- * As an alternative to annotating your proto file, you can configure gRPC
251
- * transcoding in your service config YAML files. You do this by specifying a
252
- * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
253
- * effect as the proto annotation. This can be particularly useful if you
254
- * have a proto that is reused in multiple services. Note that any transcoding
255
- * specified in the service config will override any matching transcoding
256
- * configuration in the proto.
257
- *
258
- * Example:
259
- *
260
- * http:
261
- * rules:
262
- * # Selects a gRPC method and applies HttpRule to it.
263
- * - selector: example.v1.Messaging.GetMessage
264
- * get: /v1/messages/{message_id}/{sub.subfield}
265
- *
266
- * ## Special notes
267
- *
268
- * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
269
- * proto to JSON conversion must follow the [proto3
270
- * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
271
- *
272
- * While the single segment variable follows the semantics of
273
- * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
274
- * Expansion, the multi segment variable **does not** follow RFC 6570 Section
275
- * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
276
- * does not expand special characters like `?` and `#`, which would lead
277
- * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
278
- * for multi segment variables.
279
- *
280
- * The path variables **must not** refer to any repeated or mapped field,
281
- * because client libraries are not capable of handling such variable expansion.
282
- *
283
- * The path variables **must not** capture the leading "/" character. The reason
284
- * is that the most common use case "{var}" does not capture the leading "/"
285
- * character. For consistency, all path variables must share the same behavior.
286
- *
287
- * Repeated message fields must not be mapped to URL query parameters, because
288
- * no client library can support such complicated mapping.
289
- *
290
- * If an API needs to use a JSON array for request or response body, it can map
291
- * the request or response body to a repeated field. However, some gRPC
292
- * Transcoding implementations may not support this feature.
293
- */
294
- export interface HttpRule {
295
- /**
296
- * Selects a method to which this rule applies.
297
- *
298
- * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
299
- */
300
- selector: string;
301
- /**
302
- * Maps to HTTP GET. Used for listing and getting information about
303
- * resources.
304
- */
305
- get?: string | undefined;
306
- /** Maps to HTTP PUT. Used for replacing a resource. */
307
- put?: string | undefined;
308
- /** Maps to HTTP POST. Used for creating a resource or performing an action. */
309
- post?: string | undefined;
310
- /** Maps to HTTP DELETE. Used for deleting a resource. */
311
- delete?: string | undefined;
312
- /** Maps to HTTP PATCH. Used for updating a resource. */
313
- patch?: string | undefined;
314
- /**
315
- * The custom pattern is used for specifying an HTTP method that is not
316
- * included in the `pattern` field, such as HEAD, or "*" to leave the
317
- * HTTP method unspecified for this rule. The wild-card rule is useful
318
- * for services that provide content to Web (HTML) clients.
319
- */
320
- custom?: CustomHttpPattern | undefined;
321
- /**
322
- * The name of the request field whose value is mapped to the HTTP request
323
- * body, or `*` for mapping all request fields not captured by the path
324
- * pattern to the HTTP body, or omitted for not having any HTTP request body.
325
- *
326
- * NOTE: the referred field must be present at the top-level of the request
327
- * message type.
328
- */
329
- body: string;
330
- /**
331
- * Optional. The name of the response field whose value is mapped to the HTTP
332
- * response body. When omitted, the entire response message will be used
333
- * as the HTTP response body.
334
- *
335
- * NOTE: The referred field must be present at the top-level of the response
336
- * message type.
337
- */
338
- responseBody: string;
339
- /**
340
- * Additional HTTP bindings for the selector. Nested bindings must
341
- * not contain an `additional_bindings` field themselves (that is,
342
- * the nesting may only be one level deep).
343
- */
344
- additionalBindings: HttpRule[];
345
- }
346
- /** A custom pattern is used for defining custom HTTP verb. */
347
- export interface CustomHttpPattern {
348
- /** The name of this custom HTTP verb. */
349
- kind: string;
350
- /** The path matched by this custom verb. */
351
- path: string;
352
- }