weave-typescript 0.26.0 → 0.28.0

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