@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,248 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { MessageType } from "@protobuf-ts/runtime";
5
+ /**
6
+ * @generated from protobuf enum otonoma.common.NullValue
7
+ */
8
+ export var NullValue;
9
+ (function (NullValue) {
10
+ /**
11
+ * @generated from protobuf enum value: NULL_VALUE = 0;
12
+ */
13
+ NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
14
+ })(NullValue || (NullValue = {}));
15
+ // @generated message type with reflection information, may provide speed optimized methods
16
+ class Value$Type extends MessageType {
17
+ constructor() {
18
+ super("otonoma.common.Value", [
19
+ { no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["otonoma.common.NullValue", NullValue] },
20
+ { no: 2, name: "number_value", kind: "scalar", oneof: "kind", T: 1 /*ScalarType.DOUBLE*/ },
21
+ { no: 3, name: "neg_int_value", kind: "scalar", oneof: "kind", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
22
+ { no: 4, name: "pos_int_value", kind: "scalar", oneof: "kind", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
23
+ { no: 5, name: "string_value", kind: "scalar", oneof: "kind", T: 9 /*ScalarType.STRING*/ },
24
+ { no: 6, name: "bool_value", kind: "scalar", oneof: "kind", T: 8 /*ScalarType.BOOL*/ },
25
+ { no: 7, name: "struct_value", kind: "message", oneof: "kind", T: () => Struct },
26
+ { no: 8, name: "list_value", kind: "message", oneof: "kind", T: () => ListValue }
27
+ ]);
28
+ }
29
+ create(value) {
30
+ const message = globalThis.Object.create((this.messagePrototype));
31
+ message.kind = { oneofKind: undefined };
32
+ if (value !== undefined)
33
+ reflectionMergePartial(this, message, value);
34
+ return message;
35
+ }
36
+ internalBinaryRead(reader, length, options, target) {
37
+ let message = target ?? this.create(), end = reader.pos + length;
38
+ while (reader.pos < end) {
39
+ let [fieldNo, wireType] = reader.tag();
40
+ switch (fieldNo) {
41
+ case /* otonoma.common.NullValue null_value */ 1:
42
+ message.kind = {
43
+ oneofKind: "nullValue",
44
+ nullValue: reader.int32()
45
+ };
46
+ break;
47
+ case /* double number_value */ 2:
48
+ message.kind = {
49
+ oneofKind: "numberValue",
50
+ numberValue: reader.double()
51
+ };
52
+ break;
53
+ case /* int64 neg_int_value */ 3:
54
+ message.kind = {
55
+ oneofKind: "negIntValue",
56
+ negIntValue: reader.int64().toBigInt()
57
+ };
58
+ break;
59
+ case /* uint64 pos_int_value */ 4:
60
+ message.kind = {
61
+ oneofKind: "posIntValue",
62
+ posIntValue: reader.uint64().toBigInt()
63
+ };
64
+ break;
65
+ case /* string string_value */ 5:
66
+ message.kind = {
67
+ oneofKind: "stringValue",
68
+ stringValue: reader.string()
69
+ };
70
+ break;
71
+ case /* bool bool_value */ 6:
72
+ message.kind = {
73
+ oneofKind: "boolValue",
74
+ boolValue: reader.bool()
75
+ };
76
+ break;
77
+ case /* otonoma.common.Struct struct_value */ 7:
78
+ message.kind = {
79
+ oneofKind: "structValue",
80
+ structValue: Struct.internalBinaryRead(reader, reader.uint32(), options, message.kind.structValue)
81
+ };
82
+ break;
83
+ case /* otonoma.common.ListValue list_value */ 8:
84
+ message.kind = {
85
+ oneofKind: "listValue",
86
+ listValue: ListValue.internalBinaryRead(reader, reader.uint32(), options, message.kind.listValue)
87
+ };
88
+ break;
89
+ default:
90
+ let u = options.readUnknownField;
91
+ if (u === "throw")
92
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
93
+ let d = reader.skip(wireType);
94
+ if (u !== false)
95
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
96
+ }
97
+ }
98
+ return message;
99
+ }
100
+ internalBinaryWrite(message, writer, options) {
101
+ /* otonoma.common.NullValue null_value = 1; */
102
+ if (message.kind.oneofKind === "nullValue")
103
+ writer.tag(1, WireType.Varint).int32(message.kind.nullValue);
104
+ /* double number_value = 2; */
105
+ if (message.kind.oneofKind === "numberValue")
106
+ writer.tag(2, WireType.Bit64).double(message.kind.numberValue);
107
+ /* int64 neg_int_value = 3; */
108
+ if (message.kind.oneofKind === "negIntValue")
109
+ writer.tag(3, WireType.Varint).int64(message.kind.negIntValue);
110
+ /* uint64 pos_int_value = 4; */
111
+ if (message.kind.oneofKind === "posIntValue")
112
+ writer.tag(4, WireType.Varint).uint64(message.kind.posIntValue);
113
+ /* string string_value = 5; */
114
+ if (message.kind.oneofKind === "stringValue")
115
+ writer.tag(5, WireType.LengthDelimited).string(message.kind.stringValue);
116
+ /* bool bool_value = 6; */
117
+ if (message.kind.oneofKind === "boolValue")
118
+ writer.tag(6, WireType.Varint).bool(message.kind.boolValue);
119
+ /* otonoma.common.Struct struct_value = 7; */
120
+ if (message.kind.oneofKind === "structValue")
121
+ Struct.internalBinaryWrite(message.kind.structValue, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
122
+ /* otonoma.common.ListValue list_value = 8; */
123
+ if (message.kind.oneofKind === "listValue")
124
+ ListValue.internalBinaryWrite(message.kind.listValue, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
125
+ let u = options.writeUnknownFields;
126
+ if (u !== false)
127
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
128
+ return writer;
129
+ }
130
+ }
131
+ /**
132
+ * @generated MessageType for protobuf message otonoma.common.Value
133
+ */
134
+ export const Value = new Value$Type();
135
+ // @generated message type with reflection information, may provide speed optimized methods
136
+ class Struct$Type extends MessageType {
137
+ constructor() {
138
+ super("otonoma.common.Struct", [
139
+ { no: 1, name: "fields", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } }
140
+ ]);
141
+ }
142
+ create(value) {
143
+ const message = globalThis.Object.create((this.messagePrototype));
144
+ message.fields = {};
145
+ if (value !== undefined)
146
+ reflectionMergePartial(this, message, value);
147
+ return message;
148
+ }
149
+ internalBinaryRead(reader, length, options, target) {
150
+ let message = target ?? this.create(), end = reader.pos + length;
151
+ while (reader.pos < end) {
152
+ let [fieldNo, wireType] = reader.tag();
153
+ switch (fieldNo) {
154
+ case /* map<string, otonoma.common.Value> fields */ 1:
155
+ this.binaryReadMap1(message.fields, reader, options);
156
+ break;
157
+ default:
158
+ let u = options.readUnknownField;
159
+ if (u === "throw")
160
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
161
+ let d = reader.skip(wireType);
162
+ if (u !== false)
163
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
164
+ }
165
+ }
166
+ return message;
167
+ }
168
+ binaryReadMap1(map, reader, options) {
169
+ let len = reader.uint32(), end = reader.pos + len, key, val;
170
+ while (reader.pos < end) {
171
+ let [fieldNo, wireType] = reader.tag();
172
+ switch (fieldNo) {
173
+ case 1:
174
+ key = reader.string();
175
+ break;
176
+ case 2:
177
+ val = Value.internalBinaryRead(reader, reader.uint32(), options);
178
+ break;
179
+ default: throw new globalThis.Error("unknown map entry field for field otonoma.common.Struct.fields");
180
+ }
181
+ }
182
+ map[key ?? ""] = val ?? Value.create();
183
+ }
184
+ internalBinaryWrite(message, writer, options) {
185
+ /* map<string, otonoma.common.Value> fields = 1; */
186
+ for (let k of globalThis.Object.keys(message.fields)) {
187
+ writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
188
+ writer.tag(2, WireType.LengthDelimited).fork();
189
+ Value.internalBinaryWrite(message.fields[k], writer, options);
190
+ writer.join().join();
191
+ }
192
+ let u = options.writeUnknownFields;
193
+ if (u !== false)
194
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
195
+ return writer;
196
+ }
197
+ }
198
+ /**
199
+ * @generated MessageType for protobuf message otonoma.common.Struct
200
+ */
201
+ export const Struct = new Struct$Type();
202
+ // @generated message type with reflection information, may provide speed optimized methods
203
+ class ListValue$Type extends MessageType {
204
+ constructor() {
205
+ super("otonoma.common.ListValue", [
206
+ { no: 1, name: "values", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Value }
207
+ ]);
208
+ }
209
+ create(value) {
210
+ const message = globalThis.Object.create((this.messagePrototype));
211
+ message.values = [];
212
+ if (value !== undefined)
213
+ reflectionMergePartial(this, message, value);
214
+ return message;
215
+ }
216
+ internalBinaryRead(reader, length, options, target) {
217
+ let message = target ?? this.create(), end = reader.pos + length;
218
+ while (reader.pos < end) {
219
+ let [fieldNo, wireType] = reader.tag();
220
+ switch (fieldNo) {
221
+ case /* repeated otonoma.common.Value values */ 1:
222
+ message.values.push(Value.internalBinaryRead(reader, reader.uint32(), options));
223
+ break;
224
+ default:
225
+ let u = options.readUnknownField;
226
+ if (u === "throw")
227
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
228
+ let d = reader.skip(wireType);
229
+ if (u !== false)
230
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
231
+ }
232
+ }
233
+ return message;
234
+ }
235
+ internalBinaryWrite(message, writer, options) {
236
+ /* repeated otonoma.common.Value values = 1; */
237
+ for (let i = 0; i < message.values.length; i++)
238
+ Value.internalBinaryWrite(message.values[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
239
+ let u = options.writeUnknownFields;
240
+ if (u !== false)
241
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
242
+ return writer;
243
+ }
244
+ }
245
+ /**
246
+ * @generated MessageType for protobuf message otonoma.common.ListValue
247
+ */
248
+ export const ListValue = new ListValue$Type();