@fonoster/sdk 0.7.3 → 0.7.5

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 (41) hide show
  1. package/README.md +20 -13
  2. package/dist/node/Calls.d.ts +2 -2
  3. package/dist/node/Calls.js +2 -2
  4. package/dist/node/client/types/common.d.ts +1 -1
  5. package/dist/node/client/types/index.d.ts +3 -3
  6. package/dist/node/client/types/index.js +5 -5
  7. package/dist/node/client/utils.d.ts +1 -1
  8. package/dist/node/client/utils.js +2 -2
  9. package/dist/node/generated/node/applications_pb.js +1 -1
  10. package/dist/node/generated/web/applications_pb.d.ts +1 -1
  11. package/dist/node/generated/web/applications_pb.js +1 -1
  12. package/dist/node/node.d.ts +8 -8
  13. package/dist/node/node.js +12 -12
  14. package/dist/node/tsconfig.node.tsbuildinfo +1 -1
  15. package/dist/web/fonoster.min.js +1 -1
  16. package/dist/web/index.esm.js +1 -1
  17. package/package.json +4 -4
  18. package/dist/node/generated/node/acls.ts +0 -1054
  19. package/dist/node/generated/node/agents.ts +0 -1388
  20. package/dist/node/generated/node/applications.ts +0 -1411
  21. package/dist/node/generated/node/calls.ts +0 -1123
  22. package/dist/node/generated/node/credentials.ts +0 -1054
  23. package/dist/node/generated/node/domains.ts +0 -1144
  24. package/dist/node/generated/node/google/protobuf/empty.ts +0 -48
  25. package/dist/node/generated/node/google/protobuf/struct.ts +0 -408
  26. package/dist/node/generated/node/identity.ts +0 -4267
  27. package/dist/node/generated/node/numbers.ts +0 -1371
  28. package/dist/node/generated/node/secrets.ts +0 -985
  29. package/dist/node/generated/node/trunks.ts +0 -1546
  30. package/dist/node/generated/web/acls.ts +0 -1054
  31. package/dist/node/generated/web/agents.ts +0 -1388
  32. package/dist/node/generated/web/applications.ts +0 -1411
  33. package/dist/node/generated/web/calls.ts +0 -1123
  34. package/dist/node/generated/web/credentials.ts +0 -1054
  35. package/dist/node/generated/web/domains.ts +0 -1144
  36. package/dist/node/generated/web/google/protobuf/empty.ts +0 -48
  37. package/dist/node/generated/web/google/protobuf/struct.ts +0 -408
  38. package/dist/node/generated/web/identity.ts +0 -4267
  39. package/dist/node/generated/web/numbers.ts +0 -1371
  40. package/dist/node/generated/web/secrets.ts +0 -985
  41. package/dist/node/generated/web/trunks.ts +0 -1546
package/README.md CHANGED
@@ -967,8 +967,8 @@ Note that an active Fonoster deployment is required.
967
967
 
968
968
  * [Calls](#Calls)
969
969
  * [new Calls(client)](#new_Calls_new)
970
- * [.createCall(request)](#Calls+createCall) ⇒ <code>Promise.&lt;CreateCallResponse&gt;</code>
971
- * [.getCall(ref)](#Calls+getCall) ⇒ <code>Promise.&lt;Acl&gt;</code>
970
+ * [.createCall(request)](#Calls+createCall) ⇒ <code>Object</code>
971
+ * [.getCall(ref)](#Calls+getCall) ⇒ <code>Promise.&lt;CallDetailRecord&gt;</code>
972
972
  * [.listCalls(request)](#Calls+listCalls) ⇒ <code>Promise.&lt;ListCallsResponse&gt;</code>
973
973
 
974
974
  <a name="new_Calls_new"></a>
@@ -1003,7 +1003,7 @@ async function main(request) {
1003
1003
  }
1004
1004
 
1005
1005
  const request = {
1006
- from: "8287854037",
1006
+ from: "+18287854037",
1007
1007
  to: "+17853178070",
1008
1008
  appRef: "00000000-0000-0000-0000-000000000000"
1009
1009
  };
@@ -1012,11 +1012,12 @@ main(request).catch(console.error);
1012
1012
  ```
1013
1013
  <a name="Calls+createCall"></a>
1014
1014
 
1015
- ### calls.createCall(request) ⇒ <code>Promise.&lt;CreateCallResponse&gt;</code>
1015
+ ### calls.createCall(request) ⇒ <code>Object</code>
1016
1016
  Creates a new Call in the Workspace.
1017
1017
 
1018
1018
  **Kind**: instance method of [<code>Calls</code>](#Calls)
1019
- **Returns**: <code>Promise.&lt;CreateCallResponse&gt;</code> - - The response object that contains the reference to the created Call
1019
+ **Returns**: <code>Object</code> - - The response object that contains the Call reference and a stream of status updates
1020
+ **See**: DialStatus
1020
1021
 
1021
1022
  | Param | Type | Description |
1022
1023
  | --- | --- | --- |
@@ -1024,29 +1025,35 @@ Creates a new Call in the Workspace.
1024
1025
  | request.from | <code>string</code> | The number that originated the call |
1025
1026
  | request.to | <code>string</code> | The number that received the call |
1026
1027
  | request.appRef | <code>string</code> | The reference of the App that will handle the call |
1028
+ | request.timeout | <code>number</code> | The time in seconds to wait for the call to be answered. Default is 60 seconds |
1027
1029
 
1028
1030
  **Example**
1029
1031
  ```js
1030
1032
  const calls = new SDK.Calls(client); // Existing client object
1031
1033
 
1032
1034
  const request = {
1033
- from: "8287854037",
1035
+ from: "+18287854037",
1034
1036
  to: "+17853178070",
1035
- appRef: "00000000-0000-0000-0000-000000000000"
1037
+ appRef: "00000000-0000-0000-0000-000000000000",
1038
+ timeout: 30
1036
1039
  };
1037
1040
 
1038
- calls
1039
- .createCall(request)
1040
- .then(console.log) // successful response
1041
- .catch(console.error); // an error occurred
1041
+ const response = await calls.createCall(request);
1042
+ const { ref, statusStream } = response;
1043
+
1044
+ console.log(ref); // Call reference
1045
+
1046
+ for await (const status of statusStream) {
1047
+ console.log(status); // Streamed status
1048
+ }
1042
1049
  ```
1043
1050
  <a name="Calls+getCall"></a>
1044
1051
 
1045
- ### calls.getCall(ref) ⇒ <code>Promise.&lt;Acl&gt;</code>
1052
+ ### calls.getCall(ref) ⇒ <code>Promise.&lt;CallDetailRecord&gt;</code>
1046
1053
  Retrieves an existing Call in the Workspace.
1047
1054
 
1048
1055
  **Kind**: instance method of [<code>Calls</code>](#Calls)
1049
- **Returns**: <code>Promise.&lt;Acl&gt;</code> - - The response object that contains the Call detail
1056
+ **Returns**: <code>Promise.&lt;CallDetailRecord&gt;</code> - - The response object that contains the Call detail
1050
1057
 
1051
1058
  | Param | Type | Description |
1052
1059
  | --- | --- | --- |
@@ -28,7 +28,7 @@ import { FonosterClient } from "./client/types";
28
28
  * }
29
29
  *
30
30
  * const request = {
31
- * from: "8287854037",
31
+ * from: "+18287854037",
32
32
  * to: "+17853178070",
33
33
  * appRef: "00000000-0000-0000-0000-000000000000"
34
34
  * };
@@ -59,7 +59,7 @@ declare class Calls {
59
59
  * const calls = new SDK.Calls(client); // Existing client object
60
60
  *
61
61
  * const request = {
62
- * from: "8287854037",
62
+ * from: "+18287854037",
63
63
  * to: "+17853178070",
64
64
  * appRef: "00000000-0000-0000-0000-000000000000",
65
65
  * timeout: 30
@@ -31,7 +31,7 @@ const utils_1 = require("./utils");
31
31
  * }
32
32
  *
33
33
  * const request = {
34
- * from: "8287854037",
34
+ * from: "+18287854037",
35
35
  * to: "+17853178070",
36
36
  * appRef: "00000000-0000-0000-0000-000000000000"
37
37
  * };
@@ -64,7 +64,7 @@ class Calls {
64
64
  * const calls = new SDK.Calls(client); // Existing client object
65
65
  *
66
66
  * const request = {
67
- * from: "8287854037",
67
+ * from: "+18287854037",
68
68
  * to: "+17853178070",
69
69
  * appRef: "00000000-0000-0000-0000-000000000000",
70
70
  * timeout: 30
@@ -8,4 +8,4 @@ type ServerStream<U> = {
8
8
  on: (event: "data" | "error" | "end" | "status", listener: (response: U | Error | DataResponse) => void) => void;
9
9
  };
10
10
  type ServerStreamFunction<T, U> = (request: T, metadata: Metadata | unknown | null) => ServerStream<U>;
11
- export { MappingTuple, ServerStreamFunction, DataResponse, ClientFunction };
11
+ export { ClientFunction, DataResponse, MappingTuple, ServerStreamFunction };
@@ -1,6 +1,6 @@
1
- export * from "./common";
2
- export * from "./FonosterClient";
3
1
  export * from "./ApplicationsClient";
4
- export * from "./IdentityClient";
5
2
  export * from "./CallsClient";
3
+ export * from "./FonosterClient";
4
+ export * from "./IdentityClient";
6
5
  export * from "./SecretsClient";
6
+ export * from "./common";
@@ -14,6 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ApplicationsClient"), exports);
18
+ __exportStar(require("./CallsClient"), exports);
19
+ __exportStar(require("./FonosterClient"), exports);
20
+ __exportStar(require("./IdentityClient"), exports);
21
+ __exportStar(require("./SecretsClient"), exports);
17
22
  /*
18
23
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
19
24
  * http://github.com/fonoster/fonoster
@@ -33,8 +38,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
38
  * limitations under the License.
34
39
  */
35
40
  __exportStar(require("./common"), exports);
36
- __exportStar(require("./FonosterClient"), exports);
37
- __exportStar(require("./ApplicationsClient"), exports);
38
- __exportStar(require("./IdentityClient"), exports);
39
- __exportStar(require("./CallsClient"), exports);
40
- __exportStar(require("./SecretsClient"), exports);
@@ -2,4 +2,4 @@ import { MappingTuple } from "./types";
2
2
  declare function isMapping(key: string, objectMapping: MappingTuple<unknown>): boolean;
3
3
  declare function getEnumValue(key: string, value: string, enumMapping: MappingTuple<unknown>): number;
4
4
  declare function getEnumKey(key: string, value: number, enumMapping: MappingTuple<unknown>): string;
5
- export { isMapping, getEnumValue, getEnumKey };
5
+ export { getEnumKey, getEnumValue, isMapping };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMapping = isMapping;
4
- exports.getEnumValue = getEnumValue;
5
3
  exports.getEnumKey = getEnumKey;
4
+ exports.getEnumValue = getEnumValue;
5
+ exports.isMapping = isMapping;
6
6
  function isMapping(key, objectMapping) {
7
7
  return objectMapping?.some((tuple) => tuple[0] === key);
8
8
  }
@@ -2645,7 +2645,7 @@ proto.fonoster.applications.v1beta2.DeleteApplicationResponse.prototype.setRef =
2645
2645
  * @enum {number}
2646
2646
  */
2647
2647
  proto.fonoster.applications.v1beta2.ApplicationType = {
2648
- PROGRAMMABLE_VOICE: 0
2648
+ EXTERNAL: 0
2649
2649
  };
2650
2650
 
2651
2651
  goog.object.extend(exports, proto.fonoster.applications.v1beta2);
@@ -318,5 +318,5 @@ export namespace DeleteApplicationResponse {
318
318
  }
319
319
 
320
320
  export enum ApplicationType {
321
- PROGRAMMABLE_VOICE = 0,
321
+ EXTERNAL = 0,
322
322
  }
@@ -2645,7 +2645,7 @@ proto.fonoster.applications.v1beta2.DeleteApplicationResponse.prototype.setRef =
2645
2645
  * @enum {number}
2646
2646
  */
2647
2647
  proto.fonoster.applications.v1beta2.ApplicationType = {
2648
- PROGRAMMABLE_VOICE: 0
2648
+ EXTERNAL: 0
2649
2649
  };
2650
2650
 
2651
2651
  goog.object.extend(exports, proto.fonoster.applications.v1beta2);
@@ -1,13 +1,13 @@
1
- export * from "./client/Client";
1
+ export * from "./Acls";
2
+ export * from "./Agents";
3
+ export * from "./ApiKeys";
2
4
  export * from "./Applications";
3
5
  export * from "./Calls";
4
- export * from "./ApiKeys";
5
- export * from "./Users";
6
- export * from "./Secrets";
7
- export * from "./Agents";
8
- export * from "./Domains";
9
- export * from "./Trunks";
10
6
  export * from "./Credentials";
11
- export * from "./Acls";
7
+ export * from "./Domains";
12
8
  export * from "./Numbers";
9
+ export * from "./Secrets";
10
+ export * from "./Trunks";
11
+ export * from "./Users";
13
12
  export * from "./Workspaces";
13
+ export * from "./client/Client";
package/dist/node/node.js CHANGED
@@ -14,6 +14,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Acls"), exports);
18
+ __exportStar(require("./Agents"), exports);
19
+ __exportStar(require("./ApiKeys"), exports);
20
+ __exportStar(require("./Applications"), exports);
21
+ __exportStar(require("./Calls"), exports);
22
+ __exportStar(require("./Credentials"), exports);
23
+ __exportStar(require("./Domains"), exports);
24
+ __exportStar(require("./Numbers"), exports);
25
+ __exportStar(require("./Secrets"), exports);
26
+ __exportStar(require("./Trunks"), exports);
27
+ __exportStar(require("./Users"), exports);
28
+ __exportStar(require("./Workspaces"), exports);
17
29
  /*
18
30
  * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
19
31
  * http://github.com/fonoster/fonoster
@@ -33,15 +45,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
45
  * limitations under the License.
34
46
  */
35
47
  __exportStar(require("./client/Client"), exports);
36
- __exportStar(require("./Applications"), exports);
37
- __exportStar(require("./Calls"), exports);
38
- __exportStar(require("./ApiKeys"), exports);
39
- __exportStar(require("./Users"), exports);
40
- __exportStar(require("./Secrets"), exports);
41
- __exportStar(require("./Agents"), exports);
42
- __exportStar(require("./Domains"), exports);
43
- __exportStar(require("./Trunks"), exports);
44
- __exportStar(require("./Credentials"), exports);
45
- __exportStar(require("./Acls"), exports);
46
- __exportStar(require("./Numbers"), exports);
47
- __exportStar(require("./Workspaces"), exports);