@otonoma/paranet-client 2.11.0-rc.18

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 (75) hide show
  1. package/README.md +2 -0
  2. package/dist/client.d.ts +168 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +497 -0
  5. package/dist/graphql.d.ts +8 -0
  6. package/dist/graphql.d.ts.map +1 -0
  7. package/dist/graphql.js +113 -0
  8. package/dist/index.d.ts +12 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +11 -0
  11. package/dist/pncp.d.ts +129 -0
  12. package/dist/pncp.d.ts.map +1 -0
  13. package/dist/pncp.js +100 -0
  14. package/dist/proto/broker.grpc.client.d.ts +154 -0
  15. package/dist/proto/broker.grpc.client.d.ts.map +1 -0
  16. package/dist/proto/broker.grpc.client.js +102 -0
  17. package/dist/proto/broker.grpc.d.ts +6 -0
  18. package/dist/proto/broker.grpc.d.ts.map +1 -0
  19. package/dist/proto/broker.grpc.js +32 -0
  20. package/dist/proto/broker_api.d.ts +324 -0
  21. package/dist/proto/broker_api.d.ts.map +1 -0
  22. package/dist/proto/broker_api.js +566 -0
  23. package/dist/proto/google/protobuf/descriptor.d.ts +2492 -0
  24. package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -0
  25. package/dist/proto/google/protobuf/descriptor.js +3250 -0
  26. package/dist/proto/google/protobuf/timestamp.d.ts +157 -0
  27. package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -0
  28. package/dist/proto/google/protobuf/timestamp.js +132 -0
  29. package/dist/proto/grpc/health/v1/health.client.d.ts +79 -0
  30. package/dist/proto/grpc/health/v1/health.client.d.ts.map +1 -0
  31. package/dist/proto/grpc/health/v1/health.client.js +46 -0
  32. package/dist/proto/grpc/health/v1/health.d.ts +74 -0
  33. package/dist/proto/grpc/health/v1/health.d.ts.map +1 -0
  34. package/dist/proto/grpc/health/v1/health.js +152 -0
  35. package/dist/proto/identifiers.d.ts +82 -0
  36. package/dist/proto/identifiers.d.ts.map +1 -0
  37. package/dist/proto/identifiers.js +132 -0
  38. package/dist/proto/mediums.d.ts +71 -0
  39. package/dist/proto/mediums.d.ts.map +1 -0
  40. package/dist/proto/mediums.js +120 -0
  41. package/dist/proto/observation.d.ts +287 -0
  42. package/dist/proto/observation.d.ts.map +1 -0
  43. package/dist/proto/observation.js +443 -0
  44. package/dist/proto/otonoma/common/value.d.ts +127 -0
  45. package/dist/proto/otonoma/common/value.d.ts.map +1 -0
  46. package/dist/proto/otonoma/common/value.js +248 -0
  47. package/dist/proto/pncp.d.ts +607 -0
  48. package/dist/proto/pncp.d.ts.map +1 -0
  49. package/dist/proto/pncp.js +936 -0
  50. package/dist/schema/paranet.d.ts +245 -0
  51. package/dist/schema/paranet.d.ts.map +1 -0
  52. package/dist/schema/paranet.js +7 -0
  53. package/dist/util.d.ts +5 -0
  54. package/dist/util.d.ts.map +1 -0
  55. package/dist/util.js +120 -0
  56. package/package.json +39 -0
  57. package/src/client.ts +677 -0
  58. package/src/graphql.ts +103 -0
  59. package/src/index.ts +14 -0
  60. package/src/pncp.ts +236 -0
  61. package/src/proto/broker.grpc.client.ts +193 -0
  62. package/src/proto/broker.grpc.ts +32 -0
  63. package/src/proto/broker_api.ts +778 -0
  64. package/src/proto/google/protobuf/descriptor.ts +4860 -0
  65. package/src/proto/google/protobuf/timestamp.ts +288 -0
  66. package/src/proto/grpc/health/v1/health.client.ts +106 -0
  67. package/src/proto/grpc/health/v1/health.ts +174 -0
  68. package/src/proto/identifiers.ts +176 -0
  69. package/src/proto/mediums.ts +168 -0
  70. package/src/proto/observation.ts +636 -0
  71. package/src/proto/otonoma/common/value.ts +334 -0
  72. package/src/proto/pncp.ts +1333 -0
  73. package/src/schema/paranet.ts +257 -0
  74. package/src/util.ts +129 -0
  75. package/tsconfig.json +27 -0
@@ -0,0 +1,636 @@
1
+ // @generated by protobuf-ts 2.9.4
2
+ // @generated from protobuf file "observation.proto" (package "pncp.v1", syntax proto3)
3
+ // tslint:disable
4
+ //
5
+ // Observeration related message types.
6
+ //
7
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
8
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
9
+ import { WireType } from "@protobuf-ts/runtime";
10
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
11
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
12
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
13
+ import type { PartialMessage } from "@protobuf-ts/runtime";
14
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
15
+ import { MessageType } from "@protobuf-ts/runtime";
16
+ import { ConversationId } from "./identifiers";
17
+ import { PncpCallback } from "./pncp";
18
+ import { PncpMessageKind } from "./pncp";
19
+ import { Value } from "./otonoma/common/value";
20
+ import { EntityId } from "./identifiers";
21
+ /**
22
+ * A request to begin observation. This includes general metadata as well as information around the
23
+ * observation being requested. All observation specific fields are optional and if not present will match
24
+ * all fields that correspond to that value.
25
+ *
26
+ * @generated from protobuf message pncp.v1.ObservationRequest
27
+ */
28
+ export interface ObservationRequest {
29
+ /**
30
+ * @generated from protobuf field: pncp.v1.ObservationInit body = 1;
31
+ */
32
+ body?: ObservationInit;
33
+ /**
34
+ * TODO: Figure out what to do with this one.
35
+ *
36
+ * @generated from protobuf field: optional string skill_observance = 2;
37
+ */
38
+ skillObservance?: string;
39
+ // Various metadata related fields for the request.
40
+
41
+ /**
42
+ * This is analogous to the PncpRequest.author field. See notes there for why it is required.
43
+ *
44
+ * @generated from protobuf field: pncp.v1.EntityId author = 3;
45
+ */
46
+ author?: EntityId;
47
+ /**
48
+ * @generated from protobuf field: pncp.v1.ObservationStartPoint start_point = 4;
49
+ */
50
+ startPoint: ObservationStartPoint;
51
+ /**
52
+ * Optional sequence ID, used to determine where the stream should start when start_point == OBS_START_SEQ.
53
+ * Note, that this value is a message ID.
54
+ *
55
+ * @generated from protobuf field: optional string seq_id = 5;
56
+ */
57
+ seqId?: string;
58
+ /**
59
+ * @generated from protobuf field: optional otonoma.common.Value callback = 6;
60
+ */
61
+ callback?: Value;
62
+ /**
63
+ * If this is true then the observer stream is not tracked in the ledger.
64
+ *
65
+ * @generated from protobuf field: bool untracked = 7;
66
+ */
67
+ untracked: boolean;
68
+ /**
69
+ * Optional sequence offset, used to determine where the stream should start when start_point == OBS_START_OFFSET.
70
+ * Ignored otherwise.
71
+ * This field is an offset from the end of the stream. For example, if the caller provides `20` for this value,
72
+ * the stream will begin 20 messages back in the observer stream. If there are less than 20 messages in the current
73
+ * stream, it will send all of the current messages in the stream.
74
+ *
75
+ * N.B. (implementation detail): This requires a reordering in the ledger. As such, this query should be used with
76
+ * only relatively small values (<10000) to avoid too much performance impact on the ledger.
77
+ *
78
+ * @generated from protobuf field: optional uint64 seq_offset = 8;
79
+ */
80
+ seqOffset?: bigint;
81
+ }
82
+ /**
83
+ * Fields that indicate what is being observed by an observation request.
84
+ *
85
+ * @generated from protobuf message pncp.v1.ObservationInit
86
+ */
87
+ export interface ObservationInit {
88
+ /**
89
+ * @generated from protobuf field: optional string subject = 1;
90
+ */
91
+ subject?: string;
92
+ /**
93
+ * @generated from protobuf field: optional string action = 2;
94
+ */
95
+ action?: string;
96
+ /**
97
+ * @generated from protobuf field: optional string requester = 3;
98
+ */
99
+ requester?: string;
100
+ /**
101
+ * @generated from protobuf field: optional string fulfiller = 4;
102
+ */
103
+ fulfiller?: string;
104
+ /**
105
+ * @generated from protobuf field: repeated pncp.v1.ObservationMessageFilter filters = 5;
106
+ */
107
+ filters: ObservationMessageFilter[];
108
+ /**
109
+ * @generated from protobuf field: optional string conversation_id = 6;
110
+ */
111
+ conversationId?: string; // skill_id could be a field here as well.
112
+ }
113
+ /**
114
+ * @generated from protobuf message pncp.v1.ObservationMessageFilter
115
+ */
116
+ export interface ObservationMessageFilter {
117
+ /**
118
+ * @generated from protobuf field: pncp.v1.ObservationMessageType kind = 1;
119
+ */
120
+ kind: ObservationMessageType;
121
+ /**
122
+ * if kind == PNCP then this field can be populated to further restrict the filter to specific PNCP types.
123
+ *
124
+ * @generated from protobuf field: optional pncp.v1.PncpMessageKind pncp = 2;
125
+ */
126
+ pncp?: PncpMessageKind;
127
+ }
128
+ /**
129
+ * A single observation message.
130
+ *
131
+ * @generated from protobuf message pncp.v1.ObservationCallback
132
+ */
133
+ export interface ObservationCallback {
134
+ /**
135
+ * Subject of the original skill request.
136
+ *
137
+ * @generated from protobuf field: string subject = 1;
138
+ */
139
+ subject: string;
140
+ /**
141
+ * Action of the original skill request.
142
+ *
143
+ * @generated from protobuf field: string action = 2;
144
+ */
145
+ action: string;
146
+ /**
147
+ * Requester of the conversation, not this particular message.
148
+ *
149
+ * @generated from protobuf field: pncp.v1.EntityId requester = 3;
150
+ */
151
+ requester?: EntityId;
152
+ /**
153
+ * fulfiller, if one exists.
154
+ *
155
+ * @generated from protobuf field: optional pncp.v1.EntityId fulfiller = 4;
156
+ */
157
+ fulfiller?: EntityId;
158
+ /**
159
+ * The callback message being observed.
160
+ *
161
+ * @generated from protobuf field: pncp.v1.PncpCallback message = 5;
162
+ */
163
+ message?: PncpCallback;
164
+ /**
165
+ * This is a unique ID corresponding to this observation stream.
166
+ *
167
+ * @generated from protobuf field: pncp.v1.ConversationId id = 6;
168
+ */
169
+ id?: ConversationId;
170
+ /**
171
+ * Actor that initiated this stream.
172
+ *
173
+ * @generated from protobuf field: pncp.v1.EntityId author = 7;
174
+ */
175
+ author?: EntityId;
176
+ /**
177
+ * Optional callback data used to identify this stream.
178
+ *
179
+ * @generated from protobuf field: optional otonoma.common.Value callback = 8;
180
+ */
181
+ callback?: Value;
182
+ /**
183
+ * The previous message ID, used for sequencing.
184
+ *
185
+ * @generated from protobuf field: optional string prev_mid = 9;
186
+ */
187
+ prevMid?: string;
188
+ /**
189
+ * @generated from protobuf field: pncp.v1.EntityId skill_id = 10;
190
+ */
191
+ skillId?: EntityId;
192
+ }
193
+ /**
194
+ * Wrapper around observations used for allowing us to send different message types in the future, or no
195
+ * message for keep alive purposes.
196
+ *
197
+ * @generated from protobuf message pncp.v1.ObservationMessageWrapper
198
+ */
199
+ export interface ObservationMessageWrapper {
200
+ /**
201
+ * @generated from protobuf field: pncp.v1.ObservationCallback body = 1;
202
+ */
203
+ body?: ObservationCallback;
204
+ }
205
+ /**
206
+ * @generated from protobuf enum pncp.v1.ObservationMessageType
207
+ */
208
+ export enum ObservationMessageType {
209
+ /**
210
+ * @generated from protobuf enum value: OBS_MESSAGE_TYPE_SKILL = 0;
211
+ */
212
+ OBS_MESSAGE_TYPE_SKILL = 0,
213
+ /**
214
+ * @generated from protobuf enum value: OBS_MESSAGE_TYPE_PNCP = 1;
215
+ */
216
+ OBS_MESSAGE_TYPE_PNCP = 1
217
+ }
218
+ /**
219
+ * @generated from protobuf enum pncp.v1.ObservationStartPoint
220
+ */
221
+ export enum ObservationStartPoint {
222
+ /**
223
+ * The default choice, begin at the current head of the stream.
224
+ *
225
+ * @generated from protobuf enum value: OBS_START_HEAD = 0;
226
+ */
227
+ OBS_START_HEAD = 0,
228
+ /**
229
+ * Begin at the last sequence point, determined by the corresponding field.
230
+ *
231
+ * @generated from protobuf enum value: OBS_START_SEQ = 1;
232
+ */
233
+ OBS_START_SEQ = 1,
234
+ /**
235
+ * Start from the beginning of the stream.
236
+ *
237
+ * @generated from protobuf enum value: OBS_START_BEGINNING = 2;
238
+ */
239
+ OBS_START_BEGINNING = 2,
240
+ /**
241
+ * Start from the offset provided, determined by the corresponding field.
242
+ *
243
+ * @generated from protobuf enum value: OBS_START_OFFSET = 3;
244
+ */
245
+ OBS_START_OFFSET = 3
246
+ }
247
+ // @generated message type with reflection information, may provide speed optimized methods
248
+ class ObservationRequest$Type extends MessageType<ObservationRequest> {
249
+ constructor() {
250
+ super("pncp.v1.ObservationRequest", [
251
+ { no: 1, name: "body", kind: "message", T: () => ObservationInit },
252
+ { no: 2, name: "skill_observance", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
253
+ { no: 3, name: "author", kind: "message", T: () => EntityId },
254
+ { no: 4, name: "start_point", kind: "enum", T: () => ["pncp.v1.ObservationStartPoint", ObservationStartPoint] },
255
+ { no: 5, name: "seq_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
256
+ { no: 6, name: "callback", kind: "message", T: () => Value },
257
+ { no: 7, name: "untracked", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
258
+ { no: 8, name: "seq_offset", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }
259
+ ]);
260
+ }
261
+ create(value?: PartialMessage<ObservationRequest>): ObservationRequest {
262
+ const message = globalThis.Object.create((this.messagePrototype!));
263
+ message.startPoint = 0;
264
+ message.untracked = false;
265
+ if (value !== undefined)
266
+ reflectionMergePartial<ObservationRequest>(this, message, value);
267
+ return message;
268
+ }
269
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ObservationRequest): ObservationRequest {
270
+ let message = target ?? this.create(), end = reader.pos + length;
271
+ while (reader.pos < end) {
272
+ let [fieldNo, wireType] = reader.tag();
273
+ switch (fieldNo) {
274
+ case /* pncp.v1.ObservationInit body */ 1:
275
+ message.body = ObservationInit.internalBinaryRead(reader, reader.uint32(), options, message.body);
276
+ break;
277
+ case /* optional string skill_observance */ 2:
278
+ message.skillObservance = reader.string();
279
+ break;
280
+ case /* pncp.v1.EntityId author */ 3:
281
+ message.author = EntityId.internalBinaryRead(reader, reader.uint32(), options, message.author);
282
+ break;
283
+ case /* pncp.v1.ObservationStartPoint start_point */ 4:
284
+ message.startPoint = reader.int32();
285
+ break;
286
+ case /* optional string seq_id */ 5:
287
+ message.seqId = reader.string();
288
+ break;
289
+ case /* optional otonoma.common.Value callback */ 6:
290
+ message.callback = Value.internalBinaryRead(reader, reader.uint32(), options, message.callback);
291
+ break;
292
+ case /* bool untracked */ 7:
293
+ message.untracked = reader.bool();
294
+ break;
295
+ case /* optional uint64 seq_offset */ 8:
296
+ message.seqOffset = reader.uint64().toBigInt();
297
+ break;
298
+ default:
299
+ let u = options.readUnknownField;
300
+ if (u === "throw")
301
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
302
+ let d = reader.skip(wireType);
303
+ if (u !== false)
304
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
305
+ }
306
+ }
307
+ return message;
308
+ }
309
+ internalBinaryWrite(message: ObservationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
310
+ /* pncp.v1.ObservationInit body = 1; */
311
+ if (message.body)
312
+ ObservationInit.internalBinaryWrite(message.body, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
313
+ /* optional string skill_observance = 2; */
314
+ if (message.skillObservance !== undefined)
315
+ writer.tag(2, WireType.LengthDelimited).string(message.skillObservance);
316
+ /* pncp.v1.EntityId author = 3; */
317
+ if (message.author)
318
+ EntityId.internalBinaryWrite(message.author, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
319
+ /* pncp.v1.ObservationStartPoint start_point = 4; */
320
+ if (message.startPoint !== 0)
321
+ writer.tag(4, WireType.Varint).int32(message.startPoint);
322
+ /* optional string seq_id = 5; */
323
+ if (message.seqId !== undefined)
324
+ writer.tag(5, WireType.LengthDelimited).string(message.seqId);
325
+ /* optional otonoma.common.Value callback = 6; */
326
+ if (message.callback)
327
+ Value.internalBinaryWrite(message.callback, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
328
+ /* bool untracked = 7; */
329
+ if (message.untracked !== false)
330
+ writer.tag(7, WireType.Varint).bool(message.untracked);
331
+ /* optional uint64 seq_offset = 8; */
332
+ if (message.seqOffset !== undefined)
333
+ writer.tag(8, WireType.Varint).uint64(message.seqOffset);
334
+ let u = options.writeUnknownFields;
335
+ if (u !== false)
336
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
337
+ return writer;
338
+ }
339
+ }
340
+ /**
341
+ * @generated MessageType for protobuf message pncp.v1.ObservationRequest
342
+ */
343
+ export const ObservationRequest = new ObservationRequest$Type();
344
+ // @generated message type with reflection information, may provide speed optimized methods
345
+ class ObservationInit$Type extends MessageType<ObservationInit> {
346
+ constructor() {
347
+ super("pncp.v1.ObservationInit", [
348
+ { no: 1, name: "subject", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
349
+ { no: 2, name: "action", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
350
+ { no: 3, name: "requester", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
351
+ { no: 4, name: "fulfiller", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
352
+ { no: 5, name: "filters", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ObservationMessageFilter },
353
+ { no: 6, name: "conversation_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
354
+ ]);
355
+ }
356
+ create(value?: PartialMessage<ObservationInit>): ObservationInit {
357
+ const message = globalThis.Object.create((this.messagePrototype!));
358
+ message.filters = [];
359
+ if (value !== undefined)
360
+ reflectionMergePartial<ObservationInit>(this, message, value);
361
+ return message;
362
+ }
363
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ObservationInit): ObservationInit {
364
+ let message = target ?? this.create(), end = reader.pos + length;
365
+ while (reader.pos < end) {
366
+ let [fieldNo, wireType] = reader.tag();
367
+ switch (fieldNo) {
368
+ case /* optional string subject */ 1:
369
+ message.subject = reader.string();
370
+ break;
371
+ case /* optional string action */ 2:
372
+ message.action = reader.string();
373
+ break;
374
+ case /* optional string requester */ 3:
375
+ message.requester = reader.string();
376
+ break;
377
+ case /* optional string fulfiller */ 4:
378
+ message.fulfiller = reader.string();
379
+ break;
380
+ case /* repeated pncp.v1.ObservationMessageFilter filters */ 5:
381
+ message.filters.push(ObservationMessageFilter.internalBinaryRead(reader, reader.uint32(), options));
382
+ break;
383
+ case /* optional string conversation_id */ 6:
384
+ message.conversationId = reader.string();
385
+ break;
386
+ default:
387
+ let u = options.readUnknownField;
388
+ if (u === "throw")
389
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
390
+ let d = reader.skip(wireType);
391
+ if (u !== false)
392
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
393
+ }
394
+ }
395
+ return message;
396
+ }
397
+ internalBinaryWrite(message: ObservationInit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
398
+ /* optional string subject = 1; */
399
+ if (message.subject !== undefined)
400
+ writer.tag(1, WireType.LengthDelimited).string(message.subject);
401
+ /* optional string action = 2; */
402
+ if (message.action !== undefined)
403
+ writer.tag(2, WireType.LengthDelimited).string(message.action);
404
+ /* optional string requester = 3; */
405
+ if (message.requester !== undefined)
406
+ writer.tag(3, WireType.LengthDelimited).string(message.requester);
407
+ /* optional string fulfiller = 4; */
408
+ if (message.fulfiller !== undefined)
409
+ writer.tag(4, WireType.LengthDelimited).string(message.fulfiller);
410
+ /* repeated pncp.v1.ObservationMessageFilter filters = 5; */
411
+ for (let i = 0; i < message.filters.length; i++)
412
+ ObservationMessageFilter.internalBinaryWrite(message.filters[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
413
+ /* optional string conversation_id = 6; */
414
+ if (message.conversationId !== undefined)
415
+ writer.tag(6, WireType.LengthDelimited).string(message.conversationId);
416
+ let u = options.writeUnknownFields;
417
+ if (u !== false)
418
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
419
+ return writer;
420
+ }
421
+ }
422
+ /**
423
+ * @generated MessageType for protobuf message pncp.v1.ObservationInit
424
+ */
425
+ export const ObservationInit = new ObservationInit$Type();
426
+ // @generated message type with reflection information, may provide speed optimized methods
427
+ class ObservationMessageFilter$Type extends MessageType<ObservationMessageFilter> {
428
+ constructor() {
429
+ super("pncp.v1.ObservationMessageFilter", [
430
+ { no: 1, name: "kind", kind: "enum", T: () => ["pncp.v1.ObservationMessageType", ObservationMessageType] },
431
+ { no: 2, name: "pncp", kind: "enum", opt: true, T: () => ["pncp.v1.PncpMessageKind", PncpMessageKind] }
432
+ ]);
433
+ }
434
+ create(value?: PartialMessage<ObservationMessageFilter>): ObservationMessageFilter {
435
+ const message = globalThis.Object.create((this.messagePrototype!));
436
+ message.kind = 0;
437
+ if (value !== undefined)
438
+ reflectionMergePartial<ObservationMessageFilter>(this, message, value);
439
+ return message;
440
+ }
441
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ObservationMessageFilter): ObservationMessageFilter {
442
+ let message = target ?? this.create(), end = reader.pos + length;
443
+ while (reader.pos < end) {
444
+ let [fieldNo, wireType] = reader.tag();
445
+ switch (fieldNo) {
446
+ case /* pncp.v1.ObservationMessageType kind */ 1:
447
+ message.kind = reader.int32();
448
+ break;
449
+ case /* optional pncp.v1.PncpMessageKind pncp */ 2:
450
+ message.pncp = reader.int32();
451
+ break;
452
+ default:
453
+ let u = options.readUnknownField;
454
+ if (u === "throw")
455
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
456
+ let d = reader.skip(wireType);
457
+ if (u !== false)
458
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
459
+ }
460
+ }
461
+ return message;
462
+ }
463
+ internalBinaryWrite(message: ObservationMessageFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
464
+ /* pncp.v1.ObservationMessageType kind = 1; */
465
+ if (message.kind !== 0)
466
+ writer.tag(1, WireType.Varint).int32(message.kind);
467
+ /* optional pncp.v1.PncpMessageKind pncp = 2; */
468
+ if (message.pncp !== undefined)
469
+ writer.tag(2, WireType.Varint).int32(message.pncp);
470
+ let u = options.writeUnknownFields;
471
+ if (u !== false)
472
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
473
+ return writer;
474
+ }
475
+ }
476
+ /**
477
+ * @generated MessageType for protobuf message pncp.v1.ObservationMessageFilter
478
+ */
479
+ export const ObservationMessageFilter = new ObservationMessageFilter$Type();
480
+ // @generated message type with reflection information, may provide speed optimized methods
481
+ class ObservationCallback$Type extends MessageType<ObservationCallback> {
482
+ constructor() {
483
+ super("pncp.v1.ObservationCallback", [
484
+ { no: 1, name: "subject", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
485
+ { no: 2, name: "action", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
486
+ { no: 3, name: "requester", kind: "message", T: () => EntityId },
487
+ { no: 4, name: "fulfiller", kind: "message", T: () => EntityId },
488
+ { no: 5, name: "message", kind: "message", T: () => PncpCallback },
489
+ { no: 6, name: "id", kind: "message", T: () => ConversationId },
490
+ { no: 7, name: "author", kind: "message", T: () => EntityId },
491
+ { no: 8, name: "callback", kind: "message", T: () => Value },
492
+ { no: 9, name: "prev_mid", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
493
+ { no: 10, name: "skill_id", kind: "message", T: () => EntityId }
494
+ ]);
495
+ }
496
+ create(value?: PartialMessage<ObservationCallback>): ObservationCallback {
497
+ const message = globalThis.Object.create((this.messagePrototype!));
498
+ message.subject = "";
499
+ message.action = "";
500
+ if (value !== undefined)
501
+ reflectionMergePartial<ObservationCallback>(this, message, value);
502
+ return message;
503
+ }
504
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ObservationCallback): ObservationCallback {
505
+ let message = target ?? this.create(), end = reader.pos + length;
506
+ while (reader.pos < end) {
507
+ let [fieldNo, wireType] = reader.tag();
508
+ switch (fieldNo) {
509
+ case /* string subject */ 1:
510
+ message.subject = reader.string();
511
+ break;
512
+ case /* string action */ 2:
513
+ message.action = reader.string();
514
+ break;
515
+ case /* pncp.v1.EntityId requester */ 3:
516
+ message.requester = EntityId.internalBinaryRead(reader, reader.uint32(), options, message.requester);
517
+ break;
518
+ case /* optional pncp.v1.EntityId fulfiller */ 4:
519
+ message.fulfiller = EntityId.internalBinaryRead(reader, reader.uint32(), options, message.fulfiller);
520
+ break;
521
+ case /* pncp.v1.PncpCallback message */ 5:
522
+ message.message = PncpCallback.internalBinaryRead(reader, reader.uint32(), options, message.message);
523
+ break;
524
+ case /* pncp.v1.ConversationId id */ 6:
525
+ message.id = ConversationId.internalBinaryRead(reader, reader.uint32(), options, message.id);
526
+ break;
527
+ case /* pncp.v1.EntityId author */ 7:
528
+ message.author = EntityId.internalBinaryRead(reader, reader.uint32(), options, message.author);
529
+ break;
530
+ case /* optional otonoma.common.Value callback */ 8:
531
+ message.callback = Value.internalBinaryRead(reader, reader.uint32(), options, message.callback);
532
+ break;
533
+ case /* optional string prev_mid */ 9:
534
+ message.prevMid = reader.string();
535
+ break;
536
+ case /* pncp.v1.EntityId skill_id */ 10:
537
+ message.skillId = EntityId.internalBinaryRead(reader, reader.uint32(), options, message.skillId);
538
+ break;
539
+ default:
540
+ let u = options.readUnknownField;
541
+ if (u === "throw")
542
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
543
+ let d = reader.skip(wireType);
544
+ if (u !== false)
545
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
546
+ }
547
+ }
548
+ return message;
549
+ }
550
+ internalBinaryWrite(message: ObservationCallback, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
551
+ /* string subject = 1; */
552
+ if (message.subject !== "")
553
+ writer.tag(1, WireType.LengthDelimited).string(message.subject);
554
+ /* string action = 2; */
555
+ if (message.action !== "")
556
+ writer.tag(2, WireType.LengthDelimited).string(message.action);
557
+ /* pncp.v1.EntityId requester = 3; */
558
+ if (message.requester)
559
+ EntityId.internalBinaryWrite(message.requester, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
560
+ /* optional pncp.v1.EntityId fulfiller = 4; */
561
+ if (message.fulfiller)
562
+ EntityId.internalBinaryWrite(message.fulfiller, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
563
+ /* pncp.v1.PncpCallback message = 5; */
564
+ if (message.message)
565
+ PncpCallback.internalBinaryWrite(message.message, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
566
+ /* pncp.v1.ConversationId id = 6; */
567
+ if (message.id)
568
+ ConversationId.internalBinaryWrite(message.id, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
569
+ /* pncp.v1.EntityId author = 7; */
570
+ if (message.author)
571
+ EntityId.internalBinaryWrite(message.author, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
572
+ /* optional otonoma.common.Value callback = 8; */
573
+ if (message.callback)
574
+ Value.internalBinaryWrite(message.callback, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
575
+ /* optional string prev_mid = 9; */
576
+ if (message.prevMid !== undefined)
577
+ writer.tag(9, WireType.LengthDelimited).string(message.prevMid);
578
+ /* pncp.v1.EntityId skill_id = 10; */
579
+ if (message.skillId)
580
+ EntityId.internalBinaryWrite(message.skillId, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
581
+ let u = options.writeUnknownFields;
582
+ if (u !== false)
583
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
584
+ return writer;
585
+ }
586
+ }
587
+ /**
588
+ * @generated MessageType for protobuf message pncp.v1.ObservationCallback
589
+ */
590
+ export const ObservationCallback = new ObservationCallback$Type();
591
+ // @generated message type with reflection information, may provide speed optimized methods
592
+ class ObservationMessageWrapper$Type extends MessageType<ObservationMessageWrapper> {
593
+ constructor() {
594
+ super("pncp.v1.ObservationMessageWrapper", [
595
+ { no: 1, name: "body", kind: "message", T: () => ObservationCallback }
596
+ ]);
597
+ }
598
+ create(value?: PartialMessage<ObservationMessageWrapper>): ObservationMessageWrapper {
599
+ const message = globalThis.Object.create((this.messagePrototype!));
600
+ if (value !== undefined)
601
+ reflectionMergePartial<ObservationMessageWrapper>(this, message, value);
602
+ return message;
603
+ }
604
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ObservationMessageWrapper): ObservationMessageWrapper {
605
+ let message = target ?? this.create(), end = reader.pos + length;
606
+ while (reader.pos < end) {
607
+ let [fieldNo, wireType] = reader.tag();
608
+ switch (fieldNo) {
609
+ case /* pncp.v1.ObservationCallback body */ 1:
610
+ message.body = ObservationCallback.internalBinaryRead(reader, reader.uint32(), options, message.body);
611
+ break;
612
+ default:
613
+ let u = options.readUnknownField;
614
+ if (u === "throw")
615
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
616
+ let d = reader.skip(wireType);
617
+ if (u !== false)
618
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
619
+ }
620
+ }
621
+ return message;
622
+ }
623
+ internalBinaryWrite(message: ObservationMessageWrapper, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
624
+ /* pncp.v1.ObservationCallback body = 1; */
625
+ if (message.body)
626
+ ObservationCallback.internalBinaryWrite(message.body, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
627
+ let u = options.writeUnknownFields;
628
+ if (u !== false)
629
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
630
+ return writer;
631
+ }
632
+ }
633
+ /**
634
+ * @generated MessageType for protobuf message pncp.v1.ObservationMessageWrapper
635
+ */
636
+ export const ObservationMessageWrapper = new ObservationMessageWrapper$Type();