weave-typescript 0.50.0 → 0.51.1

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 (27) hide show
  1. package/dist/index.d.ts +23 -0
  2. package/dist/index.js +35 -1
  3. package/dist/weaveapi/consolidation/v1/consolidation.pb.d.ts +13 -14
  4. package/dist/weaveapi/consolidation/v1/consolidation.pb.js +62 -74
  5. package/dist/weaveapi/ingestion/v1/ingestion.pb.d.ts +82 -50
  6. package/dist/weaveapi/ingestion/v1/ingestion.pb.js +708 -216
  7. package/dist/weaveapi/ingestion/v1/service.pb.d.ts +50 -7
  8. package/dist/weaveapi/ingestion/v1/service.pb.js +279 -16
  9. package/dist/weaveapi/ingestion/v1/table.pb.d.ts +121 -0
  10. package/dist/weaveapi/ingestion/v1/table.pb.js +1478 -0
  11. package/dist/weaveapi/model/v1/model.pb.d.ts +3 -3
  12. package/dist/weaveapi/model/v1/model.pb.js +33 -33
  13. package/dist/weaveapi/model/v1/service.pb.d.ts +3 -3
  14. package/dist/weaveapi/model/v1/service.pb.js +33 -33
  15. package/dist/weaveapi/retrieval/v1/retrieval.pb.d.ts +123 -0
  16. package/dist/weaveapi/retrieval/v1/retrieval.pb.js +2096 -113
  17. package/dist/weaveapi/retrieval/v1/service.pb.d.ts +29 -1
  18. package/dist/weaveapi/retrieval/v1/service.pb.js +142 -0
  19. package/dist/weavesql/weavedb/consolidation_sql.d.ts +33 -33
  20. package/dist/weavesql/weavedb/consolidation_sql.js +56 -56
  21. package/dist/weavesql/weavedb/document_table_sql.d.ts +533 -0
  22. package/dist/weavesql/weavedb/document_table_sql.js +1352 -0
  23. package/dist/weavesql/weavedb/ingestion_sql.d.ts +67 -34
  24. package/dist/weavesql/weavedb/ingestion_sql.js +169 -73
  25. package/dist/weavesql/weavedb/retrieval_sql.d.ts +11 -11
  26. package/dist/weavesql/weavedb/retrieval_sql.js +13 -13
  27. package/package.json +1 -1
@@ -0,0 +1,1478 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.8
5
+ // protoc unknown
6
+ // source: weaveapi/ingestion/v1/table.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.GetDocumentTableResponse = exports.GetDocumentTableRequest = exports.ListDocumentTablesResponse = exports.ListDocumentTablesRequest = exports.ThreadTableLink = exports.DocumentTable = exports.DocumentTableColumn = exports.TableSourceFormat = exports.protobufPackage = void 0;
9
+ exports.tableSourceFormatFromJSON = tableSourceFormatFromJSON;
10
+ exports.tableSourceFormatToJSON = tableSourceFormatToJSON;
11
+ /* eslint-disable */
12
+ const wire_1 = require("@bufbuild/protobuf/wire");
13
+ const struct_pb_1 = require("../../../google/protobuf/struct.pb");
14
+ const timestamp_pb_1 = require("../../../google/protobuf/timestamp.pb");
15
+ const ingestion_pb_1 = require("./ingestion.pb");
16
+ exports.protobufPackage = "weaveapi.ingestion.v1";
17
+ var TableSourceFormat;
18
+ (function (TableSourceFormat) {
19
+ TableSourceFormat[TableSourceFormat["TABLE_SOURCE_FORMAT_UNSPECIFIED"] = 0] = "TABLE_SOURCE_FORMAT_UNSPECIFIED";
20
+ TableSourceFormat[TableSourceFormat["TABLE_SOURCE_FORMAT_CSV"] = 1] = "TABLE_SOURCE_FORMAT_CSV";
21
+ TableSourceFormat[TableSourceFormat["TABLE_SOURCE_FORMAT_TSV"] = 2] = "TABLE_SOURCE_FORMAT_TSV";
22
+ TableSourceFormat[TableSourceFormat["TABLE_SOURCE_FORMAT_XLSX"] = 3] = "TABLE_SOURCE_FORMAT_XLSX";
23
+ TableSourceFormat[TableSourceFormat["TABLE_SOURCE_FORMAT_HTML"] = 4] = "TABLE_SOURCE_FORMAT_HTML";
24
+ TableSourceFormat[TableSourceFormat["TABLE_SOURCE_FORMAT_PDF"] = 5] = "TABLE_SOURCE_FORMAT_PDF";
25
+ TableSourceFormat[TableSourceFormat["TABLE_SOURCE_FORMAT_OTHER"] = 6] = "TABLE_SOURCE_FORMAT_OTHER";
26
+ TableSourceFormat[TableSourceFormat["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
+ })(TableSourceFormat || (exports.TableSourceFormat = TableSourceFormat = {}));
28
+ function tableSourceFormatFromJSON(object) {
29
+ switch (object) {
30
+ case 0:
31
+ case "TABLE_SOURCE_FORMAT_UNSPECIFIED":
32
+ return TableSourceFormat.TABLE_SOURCE_FORMAT_UNSPECIFIED;
33
+ case 1:
34
+ case "TABLE_SOURCE_FORMAT_CSV":
35
+ return TableSourceFormat.TABLE_SOURCE_FORMAT_CSV;
36
+ case 2:
37
+ case "TABLE_SOURCE_FORMAT_TSV":
38
+ return TableSourceFormat.TABLE_SOURCE_FORMAT_TSV;
39
+ case 3:
40
+ case "TABLE_SOURCE_FORMAT_XLSX":
41
+ return TableSourceFormat.TABLE_SOURCE_FORMAT_XLSX;
42
+ case 4:
43
+ case "TABLE_SOURCE_FORMAT_HTML":
44
+ return TableSourceFormat.TABLE_SOURCE_FORMAT_HTML;
45
+ case 5:
46
+ case "TABLE_SOURCE_FORMAT_PDF":
47
+ return TableSourceFormat.TABLE_SOURCE_FORMAT_PDF;
48
+ case 6:
49
+ case "TABLE_SOURCE_FORMAT_OTHER":
50
+ return TableSourceFormat.TABLE_SOURCE_FORMAT_OTHER;
51
+ case -1:
52
+ case "UNRECOGNIZED":
53
+ default:
54
+ return TableSourceFormat.UNRECOGNIZED;
55
+ }
56
+ }
57
+ function tableSourceFormatToJSON(object) {
58
+ switch (object) {
59
+ case TableSourceFormat.TABLE_SOURCE_FORMAT_UNSPECIFIED:
60
+ return "TABLE_SOURCE_FORMAT_UNSPECIFIED";
61
+ case TableSourceFormat.TABLE_SOURCE_FORMAT_CSV:
62
+ return "TABLE_SOURCE_FORMAT_CSV";
63
+ case TableSourceFormat.TABLE_SOURCE_FORMAT_TSV:
64
+ return "TABLE_SOURCE_FORMAT_TSV";
65
+ case TableSourceFormat.TABLE_SOURCE_FORMAT_XLSX:
66
+ return "TABLE_SOURCE_FORMAT_XLSX";
67
+ case TableSourceFormat.TABLE_SOURCE_FORMAT_HTML:
68
+ return "TABLE_SOURCE_FORMAT_HTML";
69
+ case TableSourceFormat.TABLE_SOURCE_FORMAT_PDF:
70
+ return "TABLE_SOURCE_FORMAT_PDF";
71
+ case TableSourceFormat.TABLE_SOURCE_FORMAT_OTHER:
72
+ return "TABLE_SOURCE_FORMAT_OTHER";
73
+ case TableSourceFormat.UNRECOGNIZED:
74
+ default:
75
+ return "UNRECOGNIZED";
76
+ }
77
+ }
78
+ function createBaseDocumentTableColumn() {
79
+ return {
80
+ id: "",
81
+ tableId: "",
82
+ ordinal: 0,
83
+ name: "",
84
+ sourceName: "",
85
+ dataType: "",
86
+ semanticType: "",
87
+ unit: "",
88
+ description: "",
89
+ nullable: false,
90
+ confidence: 0,
91
+ metadata: undefined,
92
+ };
93
+ }
94
+ exports.DocumentTableColumn = {
95
+ encode(message, writer = new wire_1.BinaryWriter()) {
96
+ if (message.id !== "") {
97
+ writer.uint32(10).string(message.id);
98
+ }
99
+ if (message.tableId !== "") {
100
+ writer.uint32(18).string(message.tableId);
101
+ }
102
+ if (message.ordinal !== 0) {
103
+ writer.uint32(24).int32(message.ordinal);
104
+ }
105
+ if (message.name !== "") {
106
+ writer.uint32(34).string(message.name);
107
+ }
108
+ if (message.sourceName !== "") {
109
+ writer.uint32(42).string(message.sourceName);
110
+ }
111
+ if (message.dataType !== "") {
112
+ writer.uint32(50).string(message.dataType);
113
+ }
114
+ if (message.semanticType !== "") {
115
+ writer.uint32(58).string(message.semanticType);
116
+ }
117
+ if (message.unit !== "") {
118
+ writer.uint32(66).string(message.unit);
119
+ }
120
+ if (message.description !== "") {
121
+ writer.uint32(74).string(message.description);
122
+ }
123
+ if (message.nullable !== false) {
124
+ writer.uint32(80).bool(message.nullable);
125
+ }
126
+ if (message.confidence !== 0) {
127
+ writer.uint32(93).float(message.confidence);
128
+ }
129
+ if (message.metadata !== undefined) {
130
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.metadata), writer.uint32(98).fork()).join();
131
+ }
132
+ return writer;
133
+ },
134
+ decode(input, length) {
135
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
136
+ const end = length === undefined ? reader.len : reader.pos + length;
137
+ const message = createBaseDocumentTableColumn();
138
+ while (reader.pos < end) {
139
+ const tag = reader.uint32();
140
+ switch (tag >>> 3) {
141
+ case 1: {
142
+ if (tag !== 10) {
143
+ break;
144
+ }
145
+ message.id = reader.string();
146
+ continue;
147
+ }
148
+ case 2: {
149
+ if (tag !== 18) {
150
+ break;
151
+ }
152
+ message.tableId = reader.string();
153
+ continue;
154
+ }
155
+ case 3: {
156
+ if (tag !== 24) {
157
+ break;
158
+ }
159
+ message.ordinal = reader.int32();
160
+ continue;
161
+ }
162
+ case 4: {
163
+ if (tag !== 34) {
164
+ break;
165
+ }
166
+ message.name = reader.string();
167
+ continue;
168
+ }
169
+ case 5: {
170
+ if (tag !== 42) {
171
+ break;
172
+ }
173
+ message.sourceName = reader.string();
174
+ continue;
175
+ }
176
+ case 6: {
177
+ if (tag !== 50) {
178
+ break;
179
+ }
180
+ message.dataType = reader.string();
181
+ continue;
182
+ }
183
+ case 7: {
184
+ if (tag !== 58) {
185
+ break;
186
+ }
187
+ message.semanticType = reader.string();
188
+ continue;
189
+ }
190
+ case 8: {
191
+ if (tag !== 66) {
192
+ break;
193
+ }
194
+ message.unit = reader.string();
195
+ continue;
196
+ }
197
+ case 9: {
198
+ if (tag !== 74) {
199
+ break;
200
+ }
201
+ message.description = reader.string();
202
+ continue;
203
+ }
204
+ case 10: {
205
+ if (tag !== 80) {
206
+ break;
207
+ }
208
+ message.nullable = reader.bool();
209
+ continue;
210
+ }
211
+ case 11: {
212
+ if (tag !== 93) {
213
+ break;
214
+ }
215
+ message.confidence = reader.float();
216
+ continue;
217
+ }
218
+ case 12: {
219
+ if (tag !== 98) {
220
+ break;
221
+ }
222
+ message.metadata = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
223
+ continue;
224
+ }
225
+ }
226
+ if ((tag & 7) === 4 || tag === 0) {
227
+ break;
228
+ }
229
+ reader.skip(tag & 7);
230
+ }
231
+ return message;
232
+ },
233
+ fromJSON(object) {
234
+ return {
235
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
236
+ tableId: isSet(object.tableId)
237
+ ? globalThis.String(object.tableId)
238
+ : isSet(object.table_id)
239
+ ? globalThis.String(object.table_id)
240
+ : "",
241
+ ordinal: isSet(object.ordinal) ? globalThis.Number(object.ordinal) : 0,
242
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
243
+ sourceName: isSet(object.sourceName)
244
+ ? globalThis.String(object.sourceName)
245
+ : isSet(object.source_name)
246
+ ? globalThis.String(object.source_name)
247
+ : "",
248
+ dataType: isSet(object.dataType)
249
+ ? globalThis.String(object.dataType)
250
+ : isSet(object.data_type)
251
+ ? globalThis.String(object.data_type)
252
+ : "",
253
+ semanticType: isSet(object.semanticType)
254
+ ? globalThis.String(object.semanticType)
255
+ : isSet(object.semantic_type)
256
+ ? globalThis.String(object.semantic_type)
257
+ : "",
258
+ unit: isSet(object.unit) ? globalThis.String(object.unit) : "",
259
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
260
+ nullable: isSet(object.nullable) ? globalThis.Boolean(object.nullable) : false,
261
+ confidence: isSet(object.confidence) ? globalThis.Number(object.confidence) : 0,
262
+ metadata: isObject(object.metadata) ? object.metadata : undefined,
263
+ };
264
+ },
265
+ toJSON(message) {
266
+ const obj = {};
267
+ if (message.id !== "") {
268
+ obj.id = message.id;
269
+ }
270
+ if (message.tableId !== "") {
271
+ obj.tableId = message.tableId;
272
+ }
273
+ if (message.ordinal !== 0) {
274
+ obj.ordinal = Math.round(message.ordinal);
275
+ }
276
+ if (message.name !== "") {
277
+ obj.name = message.name;
278
+ }
279
+ if (message.sourceName !== "") {
280
+ obj.sourceName = message.sourceName;
281
+ }
282
+ if (message.dataType !== "") {
283
+ obj.dataType = message.dataType;
284
+ }
285
+ if (message.semanticType !== "") {
286
+ obj.semanticType = message.semanticType;
287
+ }
288
+ if (message.unit !== "") {
289
+ obj.unit = message.unit;
290
+ }
291
+ if (message.description !== "") {
292
+ obj.description = message.description;
293
+ }
294
+ if (message.nullable !== false) {
295
+ obj.nullable = message.nullable;
296
+ }
297
+ if (message.confidence !== 0) {
298
+ obj.confidence = message.confidence;
299
+ }
300
+ if (message.metadata !== undefined) {
301
+ obj.metadata = message.metadata;
302
+ }
303
+ return obj;
304
+ },
305
+ create(base) {
306
+ return exports.DocumentTableColumn.fromPartial(base !== null && base !== void 0 ? base : {});
307
+ },
308
+ fromPartial(object) {
309
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
310
+ const message = createBaseDocumentTableColumn();
311
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
312
+ message.tableId = (_b = object.tableId) !== null && _b !== void 0 ? _b : "";
313
+ message.ordinal = (_c = object.ordinal) !== null && _c !== void 0 ? _c : 0;
314
+ message.name = (_d = object.name) !== null && _d !== void 0 ? _d : "";
315
+ message.sourceName = (_e = object.sourceName) !== null && _e !== void 0 ? _e : "";
316
+ message.dataType = (_f = object.dataType) !== null && _f !== void 0 ? _f : "";
317
+ message.semanticType = (_g = object.semanticType) !== null && _g !== void 0 ? _g : "";
318
+ message.unit = (_h = object.unit) !== null && _h !== void 0 ? _h : "";
319
+ message.description = (_j = object.description) !== null && _j !== void 0 ? _j : "";
320
+ message.nullable = (_k = object.nullable) !== null && _k !== void 0 ? _k : false;
321
+ message.confidence = (_l = object.confidence) !== null && _l !== void 0 ? _l : 0;
322
+ message.metadata = (_m = object.metadata) !== null && _m !== void 0 ? _m : undefined;
323
+ return message;
324
+ },
325
+ };
326
+ function createBaseDocumentTable() {
327
+ return {
328
+ id: "",
329
+ organizationId: "",
330
+ documentId: "",
331
+ name: "",
332
+ description: "",
333
+ summary: "",
334
+ sourceFormat: 0,
335
+ parserName: "",
336
+ tableVersion: 0,
337
+ active: false,
338
+ artifactId: "",
339
+ artifactVersion: 0,
340
+ safeTableAlias: "",
341
+ rowCount: 0,
342
+ columnCount: 0,
343
+ artifactScopeKind: "",
344
+ artifactScopeKey: "",
345
+ authorizationSnapshot: undefined,
346
+ sourceLocation: undefined,
347
+ columns: [],
348
+ metadata: undefined,
349
+ createdAt: undefined,
350
+ updatedAt: undefined,
351
+ };
352
+ }
353
+ exports.DocumentTable = {
354
+ encode(message, writer = new wire_1.BinaryWriter()) {
355
+ if (message.id !== "") {
356
+ writer.uint32(10).string(message.id);
357
+ }
358
+ if (message.organizationId !== "") {
359
+ writer.uint32(18).string(message.organizationId);
360
+ }
361
+ if (message.documentId !== "") {
362
+ writer.uint32(26).string(message.documentId);
363
+ }
364
+ if (message.name !== "") {
365
+ writer.uint32(34).string(message.name);
366
+ }
367
+ if (message.description !== "") {
368
+ writer.uint32(42).string(message.description);
369
+ }
370
+ if (message.summary !== "") {
371
+ writer.uint32(50).string(message.summary);
372
+ }
373
+ if (message.sourceFormat !== 0) {
374
+ writer.uint32(56).int32(message.sourceFormat);
375
+ }
376
+ if (message.parserName !== "") {
377
+ writer.uint32(66).string(message.parserName);
378
+ }
379
+ if (message.tableVersion !== 0) {
380
+ writer.uint32(72).int32(message.tableVersion);
381
+ }
382
+ if (message.active !== false) {
383
+ writer.uint32(80).bool(message.active);
384
+ }
385
+ if (message.artifactId !== "") {
386
+ writer.uint32(90).string(message.artifactId);
387
+ }
388
+ if (message.artifactVersion !== 0) {
389
+ writer.uint32(96).int32(message.artifactVersion);
390
+ }
391
+ if (message.safeTableAlias !== "") {
392
+ writer.uint32(106).string(message.safeTableAlias);
393
+ }
394
+ if (message.rowCount !== 0) {
395
+ writer.uint32(112).int64(message.rowCount);
396
+ }
397
+ if (message.columnCount !== 0) {
398
+ writer.uint32(120).int32(message.columnCount);
399
+ }
400
+ if (message.artifactScopeKind !== "") {
401
+ writer.uint32(130).string(message.artifactScopeKind);
402
+ }
403
+ if (message.artifactScopeKey !== "") {
404
+ writer.uint32(138).string(message.artifactScopeKey);
405
+ }
406
+ if (message.authorizationSnapshot !== undefined) {
407
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.authorizationSnapshot), writer.uint32(146).fork()).join();
408
+ }
409
+ if (message.sourceLocation !== undefined) {
410
+ ingestion_pb_1.SourceLocation.encode(message.sourceLocation, writer.uint32(154).fork()).join();
411
+ }
412
+ for (const v of message.columns) {
413
+ exports.DocumentTableColumn.encode(v, writer.uint32(162).fork()).join();
414
+ }
415
+ if (message.metadata !== undefined) {
416
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.metadata), writer.uint32(186).fork()).join();
417
+ }
418
+ if (message.createdAt !== undefined) {
419
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(194).fork()).join();
420
+ }
421
+ if (message.updatedAt !== undefined) {
422
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(202).fork()).join();
423
+ }
424
+ return writer;
425
+ },
426
+ decode(input, length) {
427
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
428
+ const end = length === undefined ? reader.len : reader.pos + length;
429
+ const message = createBaseDocumentTable();
430
+ while (reader.pos < end) {
431
+ const tag = reader.uint32();
432
+ switch (tag >>> 3) {
433
+ case 1: {
434
+ if (tag !== 10) {
435
+ break;
436
+ }
437
+ message.id = reader.string();
438
+ continue;
439
+ }
440
+ case 2: {
441
+ if (tag !== 18) {
442
+ break;
443
+ }
444
+ message.organizationId = reader.string();
445
+ continue;
446
+ }
447
+ case 3: {
448
+ if (tag !== 26) {
449
+ break;
450
+ }
451
+ message.documentId = reader.string();
452
+ continue;
453
+ }
454
+ case 4: {
455
+ if (tag !== 34) {
456
+ break;
457
+ }
458
+ message.name = reader.string();
459
+ continue;
460
+ }
461
+ case 5: {
462
+ if (tag !== 42) {
463
+ break;
464
+ }
465
+ message.description = reader.string();
466
+ continue;
467
+ }
468
+ case 6: {
469
+ if (tag !== 50) {
470
+ break;
471
+ }
472
+ message.summary = reader.string();
473
+ continue;
474
+ }
475
+ case 7: {
476
+ if (tag !== 56) {
477
+ break;
478
+ }
479
+ message.sourceFormat = reader.int32();
480
+ continue;
481
+ }
482
+ case 8: {
483
+ if (tag !== 66) {
484
+ break;
485
+ }
486
+ message.parserName = reader.string();
487
+ continue;
488
+ }
489
+ case 9: {
490
+ if (tag !== 72) {
491
+ break;
492
+ }
493
+ message.tableVersion = reader.int32();
494
+ continue;
495
+ }
496
+ case 10: {
497
+ if (tag !== 80) {
498
+ break;
499
+ }
500
+ message.active = reader.bool();
501
+ continue;
502
+ }
503
+ case 11: {
504
+ if (tag !== 90) {
505
+ break;
506
+ }
507
+ message.artifactId = reader.string();
508
+ continue;
509
+ }
510
+ case 12: {
511
+ if (tag !== 96) {
512
+ break;
513
+ }
514
+ message.artifactVersion = reader.int32();
515
+ continue;
516
+ }
517
+ case 13: {
518
+ if (tag !== 106) {
519
+ break;
520
+ }
521
+ message.safeTableAlias = reader.string();
522
+ continue;
523
+ }
524
+ case 14: {
525
+ if (tag !== 112) {
526
+ break;
527
+ }
528
+ message.rowCount = longToNumber(reader.int64());
529
+ continue;
530
+ }
531
+ case 15: {
532
+ if (tag !== 120) {
533
+ break;
534
+ }
535
+ message.columnCount = reader.int32();
536
+ continue;
537
+ }
538
+ case 16: {
539
+ if (tag !== 130) {
540
+ break;
541
+ }
542
+ message.artifactScopeKind = reader.string();
543
+ continue;
544
+ }
545
+ case 17: {
546
+ if (tag !== 138) {
547
+ break;
548
+ }
549
+ message.artifactScopeKey = reader.string();
550
+ continue;
551
+ }
552
+ case 18: {
553
+ if (tag !== 146) {
554
+ break;
555
+ }
556
+ message.authorizationSnapshot = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
557
+ continue;
558
+ }
559
+ case 19: {
560
+ if (tag !== 154) {
561
+ break;
562
+ }
563
+ message.sourceLocation = ingestion_pb_1.SourceLocation.decode(reader, reader.uint32());
564
+ continue;
565
+ }
566
+ case 20: {
567
+ if (tag !== 162) {
568
+ break;
569
+ }
570
+ message.columns.push(exports.DocumentTableColumn.decode(reader, reader.uint32()));
571
+ continue;
572
+ }
573
+ case 23: {
574
+ if (tag !== 186) {
575
+ break;
576
+ }
577
+ message.metadata = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
578
+ continue;
579
+ }
580
+ case 24: {
581
+ if (tag !== 194) {
582
+ break;
583
+ }
584
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
585
+ continue;
586
+ }
587
+ case 25: {
588
+ if (tag !== 202) {
589
+ break;
590
+ }
591
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
592
+ continue;
593
+ }
594
+ }
595
+ if ((tag & 7) === 4 || tag === 0) {
596
+ break;
597
+ }
598
+ reader.skip(tag & 7);
599
+ }
600
+ return message;
601
+ },
602
+ fromJSON(object) {
603
+ return {
604
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
605
+ organizationId: isSet(object.organizationId)
606
+ ? globalThis.String(object.organizationId)
607
+ : isSet(object.organization_id)
608
+ ? globalThis.String(object.organization_id)
609
+ : "",
610
+ documentId: isSet(object.documentId)
611
+ ? globalThis.String(object.documentId)
612
+ : isSet(object.document_id)
613
+ ? globalThis.String(object.document_id)
614
+ : "",
615
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
616
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
617
+ summary: isSet(object.summary) ? globalThis.String(object.summary) : "",
618
+ sourceFormat: isSet(object.sourceFormat)
619
+ ? tableSourceFormatFromJSON(object.sourceFormat)
620
+ : isSet(object.source_format)
621
+ ? tableSourceFormatFromJSON(object.source_format)
622
+ : 0,
623
+ parserName: isSet(object.parserName)
624
+ ? globalThis.String(object.parserName)
625
+ : isSet(object.parser_name)
626
+ ? globalThis.String(object.parser_name)
627
+ : "",
628
+ tableVersion: isSet(object.tableVersion)
629
+ ? globalThis.Number(object.tableVersion)
630
+ : isSet(object.table_version)
631
+ ? globalThis.Number(object.table_version)
632
+ : 0,
633
+ active: isSet(object.active) ? globalThis.Boolean(object.active) : false,
634
+ artifactId: isSet(object.artifactId)
635
+ ? globalThis.String(object.artifactId)
636
+ : isSet(object.artifact_id)
637
+ ? globalThis.String(object.artifact_id)
638
+ : "",
639
+ artifactVersion: isSet(object.artifactVersion)
640
+ ? globalThis.Number(object.artifactVersion)
641
+ : isSet(object.artifact_version)
642
+ ? globalThis.Number(object.artifact_version)
643
+ : 0,
644
+ safeTableAlias: isSet(object.safeTableAlias)
645
+ ? globalThis.String(object.safeTableAlias)
646
+ : isSet(object.safe_table_alias)
647
+ ? globalThis.String(object.safe_table_alias)
648
+ : "",
649
+ rowCount: isSet(object.rowCount)
650
+ ? globalThis.Number(object.rowCount)
651
+ : isSet(object.row_count)
652
+ ? globalThis.Number(object.row_count)
653
+ : 0,
654
+ columnCount: isSet(object.columnCount)
655
+ ? globalThis.Number(object.columnCount)
656
+ : isSet(object.column_count)
657
+ ? globalThis.Number(object.column_count)
658
+ : 0,
659
+ artifactScopeKind: isSet(object.artifactScopeKind)
660
+ ? globalThis.String(object.artifactScopeKind)
661
+ : isSet(object.artifact_scope_kind)
662
+ ? globalThis.String(object.artifact_scope_kind)
663
+ : "",
664
+ artifactScopeKey: isSet(object.artifactScopeKey)
665
+ ? globalThis.String(object.artifactScopeKey)
666
+ : isSet(object.artifact_scope_key)
667
+ ? globalThis.String(object.artifact_scope_key)
668
+ : "",
669
+ authorizationSnapshot: isObject(object.authorizationSnapshot)
670
+ ? object.authorizationSnapshot
671
+ : isObject(object.authorization_snapshot)
672
+ ? object.authorization_snapshot
673
+ : undefined,
674
+ sourceLocation: isSet(object.sourceLocation)
675
+ ? ingestion_pb_1.SourceLocation.fromJSON(object.sourceLocation)
676
+ : isSet(object.source_location)
677
+ ? ingestion_pb_1.SourceLocation.fromJSON(object.source_location)
678
+ : undefined,
679
+ columns: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.columns)
680
+ ? object.columns.map((e) => exports.DocumentTableColumn.fromJSON(e))
681
+ : [],
682
+ metadata: isObject(object.metadata) ? object.metadata : undefined,
683
+ createdAt: isSet(object.createdAt)
684
+ ? fromJsonTimestamp(object.createdAt)
685
+ : isSet(object.created_at)
686
+ ? fromJsonTimestamp(object.created_at)
687
+ : undefined,
688
+ updatedAt: isSet(object.updatedAt)
689
+ ? fromJsonTimestamp(object.updatedAt)
690
+ : isSet(object.updated_at)
691
+ ? fromJsonTimestamp(object.updated_at)
692
+ : undefined,
693
+ };
694
+ },
695
+ toJSON(message) {
696
+ var _a;
697
+ const obj = {};
698
+ if (message.id !== "") {
699
+ obj.id = message.id;
700
+ }
701
+ if (message.organizationId !== "") {
702
+ obj.organizationId = message.organizationId;
703
+ }
704
+ if (message.documentId !== "") {
705
+ obj.documentId = message.documentId;
706
+ }
707
+ if (message.name !== "") {
708
+ obj.name = message.name;
709
+ }
710
+ if (message.description !== "") {
711
+ obj.description = message.description;
712
+ }
713
+ if (message.summary !== "") {
714
+ obj.summary = message.summary;
715
+ }
716
+ if (message.sourceFormat !== 0) {
717
+ obj.sourceFormat = tableSourceFormatToJSON(message.sourceFormat);
718
+ }
719
+ if (message.parserName !== "") {
720
+ obj.parserName = message.parserName;
721
+ }
722
+ if (message.tableVersion !== 0) {
723
+ obj.tableVersion = Math.round(message.tableVersion);
724
+ }
725
+ if (message.active !== false) {
726
+ obj.active = message.active;
727
+ }
728
+ if (message.artifactId !== "") {
729
+ obj.artifactId = message.artifactId;
730
+ }
731
+ if (message.artifactVersion !== 0) {
732
+ obj.artifactVersion = Math.round(message.artifactVersion);
733
+ }
734
+ if (message.safeTableAlias !== "") {
735
+ obj.safeTableAlias = message.safeTableAlias;
736
+ }
737
+ if (message.rowCount !== 0) {
738
+ obj.rowCount = Math.round(message.rowCount);
739
+ }
740
+ if (message.columnCount !== 0) {
741
+ obj.columnCount = Math.round(message.columnCount);
742
+ }
743
+ if (message.artifactScopeKind !== "") {
744
+ obj.artifactScopeKind = message.artifactScopeKind;
745
+ }
746
+ if (message.artifactScopeKey !== "") {
747
+ obj.artifactScopeKey = message.artifactScopeKey;
748
+ }
749
+ if (message.authorizationSnapshot !== undefined) {
750
+ obj.authorizationSnapshot = message.authorizationSnapshot;
751
+ }
752
+ if (message.sourceLocation !== undefined) {
753
+ obj.sourceLocation = ingestion_pb_1.SourceLocation.toJSON(message.sourceLocation);
754
+ }
755
+ if ((_a = message.columns) === null || _a === void 0 ? void 0 : _a.length) {
756
+ obj.columns = message.columns.map((e) => exports.DocumentTableColumn.toJSON(e));
757
+ }
758
+ if (message.metadata !== undefined) {
759
+ obj.metadata = message.metadata;
760
+ }
761
+ if (message.createdAt !== undefined) {
762
+ obj.createdAt = message.createdAt.toISOString();
763
+ }
764
+ if (message.updatedAt !== undefined) {
765
+ obj.updatedAt = message.updatedAt.toISOString();
766
+ }
767
+ return obj;
768
+ },
769
+ create(base) {
770
+ return exports.DocumentTable.fromPartial(base !== null && base !== void 0 ? base : {});
771
+ },
772
+ fromPartial(object) {
773
+ var _a;
774
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
775
+ const message = createBaseDocumentTable();
776
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
777
+ message.organizationId = (_c = object.organizationId) !== null && _c !== void 0 ? _c : "";
778
+ message.documentId = (_d = object.documentId) !== null && _d !== void 0 ? _d : "";
779
+ message.name = (_e = object.name) !== null && _e !== void 0 ? _e : "";
780
+ message.description = (_f = object.description) !== null && _f !== void 0 ? _f : "";
781
+ message.summary = (_g = object.summary) !== null && _g !== void 0 ? _g : "";
782
+ message.sourceFormat = (_h = object.sourceFormat) !== null && _h !== void 0 ? _h : 0;
783
+ message.parserName = (_j = object.parserName) !== null && _j !== void 0 ? _j : "";
784
+ message.tableVersion = (_k = object.tableVersion) !== null && _k !== void 0 ? _k : 0;
785
+ message.active = (_l = object.active) !== null && _l !== void 0 ? _l : false;
786
+ message.artifactId = (_m = object.artifactId) !== null && _m !== void 0 ? _m : "";
787
+ message.artifactVersion = (_o = object.artifactVersion) !== null && _o !== void 0 ? _o : 0;
788
+ message.safeTableAlias = (_p = object.safeTableAlias) !== null && _p !== void 0 ? _p : "";
789
+ message.rowCount = (_q = object.rowCount) !== null && _q !== void 0 ? _q : 0;
790
+ message.columnCount = (_r = object.columnCount) !== null && _r !== void 0 ? _r : 0;
791
+ message.artifactScopeKind = (_s = object.artifactScopeKind) !== null && _s !== void 0 ? _s : "";
792
+ message.artifactScopeKey = (_t = object.artifactScopeKey) !== null && _t !== void 0 ? _t : "";
793
+ message.authorizationSnapshot = (_u = object.authorizationSnapshot) !== null && _u !== void 0 ? _u : undefined;
794
+ message.sourceLocation = (object.sourceLocation !== undefined && object.sourceLocation !== null)
795
+ ? ingestion_pb_1.SourceLocation.fromPartial(object.sourceLocation)
796
+ : undefined;
797
+ message.columns = ((_a = object.columns) === null || _a === void 0 ? void 0 : _a.map((e) => exports.DocumentTableColumn.fromPartial(e))) || [];
798
+ message.metadata = (_v = object.metadata) !== null && _v !== void 0 ? _v : undefined;
799
+ message.createdAt = (_w = object.createdAt) !== null && _w !== void 0 ? _w : undefined;
800
+ message.updatedAt = (_x = object.updatedAt) !== null && _x !== void 0 ? _x : undefined;
801
+ return message;
802
+ },
803
+ };
804
+ function createBaseThreadTableLink() {
805
+ return {
806
+ threadId: "",
807
+ documentId: "",
808
+ tableId: "",
809
+ artifactId: "",
810
+ artifactVersion: 0,
811
+ tableName: "",
812
+ tableSummary: "",
813
+ safeTableAlias: "",
814
+ sourceLocation: undefined,
815
+ authorizationSnapshot: undefined,
816
+ };
817
+ }
818
+ exports.ThreadTableLink = {
819
+ encode(message, writer = new wire_1.BinaryWriter()) {
820
+ if (message.threadId !== "") {
821
+ writer.uint32(10).string(message.threadId);
822
+ }
823
+ if (message.documentId !== "") {
824
+ writer.uint32(18).string(message.documentId);
825
+ }
826
+ if (message.tableId !== "") {
827
+ writer.uint32(26).string(message.tableId);
828
+ }
829
+ if (message.artifactId !== "") {
830
+ writer.uint32(34).string(message.artifactId);
831
+ }
832
+ if (message.artifactVersion !== 0) {
833
+ writer.uint32(40).int32(message.artifactVersion);
834
+ }
835
+ if (message.tableName !== "") {
836
+ writer.uint32(50).string(message.tableName);
837
+ }
838
+ if (message.tableSummary !== "") {
839
+ writer.uint32(58).string(message.tableSummary);
840
+ }
841
+ if (message.safeTableAlias !== "") {
842
+ writer.uint32(66).string(message.safeTableAlias);
843
+ }
844
+ if (message.sourceLocation !== undefined) {
845
+ ingestion_pb_1.SourceLocation.encode(message.sourceLocation, writer.uint32(74).fork()).join();
846
+ }
847
+ if (message.authorizationSnapshot !== undefined) {
848
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.authorizationSnapshot), writer.uint32(82).fork()).join();
849
+ }
850
+ return writer;
851
+ },
852
+ decode(input, length) {
853
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
854
+ const end = length === undefined ? reader.len : reader.pos + length;
855
+ const message = createBaseThreadTableLink();
856
+ while (reader.pos < end) {
857
+ const tag = reader.uint32();
858
+ switch (tag >>> 3) {
859
+ case 1: {
860
+ if (tag !== 10) {
861
+ break;
862
+ }
863
+ message.threadId = reader.string();
864
+ continue;
865
+ }
866
+ case 2: {
867
+ if (tag !== 18) {
868
+ break;
869
+ }
870
+ message.documentId = reader.string();
871
+ continue;
872
+ }
873
+ case 3: {
874
+ if (tag !== 26) {
875
+ break;
876
+ }
877
+ message.tableId = reader.string();
878
+ continue;
879
+ }
880
+ case 4: {
881
+ if (tag !== 34) {
882
+ break;
883
+ }
884
+ message.artifactId = reader.string();
885
+ continue;
886
+ }
887
+ case 5: {
888
+ if (tag !== 40) {
889
+ break;
890
+ }
891
+ message.artifactVersion = reader.int32();
892
+ continue;
893
+ }
894
+ case 6: {
895
+ if (tag !== 50) {
896
+ break;
897
+ }
898
+ message.tableName = reader.string();
899
+ continue;
900
+ }
901
+ case 7: {
902
+ if (tag !== 58) {
903
+ break;
904
+ }
905
+ message.tableSummary = reader.string();
906
+ continue;
907
+ }
908
+ case 8: {
909
+ if (tag !== 66) {
910
+ break;
911
+ }
912
+ message.safeTableAlias = reader.string();
913
+ continue;
914
+ }
915
+ case 9: {
916
+ if (tag !== 74) {
917
+ break;
918
+ }
919
+ message.sourceLocation = ingestion_pb_1.SourceLocation.decode(reader, reader.uint32());
920
+ continue;
921
+ }
922
+ case 10: {
923
+ if (tag !== 82) {
924
+ break;
925
+ }
926
+ message.authorizationSnapshot = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
927
+ continue;
928
+ }
929
+ }
930
+ if ((tag & 7) === 4 || tag === 0) {
931
+ break;
932
+ }
933
+ reader.skip(tag & 7);
934
+ }
935
+ return message;
936
+ },
937
+ fromJSON(object) {
938
+ return {
939
+ threadId: isSet(object.threadId)
940
+ ? globalThis.String(object.threadId)
941
+ : isSet(object.thread_id)
942
+ ? globalThis.String(object.thread_id)
943
+ : "",
944
+ documentId: isSet(object.documentId)
945
+ ? globalThis.String(object.documentId)
946
+ : isSet(object.document_id)
947
+ ? globalThis.String(object.document_id)
948
+ : "",
949
+ tableId: isSet(object.tableId)
950
+ ? globalThis.String(object.tableId)
951
+ : isSet(object.table_id)
952
+ ? globalThis.String(object.table_id)
953
+ : "",
954
+ artifactId: isSet(object.artifactId)
955
+ ? globalThis.String(object.artifactId)
956
+ : isSet(object.artifact_id)
957
+ ? globalThis.String(object.artifact_id)
958
+ : "",
959
+ artifactVersion: isSet(object.artifactVersion)
960
+ ? globalThis.Number(object.artifactVersion)
961
+ : isSet(object.artifact_version)
962
+ ? globalThis.Number(object.artifact_version)
963
+ : 0,
964
+ tableName: isSet(object.tableName)
965
+ ? globalThis.String(object.tableName)
966
+ : isSet(object.table_name)
967
+ ? globalThis.String(object.table_name)
968
+ : "",
969
+ tableSummary: isSet(object.tableSummary)
970
+ ? globalThis.String(object.tableSummary)
971
+ : isSet(object.table_summary)
972
+ ? globalThis.String(object.table_summary)
973
+ : "",
974
+ safeTableAlias: isSet(object.safeTableAlias)
975
+ ? globalThis.String(object.safeTableAlias)
976
+ : isSet(object.safe_table_alias)
977
+ ? globalThis.String(object.safe_table_alias)
978
+ : "",
979
+ sourceLocation: isSet(object.sourceLocation)
980
+ ? ingestion_pb_1.SourceLocation.fromJSON(object.sourceLocation)
981
+ : isSet(object.source_location)
982
+ ? ingestion_pb_1.SourceLocation.fromJSON(object.source_location)
983
+ : undefined,
984
+ authorizationSnapshot: isObject(object.authorizationSnapshot)
985
+ ? object.authorizationSnapshot
986
+ : isObject(object.authorization_snapshot)
987
+ ? object.authorization_snapshot
988
+ : undefined,
989
+ };
990
+ },
991
+ toJSON(message) {
992
+ const obj = {};
993
+ if (message.threadId !== "") {
994
+ obj.threadId = message.threadId;
995
+ }
996
+ if (message.documentId !== "") {
997
+ obj.documentId = message.documentId;
998
+ }
999
+ if (message.tableId !== "") {
1000
+ obj.tableId = message.tableId;
1001
+ }
1002
+ if (message.artifactId !== "") {
1003
+ obj.artifactId = message.artifactId;
1004
+ }
1005
+ if (message.artifactVersion !== 0) {
1006
+ obj.artifactVersion = Math.round(message.artifactVersion);
1007
+ }
1008
+ if (message.tableName !== "") {
1009
+ obj.tableName = message.tableName;
1010
+ }
1011
+ if (message.tableSummary !== "") {
1012
+ obj.tableSummary = message.tableSummary;
1013
+ }
1014
+ if (message.safeTableAlias !== "") {
1015
+ obj.safeTableAlias = message.safeTableAlias;
1016
+ }
1017
+ if (message.sourceLocation !== undefined) {
1018
+ obj.sourceLocation = ingestion_pb_1.SourceLocation.toJSON(message.sourceLocation);
1019
+ }
1020
+ if (message.authorizationSnapshot !== undefined) {
1021
+ obj.authorizationSnapshot = message.authorizationSnapshot;
1022
+ }
1023
+ return obj;
1024
+ },
1025
+ create(base) {
1026
+ return exports.ThreadTableLink.fromPartial(base !== null && base !== void 0 ? base : {});
1027
+ },
1028
+ fromPartial(object) {
1029
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1030
+ const message = createBaseThreadTableLink();
1031
+ message.threadId = (_a = object.threadId) !== null && _a !== void 0 ? _a : "";
1032
+ message.documentId = (_b = object.documentId) !== null && _b !== void 0 ? _b : "";
1033
+ message.tableId = (_c = object.tableId) !== null && _c !== void 0 ? _c : "";
1034
+ message.artifactId = (_d = object.artifactId) !== null && _d !== void 0 ? _d : "";
1035
+ message.artifactVersion = (_e = object.artifactVersion) !== null && _e !== void 0 ? _e : 0;
1036
+ message.tableName = (_f = object.tableName) !== null && _f !== void 0 ? _f : "";
1037
+ message.tableSummary = (_g = object.tableSummary) !== null && _g !== void 0 ? _g : "";
1038
+ message.safeTableAlias = (_h = object.safeTableAlias) !== null && _h !== void 0 ? _h : "";
1039
+ message.sourceLocation = (object.sourceLocation !== undefined && object.sourceLocation !== null)
1040
+ ? ingestion_pb_1.SourceLocation.fromPartial(object.sourceLocation)
1041
+ : undefined;
1042
+ message.authorizationSnapshot = (_j = object.authorizationSnapshot) !== null && _j !== void 0 ? _j : undefined;
1043
+ return message;
1044
+ },
1045
+ };
1046
+ function createBaseListDocumentTablesRequest() {
1047
+ return { organizationId: "", documentId: "", actingUserId: "", includeInactive: false, pageSize: 0, pageToken: "" };
1048
+ }
1049
+ exports.ListDocumentTablesRequest = {
1050
+ encode(message, writer = new wire_1.BinaryWriter()) {
1051
+ if (message.organizationId !== "") {
1052
+ writer.uint32(10).string(message.organizationId);
1053
+ }
1054
+ if (message.documentId !== "") {
1055
+ writer.uint32(18).string(message.documentId);
1056
+ }
1057
+ if (message.actingUserId !== "") {
1058
+ writer.uint32(26).string(message.actingUserId);
1059
+ }
1060
+ if (message.includeInactive !== false) {
1061
+ writer.uint32(32).bool(message.includeInactive);
1062
+ }
1063
+ if (message.pageSize !== 0) {
1064
+ writer.uint32(40).int32(message.pageSize);
1065
+ }
1066
+ if (message.pageToken !== "") {
1067
+ writer.uint32(50).string(message.pageToken);
1068
+ }
1069
+ return writer;
1070
+ },
1071
+ decode(input, length) {
1072
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1073
+ const end = length === undefined ? reader.len : reader.pos + length;
1074
+ const message = createBaseListDocumentTablesRequest();
1075
+ while (reader.pos < end) {
1076
+ const tag = reader.uint32();
1077
+ switch (tag >>> 3) {
1078
+ case 1: {
1079
+ if (tag !== 10) {
1080
+ break;
1081
+ }
1082
+ message.organizationId = reader.string();
1083
+ continue;
1084
+ }
1085
+ case 2: {
1086
+ if (tag !== 18) {
1087
+ break;
1088
+ }
1089
+ message.documentId = reader.string();
1090
+ continue;
1091
+ }
1092
+ case 3: {
1093
+ if (tag !== 26) {
1094
+ break;
1095
+ }
1096
+ message.actingUserId = reader.string();
1097
+ continue;
1098
+ }
1099
+ case 4: {
1100
+ if (tag !== 32) {
1101
+ break;
1102
+ }
1103
+ message.includeInactive = reader.bool();
1104
+ continue;
1105
+ }
1106
+ case 5: {
1107
+ if (tag !== 40) {
1108
+ break;
1109
+ }
1110
+ message.pageSize = reader.int32();
1111
+ continue;
1112
+ }
1113
+ case 6: {
1114
+ if (tag !== 50) {
1115
+ break;
1116
+ }
1117
+ message.pageToken = reader.string();
1118
+ continue;
1119
+ }
1120
+ }
1121
+ if ((tag & 7) === 4 || tag === 0) {
1122
+ break;
1123
+ }
1124
+ reader.skip(tag & 7);
1125
+ }
1126
+ return message;
1127
+ },
1128
+ fromJSON(object) {
1129
+ return {
1130
+ organizationId: isSet(object.organizationId)
1131
+ ? globalThis.String(object.organizationId)
1132
+ : isSet(object.organization_id)
1133
+ ? globalThis.String(object.organization_id)
1134
+ : "",
1135
+ documentId: isSet(object.documentId)
1136
+ ? globalThis.String(object.documentId)
1137
+ : isSet(object.document_id)
1138
+ ? globalThis.String(object.document_id)
1139
+ : "",
1140
+ actingUserId: isSet(object.actingUserId)
1141
+ ? globalThis.String(object.actingUserId)
1142
+ : isSet(object.acting_user_id)
1143
+ ? globalThis.String(object.acting_user_id)
1144
+ : "",
1145
+ includeInactive: isSet(object.includeInactive)
1146
+ ? globalThis.Boolean(object.includeInactive)
1147
+ : isSet(object.include_inactive)
1148
+ ? globalThis.Boolean(object.include_inactive)
1149
+ : false,
1150
+ pageSize: isSet(object.pageSize)
1151
+ ? globalThis.Number(object.pageSize)
1152
+ : isSet(object.page_size)
1153
+ ? globalThis.Number(object.page_size)
1154
+ : 0,
1155
+ pageToken: isSet(object.pageToken)
1156
+ ? globalThis.String(object.pageToken)
1157
+ : isSet(object.page_token)
1158
+ ? globalThis.String(object.page_token)
1159
+ : "",
1160
+ };
1161
+ },
1162
+ toJSON(message) {
1163
+ const obj = {};
1164
+ if (message.organizationId !== "") {
1165
+ obj.organizationId = message.organizationId;
1166
+ }
1167
+ if (message.documentId !== "") {
1168
+ obj.documentId = message.documentId;
1169
+ }
1170
+ if (message.actingUserId !== "") {
1171
+ obj.actingUserId = message.actingUserId;
1172
+ }
1173
+ if (message.includeInactive !== false) {
1174
+ obj.includeInactive = message.includeInactive;
1175
+ }
1176
+ if (message.pageSize !== 0) {
1177
+ obj.pageSize = Math.round(message.pageSize);
1178
+ }
1179
+ if (message.pageToken !== "") {
1180
+ obj.pageToken = message.pageToken;
1181
+ }
1182
+ return obj;
1183
+ },
1184
+ create(base) {
1185
+ return exports.ListDocumentTablesRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1186
+ },
1187
+ fromPartial(object) {
1188
+ var _a, _b, _c, _d, _e, _f;
1189
+ const message = createBaseListDocumentTablesRequest();
1190
+ message.organizationId = (_a = object.organizationId) !== null && _a !== void 0 ? _a : "";
1191
+ message.documentId = (_b = object.documentId) !== null && _b !== void 0 ? _b : "";
1192
+ message.actingUserId = (_c = object.actingUserId) !== null && _c !== void 0 ? _c : "";
1193
+ message.includeInactive = (_d = object.includeInactive) !== null && _d !== void 0 ? _d : false;
1194
+ message.pageSize = (_e = object.pageSize) !== null && _e !== void 0 ? _e : 0;
1195
+ message.pageToken = (_f = object.pageToken) !== null && _f !== void 0 ? _f : "";
1196
+ return message;
1197
+ },
1198
+ };
1199
+ function createBaseListDocumentTablesResponse() {
1200
+ return { tables: [], nextPageToken: "" };
1201
+ }
1202
+ exports.ListDocumentTablesResponse = {
1203
+ encode(message, writer = new wire_1.BinaryWriter()) {
1204
+ for (const v of message.tables) {
1205
+ exports.DocumentTable.encode(v, writer.uint32(10).fork()).join();
1206
+ }
1207
+ if (message.nextPageToken !== "") {
1208
+ writer.uint32(18).string(message.nextPageToken);
1209
+ }
1210
+ return writer;
1211
+ },
1212
+ decode(input, length) {
1213
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1214
+ const end = length === undefined ? reader.len : reader.pos + length;
1215
+ const message = createBaseListDocumentTablesResponse();
1216
+ while (reader.pos < end) {
1217
+ const tag = reader.uint32();
1218
+ switch (tag >>> 3) {
1219
+ case 1: {
1220
+ if (tag !== 10) {
1221
+ break;
1222
+ }
1223
+ message.tables.push(exports.DocumentTable.decode(reader, reader.uint32()));
1224
+ continue;
1225
+ }
1226
+ case 2: {
1227
+ if (tag !== 18) {
1228
+ break;
1229
+ }
1230
+ message.nextPageToken = reader.string();
1231
+ continue;
1232
+ }
1233
+ }
1234
+ if ((tag & 7) === 4 || tag === 0) {
1235
+ break;
1236
+ }
1237
+ reader.skip(tag & 7);
1238
+ }
1239
+ return message;
1240
+ },
1241
+ fromJSON(object) {
1242
+ return {
1243
+ tables: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.tables) ? object.tables.map((e) => exports.DocumentTable.fromJSON(e)) : [],
1244
+ nextPageToken: isSet(object.nextPageToken)
1245
+ ? globalThis.String(object.nextPageToken)
1246
+ : isSet(object.next_page_token)
1247
+ ? globalThis.String(object.next_page_token)
1248
+ : "",
1249
+ };
1250
+ },
1251
+ toJSON(message) {
1252
+ var _a;
1253
+ const obj = {};
1254
+ if ((_a = message.tables) === null || _a === void 0 ? void 0 : _a.length) {
1255
+ obj.tables = message.tables.map((e) => exports.DocumentTable.toJSON(e));
1256
+ }
1257
+ if (message.nextPageToken !== "") {
1258
+ obj.nextPageToken = message.nextPageToken;
1259
+ }
1260
+ return obj;
1261
+ },
1262
+ create(base) {
1263
+ return exports.ListDocumentTablesResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1264
+ },
1265
+ fromPartial(object) {
1266
+ var _a;
1267
+ var _b;
1268
+ const message = createBaseListDocumentTablesResponse();
1269
+ message.tables = ((_a = object.tables) === null || _a === void 0 ? void 0 : _a.map((e) => exports.DocumentTable.fromPartial(e))) || [];
1270
+ message.nextPageToken = (_b = object.nextPageToken) !== null && _b !== void 0 ? _b : "";
1271
+ return message;
1272
+ },
1273
+ };
1274
+ function createBaseGetDocumentTableRequest() {
1275
+ return { organizationId: "", documentId: "", tableId: "", actingUserId: "" };
1276
+ }
1277
+ exports.GetDocumentTableRequest = {
1278
+ encode(message, writer = new wire_1.BinaryWriter()) {
1279
+ if (message.organizationId !== "") {
1280
+ writer.uint32(10).string(message.organizationId);
1281
+ }
1282
+ if (message.documentId !== "") {
1283
+ writer.uint32(18).string(message.documentId);
1284
+ }
1285
+ if (message.tableId !== "") {
1286
+ writer.uint32(26).string(message.tableId);
1287
+ }
1288
+ if (message.actingUserId !== "") {
1289
+ writer.uint32(34).string(message.actingUserId);
1290
+ }
1291
+ return writer;
1292
+ },
1293
+ decode(input, length) {
1294
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1295
+ const end = length === undefined ? reader.len : reader.pos + length;
1296
+ const message = createBaseGetDocumentTableRequest();
1297
+ while (reader.pos < end) {
1298
+ const tag = reader.uint32();
1299
+ switch (tag >>> 3) {
1300
+ case 1: {
1301
+ if (tag !== 10) {
1302
+ break;
1303
+ }
1304
+ message.organizationId = reader.string();
1305
+ continue;
1306
+ }
1307
+ case 2: {
1308
+ if (tag !== 18) {
1309
+ break;
1310
+ }
1311
+ message.documentId = reader.string();
1312
+ continue;
1313
+ }
1314
+ case 3: {
1315
+ if (tag !== 26) {
1316
+ break;
1317
+ }
1318
+ message.tableId = reader.string();
1319
+ continue;
1320
+ }
1321
+ case 4: {
1322
+ if (tag !== 34) {
1323
+ break;
1324
+ }
1325
+ message.actingUserId = reader.string();
1326
+ continue;
1327
+ }
1328
+ }
1329
+ if ((tag & 7) === 4 || tag === 0) {
1330
+ break;
1331
+ }
1332
+ reader.skip(tag & 7);
1333
+ }
1334
+ return message;
1335
+ },
1336
+ fromJSON(object) {
1337
+ return {
1338
+ organizationId: isSet(object.organizationId)
1339
+ ? globalThis.String(object.organizationId)
1340
+ : isSet(object.organization_id)
1341
+ ? globalThis.String(object.organization_id)
1342
+ : "",
1343
+ documentId: isSet(object.documentId)
1344
+ ? globalThis.String(object.documentId)
1345
+ : isSet(object.document_id)
1346
+ ? globalThis.String(object.document_id)
1347
+ : "",
1348
+ tableId: isSet(object.tableId)
1349
+ ? globalThis.String(object.tableId)
1350
+ : isSet(object.table_id)
1351
+ ? globalThis.String(object.table_id)
1352
+ : "",
1353
+ actingUserId: isSet(object.actingUserId)
1354
+ ? globalThis.String(object.actingUserId)
1355
+ : isSet(object.acting_user_id)
1356
+ ? globalThis.String(object.acting_user_id)
1357
+ : "",
1358
+ };
1359
+ },
1360
+ toJSON(message) {
1361
+ const obj = {};
1362
+ if (message.organizationId !== "") {
1363
+ obj.organizationId = message.organizationId;
1364
+ }
1365
+ if (message.documentId !== "") {
1366
+ obj.documentId = message.documentId;
1367
+ }
1368
+ if (message.tableId !== "") {
1369
+ obj.tableId = message.tableId;
1370
+ }
1371
+ if (message.actingUserId !== "") {
1372
+ obj.actingUserId = message.actingUserId;
1373
+ }
1374
+ return obj;
1375
+ },
1376
+ create(base) {
1377
+ return exports.GetDocumentTableRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1378
+ },
1379
+ fromPartial(object) {
1380
+ var _a, _b, _c, _d;
1381
+ const message = createBaseGetDocumentTableRequest();
1382
+ message.organizationId = (_a = object.organizationId) !== null && _a !== void 0 ? _a : "";
1383
+ message.documentId = (_b = object.documentId) !== null && _b !== void 0 ? _b : "";
1384
+ message.tableId = (_c = object.tableId) !== null && _c !== void 0 ? _c : "";
1385
+ message.actingUserId = (_d = object.actingUserId) !== null && _d !== void 0 ? _d : "";
1386
+ return message;
1387
+ },
1388
+ };
1389
+ function createBaseGetDocumentTableResponse() {
1390
+ return { table: undefined };
1391
+ }
1392
+ exports.GetDocumentTableResponse = {
1393
+ encode(message, writer = new wire_1.BinaryWriter()) {
1394
+ if (message.table !== undefined) {
1395
+ exports.DocumentTable.encode(message.table, writer.uint32(10).fork()).join();
1396
+ }
1397
+ return writer;
1398
+ },
1399
+ decode(input, length) {
1400
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1401
+ const end = length === undefined ? reader.len : reader.pos + length;
1402
+ const message = createBaseGetDocumentTableResponse();
1403
+ while (reader.pos < end) {
1404
+ const tag = reader.uint32();
1405
+ switch (tag >>> 3) {
1406
+ case 1: {
1407
+ if (tag !== 10) {
1408
+ break;
1409
+ }
1410
+ message.table = exports.DocumentTable.decode(reader, reader.uint32());
1411
+ continue;
1412
+ }
1413
+ }
1414
+ if ((tag & 7) === 4 || tag === 0) {
1415
+ break;
1416
+ }
1417
+ reader.skip(tag & 7);
1418
+ }
1419
+ return message;
1420
+ },
1421
+ fromJSON(object) {
1422
+ return { table: isSet(object.table) ? exports.DocumentTable.fromJSON(object.table) : undefined };
1423
+ },
1424
+ toJSON(message) {
1425
+ const obj = {};
1426
+ if (message.table !== undefined) {
1427
+ obj.table = exports.DocumentTable.toJSON(message.table);
1428
+ }
1429
+ return obj;
1430
+ },
1431
+ create(base) {
1432
+ return exports.GetDocumentTableResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1433
+ },
1434
+ fromPartial(object) {
1435
+ const message = createBaseGetDocumentTableResponse();
1436
+ message.table = (object.table !== undefined && object.table !== null)
1437
+ ? exports.DocumentTable.fromPartial(object.table)
1438
+ : undefined;
1439
+ return message;
1440
+ },
1441
+ };
1442
+ function toTimestamp(date) {
1443
+ const seconds = Math.trunc(date.getTime() / 1000);
1444
+ const nanos = (date.getTime() % 1000) * 1000000;
1445
+ return { seconds, nanos };
1446
+ }
1447
+ function fromTimestamp(t) {
1448
+ let millis = (t.seconds || 0) * 1000;
1449
+ millis += (t.nanos || 0) / 1000000;
1450
+ return new globalThis.Date(millis);
1451
+ }
1452
+ function fromJsonTimestamp(o) {
1453
+ if (o instanceof globalThis.Date) {
1454
+ return o;
1455
+ }
1456
+ else if (typeof o === "string") {
1457
+ return new globalThis.Date(o);
1458
+ }
1459
+ else {
1460
+ return fromTimestamp(timestamp_pb_1.Timestamp.fromJSON(o));
1461
+ }
1462
+ }
1463
+ function longToNumber(int64) {
1464
+ const num = globalThis.Number(int64.toString());
1465
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1466
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1467
+ }
1468
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1469
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1470
+ }
1471
+ return num;
1472
+ }
1473
+ function isObject(value) {
1474
+ return typeof value === "object" && value !== null;
1475
+ }
1476
+ function isSet(value) {
1477
+ return value !== null && value !== undefined;
1478
+ }