@fonoster/sdk 0.6.6 → 0.7.2

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.
Files changed (36) hide show
  1. package/README.md +10 -10
  2. package/dist/node/Applications.d.ts +8 -8
  3. package/dist/node/Applications.js +8 -8
  4. package/dist/node/Calls.d.ts +22 -9
  5. package/dist/node/Calls.js +56 -37
  6. package/dist/node/client/types/CallsClient.d.ts +3 -2
  7. package/dist/node/client/types/common.d.ts +8 -1
  8. package/dist/node/generated/node/acls_pb.js +6 -6
  9. package/dist/node/generated/node/agents_pb.js +6 -6
  10. package/dist/node/generated/node/applications_pb.js +18 -18
  11. package/dist/node/generated/node/calls_grpc_pb.js +0 -3
  12. package/dist/node/generated/node/calls_pb.js +103 -104
  13. package/dist/node/generated/node/credentials_pb.js +6 -6
  14. package/dist/node/generated/node/domains_pb.js +6 -6
  15. package/dist/node/generated/node/identity_pb.js +18 -18
  16. package/dist/node/generated/node/numbers_pb.js +6 -6
  17. package/dist/node/generated/node/secrets_pb.js +6 -6
  18. package/dist/node/generated/node/trunks_pb.js +6 -6
  19. package/dist/node/generated/web/acls_pb.js +6 -6
  20. package/dist/node/generated/web/agents_pb.js +6 -6
  21. package/dist/node/generated/web/applications_pb.d.ts +9 -9
  22. package/dist/node/generated/web/applications_pb.js +18 -18
  23. package/dist/node/generated/web/calls_pb.d.ts +37 -37
  24. package/dist/node/generated/web/calls_pb.js +103 -104
  25. package/dist/node/generated/web/credentials_pb.js +6 -6
  26. package/dist/node/generated/web/domains_pb.js +6 -6
  27. package/dist/node/generated/web/identity_pb.js +18 -18
  28. package/dist/node/generated/web/numbers_pb.js +6 -6
  29. package/dist/node/generated/web/secrets_pb.js +6 -6
  30. package/dist/node/generated/web/trunks_pb.js +6 -6
  31. package/dist/node/tsconfig.node.tsbuildinfo +1 -1
  32. package/dist/node/utils.d.ts +2 -1
  33. package/dist/node/utils.js +20 -0
  34. package/dist/web/fonoster.min.js +1 -1
  35. package/dist/web/index.esm.js +1 -1
  36. package/package.json +4 -4
package/README.md CHANGED
@@ -92,8 +92,8 @@ async function main() {
92
92
  const applications = new SDK.Applications(client);
93
93
  await applications.createApplication({
94
94
  name: "MyApp",
95
- type: "PROGRAMMABLE_VOICE",
96
- appEndpoint: "localhost:3000" // Your app's endpoint
95
+ type: "EXTERNAL",
96
+ endpoint: "localhost:3000" // Your app's endpoint
97
97
  });
98
98
  }
99
99
 
@@ -747,8 +747,8 @@ async function main(request) {
747
747
 
748
748
  const request = {
749
749
  name: "My application",
750
- type: "PROGRAMMABLE_VOICE",
751
- appEndpoint: "myapp.mydomain.com",
750
+ type: "EXTERNAL",
751
+ endpoint: "myapp.mydomain.com",
752
752
  textToSpeech: {
753
753
  productRef: "tts.google",
754
754
  config: {
@@ -786,8 +786,8 @@ Creates a new Application in Fonoster. The only required fields are the name and
786
786
  | --- | --- | --- |
787
787
  | request | <code>CreateApplicationRequest</code> | The request object that contains the necessary information to create a new application |
788
788
  | request.name | <code>string</code> | The name of the application |
789
- | request.type | <code>ApplicationType</code> | The type of application (e.g., PROGRAMMABLE_VOICE) |
790
- | request.appEndpoint | <code>string</code> | The endpoint where the application is hosted |
789
+ | request.type | <code>ApplicationType</code> | The type of application (e.g., EXTERNAL) |
790
+ | request.endpoint | <code>string</code> | The endpoint where the application is hosted |
791
791
  | request.textToSpeech | <code>TextToSpeech</code> | The text-to-speech configuration |
792
792
  | request.textToSpeech.productRef | <code>string</code> | The product reference of the text-to-speech engine (e.g., tts.google) |
793
793
  | request.textToSpeech.config | <code>object</code> | The configuration object for the text-to-speech engine (e.g., { voice: "en-US-Casual-K" }) |
@@ -805,8 +805,8 @@ const apps = new SDK.Applications(client); // Existing client object
805
805
 
806
806
  const request = {
807
807
  name: "My application",
808
- type: "PROGRAMMABLE_VOICE",
809
- appEndpoint: "myapp.mydomain.com",
808
+ type: "EXTERNAL",
809
+ endpoint: "myapp.mydomain.com",
810
810
  textToSpeech: {
811
811
  productRef: "tts.google",
812
812
  config: {
@@ -871,7 +871,7 @@ Updates an existing application in Fonoster.
871
871
  | request | <code>UpdateApplicationRequest</code> | The request object that contains the necessary information to update an application |
872
872
  | request.ref | <code>string</code> | The reference of the application to update |
873
873
  | request.name | <code>string</code> | The name of the application |
874
- | request.appEndpoint | <code>string</code> | The endpoint where the application is hosted |
874
+ | request.endpoint | <code>string</code> | The endpoint where the application is hosted |
875
875
  | request.textToSpeech | <code>TextToSpeech</code> | The text-to-speech configuration |
876
876
  | request.textToSpeech.productRef | <code>string</code> | The product reference of the text-to-speech engine (e.g., tts.google) |
877
877
  | request.textToSpeech.config | <code>object</code> | The configuration object for the text-to-speech engine (e.g., { voice: "en-US-Casual-K" }) |
@@ -890,7 +890,7 @@ const apps = new SDK.Applications(client); // Existing client object
890
890
  const request = {
891
891
  ref: "00000000-0000-0000-0000-000000000000",
892
892
  name: "My application",
893
- appEndpoint: "myapp.mydomain.com"
893
+ endpoint: "myapp.mydomain.com"
894
894
  };
895
895
 
896
896
  apps
@@ -28,8 +28,8 @@ import { FonosterClient } from "./client/types";
28
28
  *
29
29
  * const request = {
30
30
  * name: "My application",
31
- * type: "PROGRAMMABLE_VOICE",
32
- * appEndpoint: "myapp.mydomain.com",
31
+ * type: "EXTERNAL",
32
+ * endpoint: "myapp.mydomain.com",
33
33
  * textToSpeech: {
34
34
  * productRef: "tts.google",
35
35
  * config: {
@@ -70,8 +70,8 @@ declare class Applications {
70
70
  *
71
71
  * @param {CreateApplicationRequest} request - The request object that contains the necessary information to create a new application
72
72
  * @param {string} request.name - The name of the application
73
- * @param {ApplicationType} request.type - The type of application (e.g., PROGRAMMABLE_VOICE)
74
- * @param {string} request.appEndpoint - The endpoint where the application is hosted
73
+ * @param {ApplicationType} request.type - The type of application (e.g., EXTERNAL)
74
+ * @param {string} request.endpoint - The endpoint where the application is hosted
75
75
  * @param {TextToSpeech} request.textToSpeech - The text-to-speech configuration
76
76
  * @param {string} request.textToSpeech.productRef - The product reference of the text-to-speech engine (e.g., tts.google)
77
77
  * @param {object} request.textToSpeech.config - The configuration object for the text-to-speech engine (e.g., { voice: "en-US-Casual-K" })
@@ -88,8 +88,8 @@ declare class Applications {
88
88
  *
89
89
  * const request = {
90
90
  * name: "My application",
91
- * type: "PROGRAMMABLE_VOICE",
92
- * appEndpoint: "myapp.mydomain.com",
91
+ * type: "EXTERNAL",
92
+ * endpoint: "myapp.mydomain.com",
93
93
  * textToSpeech: {
94
94
  * productRef: "tts.google",
95
95
  * config: {
@@ -141,7 +141,7 @@ declare class Applications {
141
141
  * @param {UpdateApplicationRequest} request - The request object that contains the necessary information to update an application
142
142
  * @param {string} request.ref - The reference of the application to update
143
143
  * @param {string} request.name - The name of the application
144
- * @param {string} request.appEndpoint - The endpoint where the application is hosted
144
+ * @param {string} request.endpoint - The endpoint where the application is hosted
145
145
  * @param {TextToSpeech} request.textToSpeech - The text-to-speech configuration
146
146
  * @param {string} request.textToSpeech.productRef - The product reference of the text-to-speech engine (e.g., tts.google)
147
147
  * @param {object} request.textToSpeech.config - The configuration object for the text-to-speech engine (e.g., { voice: "en-US-Casual-K" })
@@ -159,7 +159,7 @@ declare class Applications {
159
159
  * const request = {
160
160
  * ref: "00000000-0000-0000-0000-000000000000",
161
161
  * name: "My application",
162
- * appEndpoint: "myapp.mydomain.com"
162
+ * endpoint: "myapp.mydomain.com"
163
163
  * };
164
164
  *
165
165
  * apps
@@ -32,8 +32,8 @@ const utils_1 = require("./utils");
32
32
  *
33
33
  * const request = {
34
34
  * name: "My application",
35
- * type: "PROGRAMMABLE_VOICE",
36
- * appEndpoint: "myapp.mydomain.com",
35
+ * type: "EXTERNAL",
36
+ * endpoint: "myapp.mydomain.com",
37
37
  * textToSpeech: {
38
38
  * productRef: "tts.google",
39
39
  * config: {
@@ -76,8 +76,8 @@ class Applications {
76
76
  *
77
77
  * @param {CreateApplicationRequest} request - The request object that contains the necessary information to create a new application
78
78
  * @param {string} request.name - The name of the application
79
- * @param {ApplicationType} request.type - The type of application (e.g., PROGRAMMABLE_VOICE)
80
- * @param {string} request.appEndpoint - The endpoint where the application is hosted
79
+ * @param {ApplicationType} request.type - The type of application (e.g., EXTERNAL)
80
+ * @param {string} request.endpoint - The endpoint where the application is hosted
81
81
  * @param {TextToSpeech} request.textToSpeech - The text-to-speech configuration
82
82
  * @param {string} request.textToSpeech.productRef - The product reference of the text-to-speech engine (e.g., tts.google)
83
83
  * @param {object} request.textToSpeech.config - The configuration object for the text-to-speech engine (e.g., { voice: "en-US-Casual-K" })
@@ -94,8 +94,8 @@ class Applications {
94
94
  *
95
95
  * const request = {
96
96
  * name: "My application",
97
- * type: "PROGRAMMABLE_VOICE",
98
- * appEndpoint: "myapp.mydomain.com",
97
+ * type: "EXTERNAL",
98
+ * endpoint: "myapp.mydomain.com",
99
99
  * textToSpeech: {
100
100
  * productRef: "tts.google",
101
101
  * config: {
@@ -177,7 +177,7 @@ class Applications {
177
177
  * @param {UpdateApplicationRequest} request - The request object that contains the necessary information to update an application
178
178
  * @param {string} request.ref - The reference of the application to update
179
179
  * @param {string} request.name - The name of the application
180
- * @param {string} request.appEndpoint - The endpoint where the application is hosted
180
+ * @param {string} request.endpoint - The endpoint where the application is hosted
181
181
  * @param {TextToSpeech} request.textToSpeech - The text-to-speech configuration
182
182
  * @param {string} request.textToSpeech.productRef - The product reference of the text-to-speech engine (e.g., tts.google)
183
183
  * @param {object} request.textToSpeech.config - The configuration object for the text-to-speech engine (e.g., { voice: "en-US-Casual-K" })
@@ -195,7 +195,7 @@ class Applications {
195
195
  * const request = {
196
196
  * ref: "00000000-0000-0000-0000-000000000000",
197
197
  * name: "My application",
198
- * appEndpoint: "myapp.mydomain.com"
198
+ * endpoint: "myapp.mydomain.com"
199
199
  * };
200
200
  *
201
201
  * apps
@@ -1,4 +1,5 @@
1
- import { BaseApiObject, CallDetailRecord, CreateCallRequest, ListCallsRequest, ListCallsResponse } from "@fonoster/types";
1
+ import { DialStatus } from "@fonoster/common";
2
+ import { CallDetailRecord, CreateCallRequest, ListCallsRequest, ListCallsResponse } from "@fonoster/types";
2
3
  import { FonosterClient } from "./client/types";
3
4
  /**
4
5
  * @classdesc Fonoster Calls, part of the Fonoster Media subsystem,
@@ -51,27 +52,39 @@ declare class Calls {
51
52
  * @param {string} request.from - The number that originated the call
52
53
  * @param {string} request.to - The number that received the call
53
54
  * @param {string} request.appRef - The reference of the App that will handle the call
54
- * @return {Promise<CreateCallResponse>} - The response object that contains the reference to the created Call
55
+ * @param {number} request.timeout - The time in seconds to wait for the call to be answered. Default is 60 seconds
56
+ * @return {{ref: string, statusStream: AsyncGenerator<{ status: DialStatus }>}} - The response object that contains the Call reference and a stream of status updates
57
+ * @see DialStatus
55
58
  * @example
56
59
  * const calls = new SDK.Calls(client); // Existing client object
57
60
  *
58
61
  * const request = {
59
62
  * from: "8287854037",
60
63
  * to: "+17853178070",
61
- * appRef: "00000000-0000-0000-0000-000000000000"
64
+ * appRef: "00000000-0000-0000-0000-000000000000",
65
+ * timeout: 30
62
66
  * };
63
67
  *
64
- * calls
65
- * .createCall(request)
66
- * .then(console.log) // successful response
67
- * .catch(console.error); // an error occurred
68
+ * const response = await calls.createCall(request);
69
+ * const { ref, statusStream } = response;
70
+ *
71
+ * console.log(ref); // Call reference
72
+ *
73
+ * for await (const status of statusStream) {
74
+ * console.log(status); // Streamed status
75
+ * }
68
76
  */
69
- createCall(request: CreateCallRequest): Promise<BaseApiObject>;
77
+ createCall(request: CreateCallRequest): Promise<{
78
+ ref: string;
79
+ statusStream: AsyncGenerator<{
80
+ status: DialStatus;
81
+ }>;
82
+ }>;
70
83
  /**
71
84
  * Retrieves an existing Call in the Workspace.
72
85
  *
73
86
  * @param {string} ref - The reference of the Call to retrieve
74
- * @return {Promise<Acl>} - The response object that contains the Call detail
87
+ * @return {Promise<CallDetailRecord>} - The response object that contains the Call detail
75
88
  * @example
76
89
  * const calls = new SDK.Calls(client); // Existing client object
77
90
  *
@@ -1,27 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Calls = void 0;
4
- /*
5
- * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
- * http://github.com/fonoster/fonoster
7
- *
8
- * This file is part of Fonoster
9
- *
10
- * Licensed under the MIT License (the "License");
11
- * you may not use this file except in compliance with
12
- * the License. You may obtain a copy of the License at
13
- *
14
- * https://opensource.org/licenses/MIT
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" BASIS,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
- const types_1 = require("@fonoster/types");
23
4
  const makeRpcRequest_1 = require("./client/makeRpcRequest");
24
5
  const calls_pb_1 = require("./generated/node/calls_pb");
6
+ const utils_1 = require("./utils");
25
7
  /**
26
8
  * @classdesc Fonoster Calls, part of the Fonoster Media subsystem,
27
9
  * allows you to create, list, and track calls in your deployment.
@@ -75,36 +57,75 @@ class Calls {
75
57
  * @param {string} request.from - The number that originated the call
76
58
  * @param {string} request.to - The number that received the call
77
59
  * @param {string} request.appRef - The reference of the App that will handle the call
78
- * @return {Promise<CreateCallResponse>} - The response object that contains the reference to the created Call
60
+ * @param {number} request.timeout - The time in seconds to wait for the call to be answered. Default is 60 seconds
61
+ * @return {{ref: string, statusStream: AsyncGenerator<{ status: DialStatus }>}} - The response object that contains the Call reference and a stream of status updates
62
+ * @see DialStatus
79
63
  * @example
80
64
  * const calls = new SDK.Calls(client); // Existing client object
81
65
  *
82
66
  * const request = {
83
67
  * from: "8287854037",
84
68
  * to: "+17853178070",
85
- * appRef: "00000000-0000-0000-0000-000000000000"
69
+ * appRef: "00000000-0000-0000-0000-000000000000",
70
+ * timeout: 30
86
71
  * };
87
72
  *
88
- * calls
89
- * .createCall(request)
90
- * .then(console.log) // successful response
91
- * .catch(console.error); // an error occurred
73
+ * const response = await calls.createCall(request);
74
+ * const { ref, statusStream } = response;
75
+ *
76
+ * console.log(ref); // Call reference
77
+ *
78
+ * for await (const status of statusStream) {
79
+ * console.log(status); // Streamed status
80
+ * }
92
81
  */
93
82
  async createCall(request) {
94
83
  const client = this.client.getCallsClient();
95
- return await (0, makeRpcRequest_1.makeRpcRequest)({
84
+ const response = await (0, makeRpcRequest_1.makeRpcRequest)({
96
85
  method: client.createCall.bind(client),
97
86
  requestPBObjectConstructor: calls_pb_1.CreateCallRequest,
98
87
  metadata: this.client.getMetadata(),
99
- request,
100
- enumMapping: [["type", types_1.CallType]]
88
+ request
101
89
  });
90
+ const trackCallRequest = new calls_pb_1.TrackCallRequest();
91
+ trackCallRequest.setRef(response.ref);
92
+ const call = client.trackCall(trackCallRequest, this.client.getMetadata());
93
+ async function* statusStreamGenerator() {
94
+ const queue = [];
95
+ let done = false;
96
+ call.on("data", (response) => {
97
+ const data = response.toObject();
98
+ queue.push(data);
99
+ });
100
+ call.on("end", () => {
101
+ done = true;
102
+ });
103
+ call.on("error", () => {
104
+ done = true;
105
+ throw new Error("An error occurred while tracking the call");
106
+ });
107
+ // eslint-disable-next-line no-loops/no-loops
108
+ while (!done) {
109
+ if (queue.length > 0) {
110
+ const data = queue.shift();
111
+ if (!data) {
112
+ return;
113
+ }
114
+ yield { status: (0, utils_1.dialStatusToString)(data.status) };
115
+ }
116
+ else {
117
+ await new Promise((resolve) => setTimeout(resolve, 50));
118
+ }
119
+ }
120
+ }
121
+ const statusStream = statusStreamGenerator();
122
+ return { ref: response.ref, statusStream };
102
123
  }
103
124
  /**
104
125
  * Retrieves an existing Call in the Workspace.
105
126
  *
106
127
  * @param {string} ref - The reference of the Call to retrieve
107
- * @return {Promise<Acl>} - The response object that contains the Call detail
128
+ * @return {Promise<CallDetailRecord>} - The response object that contains the Call detail
108
129
  * @example
109
130
  * const calls = new SDK.Calls(client); // Existing client object
110
131
  *
@@ -123,10 +144,9 @@ class Calls {
123
144
  metadata: this.client.getMetadata(),
124
145
  request: { ref },
125
146
  enumMapping: [
126
- ["type", types_1.CallType],
127
- ["callStatus", types_1.CallStatus],
128
- ["hangupCause", types_1.HangupCause],
129
- ["callDirection", types_1.CallDirection]
147
+ ["type", calls_pb_1.CallType],
148
+ ["status", calls_pb_1.CallStatus],
149
+ ["direction", calls_pb_1.CallDirection]
130
150
  ]
131
151
  });
132
152
  }
@@ -158,10 +178,9 @@ class Calls {
158
178
  metadata: this.client.getMetadata(),
159
179
  request,
160
180
  enumMapping: [
161
- ["type", types_1.CallType],
162
- ["callStatus", types_1.CallStatus],
163
- ["hangupCause", types_1.HangupCause],
164
- ["callDirection", types_1.CallDirection]
181
+ ["type", calls_pb_1.CallType],
182
+ ["status", calls_pb_1.CallStatus],
183
+ ["direction", calls_pb_1.CallDirection]
165
184
  ],
166
185
  repeatableObjectMapping: [["itemsList", calls_pb_1.Call]]
167
186
  });
@@ -1,8 +1,9 @@
1
- import { ClientFunction } from "./common";
2
- import { CallDetailRecord, CreateCallRequest, CreateCallResponse, GetCallRequest, ListCallsRequest, ListCallsResponse } from "../../generated/web/calls_pb";
1
+ import { ClientFunction, ServerStreamFunction } from "./common";
2
+ import { CallDetailRecord, CreateCallRequest, CreateCallResponse, GetCallRequest, ListCallsRequest, ListCallsResponse, TrackCallRequest } from "../../generated/web/calls_pb";
3
3
  type CallsClient = {
4
4
  createCall: ClientFunction<CreateCallRequest, CreateCallResponse>;
5
5
  getCall: ClientFunction<GetCallRequest, CallDetailRecord>;
6
6
  listCalls: ClientFunction<ListCallsRequest, ListCallsResponse>;
7
+ trackCall: ServerStreamFunction<TrackCallRequest, CallDetailRecord>;
7
8
  };
8
9
  export { CallsClient };
@@ -1,4 +1,11 @@
1
1
  import { Metadata } from "grpc-web";
2
2
  type MappingTuple<T> = Array<[string, T]>;
3
3
  type ClientFunction<T, U> = (request: T, metadata: Metadata | unknown | null, callback: (err: Error | null, response: U | null) => void) => void;
4
- export { MappingTuple, ClientFunction };
4
+ type DataResponse = {
5
+ toObject: () => unknown;
6
+ };
7
+ type ServerStream<U> = {
8
+ on: (event: "data" | "error" | "end" | "status", listener: (response: U | Error | DataResponse) => void) => void;
9
+ };
10
+ type ServerStreamFunction<T, U> = (request: T, metadata: Metadata | unknown | null) => ServerStream<U>;
11
+ export { MappingTuple, ServerStreamFunction, DataResponse, ClientFunction };
@@ -333,11 +333,11 @@ proto.fonoster.acls.v1beta2.Acl.deserializeBinaryFromReader = function(msg, read
333
333
  msg.addDeny(value);
334
334
  break;
335
335
  case 5:
336
- var value = /** @type {number} */ (reader.readInt64());
336
+ var value = /** @type {number} */ (reader.readInt32());
337
337
  msg.setCreatedAt(value);
338
338
  break;
339
339
  case 6:
340
- var value = /** @type {number} */ (reader.readInt64());
340
+ var value = /** @type {number} */ (reader.readInt32());
341
341
  msg.setUpdatedAt(value);
342
342
  break;
343
343
  default:
@@ -399,14 +399,14 @@ proto.fonoster.acls.v1beta2.Acl.serializeBinaryToWriter = function(message, writ
399
399
  }
400
400
  f = message.getCreatedAt();
401
401
  if (f !== 0) {
402
- writer.writeInt64(
402
+ writer.writeInt32(
403
403
  5,
404
404
  f
405
405
  );
406
406
  }
407
407
  f = message.getUpdatedAt();
408
408
  if (f !== 0) {
409
- writer.writeInt64(
409
+ writer.writeInt32(
410
410
  6,
411
411
  f
412
412
  );
@@ -525,7 +525,7 @@ proto.fonoster.acls.v1beta2.Acl.prototype.clearDenyList = function() {
525
525
 
526
526
 
527
527
  /**
528
- * optional int64 created_at = 5;
528
+ * optional int32 created_at = 5;
529
529
  * @return {number}
530
530
  */
531
531
  proto.fonoster.acls.v1beta2.Acl.prototype.getCreatedAt = function() {
@@ -543,7 +543,7 @@ proto.fonoster.acls.v1beta2.Acl.prototype.setCreatedAt = function(value) {
543
543
 
544
544
 
545
545
  /**
546
- * optional int64 updated_at = 6;
546
+ * optional int32 updated_at = 6;
547
547
  * @return {number}
548
548
  */
549
549
  proto.fonoster.acls.v1beta2.Acl.prototype.getUpdatedAt = function() {
@@ -380,11 +380,11 @@ proto.fonoster.agents.v1beta2.Agent.deserializeBinaryFromReader = function(msg,
380
380
  msg.setEnabled(value);
381
381
  break;
382
382
  case 6:
383
- var value = /** @type {number} */ (reader.readInt64());
383
+ var value = /** @type {number} */ (reader.readInt32());
384
384
  msg.setCreatedAt(value);
385
385
  break;
386
386
  case 7:
387
- var value = /** @type {number} */ (reader.readInt64());
387
+ var value = /** @type {number} */ (reader.readInt32());
388
388
  msg.setUpdatedAt(value);
389
389
  break;
390
390
  case 8:
@@ -471,14 +471,14 @@ proto.fonoster.agents.v1beta2.Agent.serializeBinaryToWriter = function(message,
471
471
  }
472
472
  f = message.getCreatedAt();
473
473
  if (f !== 0) {
474
- writer.writeInt64(
474
+ writer.writeInt32(
475
475
  6,
476
476
  f
477
477
  );
478
478
  }
479
479
  f = message.getUpdatedAt();
480
480
  if (f !== 0) {
481
- writer.writeInt64(
481
+ writer.writeInt32(
482
482
  7,
483
483
  f
484
484
  );
@@ -987,7 +987,7 @@ proto.fonoster.agents.v1beta2.Agent.prototype.setEnabled = function(value) {
987
987
 
988
988
 
989
989
  /**
990
- * optional int64 created_at = 6;
990
+ * optional int32 created_at = 6;
991
991
  * @return {number}
992
992
  */
993
993
  proto.fonoster.agents.v1beta2.Agent.prototype.getCreatedAt = function() {
@@ -1005,7 +1005,7 @@ proto.fonoster.agents.v1beta2.Agent.prototype.setCreatedAt = function(value) {
1005
1005
 
1006
1006
 
1007
1007
  /**
1008
- * optional int64 updated_at = 7;
1008
+ * optional int32 updated_at = 7;
1009
1009
  * @return {number}
1010
1010
  */
1011
1011
  proto.fonoster.agents.v1beta2.Agent.prototype.getUpdatedAt = function() {
@@ -527,7 +527,7 @@ proto.fonoster.applications.v1beta2.Application.toObject = function(includeInsta
527
527
  ref: jspb.Message.getFieldWithDefault(msg, 1, ""),
528
528
  name: jspb.Message.getFieldWithDefault(msg, 2, ""),
529
529
  type: jspb.Message.getFieldWithDefault(msg, 3, 0),
530
- appEndpoint: jspb.Message.getFieldWithDefault(msg, 4, ""),
530
+ endpoint: jspb.Message.getFieldWithDefault(msg, 4, ""),
531
531
  textToSpeech: (f = msg.getTextToSpeech()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
532
532
  speechToText: (f = msg.getSpeechToText()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
533
533
  conversation: (f = msg.getConversation()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
@@ -583,7 +583,7 @@ proto.fonoster.applications.v1beta2.Application.deserializeBinaryFromReader = fu
583
583
  break;
584
584
  case 4:
585
585
  var value = /** @type {string} */ (reader.readString());
586
- msg.setAppEndpoint(value);
586
+ msg.setEndpoint(value);
587
587
  break;
588
588
  case 5:
589
589
  var value = new proto.fonoster.applications.v1beta2.ProductContainer;
@@ -658,7 +658,7 @@ proto.fonoster.applications.v1beta2.Application.serializeBinaryToWriter = functi
658
658
  f
659
659
  );
660
660
  }
661
- f = message.getAppEndpoint();
661
+ f = message.getEndpoint();
662
662
  if (f.length > 0) {
663
663
  writer.writeString(
664
664
  4,
@@ -761,10 +761,10 @@ proto.fonoster.applications.v1beta2.Application.prototype.setType = function(val
761
761
 
762
762
 
763
763
  /**
764
- * optional string app_endpoint = 4;
764
+ * optional string endpoint = 4;
765
765
  * @return {string}
766
766
  */
767
- proto.fonoster.applications.v1beta2.Application.prototype.getAppEndpoint = function() {
767
+ proto.fonoster.applications.v1beta2.Application.prototype.getEndpoint = function() {
768
768
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
769
769
  };
770
770
 
@@ -773,7 +773,7 @@ proto.fonoster.applications.v1beta2.Application.prototype.getAppEndpoint = funct
773
773
  * @param {string} value
774
774
  * @return {!proto.fonoster.applications.v1beta2.Application} returns this
775
775
  */
776
- proto.fonoster.applications.v1beta2.Application.prototype.setAppEndpoint = function(value) {
776
+ proto.fonoster.applications.v1beta2.Application.prototype.setEndpoint = function(value) {
777
777
  return jspb.Message.setProto3StringField(this, 4, value);
778
778
  };
779
779
 
@@ -959,7 +959,7 @@ proto.fonoster.applications.v1beta2.CreateApplicationRequest.toObject = function
959
959
  var f, obj = {
960
960
  name: jspb.Message.getFieldWithDefault(msg, 1, ""),
961
961
  type: jspb.Message.getFieldWithDefault(msg, 2, 0),
962
- appEndpoint: jspb.Message.getFieldWithDefault(msg, 3, ""),
962
+ endpoint: jspb.Message.getFieldWithDefault(msg, 3, ""),
963
963
  textToSpeech: (f = msg.getTextToSpeech()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
964
964
  speechToText: (f = msg.getSpeechToText()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
965
965
  intelligence: (f = msg.getIntelligence()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f)
@@ -1009,7 +1009,7 @@ proto.fonoster.applications.v1beta2.CreateApplicationRequest.deserializeBinaryFr
1009
1009
  break;
1010
1010
  case 3:
1011
1011
  var value = /** @type {string} */ (reader.readString());
1012
- msg.setAppEndpoint(value);
1012
+ msg.setEndpoint(value);
1013
1013
  break;
1014
1014
  case 4:
1015
1015
  var value = new proto.fonoster.applications.v1beta2.ProductContainer;
@@ -1069,7 +1069,7 @@ proto.fonoster.applications.v1beta2.CreateApplicationRequest.serializeBinaryToWr
1069
1069
  f
1070
1070
  );
1071
1071
  }
1072
- f = message.getAppEndpoint();
1072
+ f = message.getEndpoint();
1073
1073
  if (f.length > 0) {
1074
1074
  writer.writeString(
1075
1075
  3,
@@ -1140,10 +1140,10 @@ proto.fonoster.applications.v1beta2.CreateApplicationRequest.prototype.setType =
1140
1140
 
1141
1141
 
1142
1142
  /**
1143
- * optional string app_endpoint = 3;
1143
+ * optional string endpoint = 3;
1144
1144
  * @return {string}
1145
1145
  */
1146
- proto.fonoster.applications.v1beta2.CreateApplicationRequest.prototype.getAppEndpoint = function() {
1146
+ proto.fonoster.applications.v1beta2.CreateApplicationRequest.prototype.getEndpoint = function() {
1147
1147
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
1148
1148
  };
1149
1149
 
@@ -1152,7 +1152,7 @@ proto.fonoster.applications.v1beta2.CreateApplicationRequest.prototype.getAppEnd
1152
1152
  * @param {string} value
1153
1153
  * @return {!proto.fonoster.applications.v1beta2.CreateApplicationRequest} returns this
1154
1154
  */
1155
- proto.fonoster.applications.v1beta2.CreateApplicationRequest.prototype.setAppEndpoint = function(value) {
1155
+ proto.fonoster.applications.v1beta2.CreateApplicationRequest.prototype.setEndpoint = function(value) {
1156
1156
  return jspb.Message.setProto3StringField(this, 3, value);
1157
1157
  };
1158
1158
 
@@ -1913,7 +1913,7 @@ proto.fonoster.applications.v1beta2.UpdateApplicationRequest.toObject = function
1913
1913
  ref: jspb.Message.getFieldWithDefault(msg, 1, ""),
1914
1914
  name: jspb.Message.getFieldWithDefault(msg, 2, ""),
1915
1915
  type: jspb.Message.getFieldWithDefault(msg, 3, 0),
1916
- appEndpoint: jspb.Message.getFieldWithDefault(msg, 4, ""),
1916
+ endpoint: jspb.Message.getFieldWithDefault(msg, 4, ""),
1917
1917
  textToSpeech: (f = msg.getTextToSpeech()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
1918
1918
  speechToText: (f = msg.getSpeechToText()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f),
1919
1919
  intelligence: (f = msg.getIntelligence()) && proto.fonoster.applications.v1beta2.ProductContainer.toObject(includeInstance, f)
@@ -1967,7 +1967,7 @@ proto.fonoster.applications.v1beta2.UpdateApplicationRequest.deserializeBinaryFr
1967
1967
  break;
1968
1968
  case 4:
1969
1969
  var value = /** @type {string} */ (reader.readString());
1970
- msg.setAppEndpoint(value);
1970
+ msg.setEndpoint(value);
1971
1971
  break;
1972
1972
  case 5:
1973
1973
  var value = new proto.fonoster.applications.v1beta2.ProductContainer;
@@ -2034,7 +2034,7 @@ proto.fonoster.applications.v1beta2.UpdateApplicationRequest.serializeBinaryToWr
2034
2034
  f
2035
2035
  );
2036
2036
  }
2037
- f = message.getAppEndpoint();
2037
+ f = message.getEndpoint();
2038
2038
  if (f.length > 0) {
2039
2039
  writer.writeString(
2040
2040
  4,
@@ -2123,10 +2123,10 @@ proto.fonoster.applications.v1beta2.UpdateApplicationRequest.prototype.setType =
2123
2123
 
2124
2124
 
2125
2125
  /**
2126
- * optional string app_endpoint = 4;
2126
+ * optional string endpoint = 4;
2127
2127
  * @return {string}
2128
2128
  */
2129
- proto.fonoster.applications.v1beta2.UpdateApplicationRequest.prototype.getAppEndpoint = function() {
2129
+ proto.fonoster.applications.v1beta2.UpdateApplicationRequest.prototype.getEndpoint = function() {
2130
2130
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
2131
2131
  };
2132
2132
 
@@ -2135,7 +2135,7 @@ proto.fonoster.applications.v1beta2.UpdateApplicationRequest.prototype.getAppEnd
2135
2135
  * @param {string} value
2136
2136
  * @return {!proto.fonoster.applications.v1beta2.UpdateApplicationRequest} returns this
2137
2137
  */
2138
- proto.fonoster.applications.v1beta2.UpdateApplicationRequest.prototype.setAppEndpoint = function(value) {
2138
+ proto.fonoster.applications.v1beta2.UpdateApplicationRequest.prototype.setEndpoint = function(value) {
2139
2139
  return jspb.Message.setProto3StringField(this, 4, value);
2140
2140
  };
2141
2141
 
@@ -111,9 +111,6 @@ function deserialize_fonoster_calls_v1beta2_TrackCallResponse(buffer_arg) {
111
111
  }
112
112
 
113
113
 
114
- // TODO: Consider using Timestamp instead of int64
115
- // import "google/protobuf/timestamp.proto";
116
- //
117
114
  // Calls service definition
118
115
  var CallsService = exports.CallsService = {
119
116
  // Call a number and returns the call status