@ccmaymay/concrete 4.15.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/ActiveLearnerClientService.js +249 -0
- package/ActiveLearnerServerService.js +642 -0
- package/AnnotateCommunicationService.js +696 -0
- package/AnnotateWithContextService.js +298 -0
- package/FeedbackService.js +750 -0
- package/FetchCommunicationService.js +709 -0
- package/LICENSE +31 -0
- package/ResultsServerService.js +2138 -0
- package/SearchProxyService.js +962 -0
- package/SearchService.js +685 -0
- package/Service.js +373 -0
- package/StoreCommunicationService.js +255 -0
- package/SummarizationService.js +479 -0
- package/access_types.js +168 -0
- package/annotate_types.js +26 -0
- package/audio_types.js +110 -0
- package/cluster_types.js +398 -0
- package/communication_fu.js +432 -0
- package/communication_types.js +845 -0
- package/concrete.js +65 -0
- package/context_types.js +65 -0
- package/email_types.js +477 -0
- package/entities_types.js +658 -0
- package/ex_types.js +82 -0
- package/language_types.js +123 -0
- package/learn_types.js +207 -0
- package/linking_types.js +286 -0
- package/metadata_types.js +926 -0
- package/nitf_types.js +1005 -0
- package/package.json +23 -0
- package/results_types.js +18 -0
- package/search_types.js +661 -0
- package/services_types.js +384 -0
- package/situations_types.js +1268 -0
- package/spans_types.js +151 -0
- package/structure_types.js +2311 -0
- package/summarization_types.js +433 -0
- package/tokenization_fu.js +33 -0
- package/tokentagging_fu.js +241 -0
- package/twitter_types.js +1553 -0
- package/util.js +118 -0
- package/uuid_types.js +67 -0
@@ -0,0 +1,479 @@
|
|
1
|
+
//
|
2
|
+
// Autogenerated by Thrift Compiler (0.15.0)
|
3
|
+
//
|
4
|
+
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
//
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
const thrift = require('thrift');
|
9
|
+
const Thrift = thrift.Thrift;
|
10
|
+
const Int64 = require('node-int64');
|
11
|
+
|
12
|
+
const communication_ttypes = require('./communication_types');
|
13
|
+
const services_ttypes = require('./services_types');
|
14
|
+
const structure_ttypes = require('./structure_types');
|
15
|
+
const uuid_ttypes = require('./uuid_types');
|
16
|
+
|
17
|
+
|
18
|
+
const Service = require('./Service');
|
19
|
+
const ServiceClient = Service.Client;
|
20
|
+
const ServiceProcessor = Service.Processor;
|
21
|
+
const ttypes = require('./summarization_types');
|
22
|
+
//HELPER FUNCTIONS AND STRUCTURES
|
23
|
+
|
24
|
+
const SummarizationService_summarize_args = class {
|
25
|
+
constructor(args) {
|
26
|
+
this.query = null;
|
27
|
+
if (args) {
|
28
|
+
if (args.query !== undefined && args.query !== null) {
|
29
|
+
this.query = new ttypes.SummarizationRequest(args.query);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
read (input) {
|
35
|
+
input.readStructBegin();
|
36
|
+
while (true) {
|
37
|
+
const ret = input.readFieldBegin();
|
38
|
+
const ftype = ret.ftype;
|
39
|
+
const fid = ret.fid;
|
40
|
+
if (ftype == Thrift.Type.STOP) {
|
41
|
+
break;
|
42
|
+
}
|
43
|
+
switch (fid) {
|
44
|
+
case 1:
|
45
|
+
if (ftype == Thrift.Type.STRUCT) {
|
46
|
+
this.query = new ttypes.SummarizationRequest();
|
47
|
+
this.query.read(input);
|
48
|
+
} else {
|
49
|
+
input.skip(ftype);
|
50
|
+
}
|
51
|
+
break;
|
52
|
+
case 0:
|
53
|
+
input.skip(ftype);
|
54
|
+
break;
|
55
|
+
default:
|
56
|
+
input.skip(ftype);
|
57
|
+
}
|
58
|
+
input.readFieldEnd();
|
59
|
+
}
|
60
|
+
input.readStructEnd();
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
|
64
|
+
write (output) {
|
65
|
+
output.writeStructBegin('SummarizationService_summarize_args');
|
66
|
+
if (this.query !== null && this.query !== undefined) {
|
67
|
+
output.writeFieldBegin('query', Thrift.Type.STRUCT, 1);
|
68
|
+
this.query.write(output);
|
69
|
+
output.writeFieldEnd();
|
70
|
+
}
|
71
|
+
output.writeFieldStop();
|
72
|
+
output.writeStructEnd();
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
|
76
|
+
};
|
77
|
+
const SummarizationService_summarize_result = class {
|
78
|
+
constructor(args) {
|
79
|
+
this.success = null;
|
80
|
+
this.ex = null;
|
81
|
+
if (args instanceof services_ttypes.ServicesException) {
|
82
|
+
this.ex = args;
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
if (args) {
|
86
|
+
if (args.success !== undefined && args.success !== null) {
|
87
|
+
this.success = new ttypes.Summary(args.success);
|
88
|
+
}
|
89
|
+
if (args.ex !== undefined && args.ex !== null) {
|
90
|
+
this.ex = args.ex;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
read (input) {
|
96
|
+
input.readStructBegin();
|
97
|
+
while (true) {
|
98
|
+
const ret = input.readFieldBegin();
|
99
|
+
const ftype = ret.ftype;
|
100
|
+
const fid = ret.fid;
|
101
|
+
if (ftype == Thrift.Type.STOP) {
|
102
|
+
break;
|
103
|
+
}
|
104
|
+
switch (fid) {
|
105
|
+
case 0:
|
106
|
+
if (ftype == Thrift.Type.STRUCT) {
|
107
|
+
this.success = new ttypes.Summary();
|
108
|
+
this.success.read(input);
|
109
|
+
} else {
|
110
|
+
input.skip(ftype);
|
111
|
+
}
|
112
|
+
break;
|
113
|
+
case 1:
|
114
|
+
if (ftype == Thrift.Type.STRUCT) {
|
115
|
+
this.ex = new services_ttypes.ServicesException();
|
116
|
+
this.ex.read(input);
|
117
|
+
} else {
|
118
|
+
input.skip(ftype);
|
119
|
+
}
|
120
|
+
break;
|
121
|
+
default:
|
122
|
+
input.skip(ftype);
|
123
|
+
}
|
124
|
+
input.readFieldEnd();
|
125
|
+
}
|
126
|
+
input.readStructEnd();
|
127
|
+
return;
|
128
|
+
}
|
129
|
+
|
130
|
+
write (output) {
|
131
|
+
output.writeStructBegin('SummarizationService_summarize_result');
|
132
|
+
if (this.success !== null && this.success !== undefined) {
|
133
|
+
output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);
|
134
|
+
this.success.write(output);
|
135
|
+
output.writeFieldEnd();
|
136
|
+
}
|
137
|
+
if (this.ex !== null && this.ex !== undefined) {
|
138
|
+
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
|
139
|
+
this.ex.write(output);
|
140
|
+
output.writeFieldEnd();
|
141
|
+
}
|
142
|
+
output.writeFieldStop();
|
143
|
+
output.writeStructEnd();
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
|
147
|
+
};
|
148
|
+
const SummarizationService_getCapabilities_args = class {
|
149
|
+
constructor(args) {
|
150
|
+
}
|
151
|
+
|
152
|
+
read (input) {
|
153
|
+
input.readStructBegin();
|
154
|
+
while (true) {
|
155
|
+
const ret = input.readFieldBegin();
|
156
|
+
const ftype = ret.ftype;
|
157
|
+
if (ftype == Thrift.Type.STOP) {
|
158
|
+
break;
|
159
|
+
}
|
160
|
+
input.skip(ftype);
|
161
|
+
input.readFieldEnd();
|
162
|
+
}
|
163
|
+
input.readStructEnd();
|
164
|
+
return;
|
165
|
+
}
|
166
|
+
|
167
|
+
write (output) {
|
168
|
+
output.writeStructBegin('SummarizationService_getCapabilities_args');
|
169
|
+
output.writeFieldStop();
|
170
|
+
output.writeStructEnd();
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
|
174
|
+
};
|
175
|
+
const SummarizationService_getCapabilities_result = class {
|
176
|
+
constructor(args) {
|
177
|
+
this.success = null;
|
178
|
+
this.ex = null;
|
179
|
+
if (args instanceof services_ttypes.ServicesException) {
|
180
|
+
this.ex = args;
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
if (args) {
|
184
|
+
if (args.success !== undefined && args.success !== null) {
|
185
|
+
this.success = Thrift.copyList(args.success, [ttypes.SummarizationCapability]);
|
186
|
+
}
|
187
|
+
if (args.ex !== undefined && args.ex !== null) {
|
188
|
+
this.ex = args.ex;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
read (input) {
|
194
|
+
input.readStructBegin();
|
195
|
+
while (true) {
|
196
|
+
const ret = input.readFieldBegin();
|
197
|
+
const ftype = ret.ftype;
|
198
|
+
const fid = ret.fid;
|
199
|
+
if (ftype == Thrift.Type.STOP) {
|
200
|
+
break;
|
201
|
+
}
|
202
|
+
switch (fid) {
|
203
|
+
case 0:
|
204
|
+
if (ftype == Thrift.Type.LIST) {
|
205
|
+
this.success = [];
|
206
|
+
const _rtmp316 = input.readListBegin();
|
207
|
+
const _size15 = _rtmp316.size || 0;
|
208
|
+
for (let _i17 = 0; _i17 < _size15; ++_i17) {
|
209
|
+
let elem18 = null;
|
210
|
+
elem18 = new ttypes.SummarizationCapability();
|
211
|
+
elem18.read(input);
|
212
|
+
this.success.push(elem18);
|
213
|
+
}
|
214
|
+
input.readListEnd();
|
215
|
+
} else {
|
216
|
+
input.skip(ftype);
|
217
|
+
}
|
218
|
+
break;
|
219
|
+
case 1:
|
220
|
+
if (ftype == Thrift.Type.STRUCT) {
|
221
|
+
this.ex = new services_ttypes.ServicesException();
|
222
|
+
this.ex.read(input);
|
223
|
+
} else {
|
224
|
+
input.skip(ftype);
|
225
|
+
}
|
226
|
+
break;
|
227
|
+
default:
|
228
|
+
input.skip(ftype);
|
229
|
+
}
|
230
|
+
input.readFieldEnd();
|
231
|
+
}
|
232
|
+
input.readStructEnd();
|
233
|
+
return;
|
234
|
+
}
|
235
|
+
|
236
|
+
write (output) {
|
237
|
+
output.writeStructBegin('SummarizationService_getCapabilities_result');
|
238
|
+
if (this.success !== null && this.success !== undefined) {
|
239
|
+
output.writeFieldBegin('success', Thrift.Type.LIST, 0);
|
240
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.success.length);
|
241
|
+
for (let iter19 in this.success) {
|
242
|
+
if (this.success.hasOwnProperty(iter19)) {
|
243
|
+
iter19 = this.success[iter19];
|
244
|
+
iter19.write(output);
|
245
|
+
}
|
246
|
+
}
|
247
|
+
output.writeListEnd();
|
248
|
+
output.writeFieldEnd();
|
249
|
+
}
|
250
|
+
if (this.ex !== null && this.ex !== undefined) {
|
251
|
+
output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);
|
252
|
+
this.ex.write(output);
|
253
|
+
output.writeFieldEnd();
|
254
|
+
}
|
255
|
+
output.writeFieldStop();
|
256
|
+
output.writeStructEnd();
|
257
|
+
return;
|
258
|
+
}
|
259
|
+
|
260
|
+
};
|
261
|
+
const SummarizationServiceClient = exports.Client = class SummarizationServiceClient extends ServiceClient {
|
262
|
+
constructor(output, pClass) {
|
263
|
+
super(output, pClass);
|
264
|
+
this.output = output;
|
265
|
+
this.pClass = pClass;
|
266
|
+
this._seqid = 0;
|
267
|
+
this._reqs = {};
|
268
|
+
}
|
269
|
+
seqid () { return this._seqid; }
|
270
|
+
new_seqid () { return this._seqid += 1; }
|
271
|
+
|
272
|
+
summarize (query) {
|
273
|
+
this._seqid = this.new_seqid();
|
274
|
+
const self = this;
|
275
|
+
return new Promise((resolve, reject) => {
|
276
|
+
self._reqs[self.seqid()] = (error, result) => {
|
277
|
+
return error ? reject(error) : resolve(result);
|
278
|
+
};
|
279
|
+
self.send_summarize(query);
|
280
|
+
});
|
281
|
+
}
|
282
|
+
|
283
|
+
send_summarize (query) {
|
284
|
+
const output = new this.pClass(this.output);
|
285
|
+
const params = {
|
286
|
+
query: query
|
287
|
+
};
|
288
|
+
const args = new SummarizationService_summarize_args(params);
|
289
|
+
try {
|
290
|
+
output.writeMessageBegin('summarize', Thrift.MessageType.CALL, this.seqid());
|
291
|
+
args.write(output);
|
292
|
+
output.writeMessageEnd();
|
293
|
+
return this.output.flush();
|
294
|
+
}
|
295
|
+
catch (e) {
|
296
|
+
delete this._reqs[this.seqid()];
|
297
|
+
if (typeof output.reset === 'function') {
|
298
|
+
output.reset();
|
299
|
+
}
|
300
|
+
throw e;
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
recv_summarize (input, mtype, rseqid) {
|
305
|
+
const callback = this._reqs[rseqid] || function() {};
|
306
|
+
delete this._reqs[rseqid];
|
307
|
+
if (mtype == Thrift.MessageType.EXCEPTION) {
|
308
|
+
const x = new Thrift.TApplicationException();
|
309
|
+
x.read(input);
|
310
|
+
input.readMessageEnd();
|
311
|
+
return callback(x);
|
312
|
+
}
|
313
|
+
const result = new SummarizationService_summarize_result();
|
314
|
+
result.read(input);
|
315
|
+
input.readMessageEnd();
|
316
|
+
|
317
|
+
if (null !== result.ex) {
|
318
|
+
return callback(result.ex);
|
319
|
+
}
|
320
|
+
if (null !== result.success) {
|
321
|
+
return callback(null, result.success);
|
322
|
+
}
|
323
|
+
return callback('summarize failed: unknown result');
|
324
|
+
}
|
325
|
+
|
326
|
+
getCapabilities () {
|
327
|
+
this._seqid = this.new_seqid();
|
328
|
+
const self = this;
|
329
|
+
return new Promise((resolve, reject) => {
|
330
|
+
self._reqs[self.seqid()] = (error, result) => {
|
331
|
+
return error ? reject(error) : resolve(result);
|
332
|
+
};
|
333
|
+
self.send_getCapabilities();
|
334
|
+
});
|
335
|
+
}
|
336
|
+
|
337
|
+
send_getCapabilities () {
|
338
|
+
const output = new this.pClass(this.output);
|
339
|
+
const args = new SummarizationService_getCapabilities_args();
|
340
|
+
try {
|
341
|
+
output.writeMessageBegin('getCapabilities', Thrift.MessageType.CALL, this.seqid());
|
342
|
+
args.write(output);
|
343
|
+
output.writeMessageEnd();
|
344
|
+
return this.output.flush();
|
345
|
+
}
|
346
|
+
catch (e) {
|
347
|
+
delete this._reqs[this.seqid()];
|
348
|
+
if (typeof output.reset === 'function') {
|
349
|
+
output.reset();
|
350
|
+
}
|
351
|
+
throw e;
|
352
|
+
}
|
353
|
+
}
|
354
|
+
|
355
|
+
recv_getCapabilities (input, mtype, rseqid) {
|
356
|
+
const callback = this._reqs[rseqid] || function() {};
|
357
|
+
delete this._reqs[rseqid];
|
358
|
+
if (mtype == Thrift.MessageType.EXCEPTION) {
|
359
|
+
const x = new Thrift.TApplicationException();
|
360
|
+
x.read(input);
|
361
|
+
input.readMessageEnd();
|
362
|
+
return callback(x);
|
363
|
+
}
|
364
|
+
const result = new SummarizationService_getCapabilities_result();
|
365
|
+
result.read(input);
|
366
|
+
input.readMessageEnd();
|
367
|
+
|
368
|
+
if (null !== result.ex) {
|
369
|
+
return callback(result.ex);
|
370
|
+
}
|
371
|
+
if (null !== result.success) {
|
372
|
+
return callback(null, result.success);
|
373
|
+
}
|
374
|
+
return callback('getCapabilities failed: unknown result');
|
375
|
+
}
|
376
|
+
};
|
377
|
+
const SummarizationServiceProcessor = exports.Processor = class SummarizationServiceProcessor extends ServiceProcessor {
|
378
|
+
constructor(handler) {
|
379
|
+
super(handler);
|
380
|
+
this._handler = handler;
|
381
|
+
}
|
382
|
+
process (input, output) {
|
383
|
+
const r = input.readMessageBegin();
|
384
|
+
if (this['process_' + r.fname]) {
|
385
|
+
return this['process_' + r.fname].call(this, r.rseqid, input, output);
|
386
|
+
} else {
|
387
|
+
input.skip(Thrift.Type.STRUCT);
|
388
|
+
input.readMessageEnd();
|
389
|
+
const x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);
|
390
|
+
output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid);
|
391
|
+
x.write(output);
|
392
|
+
output.writeMessageEnd();
|
393
|
+
output.flush();
|
394
|
+
}
|
395
|
+
}
|
396
|
+
process_summarize (seqid, input, output) {
|
397
|
+
const args = new SummarizationService_summarize_args();
|
398
|
+
args.read(input);
|
399
|
+
input.readMessageEnd();
|
400
|
+
if (this._handler.summarize.length === 1) {
|
401
|
+
Promise.resolve(this._handler.summarize.bind(this._handler)(
|
402
|
+
args.query
|
403
|
+
)).then(result => {
|
404
|
+
const result_obj = new SummarizationService_summarize_result({success: result});
|
405
|
+
output.writeMessageBegin("summarize", Thrift.MessageType.REPLY, seqid);
|
406
|
+
result_obj.write(output);
|
407
|
+
output.writeMessageEnd();
|
408
|
+
output.flush();
|
409
|
+
}).catch(err => {
|
410
|
+
let result;
|
411
|
+
if (err instanceof services_ttypes.ServicesException) {
|
412
|
+
result = new SummarizationService_summarize_result(err);
|
413
|
+
output.writeMessageBegin("summarize", Thrift.MessageType.REPLY, seqid);
|
414
|
+
} else {
|
415
|
+
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
416
|
+
output.writeMessageBegin("summarize", Thrift.MessageType.EXCEPTION, seqid);
|
417
|
+
}
|
418
|
+
result.write(output);
|
419
|
+
output.writeMessageEnd();
|
420
|
+
output.flush();
|
421
|
+
});
|
422
|
+
} else {
|
423
|
+
this._handler.summarize(args.query, (err, result) => {
|
424
|
+
let result_obj;
|
425
|
+
if ((err === null || typeof err === 'undefined') || err instanceof services_ttypes.ServicesException) {
|
426
|
+
result_obj = new SummarizationService_summarize_result((err !== null || typeof err === 'undefined') ? err : {success: result});
|
427
|
+
output.writeMessageBegin("summarize", Thrift.MessageType.REPLY, seqid);
|
428
|
+
} else {
|
429
|
+
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
430
|
+
output.writeMessageBegin("summarize", Thrift.MessageType.EXCEPTION, seqid);
|
431
|
+
}
|
432
|
+
result_obj.write(output);
|
433
|
+
output.writeMessageEnd();
|
434
|
+
output.flush();
|
435
|
+
});
|
436
|
+
}
|
437
|
+
}
|
438
|
+
process_getCapabilities (seqid, input, output) {
|
439
|
+
const args = new SummarizationService_getCapabilities_args();
|
440
|
+
args.read(input);
|
441
|
+
input.readMessageEnd();
|
442
|
+
if (this._handler.getCapabilities.length === 0) {
|
443
|
+
Promise.resolve(this._handler.getCapabilities.bind(this._handler)(
|
444
|
+
)).then(result => {
|
445
|
+
const result_obj = new SummarizationService_getCapabilities_result({success: result});
|
446
|
+
output.writeMessageBegin("getCapabilities", Thrift.MessageType.REPLY, seqid);
|
447
|
+
result_obj.write(output);
|
448
|
+
output.writeMessageEnd();
|
449
|
+
output.flush();
|
450
|
+
}).catch(err => {
|
451
|
+
let result;
|
452
|
+
if (err instanceof services_ttypes.ServicesException) {
|
453
|
+
result = new SummarizationService_getCapabilities_result(err);
|
454
|
+
output.writeMessageBegin("getCapabilities", Thrift.MessageType.REPLY, seqid);
|
455
|
+
} else {
|
456
|
+
result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
457
|
+
output.writeMessageBegin("getCapabilities", Thrift.MessageType.EXCEPTION, seqid);
|
458
|
+
}
|
459
|
+
result.write(output);
|
460
|
+
output.writeMessageEnd();
|
461
|
+
output.flush();
|
462
|
+
});
|
463
|
+
} else {
|
464
|
+
this._handler.getCapabilities((err, result) => {
|
465
|
+
let result_obj;
|
466
|
+
if ((err === null || typeof err === 'undefined') || err instanceof services_ttypes.ServicesException) {
|
467
|
+
result_obj = new SummarizationService_getCapabilities_result((err !== null || typeof err === 'undefined') ? err : {success: result});
|
468
|
+
output.writeMessageBegin("getCapabilities", Thrift.MessageType.REPLY, seqid);
|
469
|
+
} else {
|
470
|
+
result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
|
471
|
+
output.writeMessageBegin("getCapabilities", Thrift.MessageType.EXCEPTION, seqid);
|
472
|
+
}
|
473
|
+
result_obj.write(output);
|
474
|
+
output.writeMessageEnd();
|
475
|
+
output.flush();
|
476
|
+
});
|
477
|
+
}
|
478
|
+
}
|
479
|
+
};
|
package/access_types.js
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
//
|
2
|
+
// Autogenerated by Thrift Compiler (0.15.0)
|
3
|
+
//
|
4
|
+
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
//
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
const thrift = require('thrift');
|
9
|
+
const Thrift = thrift.Thrift;
|
10
|
+
const Int64 = require('node-int64');
|
11
|
+
|
12
|
+
const communication_ttypes = require('./communication_types');
|
13
|
+
const services_ttypes = require('./services_types');
|
14
|
+
|
15
|
+
|
16
|
+
const ttypes = module.exports = {};
|
17
|
+
const FetchResult = module.exports.FetchResult = class {
|
18
|
+
constructor(args) {
|
19
|
+
this.communications = null;
|
20
|
+
if (args) {
|
21
|
+
if (args.communications !== undefined && args.communications !== null) {
|
22
|
+
this.communications = Thrift.copyList(args.communications, [communication_ttypes.Communication]);
|
23
|
+
} else {
|
24
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field communications is unset!');
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
read (input) {
|
30
|
+
input.readStructBegin();
|
31
|
+
while (true) {
|
32
|
+
const ret = input.readFieldBegin();
|
33
|
+
const ftype = ret.ftype;
|
34
|
+
const fid = ret.fid;
|
35
|
+
if (ftype == Thrift.Type.STOP) {
|
36
|
+
break;
|
37
|
+
}
|
38
|
+
switch (fid) {
|
39
|
+
case 1:
|
40
|
+
if (ftype == Thrift.Type.LIST) {
|
41
|
+
this.communications = [];
|
42
|
+
const _rtmp31 = input.readListBegin();
|
43
|
+
const _size0 = _rtmp31.size || 0;
|
44
|
+
for (let _i2 = 0; _i2 < _size0; ++_i2) {
|
45
|
+
let elem3 = null;
|
46
|
+
elem3 = new communication_ttypes.Communication();
|
47
|
+
elem3.read(input);
|
48
|
+
this.communications.push(elem3);
|
49
|
+
}
|
50
|
+
input.readListEnd();
|
51
|
+
} else {
|
52
|
+
input.skip(ftype);
|
53
|
+
}
|
54
|
+
break;
|
55
|
+
case 0:
|
56
|
+
input.skip(ftype);
|
57
|
+
break;
|
58
|
+
default:
|
59
|
+
input.skip(ftype);
|
60
|
+
}
|
61
|
+
input.readFieldEnd();
|
62
|
+
}
|
63
|
+
input.readStructEnd();
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
|
67
|
+
write (output) {
|
68
|
+
output.writeStructBegin('FetchResult');
|
69
|
+
if (this.communications !== null && this.communications !== undefined) {
|
70
|
+
output.writeFieldBegin('communications', Thrift.Type.LIST, 1);
|
71
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.communications.length);
|
72
|
+
for (let iter4 in this.communications) {
|
73
|
+
if (this.communications.hasOwnProperty(iter4)) {
|
74
|
+
iter4 = this.communications[iter4];
|
75
|
+
iter4.write(output);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
output.writeListEnd();
|
79
|
+
output.writeFieldEnd();
|
80
|
+
}
|
81
|
+
output.writeFieldStop();
|
82
|
+
output.writeStructEnd();
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
|
86
|
+
};
|
87
|
+
const FetchRequest = module.exports.FetchRequest = class {
|
88
|
+
constructor(args) {
|
89
|
+
this.communicationIds = null;
|
90
|
+
this.auths = null;
|
91
|
+
if (args) {
|
92
|
+
if (args.communicationIds !== undefined && args.communicationIds !== null) {
|
93
|
+
this.communicationIds = Thrift.copyList(args.communicationIds, [null]);
|
94
|
+
} else {
|
95
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field communicationIds is unset!');
|
96
|
+
}
|
97
|
+
if (args.auths !== undefined && args.auths !== null) {
|
98
|
+
this.auths = args.auths;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
read (input) {
|
104
|
+
input.readStructBegin();
|
105
|
+
while (true) {
|
106
|
+
const ret = input.readFieldBegin();
|
107
|
+
const ftype = ret.ftype;
|
108
|
+
const fid = ret.fid;
|
109
|
+
if (ftype == Thrift.Type.STOP) {
|
110
|
+
break;
|
111
|
+
}
|
112
|
+
switch (fid) {
|
113
|
+
case 1:
|
114
|
+
if (ftype == Thrift.Type.LIST) {
|
115
|
+
this.communicationIds = [];
|
116
|
+
const _rtmp36 = input.readListBegin();
|
117
|
+
const _size5 = _rtmp36.size || 0;
|
118
|
+
for (let _i7 = 0; _i7 < _size5; ++_i7) {
|
119
|
+
let elem8 = null;
|
120
|
+
elem8 = input.readString();
|
121
|
+
this.communicationIds.push(elem8);
|
122
|
+
}
|
123
|
+
input.readListEnd();
|
124
|
+
} else {
|
125
|
+
input.skip(ftype);
|
126
|
+
}
|
127
|
+
break;
|
128
|
+
case 2:
|
129
|
+
if (ftype == Thrift.Type.STRING) {
|
130
|
+
this.auths = input.readString();
|
131
|
+
} else {
|
132
|
+
input.skip(ftype);
|
133
|
+
}
|
134
|
+
break;
|
135
|
+
default:
|
136
|
+
input.skip(ftype);
|
137
|
+
}
|
138
|
+
input.readFieldEnd();
|
139
|
+
}
|
140
|
+
input.readStructEnd();
|
141
|
+
return;
|
142
|
+
}
|
143
|
+
|
144
|
+
write (output) {
|
145
|
+
output.writeStructBegin('FetchRequest');
|
146
|
+
if (this.communicationIds !== null && this.communicationIds !== undefined) {
|
147
|
+
output.writeFieldBegin('communicationIds', Thrift.Type.LIST, 1);
|
148
|
+
output.writeListBegin(Thrift.Type.STRING, this.communicationIds.length);
|
149
|
+
for (let iter9 in this.communicationIds) {
|
150
|
+
if (this.communicationIds.hasOwnProperty(iter9)) {
|
151
|
+
iter9 = this.communicationIds[iter9];
|
152
|
+
output.writeString(iter9);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
output.writeListEnd();
|
156
|
+
output.writeFieldEnd();
|
157
|
+
}
|
158
|
+
if (this.auths !== null && this.auths !== undefined) {
|
159
|
+
output.writeFieldBegin('auths', Thrift.Type.STRING, 2);
|
160
|
+
output.writeString(this.auths);
|
161
|
+
output.writeFieldEnd();
|
162
|
+
}
|
163
|
+
output.writeFieldStop();
|
164
|
+
output.writeStructEnd();
|
165
|
+
return;
|
166
|
+
}
|
167
|
+
|
168
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
//
|
2
|
+
// Autogenerated by Thrift Compiler (0.15.0)
|
3
|
+
//
|
4
|
+
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
//
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
const thrift = require('thrift');
|
9
|
+
const Thrift = thrift.Thrift;
|
10
|
+
const Int64 = require('node-int64');
|
11
|
+
|
12
|
+
const context_ttypes = require('./context_types');
|
13
|
+
const metadata_ttypes = require('./metadata_types');
|
14
|
+
const language_ttypes = require('./language_types');
|
15
|
+
const structure_ttypes = require('./structure_types');
|
16
|
+
const entities_ttypes = require('./entities_types');
|
17
|
+
const situations_ttypes = require('./situations_types');
|
18
|
+
const ex_ttypes = require('./ex_types');
|
19
|
+
const email_ttypes = require('./email_types');
|
20
|
+
const twitter_ttypes = require('./twitter_types');
|
21
|
+
const audio_ttypes = require('./audio_types');
|
22
|
+
const communication_ttypes = require('./communication_types');
|
23
|
+
const services_ttypes = require('./services_types');
|
24
|
+
|
25
|
+
|
26
|
+
const ttypes = module.exports = {};
|