@fonoster/sdk 0.14.3 → 0.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.
@@ -249,6 +249,11 @@ class Applications {
249
249
  metadata: this.client.getMetadata(),
250
250
  request,
251
251
  enumMapping: [["type", applications_pb_1.ApplicationType]],
252
+ objectMapping: [
253
+ ["speechToText", applications_pb_1.ProductContainer],
254
+ ["textToSpeech", applications_pb_1.ProductContainer],
255
+ ["intelligence", applications_pb_1.ProductContainer]
256
+ ],
252
257
  repeatableObjectMapping: [["itemsList", applications_pb_1.Application]]
253
258
  });
254
259
  return {
@@ -22,6 +22,7 @@
22
22
  var grpc = require('@grpc/grpc-js');
23
23
  var applications_pb = require('./applications_pb.js');
24
24
  var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
25
+ var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
25
26
 
26
27
  function serialize_fonoster_applications_v1beta2_Application(arg) {
27
28
  if (!(arg instanceof applications_pb.Application)) {
@@ -133,6 +134,17 @@ function deserialize_fonoster_applications_v1beta2_ListApplicationsResponse(buff
133
134
  return applications_pb.ListApplicationsResponse.deserializeBinary(new Uint8Array(buffer_arg));
134
135
  }
135
136
 
137
+ function serialize_fonoster_applications_v1beta2_TestTokenResponse(arg) {
138
+ if (!(arg instanceof applications_pb.TestTokenResponse)) {
139
+ throw new Error('Expected argument of type fonoster.applications.v1beta2.TestTokenResponse');
140
+ }
141
+ return Buffer.from(arg.serializeBinary());
142
+ }
143
+
144
+ function deserialize_fonoster_applications_v1beta2_TestTokenResponse(buffer_arg) {
145
+ return applications_pb.TestTokenResponse.deserializeBinary(new Uint8Array(buffer_arg));
146
+ }
147
+
136
148
  function serialize_fonoster_applications_v1beta2_UpdateApplicationRequest(arg) {
137
149
  if (!(arg instanceof applications_pb.UpdateApplicationRequest)) {
138
150
  throw new Error('Expected argument of type fonoster.applications.v1beta2.UpdateApplicationRequest');
@@ -155,6 +167,17 @@ function deserialize_fonoster_applications_v1beta2_UpdateApplicationResponse(buf
155
167
  return applications_pb.UpdateApplicationResponse.deserializeBinary(new Uint8Array(buffer_arg));
156
168
  }
157
169
 
170
+ function serialize_google_protobuf_Empty(arg) {
171
+ if (!(arg instanceof google_protobuf_empty_pb.Empty)) {
172
+ throw new Error('Expected argument of type google.protobuf.Empty');
173
+ }
174
+ return Buffer.from(arg.serializeBinary());
175
+ }
176
+
177
+ function deserialize_google_protobuf_Empty(buffer_arg) {
178
+ return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg));
179
+ }
180
+
158
181
 
159
182
  // Applications service definition
160
183
  var ApplicationsService = exports.ApplicationsService = {
@@ -230,6 +253,18 @@ evaluateIntelligence: {
230
253
  responseSerialize: serialize_fonoster_applications_v1beta2_EvaluateIntelligenceResponse,
231
254
  responseDeserialize: deserialize_fonoster_applications_v1beta2_EvaluateIntelligenceResponse,
232
255
  },
256
+ // Create an Ephemeral Agent to perform test calls to an application
257
+ createTestToken: {
258
+ path: '/fonoster.applications.v1beta2.Applications/CreateTestToken',
259
+ requestStream: false,
260
+ responseStream: false,
261
+ requestType: google_protobuf_empty_pb.Empty,
262
+ responseType: applications_pb.TestTokenResponse,
263
+ requestSerialize: serialize_google_protobuf_Empty,
264
+ requestDeserialize: deserialize_google_protobuf_Empty,
265
+ responseSerialize: serialize_fonoster_applications_v1beta2_TestTokenResponse,
266
+ responseDeserialize: deserialize_fonoster_applications_v1beta2_TestTokenResponse,
267
+ },
233
268
  };
234
269
 
235
270
  exports.ApplicationsClient = grpc.makeGenericClientConstructor(ApplicationsService, 'Applications');
@@ -23,6 +23,8 @@ var global =
23
23
 
24
24
  var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
25
25
  goog.object.extend(proto, google_protobuf_struct_pb);
26
+ var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
27
+ goog.object.extend(proto, google_protobuf_empty_pb);
26
28
  goog.exportSymbol('proto.fonoster.applications.v1beta2.Application', null, global);
27
29
  goog.exportSymbol('proto.fonoster.applications.v1beta2.ApplicationType', null, global);
28
30
  goog.exportSymbol('proto.fonoster.applications.v1beta2.CreateApplicationRequest', null, global);
@@ -39,6 +41,7 @@ goog.exportSymbol('proto.fonoster.applications.v1beta2.GetApplicationRequest', n
39
41
  goog.exportSymbol('proto.fonoster.applications.v1beta2.ListApplicationsRequest', null, global);
40
42
  goog.exportSymbol('proto.fonoster.applications.v1beta2.ListApplicationsResponse', null, global);
41
43
  goog.exportSymbol('proto.fonoster.applications.v1beta2.ProductContainer', null, global);
44
+ goog.exportSymbol('proto.fonoster.applications.v1beta2.TestTokenResponse', null, global);
42
45
  goog.exportSymbol('proto.fonoster.applications.v1beta2.UpdateApplicationRequest', null, global);
43
46
  goog.exportSymbol('proto.fonoster.applications.v1beta2.UpdateApplicationResponse', null, global);
44
47
  /**
@@ -377,6 +380,27 @@ if (goog.DEBUG && !COMPILED) {
377
380
  */
378
381
  proto.fonoster.applications.v1beta2.EvaluateIntelligenceResponse.ScenarioEvaluationReport.displayName = 'proto.fonoster.applications.v1beta2.EvaluateIntelligenceResponse.ScenarioEvaluationReport';
379
382
  }
383
+ /**
384
+ * Generated by JsPbCodeGenerator.
385
+ * @param {Array=} opt_data Optional initial data array, typically from a
386
+ * server response, or constructed directly in Javascript. The array is used
387
+ * in place and becomes part of the constructed object. It is not cloned.
388
+ * If no data is provided, the constructed object will be empty, but still
389
+ * valid.
390
+ * @extends {jspb.Message}
391
+ * @constructor
392
+ */
393
+ proto.fonoster.applications.v1beta2.TestTokenResponse = function(opt_data) {
394
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
395
+ };
396
+ goog.inherits(proto.fonoster.applications.v1beta2.TestTokenResponse, jspb.Message);
397
+ if (goog.DEBUG && !COMPILED) {
398
+ /**
399
+ * @public
400
+ * @override
401
+ */
402
+ proto.fonoster.applications.v1beta2.TestTokenResponse.displayName = 'proto.fonoster.applications.v1beta2.TestTokenResponse';
403
+ }
380
404
 
381
405
 
382
406
 
@@ -3959,6 +3983,286 @@ proto.fonoster.applications.v1beta2.EvaluateIntelligenceResponse.prototype.clear
3959
3983
  };
3960
3984
 
3961
3985
 
3986
+
3987
+
3988
+
3989
+ if (jspb.Message.GENERATE_TO_OBJECT) {
3990
+ /**
3991
+ * Creates an object representation of this proto.
3992
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
3993
+ * Optional fields that are not set will be set to undefined.
3994
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
3995
+ * For the list of reserved names please see:
3996
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
3997
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
3998
+ * JSPB instance for transitional soy proto support:
3999
+ * http://goto/soy-param-migration
4000
+ * @return {!Object}
4001
+ */
4002
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.toObject = function(opt_includeInstance) {
4003
+ return proto.fonoster.applications.v1beta2.TestTokenResponse.toObject(opt_includeInstance, this);
4004
+ };
4005
+
4006
+
4007
+ /**
4008
+ * Static version of the {@see toObject} method.
4009
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
4010
+ * the JSPB instance for transitional soy proto support:
4011
+ * http://goto/soy-param-migration
4012
+ * @param {!proto.fonoster.applications.v1beta2.TestTokenResponse} msg The msg instance to transform.
4013
+ * @return {!Object}
4014
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4015
+ */
4016
+ proto.fonoster.applications.v1beta2.TestTokenResponse.toObject = function(includeInstance, msg) {
4017
+ var f, obj = {
4018
+ token: jspb.Message.getFieldWithDefault(msg, 1, ""),
4019
+ domain: jspb.Message.getFieldWithDefault(msg, 2, ""),
4020
+ displayName: jspb.Message.getFieldWithDefault(msg, 3, ""),
4021
+ signalingServer: jspb.Message.getFieldWithDefault(msg, 4, ""),
4022
+ targetAor: jspb.Message.getFieldWithDefault(msg, 5, ""),
4023
+ username: jspb.Message.getFieldWithDefault(msg, 6, "")
4024
+ };
4025
+
4026
+ if (includeInstance) {
4027
+ obj.$jspbMessageInstance = msg;
4028
+ }
4029
+ return obj;
4030
+ };
4031
+ }
4032
+
4033
+
4034
+ /**
4035
+ * Deserializes binary data (in protobuf wire format).
4036
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
4037
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse}
4038
+ */
4039
+ proto.fonoster.applications.v1beta2.TestTokenResponse.deserializeBinary = function(bytes) {
4040
+ var reader = new jspb.BinaryReader(bytes);
4041
+ var msg = new proto.fonoster.applications.v1beta2.TestTokenResponse;
4042
+ return proto.fonoster.applications.v1beta2.TestTokenResponse.deserializeBinaryFromReader(msg, reader);
4043
+ };
4044
+
4045
+
4046
+ /**
4047
+ * Deserializes binary data (in protobuf wire format) from the
4048
+ * given reader into the given message object.
4049
+ * @param {!proto.fonoster.applications.v1beta2.TestTokenResponse} msg The message object to deserialize into.
4050
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4051
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse}
4052
+ */
4053
+ proto.fonoster.applications.v1beta2.TestTokenResponse.deserializeBinaryFromReader = function(msg, reader) {
4054
+ while (reader.nextField()) {
4055
+ if (reader.isEndGroup()) {
4056
+ break;
4057
+ }
4058
+ var field = reader.getFieldNumber();
4059
+ switch (field) {
4060
+ case 1:
4061
+ var value = /** @type {string} */ (reader.readString());
4062
+ msg.setToken(value);
4063
+ break;
4064
+ case 2:
4065
+ var value = /** @type {string} */ (reader.readString());
4066
+ msg.setDomain(value);
4067
+ break;
4068
+ case 3:
4069
+ var value = /** @type {string} */ (reader.readString());
4070
+ msg.setDisplayName(value);
4071
+ break;
4072
+ case 4:
4073
+ var value = /** @type {string} */ (reader.readString());
4074
+ msg.setSignalingServer(value);
4075
+ break;
4076
+ case 5:
4077
+ var value = /** @type {string} */ (reader.readString());
4078
+ msg.setTargetAor(value);
4079
+ break;
4080
+ case 6:
4081
+ var value = /** @type {string} */ (reader.readString());
4082
+ msg.setUsername(value);
4083
+ break;
4084
+ default:
4085
+ reader.skipField();
4086
+ break;
4087
+ }
4088
+ }
4089
+ return msg;
4090
+ };
4091
+
4092
+
4093
+ /**
4094
+ * Serializes the message to binary data (in protobuf wire format).
4095
+ * @return {!Uint8Array}
4096
+ */
4097
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.serializeBinary = function() {
4098
+ var writer = new jspb.BinaryWriter();
4099
+ proto.fonoster.applications.v1beta2.TestTokenResponse.serializeBinaryToWriter(this, writer);
4100
+ return writer.getResultBuffer();
4101
+ };
4102
+
4103
+
4104
+ /**
4105
+ * Serializes the given message to binary data (in protobuf wire
4106
+ * format), writing to the given BinaryWriter.
4107
+ * @param {!proto.fonoster.applications.v1beta2.TestTokenResponse} message
4108
+ * @param {!jspb.BinaryWriter} writer
4109
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4110
+ */
4111
+ proto.fonoster.applications.v1beta2.TestTokenResponse.serializeBinaryToWriter = function(message, writer) {
4112
+ var f = undefined;
4113
+ f = message.getToken();
4114
+ if (f.length > 0) {
4115
+ writer.writeString(
4116
+ 1,
4117
+ f
4118
+ );
4119
+ }
4120
+ f = message.getDomain();
4121
+ if (f.length > 0) {
4122
+ writer.writeString(
4123
+ 2,
4124
+ f
4125
+ );
4126
+ }
4127
+ f = message.getDisplayName();
4128
+ if (f.length > 0) {
4129
+ writer.writeString(
4130
+ 3,
4131
+ f
4132
+ );
4133
+ }
4134
+ f = message.getSignalingServer();
4135
+ if (f.length > 0) {
4136
+ writer.writeString(
4137
+ 4,
4138
+ f
4139
+ );
4140
+ }
4141
+ f = message.getTargetAor();
4142
+ if (f.length > 0) {
4143
+ writer.writeString(
4144
+ 5,
4145
+ f
4146
+ );
4147
+ }
4148
+ f = message.getUsername();
4149
+ if (f.length > 0) {
4150
+ writer.writeString(
4151
+ 6,
4152
+ f
4153
+ );
4154
+ }
4155
+ };
4156
+
4157
+
4158
+ /**
4159
+ * optional string token = 1;
4160
+ * @return {string}
4161
+ */
4162
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.getToken = function() {
4163
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
4164
+ };
4165
+
4166
+
4167
+ /**
4168
+ * @param {string} value
4169
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse} returns this
4170
+ */
4171
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.setToken = function(value) {
4172
+ return jspb.Message.setProto3StringField(this, 1, value);
4173
+ };
4174
+
4175
+
4176
+ /**
4177
+ * optional string domain = 2;
4178
+ * @return {string}
4179
+ */
4180
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.getDomain = function() {
4181
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
4182
+ };
4183
+
4184
+
4185
+ /**
4186
+ * @param {string} value
4187
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse} returns this
4188
+ */
4189
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.setDomain = function(value) {
4190
+ return jspb.Message.setProto3StringField(this, 2, value);
4191
+ };
4192
+
4193
+
4194
+ /**
4195
+ * optional string display_name = 3;
4196
+ * @return {string}
4197
+ */
4198
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.getDisplayName = function() {
4199
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
4200
+ };
4201
+
4202
+
4203
+ /**
4204
+ * @param {string} value
4205
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse} returns this
4206
+ */
4207
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.setDisplayName = function(value) {
4208
+ return jspb.Message.setProto3StringField(this, 3, value);
4209
+ };
4210
+
4211
+
4212
+ /**
4213
+ * optional string signaling_server = 4;
4214
+ * @return {string}
4215
+ */
4216
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.getSignalingServer = function() {
4217
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
4218
+ };
4219
+
4220
+
4221
+ /**
4222
+ * @param {string} value
4223
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse} returns this
4224
+ */
4225
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.setSignalingServer = function(value) {
4226
+ return jspb.Message.setProto3StringField(this, 4, value);
4227
+ };
4228
+
4229
+
4230
+ /**
4231
+ * optional string target_aor = 5;
4232
+ * @return {string}
4233
+ */
4234
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.getTargetAor = function() {
4235
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
4236
+ };
4237
+
4238
+
4239
+ /**
4240
+ * @param {string} value
4241
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse} returns this
4242
+ */
4243
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.setTargetAor = function(value) {
4244
+ return jspb.Message.setProto3StringField(this, 5, value);
4245
+ };
4246
+
4247
+
4248
+ /**
4249
+ * optional string username = 6;
4250
+ * @return {string}
4251
+ */
4252
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.getUsername = function() {
4253
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
4254
+ };
4255
+
4256
+
4257
+ /**
4258
+ * @param {string} value
4259
+ * @return {!proto.fonoster.applications.v1beta2.TestTokenResponse} returns this
4260
+ */
4261
+ proto.fonoster.applications.v1beta2.TestTokenResponse.prototype.setUsername = function(value) {
4262
+ return jspb.Message.setProto3StringField(this, 6, value);
4263
+ };
4264
+
4265
+
3962
4266
  /**
3963
4267
  * @enum {number}
3964
4268
  */
@@ -18,6 +18,7 @@
18
18
  import * as grpcWeb from 'grpc-web';
19
19
 
20
20
  import * as applications_pb from './applications_pb'; // proto import: "applications.proto"
21
+ import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"
21
22
 
22
23
 
23
24
  export class ApplicationsClient {
@@ -297,5 +298,48 @@ export class ApplicationsClient {
297
298
  this.methodDescriptorEvaluateIntelligence);
298
299
  }
299
300
 
301
+ methodDescriptorCreateTestToken = new grpcWeb.MethodDescriptor(
302
+ '/fonoster.applications.v1beta2.Applications/CreateTestToken',
303
+ grpcWeb.MethodType.UNARY,
304
+ google_protobuf_empty_pb.Empty,
305
+ applications_pb.TestTokenResponse,
306
+ (request: google_protobuf_empty_pb.Empty) => {
307
+ return request.serializeBinary();
308
+ },
309
+ applications_pb.TestTokenResponse.deserializeBinary
310
+ );
311
+
312
+ createTestToken(
313
+ request: google_protobuf_empty_pb.Empty,
314
+ metadata?: grpcWeb.Metadata | null): Promise<applications_pb.TestTokenResponse>;
315
+
316
+ createTestToken(
317
+ request: google_protobuf_empty_pb.Empty,
318
+ metadata: grpcWeb.Metadata | null,
319
+ callback: (err: grpcWeb.RpcError,
320
+ response: applications_pb.TestTokenResponse) => void): grpcWeb.ClientReadableStream<applications_pb.TestTokenResponse>;
321
+
322
+ createTestToken(
323
+ request: google_protobuf_empty_pb.Empty,
324
+ metadata?: grpcWeb.Metadata | null,
325
+ callback?: (err: grpcWeb.RpcError,
326
+ response: applications_pb.TestTokenResponse) => void) {
327
+ if (callback !== undefined) {
328
+ return this.client_.rpcCall(
329
+ this.hostname_ +
330
+ '/fonoster.applications.v1beta2.Applications/CreateTestToken',
331
+ request,
332
+ metadata || {},
333
+ this.methodDescriptorCreateTestToken,
334
+ callback);
335
+ }
336
+ return this.client_.unaryCall(
337
+ this.hostname_ +
338
+ '/fonoster.applications.v1beta2.Applications/CreateTestToken',
339
+ request,
340
+ metadata || {},
341
+ this.methodDescriptorCreateTestToken);
342
+ }
343
+
300
344
  }
301
345
 
@@ -1,6 +1,7 @@
1
1
  import * as jspb from 'google-protobuf'
2
2
 
3
3
  import * as google_protobuf_struct_pb from 'google-protobuf/google/protobuf/struct_pb'; // proto import: "google/protobuf/struct.proto"
4
+ import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"
4
5
 
5
6
 
6
7
  export class ProductContainer extends jspb.Message {
@@ -479,6 +480,44 @@ export namespace EvaluateIntelligenceResponse {
479
480
  }
480
481
  }
481
482
 
483
+ export class TestTokenResponse extends jspb.Message {
484
+ getToken(): string;
485
+ setToken(value: string): TestTokenResponse;
486
+
487
+ getDomain(): string;
488
+ setDomain(value: string): TestTokenResponse;
489
+
490
+ getDisplayName(): string;
491
+ setDisplayName(value: string): TestTokenResponse;
492
+
493
+ getSignalingServer(): string;
494
+ setSignalingServer(value: string): TestTokenResponse;
495
+
496
+ getTargetAor(): string;
497
+ setTargetAor(value: string): TestTokenResponse;
498
+
499
+ getUsername(): string;
500
+ setUsername(value: string): TestTokenResponse;
501
+
502
+ serializeBinary(): Uint8Array;
503
+ toObject(includeInstance?: boolean): TestTokenResponse.AsObject;
504
+ static toObject(includeInstance: boolean, msg: TestTokenResponse): TestTokenResponse.AsObject;
505
+ static serializeBinaryToWriter(message: TestTokenResponse, writer: jspb.BinaryWriter): void;
506
+ static deserializeBinary(bytes: Uint8Array): TestTokenResponse;
507
+ static deserializeBinaryFromReader(message: TestTokenResponse, reader: jspb.BinaryReader): TestTokenResponse;
508
+ }
509
+
510
+ export namespace TestTokenResponse {
511
+ export type AsObject = {
512
+ token: string,
513
+ domain: string,
514
+ displayName: string,
515
+ signalingServer: string,
516
+ targetAor: string,
517
+ username: string,
518
+ }
519
+ }
520
+
482
521
  export enum ApplicationType {
483
522
  EXTERNAL = 0,
484
523
  AUTOPILOT = 1,