@guardian/bridget 2.8.1 → 3.0.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.
package/Discussion.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import * as thrift from "@creditkarma/thrift-server-core";
4
- import * as CommentResponse from "./CommentResponse";
4
+ import * as DiscussionResponse from "./DiscussionResponse";
5
5
  export declare const serviceName: string;
6
6
  export declare const annotations: thrift.IThriftAnnotations;
7
7
  export declare const methodAnnotations: thrift.IMethodAnnotations;
@@ -9,44 +9,15 @@ export declare const methodNames: Array<string>;
9
9
  export declare const methodParameters: {
10
10
  [methodName: string]: number;
11
11
  };
12
- export interface IPreview__Args {
13
- body: string;
14
- }
15
- export interface IPreview__ArgsArgs {
16
- body: string;
17
- }
18
- export declare const Preview__ArgsCodec: thrift.IStructCodec<IPreview__ArgsArgs, IPreview__Args>;
19
- export declare class Preview__Args extends thrift.StructLike implements IPreview__Args {
20
- body: string;
21
- readonly _annotations: thrift.IThriftAnnotations;
22
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
23
- constructor(args: IPreview__ArgsArgs);
24
- static read(input: thrift.TProtocol): Preview__Args;
25
- static write(args: IPreview__ArgsArgs, output: thrift.TProtocol): void;
26
- write(output: thrift.TProtocol): void;
27
- }
28
- export interface IIsDiscussionEnabled__Args {
29
- }
30
- export interface IIsDiscussionEnabled__ArgsArgs {
31
- }
32
- export declare const IsDiscussionEnabled__ArgsCodec: thrift.IStructCodec<IIsDiscussionEnabled__ArgsArgs, IIsDiscussionEnabled__Args>;
33
- export declare class IsDiscussionEnabled__Args extends thrift.StructLike implements IIsDiscussionEnabled__Args {
34
- readonly _annotations: thrift.IThriftAnnotations;
35
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
36
- constructor(args?: IIsDiscussionEnabled__ArgsArgs);
37
- static read(input: thrift.TProtocol): IsDiscussionEnabled__Args;
38
- static write(args: IIsDiscussionEnabled__ArgsArgs, output: thrift.TProtocol): void;
39
- write(output: thrift.TProtocol): void;
40
- }
41
12
  export interface IRecommend__Args {
42
- commentId: number;
13
+ commentId: string;
43
14
  }
44
15
  export interface IRecommend__ArgsArgs {
45
- commentId: number;
16
+ commentId: string;
46
17
  }
47
18
  export declare const Recommend__ArgsCodec: thrift.IStructCodec<IRecommend__ArgsArgs, IRecommend__Args>;
48
19
  export declare class Recommend__Args extends thrift.StructLike implements IRecommend__Args {
49
- commentId: number;
20
+ commentId: string;
50
21
  readonly _annotations: thrift.IThriftAnnotations;
51
22
  readonly _fieldAnnotations: thrift.IFieldAnnotations;
52
23
  constructor(args: IRecommend__ArgsArgs);
@@ -54,88 +25,15 @@ export declare class Recommend__Args extends thrift.StructLike implements IRecom
54
25
  static write(args: IRecommend__ArgsArgs, output: thrift.TProtocol): void;
55
26
  write(output: thrift.TProtocol): void;
56
27
  }
57
- export interface IComment__Args {
58
- shortUrl: string;
59
- body: string;
60
- }
61
- export interface IComment__ArgsArgs {
62
- shortUrl: string;
63
- body: string;
64
- }
65
- export declare const Comment__ArgsCodec: thrift.IStructCodec<IComment__ArgsArgs, IComment__Args>;
66
- export declare class Comment__Args extends thrift.StructLike implements IComment__Args {
67
- shortUrl: string;
68
- body: string;
69
- readonly _annotations: thrift.IThriftAnnotations;
70
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
71
- constructor(args: IComment__ArgsArgs);
72
- static read(input: thrift.TProtocol): Comment__Args;
73
- static write(args: IComment__ArgsArgs, output: thrift.TProtocol): void;
74
- write(output: thrift.TProtocol): void;
75
- }
76
- export interface IReply__Args {
77
- shortUrl: string;
78
- body: string;
79
- parentCommentId: number;
80
- }
81
- export interface IReply__ArgsArgs {
82
- shortUrl: string;
83
- body: string;
84
- parentCommentId: number;
85
- }
86
- export declare const Reply__ArgsCodec: thrift.IStructCodec<IReply__ArgsArgs, IReply__Args>;
87
- export declare class Reply__Args extends thrift.StructLike implements IReply__Args {
88
- shortUrl: string;
89
- body: string;
90
- parentCommentId: number;
91
- readonly _annotations: thrift.IThriftAnnotations;
92
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
93
- constructor(args: IReply__ArgsArgs);
94
- static read(input: thrift.TProtocol): Reply__Args;
95
- static write(args: IReply__ArgsArgs, output: thrift.TProtocol): void;
96
- write(output: thrift.TProtocol): void;
97
- }
98
- export interface IPreview__Result {
99
- success?: string;
100
- }
101
- export interface IPreview__ResultArgs {
102
- success?: string;
103
- }
104
- export declare const Preview__ResultCodec: thrift.IStructCodec<IPreview__ResultArgs, IPreview__Result>;
105
- export declare class Preview__Result extends thrift.StructLike implements IPreview__Result {
106
- success?: string;
107
- readonly _annotations: thrift.IThriftAnnotations;
108
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
109
- constructor(args?: IPreview__ResultArgs);
110
- static read(input: thrift.TProtocol): Preview__Result;
111
- static write(args: IPreview__ResultArgs, output: thrift.TProtocol): void;
112
- write(output: thrift.TProtocol): void;
113
- }
114
- export interface IIsDiscussionEnabled__Result {
115
- success?: boolean;
116
- }
117
- export interface IIsDiscussionEnabled__ResultArgs {
118
- success?: boolean;
119
- }
120
- export declare const IsDiscussionEnabled__ResultCodec: thrift.IStructCodec<IIsDiscussionEnabled__ResultArgs, IIsDiscussionEnabled__Result>;
121
- export declare class IsDiscussionEnabled__Result extends thrift.StructLike implements IIsDiscussionEnabled__Result {
122
- success?: boolean;
123
- readonly _annotations: thrift.IThriftAnnotations;
124
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
125
- constructor(args?: IIsDiscussionEnabled__ResultArgs);
126
- static read(input: thrift.TProtocol): IsDiscussionEnabled__Result;
127
- static write(args: IIsDiscussionEnabled__ResultArgs, output: thrift.TProtocol): void;
128
- write(output: thrift.TProtocol): void;
129
- }
130
28
  export interface IRecommend__Result {
131
- success?: boolean;
29
+ success?: DiscussionResponse.DiscussionResponse;
132
30
  }
133
31
  export interface IRecommend__ResultArgs {
134
- success?: boolean;
32
+ success?: DiscussionResponse.DiscussionResponseArgs;
135
33
  }
136
34
  export declare const Recommend__ResultCodec: thrift.IStructCodec<IRecommend__ResultArgs, IRecommend__Result>;
137
35
  export declare class Recommend__Result extends thrift.StructLike implements IRecommend__Result {
138
- success?: boolean;
36
+ success?: DiscussionResponse.DiscussionResponse;
139
37
  readonly _annotations: thrift.IThriftAnnotations;
140
38
  readonly _fieldAnnotations: thrift.IFieldAnnotations;
141
39
  constructor(args?: IRecommend__ResultArgs);
@@ -143,38 +41,6 @@ export declare class Recommend__Result extends thrift.StructLike implements IRec
143
41
  static write(args: IRecommend__ResultArgs, output: thrift.TProtocol): void;
144
42
  write(output: thrift.TProtocol): void;
145
43
  }
146
- export interface IComment__Result {
147
- success?: CommentResponse.ICommentResponse;
148
- }
149
- export interface IComment__ResultArgs {
150
- success?: CommentResponse.ICommentResponseArgs;
151
- }
152
- export declare const Comment__ResultCodec: thrift.IStructCodec<IComment__ResultArgs, IComment__Result>;
153
- export declare class Comment__Result extends thrift.StructLike implements IComment__Result {
154
- success?: CommentResponse.ICommentResponse;
155
- readonly _annotations: thrift.IThriftAnnotations;
156
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
157
- constructor(args?: IComment__ResultArgs);
158
- static read(input: thrift.TProtocol): Comment__Result;
159
- static write(args: IComment__ResultArgs, output: thrift.TProtocol): void;
160
- write(output: thrift.TProtocol): void;
161
- }
162
- export interface IReply__Result {
163
- success?: CommentResponse.ICommentResponse;
164
- }
165
- export interface IReply__ResultArgs {
166
- success?: CommentResponse.ICommentResponseArgs;
167
- }
168
- export declare const Reply__ResultCodec: thrift.IStructCodec<IReply__ResultArgs, IReply__Result>;
169
- export declare class Reply__Result extends thrift.StructLike implements IReply__Result {
170
- success?: CommentResponse.ICommentResponse;
171
- readonly _annotations: thrift.IThriftAnnotations;
172
- readonly _fieldAnnotations: thrift.IFieldAnnotations;
173
- constructor(args?: IReply__ResultArgs);
174
- static read(input: thrift.TProtocol): Reply__Result;
175
- static write(args: IReply__ResultArgs, output: thrift.TProtocol): void;
176
- write(output: thrift.TProtocol): void;
177
- }
178
44
  export declare class Client<Context = any> extends thrift.ThriftClient<Context> {
179
45
  static readonly serviceName: string;
180
46
  static readonly annotations: thrift.IThriftAnnotations;
@@ -187,18 +53,10 @@ export declare class Client<Context = any> extends thrift.ThriftClient<Context>
187
53
  readonly _methodParameters?: {
188
54
  [methodName: string]: number;
189
55
  };
190
- preview(body: string, context?: Context): Promise<string>;
191
- isDiscussionEnabled(context?: Context): Promise<boolean>;
192
- recommend(commentId: number, context?: Context): Promise<boolean>;
193
- comment(shortUrl: string, body: string, context?: Context): Promise<CommentResponse.ICommentResponse>;
194
- reply(shortUrl: string, body: string, parentCommentId: number, context?: Context): Promise<CommentResponse.ICommentResponse>;
56
+ recommend(commentId: string, context?: Context): Promise<DiscussionResponse.DiscussionResponse>;
195
57
  }
196
58
  export interface IHandler<Context = any> {
197
- preview(body: string, context?: Context): string | Promise<string>;
198
- isDiscussionEnabled(context?: Context): boolean | Promise<boolean>;
199
- recommend(commentId: number, context?: Context): boolean | Promise<boolean>;
200
- comment(shortUrl: string, body: string, context?: Context): CommentResponse.ICommentResponseArgs | Promise<CommentResponse.ICommentResponseArgs>;
201
- reply(shortUrl: string, body: string, parentCommentId: number, context?: Context): CommentResponse.ICommentResponseArgs | Promise<CommentResponse.ICommentResponseArgs>;
59
+ recommend(commentId: string, context?: Context): DiscussionResponse.DiscussionResponseArgs | Promise<DiscussionResponse.DiscussionResponseArgs>;
202
60
  }
203
61
  export declare class Processor<Context = any> extends thrift.ThriftProcessor<Context, IHandler<Context>> {
204
62
  protected readonly _handler: IHandler<Context>;
@@ -212,9 +70,5 @@ export declare class Processor<Context = any> extends thrift.ThriftProcessor<Con
212
70
  readonly _methodNames: Array<string>;
213
71
  constructor(handler: IHandler<Context>);
214
72
  process(input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
215
- process_preview(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
216
- process_isDiscussionEnabled(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
217
73
  process_recommend(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
218
- process_comment(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
219
- process_reply(requestId: number, input: thrift.TProtocol, output: thrift.TProtocol, context: Context): Promise<Buffer>;
220
74
  }