macrocosmos 1.2.2 → 1.2.4

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,122 +1,99 @@
1
- export interface IListTopicsRequest {
2
- source?: string;
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { type CallOptions, ChannelCredentials, Client, type ClientOptions, type ClientUnaryCall, type handleUnaryCall, Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
3
+ export declare const protobufPackage = "sn13.v1";
4
+ /** ListTopicsRequest is the request message for getting the top topics */
5
+ export interface ListTopicsRequest {
6
+ /** source: the source to validate */
7
+ source: string;
3
8
  }
4
- export interface IListTopicsResponseDetail {
5
- labelValue?: string;
6
- contentSizeBytes?: number;
7
- adjContentSizeBytes?: number;
9
+ /** ListTopicsResponseDetail is the response message for getting the top topics */
10
+ export interface ListTopicsResponseDetail {
11
+ /** label_value: reddit or x topic */
12
+ labelValue: string;
13
+ /** content_size_bytes: content size in bytes */
14
+ contentSizeBytes: number;
15
+ /** adj_content_size_bytes: adjacent content size in bytes */
16
+ adjContentSizeBytes: number;
8
17
  }
9
- export interface IListTopicsResponse {
10
- details?: IListTopicsResponseDetail[];
18
+ /** ListTopicsResponse is a list of ListTopicsResponseDetail(s) with top topics */
19
+ export interface ListTopicsResponse {
20
+ /** message: the response message */
21
+ details: ListTopicsResponseDetail[];
11
22
  }
12
- export interface IValidateRedditTopicRequest {
13
- topic?: string;
23
+ /** ValidateTopicRequest is the request message for validating a reddit topic */
24
+ export interface ValidateRedditTopicRequest {
25
+ /** topic: the topic to validate */
26
+ topic: string;
14
27
  }
15
- export interface IValidateRedditTopicResponse {
16
- platform?: string;
17
- topic?: string;
18
- exists?: boolean;
19
- over18?: boolean;
20
- quarantine?: boolean;
28
+ /** ValidateTopicResponse is the response message for validating a topic */
29
+ export interface ValidateRedditTopicResponse {
30
+ /** platform: i.e. reddit */
31
+ platform: string;
32
+ /** topic: the topic to validate */
33
+ topic: string;
34
+ /** exists: whether the topic exists */
35
+ exists: boolean;
36
+ /** over18: whether the topic is NSFW */
37
+ over18: boolean;
38
+ /** quarantine: whether the topic is quarantined */
39
+ quarantine: boolean;
21
40
  }
22
- export interface ISn13ServiceClient {
23
- ListTopics(request: IListTopicsRequest): Promise<IListTopicsResponse>;
24
- ListTopics(request: IListTopicsRequest, callback: (error: Error | null, response: IListTopicsResponse) => void): void;
25
- ValidateRedditTopic(request: IValidateRedditTopicRequest): Promise<IValidateRedditTopicResponse>;
26
- ValidateRedditTopic(request: IValidateRedditTopicRequest, callback: (error: Error | null, response: IValidateRedditTopicResponse) => void): void;
27
- }
28
- export declare const sn13_validator: {
29
- options: {
30
- syntax: string;
41
+ export declare const ListTopicsRequest: MessageFns<ListTopicsRequest>;
42
+ export declare const ListTopicsResponseDetail: MessageFns<ListTopicsResponseDetail>;
43
+ export declare const ListTopicsResponse: MessageFns<ListTopicsResponse>;
44
+ export declare const ValidateRedditTopicRequest: MessageFns<ValidateRedditTopicRequest>;
45
+ export declare const ValidateRedditTopicResponse: MessageFns<ValidateRedditTopicResponse>;
46
+ export type Sn13ServiceService = typeof Sn13ServiceService;
47
+ export declare const Sn13ServiceService: {
48
+ /** ListTopics is the RPC method for getting the top topics */
49
+ readonly listTopics: {
50
+ readonly path: "/sn13.v1.Sn13Service/ListTopics";
51
+ readonly requestStream: false;
52
+ readonly responseStream: false;
53
+ readonly requestSerialize: (value: ListTopicsRequest) => Buffer<ArrayBuffer>;
54
+ readonly requestDeserialize: (value: Buffer) => ListTopicsRequest;
55
+ readonly responseSerialize: (value: ListTopicsResponse) => Buffer<ArrayBuffer>;
56
+ readonly responseDeserialize: (value: Buffer) => ListTopicsResponse;
31
57
  };
32
- nested: {
33
- sn13: {
34
- nested: {
35
- v1: {
36
- options: {
37
- go_package: string;
38
- };
39
- nested: {
40
- Sn13Service: {
41
- methods: {
42
- ListTopics: {
43
- requestType: string;
44
- responseType: string;
45
- };
46
- ValidateRedditTopic: {
47
- requestType: string;
48
- responseType: string;
49
- };
50
- };
51
- };
52
- ListTopicsRequest: {
53
- fields: {
54
- source: {
55
- type: string;
56
- id: number;
57
- };
58
- };
59
- };
60
- ListTopicsResponseDetail: {
61
- fields: {
62
- labelValue: {
63
- type: string;
64
- id: number;
65
- };
66
- contentSizeBytes: {
67
- type: string;
68
- id: number;
69
- };
70
- adjContentSizeBytes: {
71
- type: string;
72
- id: number;
73
- };
74
- };
75
- };
76
- ListTopicsResponse: {
77
- fields: {
78
- details: {
79
- rule: string;
80
- type: string;
81
- id: number;
82
- };
83
- };
84
- };
85
- ValidateRedditTopicRequest: {
86
- fields: {
87
- topic: {
88
- type: string;
89
- id: number;
90
- };
91
- };
92
- };
93
- ValidateRedditTopicResponse: {
94
- fields: {
95
- platform: {
96
- type: string;
97
- id: number;
98
- };
99
- topic: {
100
- type: string;
101
- id: number;
102
- };
103
- exists: {
104
- type: string;
105
- id: number;
106
- };
107
- over18: {
108
- type: string;
109
- id: number;
110
- };
111
- quarantine: {
112
- type: string;
113
- id: number;
114
- };
115
- };
116
- };
117
- };
118
- };
119
- };
120
- };
58
+ readonly validateRedditTopic: {
59
+ readonly path: "/sn13.v1.Sn13Service/ValidateRedditTopic";
60
+ readonly requestStream: false;
61
+ readonly responseStream: false;
62
+ readonly requestSerialize: (value: ValidateRedditTopicRequest) => Buffer<ArrayBuffer>;
63
+ readonly requestDeserialize: (value: Buffer) => ValidateRedditTopicRequest;
64
+ readonly responseSerialize: (value: ValidateRedditTopicResponse) => Buffer<ArrayBuffer>;
65
+ readonly responseDeserialize: (value: Buffer) => ValidateRedditTopicResponse;
121
66
  };
122
67
  };
68
+ export interface Sn13ServiceServer extends UntypedServiceImplementation {
69
+ /** ListTopics is the RPC method for getting the top topics */
70
+ listTopics: handleUnaryCall<ListTopicsRequest, ListTopicsResponse>;
71
+ validateRedditTopic: handleUnaryCall<ValidateRedditTopicRequest, ValidateRedditTopicResponse>;
72
+ }
73
+ export interface Sn13ServiceClient extends Client {
74
+ /** ListTopics is the RPC method for getting the top topics */
75
+ listTopics(request: ListTopicsRequest, callback: (error: ServiceError | null, response: ListTopicsResponse) => void): ClientUnaryCall;
76
+ listTopics(request: ListTopicsRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ListTopicsResponse) => void): ClientUnaryCall;
77
+ listTopics(request: ListTopicsRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ListTopicsResponse) => void): ClientUnaryCall;
78
+ validateRedditTopic(request: ValidateRedditTopicRequest, callback: (error: ServiceError | null, response: ValidateRedditTopicResponse) => void): ClientUnaryCall;
79
+ validateRedditTopic(request: ValidateRedditTopicRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ValidateRedditTopicResponse) => void): ClientUnaryCall;
80
+ validateRedditTopic(request: ValidateRedditTopicRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ValidateRedditTopicResponse) => void): ClientUnaryCall;
81
+ }
82
+ export declare const Sn13ServiceClient: {
83
+ new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): Sn13ServiceClient;
84
+ service: typeof Sn13ServiceService;
85
+ serviceName: string;
86
+ };
87
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
88
+ 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 {} ? {
89
+ [K in keyof T]?: DeepPartial<T[K]>;
90
+ } : Partial<T>;
91
+ export interface MessageFns<T> {
92
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
93
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
94
+ fromJSON(object: any): T;
95
+ toJSON(message: T): unknown;
96
+ create(base?: DeepPartial<T>): T;
97
+ fromPartial(object: DeepPartial<T>): T;
98
+ }
99
+ export {};