macrocosmos 1.2.10 → 1.2.11

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.
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const dotenv_1 = require("dotenv");
4
- // Load environment variables from .env file
5
4
  (0, dotenv_1.config)();
@@ -0,0 +1,101 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * `NullValue` is a singleton enumeration to represent the null value for the
5
+ * `Value` type union.
6
+ *
7
+ * The JSON representation for `NullValue` is JSON `null`.
8
+ */
9
+ export declare enum NullValue {
10
+ /** NULL_VALUE - Null value. */
11
+ NULL_VALUE = 0,
12
+ UNRECOGNIZED = -1
13
+ }
14
+ export declare function nullValueFromJSON(object: any): NullValue;
15
+ export declare function nullValueToJSON(object: NullValue): string;
16
+ /**
17
+ * `Struct` represents a structured data value, consisting of fields
18
+ * which map to dynamically typed values. In some languages, `Struct`
19
+ * might be supported by a native representation. For example, in
20
+ * scripting languages like JS a struct is represented as an
21
+ * object. The details of that representation are described together
22
+ * with the proto support for the language.
23
+ *
24
+ * The JSON representation for `Struct` is JSON object.
25
+ */
26
+ export interface Struct {
27
+ /** Unordered map of dynamically typed values. */
28
+ fields: {
29
+ [key: string]: any | undefined;
30
+ };
31
+ }
32
+ export interface Struct_FieldsEntry {
33
+ key: string;
34
+ value?: any | undefined;
35
+ }
36
+ /**
37
+ * `Value` represents a dynamically typed value which can be either
38
+ * null, a number, a string, a boolean, a recursive struct value, or a
39
+ * list of values. A producer of value is expected to set one of these
40
+ * variants. Absence of any variant indicates an error.
41
+ *
42
+ * The JSON representation for `Value` is JSON value.
43
+ */
44
+ export interface Value {
45
+ /** Represents a null value. */
46
+ nullValue?: NullValue | undefined;
47
+ /** Represents a double value. */
48
+ numberValue?: number | undefined;
49
+ /** Represents a string value. */
50
+ stringValue?: string | undefined;
51
+ /** Represents a boolean value. */
52
+ boolValue?: boolean | undefined;
53
+ /** Represents a structured value. */
54
+ structValue?: {
55
+ [key: string]: any;
56
+ } | undefined;
57
+ /** Represents a repeated `Value`. */
58
+ listValue?: Array<any> | undefined;
59
+ }
60
+ /**
61
+ * `ListValue` is a wrapper around a repeated field of values.
62
+ *
63
+ * The JSON representation for `ListValue` is JSON array.
64
+ */
65
+ export interface ListValue {
66
+ /** Repeated field of dynamically typed values. */
67
+ values: any[];
68
+ }
69
+ export declare const Struct: MessageFns<Struct> & StructWrapperFns;
70
+ export declare const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry>;
71
+ export declare const Value: MessageFns<Value> & AnyValueWrapperFns;
72
+ export declare const ListValue: MessageFns<ListValue> & ListValueWrapperFns;
73
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
74
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
75
+ [K in keyof T]?: DeepPartial<T[K]>;
76
+ } : Partial<T>;
77
+ export interface MessageFns<T> {
78
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
79
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
80
+ fromJSON(object: any): T;
81
+ toJSON(message: T): unknown;
82
+ create(base?: DeepPartial<T>): T;
83
+ fromPartial(object: DeepPartial<T>): T;
84
+ }
85
+ export interface StructWrapperFns {
86
+ wrap(object: {
87
+ [key: string]: any;
88
+ } | undefined): Struct;
89
+ unwrap(message: Struct): {
90
+ [key: string]: any;
91
+ };
92
+ }
93
+ export interface AnyValueWrapperFns {
94
+ wrap(value: any): Value;
95
+ unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
96
+ }
97
+ export interface ListValueWrapperFns {
98
+ wrap(array: Array<any> | undefined): ListValue;
99
+ unwrap(message: ListValue): Array<any>;
100
+ }
101
+ export {};
@@ -0,0 +1,473 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.0
5
+ // protoc v3.20.3
6
+ // source: google/protobuf/struct.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ListValue = exports.Value = exports.Struct_FieldsEntry = exports.Struct = exports.NullValue = exports.protobufPackage = void 0;
9
+ exports.nullValueFromJSON = nullValueFromJSON;
10
+ exports.nullValueToJSON = nullValueToJSON;
11
+ /* eslint-disable */
12
+ const wire_1 = require("@bufbuild/protobuf/wire");
13
+ exports.protobufPackage = "google.protobuf";
14
+ /**
15
+ * `NullValue` is a singleton enumeration to represent the null value for the
16
+ * `Value` type union.
17
+ *
18
+ * The JSON representation for `NullValue` is JSON `null`.
19
+ */
20
+ var NullValue;
21
+ (function (NullValue) {
22
+ /** NULL_VALUE - Null value. */
23
+ NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
24
+ NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
25
+ })(NullValue || (exports.NullValue = NullValue = {}));
26
+ function nullValueFromJSON(object) {
27
+ switch (object) {
28
+ case 0:
29
+ case "NULL_VALUE":
30
+ return NullValue.NULL_VALUE;
31
+ case -1:
32
+ case "UNRECOGNIZED":
33
+ default:
34
+ return NullValue.UNRECOGNIZED;
35
+ }
36
+ }
37
+ function nullValueToJSON(object) {
38
+ switch (object) {
39
+ case NullValue.NULL_VALUE:
40
+ return "NULL_VALUE";
41
+ case NullValue.UNRECOGNIZED:
42
+ default:
43
+ return "UNRECOGNIZED";
44
+ }
45
+ }
46
+ function createBaseStruct() {
47
+ return { fields: {} };
48
+ }
49
+ exports.Struct = {
50
+ encode(message, writer = new wire_1.BinaryWriter()) {
51
+ Object.entries(message.fields).forEach(([key, value]) => {
52
+ if (value !== undefined) {
53
+ exports.Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).join();
54
+ }
55
+ });
56
+ return writer;
57
+ },
58
+ decode(input, length) {
59
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
60
+ let end = length === undefined ? reader.len : reader.pos + length;
61
+ const message = createBaseStruct();
62
+ while (reader.pos < end) {
63
+ const tag = reader.uint32();
64
+ switch (tag >>> 3) {
65
+ case 1: {
66
+ if (tag !== 10) {
67
+ break;
68
+ }
69
+ const entry1 = exports.Struct_FieldsEntry.decode(reader, reader.uint32());
70
+ if (entry1.value !== undefined) {
71
+ message.fields[entry1.key] = entry1.value;
72
+ }
73
+ continue;
74
+ }
75
+ }
76
+ if ((tag & 7) === 4 || tag === 0) {
77
+ break;
78
+ }
79
+ reader.skip(tag & 7);
80
+ }
81
+ return message;
82
+ },
83
+ fromJSON(object) {
84
+ return {
85
+ fields: isObject(object.fields)
86
+ ? Object.entries(object.fields).reduce((acc, [key, value]) => {
87
+ acc[key] = value;
88
+ return acc;
89
+ }, {})
90
+ : {},
91
+ };
92
+ },
93
+ toJSON(message) {
94
+ const obj = {};
95
+ if (message.fields) {
96
+ const entries = Object.entries(message.fields);
97
+ if (entries.length > 0) {
98
+ obj.fields = {};
99
+ entries.forEach(([k, v]) => {
100
+ obj.fields[k] = v;
101
+ });
102
+ }
103
+ }
104
+ return obj;
105
+ },
106
+ create(base) {
107
+ return exports.Struct.fromPartial(base ?? {});
108
+ },
109
+ fromPartial(object) {
110
+ const message = createBaseStruct();
111
+ message.fields = Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
112
+ if (value !== undefined) {
113
+ acc[key] = value;
114
+ }
115
+ return acc;
116
+ }, {});
117
+ return message;
118
+ },
119
+ wrap(object) {
120
+ const struct = createBaseStruct();
121
+ if (object !== undefined) {
122
+ for (const key of Object.keys(object)) {
123
+ struct.fields[key] = object[key];
124
+ }
125
+ }
126
+ return struct;
127
+ },
128
+ unwrap(message) {
129
+ const object = {};
130
+ if (message.fields) {
131
+ for (const key of Object.keys(message.fields)) {
132
+ object[key] = message.fields[key];
133
+ }
134
+ }
135
+ return object;
136
+ },
137
+ };
138
+ function createBaseStruct_FieldsEntry() {
139
+ return { key: "", value: undefined };
140
+ }
141
+ exports.Struct_FieldsEntry = {
142
+ encode(message, writer = new wire_1.BinaryWriter()) {
143
+ if (message.key !== "") {
144
+ writer.uint32(10).string(message.key);
145
+ }
146
+ if (message.value !== undefined) {
147
+ exports.Value.encode(exports.Value.wrap(message.value), writer.uint32(18).fork()).join();
148
+ }
149
+ return writer;
150
+ },
151
+ decode(input, length) {
152
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
153
+ let end = length === undefined ? reader.len : reader.pos + length;
154
+ const message = createBaseStruct_FieldsEntry();
155
+ while (reader.pos < end) {
156
+ const tag = reader.uint32();
157
+ switch (tag >>> 3) {
158
+ case 1: {
159
+ if (tag !== 10) {
160
+ break;
161
+ }
162
+ message.key = reader.string();
163
+ continue;
164
+ }
165
+ case 2: {
166
+ if (tag !== 18) {
167
+ break;
168
+ }
169
+ message.value = exports.Value.unwrap(exports.Value.decode(reader, reader.uint32()));
170
+ continue;
171
+ }
172
+ }
173
+ if ((tag & 7) === 4 || tag === 0) {
174
+ break;
175
+ }
176
+ reader.skip(tag & 7);
177
+ }
178
+ return message;
179
+ },
180
+ fromJSON(object) {
181
+ return {
182
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
183
+ value: isSet(object?.value) ? object.value : undefined,
184
+ };
185
+ },
186
+ toJSON(message) {
187
+ const obj = {};
188
+ if (message.key !== "") {
189
+ obj.key = message.key;
190
+ }
191
+ if (message.value !== undefined) {
192
+ obj.value = message.value;
193
+ }
194
+ return obj;
195
+ },
196
+ create(base) {
197
+ return exports.Struct_FieldsEntry.fromPartial(base ?? {});
198
+ },
199
+ fromPartial(object) {
200
+ const message = createBaseStruct_FieldsEntry();
201
+ message.key = object.key ?? "";
202
+ message.value = object.value ?? undefined;
203
+ return message;
204
+ },
205
+ };
206
+ function createBaseValue() {
207
+ return {
208
+ nullValue: undefined,
209
+ numberValue: undefined,
210
+ stringValue: undefined,
211
+ boolValue: undefined,
212
+ structValue: undefined,
213
+ listValue: undefined,
214
+ };
215
+ }
216
+ exports.Value = {
217
+ encode(message, writer = new wire_1.BinaryWriter()) {
218
+ if (message.nullValue !== undefined) {
219
+ writer.uint32(8).int32(message.nullValue);
220
+ }
221
+ if (message.numberValue !== undefined) {
222
+ writer.uint32(17).double(message.numberValue);
223
+ }
224
+ if (message.stringValue !== undefined) {
225
+ writer.uint32(26).string(message.stringValue);
226
+ }
227
+ if (message.boolValue !== undefined) {
228
+ writer.uint32(32).bool(message.boolValue);
229
+ }
230
+ if (message.structValue !== undefined) {
231
+ exports.Struct.encode(exports.Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
232
+ }
233
+ if (message.listValue !== undefined) {
234
+ exports.ListValue.encode(exports.ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
235
+ }
236
+ return writer;
237
+ },
238
+ decode(input, length) {
239
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
240
+ let end = length === undefined ? reader.len : reader.pos + length;
241
+ const message = createBaseValue();
242
+ while (reader.pos < end) {
243
+ const tag = reader.uint32();
244
+ switch (tag >>> 3) {
245
+ case 1: {
246
+ if (tag !== 8) {
247
+ break;
248
+ }
249
+ message.nullValue = reader.int32();
250
+ continue;
251
+ }
252
+ case 2: {
253
+ if (tag !== 17) {
254
+ break;
255
+ }
256
+ message.numberValue = reader.double();
257
+ continue;
258
+ }
259
+ case 3: {
260
+ if (tag !== 26) {
261
+ break;
262
+ }
263
+ message.stringValue = reader.string();
264
+ continue;
265
+ }
266
+ case 4: {
267
+ if (tag !== 32) {
268
+ break;
269
+ }
270
+ message.boolValue = reader.bool();
271
+ continue;
272
+ }
273
+ case 5: {
274
+ if (tag !== 42) {
275
+ break;
276
+ }
277
+ message.structValue = exports.Struct.unwrap(exports.Struct.decode(reader, reader.uint32()));
278
+ continue;
279
+ }
280
+ case 6: {
281
+ if (tag !== 50) {
282
+ break;
283
+ }
284
+ message.listValue = exports.ListValue.unwrap(exports.ListValue.decode(reader, reader.uint32()));
285
+ continue;
286
+ }
287
+ }
288
+ if ((tag & 7) === 4 || tag === 0) {
289
+ break;
290
+ }
291
+ reader.skip(tag & 7);
292
+ }
293
+ return message;
294
+ },
295
+ fromJSON(object) {
296
+ return {
297
+ nullValue: isSet(object.nullValue)
298
+ ? nullValueFromJSON(object.nullValue)
299
+ : undefined,
300
+ numberValue: isSet(object.numberValue)
301
+ ? globalThis.Number(object.numberValue)
302
+ : undefined,
303
+ stringValue: isSet(object.stringValue)
304
+ ? globalThis.String(object.stringValue)
305
+ : undefined,
306
+ boolValue: isSet(object.boolValue)
307
+ ? globalThis.Boolean(object.boolValue)
308
+ : undefined,
309
+ structValue: isObject(object.structValue)
310
+ ? object.structValue
311
+ : undefined,
312
+ listValue: globalThis.Array.isArray(object.listValue)
313
+ ? [...object.listValue]
314
+ : undefined,
315
+ };
316
+ },
317
+ toJSON(message) {
318
+ const obj = {};
319
+ if (message.nullValue !== undefined) {
320
+ obj.nullValue = nullValueToJSON(message.nullValue);
321
+ }
322
+ if (message.numberValue !== undefined) {
323
+ obj.numberValue = message.numberValue;
324
+ }
325
+ if (message.stringValue !== undefined) {
326
+ obj.stringValue = message.stringValue;
327
+ }
328
+ if (message.boolValue !== undefined) {
329
+ obj.boolValue = message.boolValue;
330
+ }
331
+ if (message.structValue !== undefined) {
332
+ obj.structValue = message.structValue;
333
+ }
334
+ if (message.listValue !== undefined) {
335
+ obj.listValue = message.listValue;
336
+ }
337
+ return obj;
338
+ },
339
+ create(base) {
340
+ return exports.Value.fromPartial(base ?? {});
341
+ },
342
+ fromPartial(object) {
343
+ const message = createBaseValue();
344
+ message.nullValue = object.nullValue ?? undefined;
345
+ message.numberValue = object.numberValue ?? undefined;
346
+ message.stringValue = object.stringValue ?? undefined;
347
+ message.boolValue = object.boolValue ?? undefined;
348
+ message.structValue = object.structValue ?? undefined;
349
+ message.listValue = object.listValue ?? undefined;
350
+ return message;
351
+ },
352
+ wrap(value) {
353
+ const result = createBaseValue();
354
+ if (value === null) {
355
+ result.nullValue = NullValue.NULL_VALUE;
356
+ }
357
+ else if (typeof value === "boolean") {
358
+ result.boolValue = value;
359
+ }
360
+ else if (typeof value === "number") {
361
+ result.numberValue = value;
362
+ }
363
+ else if (typeof value === "string") {
364
+ result.stringValue = value;
365
+ }
366
+ else if (globalThis.Array.isArray(value)) {
367
+ result.listValue = value;
368
+ }
369
+ else if (typeof value === "object") {
370
+ result.structValue = value;
371
+ }
372
+ else if (typeof value !== "undefined") {
373
+ throw new globalThis.Error("Unsupported any value type: " + typeof value);
374
+ }
375
+ return result;
376
+ },
377
+ unwrap(message) {
378
+ if (message.stringValue !== undefined) {
379
+ return message.stringValue;
380
+ }
381
+ else if (message?.numberValue !== undefined) {
382
+ return message.numberValue;
383
+ }
384
+ else if (message?.boolValue !== undefined) {
385
+ return message.boolValue;
386
+ }
387
+ else if (message?.structValue !== undefined) {
388
+ return message.structValue;
389
+ }
390
+ else if (message?.listValue !== undefined) {
391
+ return message.listValue;
392
+ }
393
+ else if (message?.nullValue !== undefined) {
394
+ return null;
395
+ }
396
+ return undefined;
397
+ },
398
+ };
399
+ function createBaseListValue() {
400
+ return { values: [] };
401
+ }
402
+ exports.ListValue = {
403
+ encode(message, writer = new wire_1.BinaryWriter()) {
404
+ for (const v of message.values) {
405
+ exports.Value.encode(exports.Value.wrap(v), writer.uint32(10).fork()).join();
406
+ }
407
+ return writer;
408
+ },
409
+ decode(input, length) {
410
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
411
+ let end = length === undefined ? reader.len : reader.pos + length;
412
+ const message = createBaseListValue();
413
+ while (reader.pos < end) {
414
+ const tag = reader.uint32();
415
+ switch (tag >>> 3) {
416
+ case 1: {
417
+ if (tag !== 10) {
418
+ break;
419
+ }
420
+ message.values.push(exports.Value.unwrap(exports.Value.decode(reader, reader.uint32())));
421
+ continue;
422
+ }
423
+ }
424
+ if ((tag & 7) === 4 || tag === 0) {
425
+ break;
426
+ }
427
+ reader.skip(tag & 7);
428
+ }
429
+ return message;
430
+ },
431
+ fromJSON(object) {
432
+ return {
433
+ values: globalThis.Array.isArray(object?.values)
434
+ ? [...object.values]
435
+ : [],
436
+ };
437
+ },
438
+ toJSON(message) {
439
+ const obj = {};
440
+ if (message.values?.length) {
441
+ obj.values = message.values;
442
+ }
443
+ return obj;
444
+ },
445
+ create(base) {
446
+ return exports.ListValue.fromPartial(base ?? {});
447
+ },
448
+ fromPartial(object) {
449
+ const message = createBaseListValue();
450
+ message.values = object.values?.map(e => e) || [];
451
+ return message;
452
+ },
453
+ wrap(array) {
454
+ const result = createBaseListValue();
455
+ result.values = array ?? [];
456
+ return result;
457
+ },
458
+ unwrap(message) {
459
+ if (message?.hasOwnProperty("values") &&
460
+ globalThis.Array.isArray(message.values)) {
461
+ return message.values;
462
+ }
463
+ else {
464
+ return message;
465
+ }
466
+ },
467
+ };
468
+ function isObject(value) {
469
+ return typeof value === "object" && value !== null;
470
+ }
471
+ function isSet(value) {
472
+ return value !== null && value !== undefined;
473
+ }
@@ -38,11 +38,41 @@ export interface ValidateRedditTopicResponse {
38
38
  /** quarantine: whether the topic is quarantined */
39
39
  quarantine: boolean;
40
40
  }
41
+ /** OnDemandDataRequest is a request to SN13 to retrieve data */
42
+ export interface OnDemandDataRequest {
43
+ /** source: the data source (X or Reddit) */
44
+ source: string;
45
+ /** usernames: list of usernames to fetch data from */
46
+ usernames: string[];
47
+ /** keywords: list of keywords to search for */
48
+ keywords: string[];
49
+ /** start_date: ISO 8601 formatted date string (e.g. "2024-01-01T00:00:00Z") */
50
+ startDate?: string | undefined;
51
+ /** end_date: ISO 8601 formatted date string (e.g. "2024-01-31T23:59:59Z") */
52
+ endDate?: string | undefined;
53
+ /** limit: maximum number of results to return */
54
+ limit?: number | undefined;
55
+ }
56
+ /** OnDemandDataResponse is the response from SN13 for an on-demand data request */
57
+ export interface OnDemandDataResponse {
58
+ /** status: the request status, either success/error */
59
+ status: string;
60
+ /** data: the data object returned */
61
+ data: {
62
+ [key: string]: any;
63
+ }[];
64
+ /** meta: additional metadata about the request */
65
+ meta?: {
66
+ [key: string]: any;
67
+ } | undefined;
68
+ }
41
69
  export declare const ListTopicsRequest: MessageFns<ListTopicsRequest>;
42
70
  export declare const ListTopicsResponseDetail: MessageFns<ListTopicsResponseDetail>;
43
71
  export declare const ListTopicsResponse: MessageFns<ListTopicsResponse>;
44
72
  export declare const ValidateRedditTopicRequest: MessageFns<ValidateRedditTopicRequest>;
45
73
  export declare const ValidateRedditTopicResponse: MessageFns<ValidateRedditTopicResponse>;
74
+ export declare const OnDemandDataRequest: MessageFns<OnDemandDataRequest>;
75
+ export declare const OnDemandDataResponse: MessageFns<OnDemandDataResponse>;
46
76
  export type Sn13ServiceService = typeof Sn13ServiceService;
47
77
  export declare const Sn13ServiceService: {
48
78
  /** ListTopics is the RPC method for getting the top topics */
@@ -64,11 +94,23 @@ export declare const Sn13ServiceService: {
64
94
  readonly responseSerialize: (value: ValidateRedditTopicResponse) => Buffer<ArrayBuffer>;
65
95
  readonly responseDeserialize: (value: Buffer) => ValidateRedditTopicResponse;
66
96
  };
97
+ /** Access the SN13 API endpoint on_demand_data_request via Constellation */
98
+ readonly onDemandData: {
99
+ readonly path: "/sn13.v1.Sn13Service/OnDemandData";
100
+ readonly requestStream: false;
101
+ readonly responseStream: false;
102
+ readonly requestSerialize: (value: OnDemandDataRequest) => Buffer<ArrayBuffer>;
103
+ readonly requestDeserialize: (value: Buffer) => OnDemandDataRequest;
104
+ readonly responseSerialize: (value: OnDemandDataResponse) => Buffer<ArrayBuffer>;
105
+ readonly responseDeserialize: (value: Buffer) => OnDemandDataResponse;
106
+ };
67
107
  };
68
108
  export interface Sn13ServiceServer extends UntypedServiceImplementation {
69
109
  /** ListTopics is the RPC method for getting the top topics */
70
110
  listTopics: handleUnaryCall<ListTopicsRequest, ListTopicsResponse>;
71
111
  validateRedditTopic: handleUnaryCall<ValidateRedditTopicRequest, ValidateRedditTopicResponse>;
112
+ /** Access the SN13 API endpoint on_demand_data_request via Constellation */
113
+ onDemandData: handleUnaryCall<OnDemandDataRequest, OnDemandDataResponse>;
72
114
  }
73
115
  export interface Sn13ServiceClient extends Client {
74
116
  /** ListTopics is the RPC method for getting the top topics */
@@ -78,6 +120,10 @@ export interface Sn13ServiceClient extends Client {
78
120
  validateRedditTopic(request: ValidateRedditTopicRequest, callback: (error: ServiceError | null, response: ValidateRedditTopicResponse) => void): ClientUnaryCall;
79
121
  validateRedditTopic(request: ValidateRedditTopicRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ValidateRedditTopicResponse) => void): ClientUnaryCall;
80
122
  validateRedditTopic(request: ValidateRedditTopicRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ValidateRedditTopicResponse) => void): ClientUnaryCall;
123
+ /** Access the SN13 API endpoint on_demand_data_request via Constellation */
124
+ onDemandData(request: OnDemandDataRequest, callback: (error: ServiceError | null, response: OnDemandDataResponse) => void): ClientUnaryCall;
125
+ onDemandData(request: OnDemandDataRequest, metadata: Metadata, callback: (error: ServiceError | null, response: OnDemandDataResponse) => void): ClientUnaryCall;
126
+ onDemandData(request: OnDemandDataRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: OnDemandDataResponse) => void): ClientUnaryCall;
81
127
  }
82
128
  export declare const Sn13ServiceClient: {
83
129
  new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): Sn13ServiceClient;
@@ -5,10 +5,11 @@
5
5
  // protoc v3.20.3
6
6
  // source: sn13/v1/sn13_validator.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Sn13ServiceClient = exports.Sn13ServiceService = exports.ValidateRedditTopicResponse = exports.ValidateRedditTopicRequest = exports.ListTopicsResponse = exports.ListTopicsResponseDetail = exports.ListTopicsRequest = exports.protobufPackage = void 0;
8
+ exports.Sn13ServiceClient = exports.Sn13ServiceService = exports.OnDemandDataResponse = exports.OnDemandDataRequest = exports.ValidateRedditTopicResponse = exports.ValidateRedditTopicRequest = exports.ListTopicsResponse = exports.ListTopicsResponseDetail = exports.ListTopicsRequest = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  const grpc_js_1 = require("@grpc/grpc-js");
12
+ const struct_1 = require("../../google/protobuf/struct");
12
13
  exports.protobufPackage = "sn13.v1";
13
14
  function createBaseListTopicsRequest() {
14
15
  return { source: "" };
@@ -388,6 +389,232 @@ exports.ValidateRedditTopicResponse = {
388
389
  return message;
389
390
  },
390
391
  };
392
+ function createBaseOnDemandDataRequest() {
393
+ return {
394
+ source: "",
395
+ usernames: [],
396
+ keywords: [],
397
+ startDate: undefined,
398
+ endDate: undefined,
399
+ limit: undefined,
400
+ };
401
+ }
402
+ exports.OnDemandDataRequest = {
403
+ encode(message, writer = new wire_1.BinaryWriter()) {
404
+ if (message.source !== "") {
405
+ writer.uint32(10).string(message.source);
406
+ }
407
+ for (const v of message.usernames) {
408
+ writer.uint32(18).string(v);
409
+ }
410
+ for (const v of message.keywords) {
411
+ writer.uint32(26).string(v);
412
+ }
413
+ if (message.startDate !== undefined) {
414
+ writer.uint32(34).string(message.startDate);
415
+ }
416
+ if (message.endDate !== undefined) {
417
+ writer.uint32(42).string(message.endDate);
418
+ }
419
+ if (message.limit !== undefined) {
420
+ writer.uint32(48).int64(message.limit);
421
+ }
422
+ return writer;
423
+ },
424
+ decode(input, length) {
425
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
426
+ let end = length === undefined ? reader.len : reader.pos + length;
427
+ const message = createBaseOnDemandDataRequest();
428
+ while (reader.pos < end) {
429
+ const tag = reader.uint32();
430
+ switch (tag >>> 3) {
431
+ case 1: {
432
+ if (tag !== 10) {
433
+ break;
434
+ }
435
+ message.source = reader.string();
436
+ continue;
437
+ }
438
+ case 2: {
439
+ if (tag !== 18) {
440
+ break;
441
+ }
442
+ message.usernames.push(reader.string());
443
+ continue;
444
+ }
445
+ case 3: {
446
+ if (tag !== 26) {
447
+ break;
448
+ }
449
+ message.keywords.push(reader.string());
450
+ continue;
451
+ }
452
+ case 4: {
453
+ if (tag !== 34) {
454
+ break;
455
+ }
456
+ message.startDate = reader.string();
457
+ continue;
458
+ }
459
+ case 5: {
460
+ if (tag !== 42) {
461
+ break;
462
+ }
463
+ message.endDate = reader.string();
464
+ continue;
465
+ }
466
+ case 6: {
467
+ if (tag !== 48) {
468
+ break;
469
+ }
470
+ message.limit = longToNumber(reader.int64());
471
+ continue;
472
+ }
473
+ }
474
+ if ((tag & 7) === 4 || tag === 0) {
475
+ break;
476
+ }
477
+ reader.skip(tag & 7);
478
+ }
479
+ return message;
480
+ },
481
+ fromJSON(object) {
482
+ return {
483
+ source: isSet(object.source) ? globalThis.String(object.source) : "",
484
+ usernames: globalThis.Array.isArray(object?.usernames)
485
+ ? object.usernames.map((e) => globalThis.String(e))
486
+ : [],
487
+ keywords: globalThis.Array.isArray(object?.keywords)
488
+ ? object.keywords.map((e) => globalThis.String(e))
489
+ : [],
490
+ startDate: isSet(object.startDate)
491
+ ? globalThis.String(object.startDate)
492
+ : undefined,
493
+ endDate: isSet(object.endDate)
494
+ ? globalThis.String(object.endDate)
495
+ : undefined,
496
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : undefined,
497
+ };
498
+ },
499
+ toJSON(message) {
500
+ const obj = {};
501
+ if (message.source !== "") {
502
+ obj.source = message.source;
503
+ }
504
+ if (message.usernames?.length) {
505
+ obj.usernames = message.usernames;
506
+ }
507
+ if (message.keywords?.length) {
508
+ obj.keywords = message.keywords;
509
+ }
510
+ if (message.startDate !== undefined) {
511
+ obj.startDate = message.startDate;
512
+ }
513
+ if (message.endDate !== undefined) {
514
+ obj.endDate = message.endDate;
515
+ }
516
+ if (message.limit !== undefined) {
517
+ obj.limit = Math.round(message.limit);
518
+ }
519
+ return obj;
520
+ },
521
+ create(base) {
522
+ return exports.OnDemandDataRequest.fromPartial(base ?? {});
523
+ },
524
+ fromPartial(object) {
525
+ const message = createBaseOnDemandDataRequest();
526
+ message.source = object.source ?? "";
527
+ message.usernames = object.usernames?.map(e => e) || [];
528
+ message.keywords = object.keywords?.map(e => e) || [];
529
+ message.startDate = object.startDate ?? undefined;
530
+ message.endDate = object.endDate ?? undefined;
531
+ message.limit = object.limit ?? undefined;
532
+ return message;
533
+ },
534
+ };
535
+ function createBaseOnDemandDataResponse() {
536
+ return { status: "", data: [], meta: undefined };
537
+ }
538
+ exports.OnDemandDataResponse = {
539
+ encode(message, writer = new wire_1.BinaryWriter()) {
540
+ if (message.status !== "") {
541
+ writer.uint32(10).string(message.status);
542
+ }
543
+ for (const v of message.data) {
544
+ struct_1.Struct.encode(struct_1.Struct.wrap(v), writer.uint32(18).fork()).join();
545
+ }
546
+ if (message.meta !== undefined) {
547
+ struct_1.Struct.encode(struct_1.Struct.wrap(message.meta), writer.uint32(26).fork()).join();
548
+ }
549
+ return writer;
550
+ },
551
+ decode(input, length) {
552
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
553
+ let end = length === undefined ? reader.len : reader.pos + length;
554
+ const message = createBaseOnDemandDataResponse();
555
+ while (reader.pos < end) {
556
+ const tag = reader.uint32();
557
+ switch (tag >>> 3) {
558
+ case 1: {
559
+ if (tag !== 10) {
560
+ break;
561
+ }
562
+ message.status = reader.string();
563
+ continue;
564
+ }
565
+ case 2: {
566
+ if (tag !== 18) {
567
+ break;
568
+ }
569
+ message.data.push(struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32())));
570
+ continue;
571
+ }
572
+ case 3: {
573
+ if (tag !== 26) {
574
+ break;
575
+ }
576
+ message.meta = struct_1.Struct.unwrap(struct_1.Struct.decode(reader, reader.uint32()));
577
+ continue;
578
+ }
579
+ }
580
+ if ((tag & 7) === 4 || tag === 0) {
581
+ break;
582
+ }
583
+ reader.skip(tag & 7);
584
+ }
585
+ return message;
586
+ },
587
+ fromJSON(object) {
588
+ return {
589
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
590
+ data: globalThis.Array.isArray(object?.data) ? [...object.data] : [],
591
+ meta: isObject(object.meta) ? object.meta : undefined,
592
+ };
593
+ },
594
+ toJSON(message) {
595
+ const obj = {};
596
+ if (message.status !== "") {
597
+ obj.status = message.status;
598
+ }
599
+ if (message.data?.length) {
600
+ obj.data = message.data;
601
+ }
602
+ if (message.meta !== undefined) {
603
+ obj.meta = message.meta;
604
+ }
605
+ return obj;
606
+ },
607
+ create(base) {
608
+ return exports.OnDemandDataResponse.fromPartial(base ?? {});
609
+ },
610
+ fromPartial(object) {
611
+ const message = createBaseOnDemandDataResponse();
612
+ message.status = object.status ?? "";
613
+ message.data = object.data?.map(e => e) || [];
614
+ message.meta = object.meta ?? undefined;
615
+ return message;
616
+ },
617
+ };
391
618
  exports.Sn13ServiceService = {
392
619
  /** ListTopics is the RPC method for getting the top topics */
393
620
  listTopics: {
@@ -408,6 +635,16 @@ exports.Sn13ServiceService = {
408
635
  responseSerialize: (value) => Buffer.from(exports.ValidateRedditTopicResponse.encode(value).finish()),
409
636
  responseDeserialize: (value) => exports.ValidateRedditTopicResponse.decode(value),
410
637
  },
638
+ /** Access the SN13 API endpoint on_demand_data_request via Constellation */
639
+ onDemandData: {
640
+ path: "/sn13.v1.Sn13Service/OnDemandData",
641
+ requestStream: false,
642
+ responseStream: false,
643
+ requestSerialize: (value) => Buffer.from(exports.OnDemandDataRequest.encode(value).finish()),
644
+ requestDeserialize: (value) => exports.OnDemandDataRequest.decode(value),
645
+ responseSerialize: (value) => Buffer.from(exports.OnDemandDataResponse.encode(value).finish()),
646
+ responseDeserialize: (value) => exports.OnDemandDataResponse.decode(value),
647
+ },
411
648
  };
412
649
  exports.Sn13ServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.Sn13ServiceService, "sn13.v1.Sn13Service");
413
650
  function longToNumber(int64) {
@@ -420,6 +657,9 @@ function longToNumber(int64) {
420
657
  }
421
658
  return num;
422
659
  }
660
+ function isObject(value) {
661
+ return typeof value === "object" && value !== null;
662
+ }
423
663
  function isSet(value) {
424
664
  return value !== null && value !== undefined;
425
665
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.2.10";
1
+ export declare const VERSION = "1.2.11";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "1.2.10";
4
+ exports.VERSION = "1.2.11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "macrocosmos",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "description": "TypeScript SDK package for Macrocosmos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",