@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.
Files changed (41) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +22 -20
  3. package/lib/types/index.d.ts +3 -1
  4. package/lib/types/ts/univer/constants/errors.d.ts +4 -0
  5. package/lib/types/ts/univer/initial_sheet.d.ts +8 -0
  6. package/lib/types/ts/v1/access_key.d.ts +32 -0
  7. package/lib/types/ts/v1/analyse_task.d.ts +173 -0
  8. package/lib/types/ts/v1/comment.d.ts +97 -0
  9. package/lib/types/ts/v1/conf.d.ts +424 -0
  10. package/lib/types/ts/v1/connector.d.ts +74 -0
  11. package/lib/types/ts/v1/conversation.d.ts +279 -0
  12. package/lib/types/ts/v1/email.d.ts +18 -0
  13. package/lib/types/ts/v1/entitlement.d.ts +318 -0
  14. package/lib/types/ts/v1/exchange.d.ts +90 -0
  15. package/lib/types/ts/v1/feedback.d.ts +26 -0
  16. package/lib/types/ts/v1/file.d.ts +2 -0
  17. package/lib/types/ts/v1/go_config_center.d.ts +91 -0
  18. package/lib/types/ts/v1/invite_code.d.ts +47 -0
  19. package/lib/types/ts/v1/license.d.ts +35 -0
  20. package/lib/types/ts/v1/license_manage.d.ts +103 -0
  21. package/lib/types/ts/v1/oauth2.d.ts +24 -0
  22. package/lib/types/ts/v1/oidc.d.ts +80 -0
  23. package/lib/types/ts/v1/source_connector/api.d.ts +110 -0
  24. package/lib/types/ts/v1/source_connector/conf.d.ts +29 -0
  25. package/lib/types/ts/v1/source_connector/displayer.d.ts +16 -0
  26. package/lib/types/ts/v1/source_connector/source.d.ts +46 -0
  27. package/lib/types/ts/v1/source_connector/stream_view.d.ts +31 -0
  28. package/lib/types/ts/v1/ssc.d.ts +238 -0
  29. package/lib/types/ts/v1/ssr.d.ts +25 -0
  30. package/lib/types/ts/v1/survey.d.ts +25 -0
  31. package/lib/types/ts/v1/template.d.ts +48 -0
  32. package/lib/types/ts/v1/trigger.d.ts +102 -0
  33. package/lib/types/ts/v1/uniscript.d.ts +104 -0
  34. package/lib/types/ts/v1/uniscript_logs.d.ts +157 -0
  35. package/lib/types/ts/v1/univer_go_template.d.ts +65 -0
  36. package/lib/types/ts/v1/user.d.ts +33 -0
  37. package/lib/types/ts/v1/user_settings.d.ts +22 -0
  38. package/lib/types/ts/v1/usip.d.ts +55 -0
  39. package/lib/types/ts/v1/workspace.d.ts +272 -0
  40. package/lib/umd/index.js +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,279 @@
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
+ import { SheetTable } from './snapshot';
6
+ export declare const protobufPackage = "universer.v1";
7
+ export declare enum CompletionStatus {
8
+ Completion_None = 0,
9
+ Completion_Completed = 1,
10
+ Completion_UserCancelled = 2,
11
+ Completion_SystemErr = 3,
12
+ UNRECOGNIZED = -1
13
+ }
14
+ export declare enum ConversationRoleType {
15
+ RoleType_None = 0,
16
+ RoleType_User = 1,
17
+ RoleType_Agent = 2,
18
+ UNRECOGNIZED = -1
19
+ }
20
+ export declare enum ContentBlockType {
21
+ ContentBlockType_None = 0,
22
+ ContentBlockType_Prompt = 1,
23
+ ContentBlockType_Thinking = 2,
24
+ ContentBlockType_Report = 3,
25
+ UNRECOGNIZED = -1
26
+ }
27
+ export declare enum ContentType {
28
+ ContentType_None = 0,
29
+ ContentType_PlainText = 1,
30
+ ContentType_Markdown = 2,
31
+ UNRECOGNIZED = -1
32
+ }
33
+ export declare enum AttachmentType {
34
+ AttachmentType_None = 0,
35
+ AttachmentType_Unit = 1,
36
+ AttachmentType_Echarts = 2,
37
+ AttachmentType_Recommendation = 3,
38
+ UNRECOGNIZED = -1
39
+ }
40
+ export declare enum MessageReaction {
41
+ Reaction_NoReact = 0,
42
+ Reaction_ThumbsUp = 1,
43
+ Reaction_ThumbsDown = 2,
44
+ UNRECOGNIZED = -1
45
+ }
46
+ export declare enum ChatSSEBlockType {
47
+ ChatSSEBlockType_None = 0,
48
+ /** ChatSSEBlockType_EndOfStream - indicates that SSE stream ended */
49
+ ChatSSEBlockType_EndOfStream = 1,
50
+ /** ChatSSEBlockType_Reject - prompt rejected univer.constants.Error */
51
+ ChatSSEBlockType_Reject = 2,
52
+ /** ChatSSEBlockType_ModConversation - conversation modified */
53
+ ChatSSEBlockType_ModConversation = 3,
54
+ /** ChatSSEBlockType_PromptAck - prompt message ACK */
55
+ ChatSSEBlockType_PromptAck = 4,
56
+ /** ChatSSEBlockType_ChatContent - chat answer stream content */
57
+ ChatSSEBlockType_ChatContent = 5,
58
+ /** ChatSSEBlockType_Attachment - attachment of chat answer */
59
+ ChatSSEBlockType_Attachment = 6,
60
+ /** ChatSSEBlockType_RespMeta - meta data of the response message */
61
+ ChatSSEBlockType_RespMeta = 7,
62
+ /** ChatSSEBlockType_StreamErr - stream error */
63
+ ChatSSEBlockType_StreamErr = 8,
64
+ /** ChatSSEBlockType_ChatThinking - chat thinking stream content */
65
+ ChatSSEBlockType_ChatThinking = 9,
66
+ UNRECOGNIZED = -1
67
+ }
68
+ export declare enum ChatSSEStatus {
69
+ ChatSSEStatus_None = 0,
70
+ /** ChatSSEStatus_Appending - streaming still ongoing */
71
+ ChatSSEStatus_Appending = 1,
72
+ /** ChatSSEStatus_Success - streaming completed successfully */
73
+ ChatSSEStatus_Success = 2,
74
+ UNRECOGNIZED = -1
75
+ }
76
+ export interface GetConversationModelsRequest {
77
+ }
78
+ export interface GetConversationModel {
79
+ /** model id */
80
+ id: string;
81
+ /** show name */
82
+ name: string;
83
+ }
84
+ export interface GetConversationModelsResponse {
85
+ models: GetConversationModel[];
86
+ error: Error | undefined;
87
+ }
88
+ export interface GetPromptRecommendationsRequest {
89
+ /** must specify the unitIds */
90
+ unitIds: string[];
91
+ /**
92
+ * if not in an existing conversation,
93
+ * leave conversationId empty.
94
+ */
95
+ conversationId: string;
96
+ /** Locale Code */
97
+ locale: string;
98
+ modelId: string;
99
+ /** how many recommendations needed, default is 3 */
100
+ count: number;
101
+ }
102
+ export interface GetPromptRecommendationsResponse {
103
+ recommendations: string[];
104
+ error: Error | undefined;
105
+ }
106
+ export interface Conversation {
107
+ conversationId: string;
108
+ /** unix timestamp milli seconds */
109
+ createTime: string;
110
+ /** unix timestamp milli seconds */
111
+ lastUpdate: string;
112
+ title: string;
113
+ }
114
+ export interface ListConversationsRequest {
115
+ /**
116
+ * batchId,
117
+ * set to empty in the 1st scroller request,
118
+ * then set to nextBatchId(which was returned by the previous request) in the following scroller request.
119
+ */
120
+ batchId: string;
121
+ /** limit, specify how many records needed. */
122
+ limit: number;
123
+ }
124
+ export interface ListConversationsResponse {
125
+ /** conversations, order by lastUpdate desc default. */
126
+ conversations: Conversation[];
127
+ hasMore: boolean;
128
+ nextBatchId: string;
129
+ error: Error | undefined;
130
+ }
131
+ export interface RenameConversationRequest {
132
+ conversationId: string;
133
+ newTitle: string;
134
+ }
135
+ export interface RenameConversationResponse {
136
+ error: Error | undefined;
137
+ }
138
+ export interface DeleteConversationRequest {
139
+ conversationId: string;
140
+ }
141
+ export interface DeleteConversationResponse {
142
+ error: Error | undefined;
143
+ }
144
+ export interface ConversationMessage {
145
+ messageId: string;
146
+ roleType: ConversationRoleType;
147
+ /** unix timestamp milli seconds */
148
+ createTime: string;
149
+ /** reaction of the owner */
150
+ reaction: MessageReaction;
151
+ /** completionStatus, set if message is answer */
152
+ completionStatus: CompletionStatus;
153
+ contents: ContentBlock[];
154
+ attachments: Attachment[];
155
+ }
156
+ export interface ContentBlock {
157
+ blockType: ContentBlockType;
158
+ contentType: ContentType;
159
+ body: string;
160
+ }
161
+ export interface Attachment {
162
+ type: AttachmentType;
163
+ /**
164
+ * id of the Attachment,
165
+ * vary with the AttachmentType,
166
+ * AttachmentType_Unit -> unitId;
167
+ * AttachmentType_Echarts -> echarts mapping key;
168
+ * AttachmentType_Recommendation -> no ID;
169
+ */
170
+ id: string;
171
+ /**
172
+ * content of the Attachment,
173
+ * vary with the AttachmentType,
174
+ * AttachmentType_Unit -> empty;
175
+ * AttachmentType_Echarts -> json string of EchartsContent;
176
+ * AttachmentType_Recommendation -> json string of recommendations(json string array)
177
+ */
178
+ content: string;
179
+ }
180
+ export interface EchartsContent {
181
+ option: string;
182
+ }
183
+ export interface ListConversationMessagesRequest {
184
+ conversationId: string;
185
+ /**
186
+ * batchId,
187
+ * set to empty in the 1st scroller request,
188
+ * then set to nextBatchId(which was returned by the previous request) in the following scroller request.
189
+ */
190
+ batchId: string;
191
+ /** limit, specify how many records needed. */
192
+ limit: number;
193
+ }
194
+ export interface ListConversationMessagesResponse {
195
+ /** messages, order by createTime desc default. */
196
+ messages: ConversationMessage[];
197
+ nextBatchId: string;
198
+ hasMore: boolean;
199
+ error: Error | undefined;
200
+ }
201
+ export interface ReactMessageRequest {
202
+ /** conversationId, required */
203
+ conversationId: string;
204
+ /** messageId, required */
205
+ messageId: string;
206
+ reaction: MessageReaction;
207
+ }
208
+ export interface ReactMessageResponse {
209
+ error: Error | undefined;
210
+ }
211
+ export interface ConversationUnit {
212
+ unitId: string;
213
+ type: UniverType;
214
+ unitName: string;
215
+ messageId: string;
216
+ roleType: ConversationRoleType;
217
+ table: SheetTable | undefined;
218
+ }
219
+ export interface ListConversationUnitsRequest {
220
+ conversationId: string;
221
+ needTableData?: boolean | undefined;
222
+ }
223
+ export interface ListConversationUnitsResponse {
224
+ units: ConversationUnit[];
225
+ error: Error | undefined;
226
+ }
227
+ export interface SubmitPromptRequest {
228
+ /** set to empty when begin a new conversation */
229
+ conversationId: string;
230
+ promptText: string;
231
+ attachedUnitIds: string[];
232
+ model: string;
233
+ }
234
+ /** chat streaming response SSE block */
235
+ export interface ChatSSEBlock {
236
+ blockType: ChatSSEBlockType;
237
+ /**
238
+ * body,
239
+ * json string identicated by blockType,
240
+ * ChatSSEBlockType_EndOfStream -> empty;
241
+ * ChatSSEBlockType_StreamErr -> json string of error reason: univer.constants.Error;
242
+ * ChatSSEBlockType_Reject -> json string of reject reason: univer.constants.Error;
243
+ * ChatSSEBlockType_ModConversation -> json string of Conversation;
244
+ * ChatSSEBlockType_PromptAck -> json string of PromptAck;
245
+ * ChatSSEBlockType_ChatContent -> json string of ChatContentSSEBlock;
246
+ * ChatSSEBlockType_Attachment -> json string of Attachment;
247
+ * ChatSSEBlockType_RespMeta -> json string of ChatRespMeta;
248
+ * ChatSSEBlockType_ChatThinking -> json string of ChatThinkingSSEBlock
249
+ */
250
+ body: string;
251
+ status: ChatSSEStatus;
252
+ }
253
+ export interface ChatContentSSEBlock {
254
+ contentType: ContentType;
255
+ body: string;
256
+ }
257
+ export interface ChatThinkingSSEBlock {
258
+ contentType: ContentType;
259
+ body: string;
260
+ }
261
+ export interface PromptAck {
262
+ /** id of the user prompt message. */
263
+ messageId: string;
264
+ }
265
+ export interface ChatRespMeta {
266
+ messageId: string;
267
+ }
268
+ export interface ConversationService {
269
+ /** the conversation list is order by lastUpdate desc default. */
270
+ ListConversations(request: ListConversationsRequest, metadata?: Metadata): Observable<ListConversationsResponse>;
271
+ RenameConversation(request: RenameConversationRequest, metadata?: Metadata): Observable<RenameConversationResponse>;
272
+ DeleteConversation(request: DeleteConversationRequest, metadata?: Metadata): Observable<DeleteConversationResponse>;
273
+ /** the message list is order by createTime desc default. */
274
+ ListConversationMessages(request: ListConversationMessagesRequest, metadata?: Metadata): Observable<ListConversationMessagesResponse>;
275
+ ReactMessage(request: ReactMessageRequest, metadata?: Metadata): Observable<ReactMessageResponse>;
276
+ ListConversationUnits(request: ListConversationUnitsRequest, metadata?: Metadata): Observable<ListConversationUnitsResponse>;
277
+ GetPromptRecommendations(request: GetPromptRecommendationsRequest, metadata?: Metadata): Observable<GetPromptRecommendationsResponse>;
278
+ GetConversationModels(request: GetConversationModelsRequest, metadata?: Metadata): Observable<GetConversationModelsResponse>;
279
+ }
@@ -0,0 +1,18 @@
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 SendClipsheetWorkflowEmailRequest {
6
+ userId: string;
7
+ recipientEmail: string;
8
+ unitUrl: string;
9
+ succeededAt: Date | undefined;
10
+ userDisplayName: string;
11
+ workflowName: string;
12
+ }
13
+ export interface SendClipsheetWorkflowEmailResponse {
14
+ error: Error | undefined;
15
+ }
16
+ export interface EmailService {
17
+ SendClipsheetWorkflowEmail(request: SendClipsheetWorkflowEmailRequest, metadata?: Metadata): Observable<SendClipsheetWorkflowEmailResponse>;
18
+ }
@@ -0,0 +1,318 @@
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 Interval {
6
+ Hour = 0,
7
+ Day = 1,
8
+ Week = 2,
9
+ Month = 3,
10
+ Year = 4,
11
+ UNRECOGNIZED = -1
12
+ }
13
+ export declare enum EntitlementItemType {
14
+ Ability = 0,
15
+ Rate = 1,
16
+ BizDefined = 2,
17
+ UNRECOGNIZED = -1
18
+ }
19
+ export declare enum EntitlementItemId {
20
+ WebTableExtractRate = 0,
21
+ ServerExtractHistory = 1,
22
+ TabsPerExtract = 2,
23
+ TargetedExtract = 3,
24
+ StandardSearchRate = 4,
25
+ ProSearchRate = 5,
26
+ AvailableAImodels = 6,
27
+ RowsLimitedPerDrillDown = 7,
28
+ UNRECOGNIZED = -1
29
+ }
30
+ export declare enum ProductType {
31
+ /** OneTime - not used now */
32
+ OneTime = 0,
33
+ Recurring = 1,
34
+ /** Freebie - freebie product, like the anonymous users can enjoy pro search 5 times per 4 hours */
35
+ Freebie = 2,
36
+ UNRECOGNIZED = -1
37
+ }
38
+ export declare enum SessionType {
39
+ /** SetupIntent - collect payment method */
40
+ SetupIntent = 0,
41
+ /** PaymentIntent - pay directly */
42
+ PaymentIntent = 1,
43
+ UNRECOGNIZED = -1
44
+ }
45
+ export declare enum SubscriptionStatus {
46
+ /** PendingCreate - the subscription is creating */
47
+ PendingCreate = 0,
48
+ /** Active - the subscription is active */
49
+ Active = 1,
50
+ /** PastDue - the subscription renewaled and pay failed */
51
+ PastDue = 2,
52
+ /** Expired - the subscription expired, due to not paid or offer the payment method */
53
+ Expired = 3,
54
+ /** Cancelled - cancelled, by user or system */
55
+ Cancelled = 4,
56
+ UNRECOGNIZED = -1
57
+ }
58
+ export declare enum UserInfoType {
59
+ Email = 0,
60
+ BillingAddress = 1,
61
+ UNRECOGNIZED = -1
62
+ }
63
+ export declare enum InvoiceStatus {
64
+ PendingPay = 0,
65
+ Paid = 1,
66
+ Void = 2,
67
+ UNRECOGNIZED = -1
68
+ }
69
+ export interface RateLimiter {
70
+ /** negative value means infinity */
71
+ limitedCnt: number;
72
+ /** eg. if interval=Week and interval_cnt=3, it's mean 3 weeks */
73
+ interval: Interval;
74
+ intervalCnt: number;
75
+ }
76
+ export interface EntitlementItem {
77
+ itemId: string;
78
+ name: string;
79
+ /** optional */
80
+ tips: string;
81
+ type: EntitlementItemType;
82
+ /** is the ability enable? set if type is Ability */
83
+ enable: boolean;
84
+ /** set if type is Rate, the bool logic relation of each limiter is 'AND' */
85
+ rateLimiters: RateLimiter[];
86
+ /** biz defined value, set if type is BizDefined */
87
+ bizDefinedValue: string;
88
+ /** desc of biz defined value, set if type is BizDefined */
89
+ bizDefinedValueDesc: string;
90
+ }
91
+ export interface EntitlementItemGroup {
92
+ name: string;
93
+ items: EntitlementItem[];
94
+ }
95
+ export interface Entitlement {
96
+ /** level of the entitlement, higher is better */
97
+ level: number;
98
+ name: string;
99
+ groups: EntitlementItemGroup[];
100
+ }
101
+ export interface RateDetail {
102
+ /** eg. if interval=Week and interval_cnt=3, it's mean 3 weeks */
103
+ interval: Interval;
104
+ intervalCnt: number;
105
+ /** total limit count, negative value means infinity */
106
+ limitedCnt: number;
107
+ /** left limit count, negative value means infinity */
108
+ leftCnt: number;
109
+ /** next time to reset the limit */
110
+ nextResetTime: number;
111
+ }
112
+ export interface EntitlementItemDetail {
113
+ itemId: string;
114
+ type: EntitlementItemType;
115
+ /** is the ability enable? set if type is Ability */
116
+ enable: boolean;
117
+ /** set if type is Rate, the bool logic relation of each limiter is 'AND' */
118
+ rateDetails: RateDetail[];
119
+ /** biz defined value, set if type is BizDefined */
120
+ bizDefinedValue: string;
121
+ }
122
+ export interface MGetEntitlementItemsByUserRequest {
123
+ userId: string;
124
+ /** item_id, string id of enum EntitlementItemId */
125
+ itemIds: string[];
126
+ }
127
+ export interface MGetEntitlementItemsByUserResponse {
128
+ /** key is item_id */
129
+ items: {
130
+ [key: string]: EntitlementItemDetail;
131
+ };
132
+ error: Error | undefined;
133
+ }
134
+ export interface MGetEntitlementItemsByUserResponse_ItemsEntry {
135
+ key: string;
136
+ value: EntitlementItemDetail | undefined;
137
+ }
138
+ export interface TakeNItemRateByUserRequest {
139
+ userId: string;
140
+ itemId: string;
141
+ n: number;
142
+ }
143
+ export interface TakeNItemRateByUserResponse {
144
+ allow: boolean;
145
+ /** if not allow, return how much lack */
146
+ lackCnt: number;
147
+ error: Error | undefined;
148
+ }
149
+ export interface Product {
150
+ productId: string;
151
+ /** only Recurring now */
152
+ productType: ProductType;
153
+ entitlement: Entitlement | undefined;
154
+ name: string;
155
+ /** optional, recommendation text of the product */
156
+ recommendation: string;
157
+ tags: string[];
158
+ /** optional, set if product_type is Recurring */
159
+ interval: Interval;
160
+ /** optional, set if product_type is Recurring */
161
+ intervalCnt: number;
162
+ /** the origin price */
163
+ price: string;
164
+ /** currency of the price */
165
+ currency: string;
166
+ /** optional, promotion price, set if there's any promotion */
167
+ promotionPrice: string;
168
+ /** optional, how many interval the promotion last, set if there's any promotion and product_type is Recurring */
169
+ promotionIntervalCnt: number;
170
+ /** optional, eg. 20 means the saving percent is 20%, 0 or nil mean do not display percent */
171
+ maxSavingPercent: number;
172
+ /** optional, the product table name */
173
+ tabName: string;
174
+ }
175
+ export interface PaymentSession {
176
+ sessionType: SessionType;
177
+ clientSecret: string;
178
+ /** eg:15.99, set if session_type is PaymentIntent */
179
+ amount: string;
180
+ /** eg:usd, set if session_type is PaymentIntent */
181
+ currency: string;
182
+ }
183
+ export interface Subscription {
184
+ subscriptionId: string;
185
+ productId: string;
186
+ productName: string;
187
+ status: SubscriptionStatus;
188
+ /** unix timestamp of UTC 0 */
189
+ subscriptTime: number;
190
+ /** unix timestamp of UTC 0 */
191
+ nextChargeTime: number;
192
+ /** is the subscription need payment */
193
+ paymentNeeded: boolean;
194
+ /** optional, set session data if payment_needed is true */
195
+ session: PaymentSession | undefined;
196
+ }
197
+ export interface PaymentMethodCard {
198
+ brand: string;
199
+ country: string;
200
+ expMonth: number;
201
+ expYear: number;
202
+ fingerprint: string;
203
+ last4: string;
204
+ }
205
+ export interface PaymentMethod {
206
+ card: PaymentMethodCard | undefined;
207
+ }
208
+ /** entitlement identity of the user */
209
+ export interface Identity {
210
+ entitlementLevel: number;
211
+ entitlementName: string;
212
+ startTime: number;
213
+ /** negative value means the identity will never expire */
214
+ expireTime: number;
215
+ }
216
+ export interface GetSubscriptionSummaryRequest {
217
+ }
218
+ export interface GetSubscriptionSummaryResponse {
219
+ identity: Identity | undefined;
220
+ /** optional */
221
+ currentSubscription: Subscription | undefined;
222
+ /** optional, may be set if currently has any subscription */
223
+ paymentMethod: PaymentMethod | undefined;
224
+ error: Error | undefined;
225
+ }
226
+ export interface Address {
227
+ City: string;
228
+ Country: string;
229
+ Line1: string;
230
+ Line2: string;
231
+ PostalCode: string;
232
+ State: string;
233
+ }
234
+ export interface ProductGroup {
235
+ entitlementName: string;
236
+ products: Product[];
237
+ }
238
+ export interface ListProductsRequest {
239
+ }
240
+ export interface ListProductsResponse {
241
+ groups: ProductGroup[];
242
+ /** set if has subscription */
243
+ currentSubscription: Subscription | undefined;
244
+ missingUserInfoTypes: UserInfoType[];
245
+ error: Error | undefined;
246
+ }
247
+ export interface CreateSubscriptionRequest {
248
+ productId: string;
249
+ /** set if missing_user_info_types include BillingAddress */
250
+ billingAddress: Address | undefined;
251
+ /** set if missing_user_info_types include Email */
252
+ email: string;
253
+ /** set the return url after payment complete */
254
+ paymentReturnUrl: string;
255
+ }
256
+ export interface CreateSubscriptionResponse {
257
+ session: PaymentSession | undefined;
258
+ error: Error | undefined;
259
+ }
260
+ export interface CancelSubscriptionRequest {
261
+ subscriptionId: string;
262
+ /** optional */
263
+ reason: string;
264
+ }
265
+ export interface CancelSubscriptionResponse {
266
+ error: Error | undefined;
267
+ }
268
+ export interface Invoice {
269
+ id: string;
270
+ status: InvoiceStatus;
271
+ /** unixtimestamp of utc 0 */
272
+ payTime: number;
273
+ /** format 12.45 */
274
+ payAmount: string;
275
+ currency: string;
276
+ productId: string;
277
+ productName: string;
278
+ description: string;
279
+ /** link of the receipt */
280
+ receiptUrl: string;
281
+ /** download link of the invoice PDF */
282
+ invoicePdf: string;
283
+ /** invoice number */
284
+ invoiceNumber: string;
285
+ }
286
+ export interface ListInvoicesRequest {
287
+ /** no of the first page is 1 */
288
+ pageNo: number;
289
+ /** max 100, default is 20 */
290
+ pageSize: number;
291
+ /** if set end_time but no start_time, it's mean [-infi, end_time) */
292
+ startTime: number;
293
+ /** if set start_time but no end_time, it's mean [start_time, now) */
294
+ endTime: number;
295
+ /** if set, only return the invoices generated by the subscription */
296
+ subscriptionId: string;
297
+ }
298
+ export interface ListInvoicesResponse {
299
+ invoices: Invoice[];
300
+ totalCnt: number;
301
+ error: Error | undefined;
302
+ }
303
+ export interface GetPaymentConfigRequest {
304
+ }
305
+ export interface GetPaymentConfigResponse {
306
+ publicApiKey: string;
307
+ error: Error | undefined;
308
+ }
309
+ export interface EntitlementService {
310
+ MGetEntitlementItemsByUser(request: MGetEntitlementItemsByUserRequest, metadata?: Metadata): Observable<MGetEntitlementItemsByUserResponse>;
311
+ TakeNItemRateByUser(request: TakeNItemRateByUserRequest, metadata?: Metadata): Observable<TakeNItemRateByUserResponse>;
312
+ GetPaymentConfig(request: GetPaymentConfigRequest, metadata?: Metadata): Observable<GetPaymentConfigResponse>;
313
+ ListProducts(request: ListProductsRequest, metadata?: Metadata): Observable<ListProductsResponse>;
314
+ GetSubscriptionSummary(request: GetSubscriptionSummaryRequest, metadata?: Metadata): Observable<GetSubscriptionSummaryResponse>;
315
+ CreateSubscription(request: CreateSubscriptionRequest, metadata?: Metadata): Observable<CreateSubscriptionResponse>;
316
+ CancelSubscription(request: CancelSubscriptionRequest, metadata?: Metadata): Observable<CancelSubscriptionResponse>;
317
+ ListInvoices(request: ListInvoicesRequest, metadata?: Metadata): Observable<ListInvoicesResponse>;
318
+ }
@@ -0,0 +1,90 @@
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
+ import { Snapshot } from '../univer/snapshot';
6
+ import { SheetBlock } from '../univer/workbook';
7
+ export declare const protobufPackage = "universer.v1";
8
+ export declare enum ImportOutputType {
9
+ UNDEFINED = 0,
10
+ /** UNIT - Import to univer unit, unit is store in the database */
11
+ UNIT = 1,
12
+ /** JSON - Import and convert to a json file which represents a univer unit, not store in the database */
13
+ JSON = 2,
14
+ UNRECOGNIZED = -1
15
+ }
16
+ export declare enum ImportScene {
17
+ ImportScene_Unspecified = 0,
18
+ ImportScene_General = 1,
19
+ ImportScene_AIAnalyse = 2,
20
+ UNRECOGNIZED = -1
21
+ }
22
+ export interface ImportRequest {
23
+ fileID: string;
24
+ type: UniverType;
25
+ outputType: ImportOutputType;
26
+ /** not supported yet */
27
+ fileUrl: string;
28
+ scene: ImportScene;
29
+ }
30
+ export interface ImportResponse {
31
+ error: Error | undefined;
32
+ taskID: string;
33
+ }
34
+ export interface ExportRequest {
35
+ /** if unitID is specified, the input is the unit in the database */
36
+ unitID: string;
37
+ /** if jsonID is specified, the input is the json file which represents a univer unit */
38
+ jsonID: string;
39
+ type: UniverType;
40
+ }
41
+ export interface ExportResponse {
42
+ error: Error | undefined;
43
+ taskID: string;
44
+ }
45
+ export interface GetTaskRequest {
46
+ taskID: string;
47
+ }
48
+ export interface GetTaskResponse {
49
+ error: Error | undefined;
50
+ taskID: string;
51
+ status: string;
52
+ import?: ImportTaskResult | undefined;
53
+ export?: ExportTaskResult | undefined;
54
+ }
55
+ export interface ImportTaskResult {
56
+ outputType: ImportOutputType;
57
+ unitID: string;
58
+ jsonID: string;
59
+ }
60
+ export interface ExportTaskResult {
61
+ fileID: string;
62
+ fileUrl: string;
63
+ }
64
+ export interface UpdateTaskRequest {
65
+ taskID: string;
66
+ status: string;
67
+ data: Uint8Array;
68
+ }
69
+ export interface UpdateTaskResponse {
70
+ error: Error | undefined;
71
+ }
72
+ /** The json file which represents a univer unit */
73
+ export interface UniverFileInJsonFmt {
74
+ /** TODO: need to consider more than one snapshot in a univer file */
75
+ snapshot: Snapshot | undefined;
76
+ /** key is the blockID, value is the sheet block */
77
+ sheetBlocks: {
78
+ [key: string]: SheetBlock;
79
+ };
80
+ }
81
+ export interface UniverFileInJsonFmt_SheetBlocksEntry {
82
+ key: string;
83
+ value: SheetBlock | undefined;
84
+ }
85
+ export interface ExchangeService {
86
+ Import(request: ImportRequest, metadata?: Metadata): Observable<ImportResponse>;
87
+ Export(request: ExportRequest, metadata?: Metadata): Observable<ExportResponse>;
88
+ GetTask(request: GetTaskRequest, metadata?: Metadata): Observable<GetTaskResponse>;
89
+ UpdateTask(request: UpdateTaskRequest, metadata?: Metadata): Observable<UpdateTaskResponse>;
90
+ }