@fonoster/common 0.5.5 → 0.6.1-alpha.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.
Files changed (102) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +3 -0
  3. package/dist/GrpcError.d.ts +5 -0
  4. package/dist/{speech/plugin.js → GrpcError.js} +8 -12
  5. package/dist/constants.d.ts +4 -0
  6. package/dist/constants.js +6 -0
  7. package/dist/errors/PrismaErrorEnum.d.ts +6 -0
  8. package/dist/{envs.js → errors/PrismaErrorEnum.js} +8 -6
  9. package/dist/errors/handleError.d.ts +6 -0
  10. package/dist/errors/handleError.js +86 -0
  11. package/dist/errors/handleZodError.d.ts +4 -0
  12. package/dist/errors/handleZodError.js +41 -0
  13. package/dist/errors/index.d.ts +4 -0
  14. package/dist/errors/index.js +38 -0
  15. package/dist/errors/types.d.ts +5 -0
  16. package/dist/grpcStatusMap.d.ts +4 -0
  17. package/dist/grpcStatusMap.js +27 -0
  18. package/dist/index.d.ts +10 -8
  19. package/dist/index.js +41 -14
  20. package/dist/notifications/compileTemplate.d.ts +6 -0
  21. package/dist/{env_is_set.js → notifications/compileTemplate.js} +12 -14
  22. package/dist/notifications/createEmailSender.d.ts +17 -0
  23. package/dist/notifications/createEmailSender.js +55 -0
  24. package/dist/notifications/index.d.ts +2 -0
  25. package/dist/notifications/index.js +36 -0
  26. package/dist/protos/acls.proto +119 -0
  27. package/dist/protos/agents.proto +155 -0
  28. package/dist/protos/applications.proto +154 -0
  29. package/dist/protos/calls.proto +164 -0
  30. package/dist/protos/credentials.proto +119 -0
  31. package/dist/protos/domains.proto +127 -0
  32. package/dist/protos/identity.proto +286 -0
  33. package/dist/protos/numbers.proto +152 -0
  34. package/dist/protos/secrets.proto +113 -0
  35. package/dist/protos/trunks.proto +164 -0
  36. package/dist/protos/voice.proto +421 -0
  37. package/dist/tts/AzureVoices.d.ts +523 -0
  38. package/dist/tts/AzureVoices.js +3622 -0
  39. package/dist/tts/GoogleVoices.d.ts +475 -0
  40. package/dist/tts/GoogleVoices.js +3284 -0
  41. package/dist/tts/index.d.ts +3 -0
  42. package/dist/tts/index.js +37 -0
  43. package/dist/tts/types.d.ts +164 -0
  44. package/dist/tts/types.js +186 -0
  45. package/dist/types/applications.d.ts +57 -0
  46. package/dist/types/applications.js +7 -0
  47. package/dist/types/index.d.ts +1 -0
  48. package/dist/types/index.js +35 -0
  49. package/dist/types.d.ts +8 -6
  50. package/dist/utils/assertEnvsAreSet.d.ts +7 -0
  51. package/dist/utils/assertEnvsAreSet.js +37 -0
  52. package/dist/utils/assertFileExists.d.ts +5 -0
  53. package/dist/utils/assertFileExists.js +38 -0
  54. package/dist/utils/createInterceptingCall.d.ts +7 -0
  55. package/dist/utils/createInterceptingCall.js +9 -0
  56. package/dist/utils/createService.d.ts +9 -0
  57. package/dist/{service_runner.js → utils/createService.js} +15 -40
  58. package/dist/utils/datesMapper.d.ts +9 -0
  59. package/dist/utils/datesMapper.js +8 -0
  60. package/dist/utils/getServerCredentials.d.ts +10 -0
  61. package/dist/{trust_util.js → utils/getServerCredentials.js} +33 -37
  62. package/dist/utils/index.d.ts +8 -0
  63. package/dist/utils/index.js +42 -0
  64. package/dist/utils/toCamelCase.d.ts +2 -0
  65. package/dist/utils/toCamelCase.js +27 -0
  66. package/dist/utils/toPascalCase.d.ts +2 -0
  67. package/dist/utils/toPascalCase.js +29 -0
  68. package/dist/voice/Dial.d.ts +23 -0
  69. package/dist/voice/Dial.js +19 -0
  70. package/dist/voice/Gather.d.ts +18 -0
  71. package/dist/voice/Gather.js +9 -0
  72. package/dist/voice/Mute.d.ts +13 -0
  73. package/dist/voice/Mute.js +9 -0
  74. package/dist/voice/Play.d.ts +12 -0
  75. package/dist/voice/Play.js +2 -0
  76. package/dist/voice/PlayDtmf.d.ts +5 -0
  77. package/dist/voice/PlayDtmf.js +2 -0
  78. package/dist/voice/PlaybackControl.d.ts +13 -0
  79. package/dist/voice/PlaybackControl.js +11 -0
  80. package/dist/voice/Record.d.ts +18 -0
  81. package/dist/voice/Record.js +7 -0
  82. package/dist/voice/Say.d.ts +15 -0
  83. package/dist/voice/Say.js +2 -0
  84. package/dist/voice/Stream.d.ts +41 -0
  85. package/dist/voice/Stream.js +39 -0
  86. package/dist/voice/Verb.d.ts +9 -0
  87. package/dist/{healthcheck.js → voice/Verb.js} +2 -5
  88. package/dist/voice/index.d.ts +11 -0
  89. package/dist/voice/index.js +45 -0
  90. package/dist/voice/voice.d.ts +101 -0
  91. package/dist/voice/voice.js +44 -0
  92. package/package.json +29 -25
  93. package/dist/api_client.d.ts +0 -27
  94. package/dist/api_client.js +0 -110
  95. package/dist/env_is_set.d.ts +0 -1
  96. package/dist/envs.d.ts +0 -4
  97. package/dist/healthcheck.d.ts +0 -2
  98. package/dist/service_runner.d.ts +0 -13
  99. package/dist/speech/plugin.d.ts +0 -6
  100. package/dist/speech/types.d.ts +0 -17
  101. package/dist/trust_util.d.ts +0 -4
  102. /package/dist/{speech → errors}/types.js +0 -0
@@ -0,0 +1,119 @@
1
+ /*
2
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.acls.v1beta2;
22
+
23
+ // AccessControlList(Acl) service definition
24
+ service Acls {
25
+ // Create a new Acl
26
+ rpc CreateAcl (CreateAclRequest) returns (CreateAclResponse) {}
27
+ // Update an existing Acl
28
+ rpc UpdateAcl (UpdateAclRequest) returns (UpdateAclResponse) {}
29
+ // Get an existing Acl
30
+ rpc GetAcl (GetAclRequest) returns (Acl) {}
31
+ // Delete an existing Acl
32
+ rpc DeleteAcl (DeleteAclRequest) returns (DeleteAclResponse) {}
33
+ // Get a list of Acls
34
+ rpc ListAcls (ListAclsRequest) returns (ListAclsResponse) {}
35
+ }
36
+
37
+ // The message for Acl resource
38
+ message Acl {
39
+ // The Acl reference
40
+ string ref = 1;
41
+ // A friendly name for the Acl
42
+ string name = 2;
43
+ // The list of allowed IP addresses
44
+ repeated string allow = 3;
45
+ // The list of denied IP addresses
46
+ repeated string deny = 4;
47
+ // The date the Acl was created
48
+ int64 created_at = 5;
49
+ // The date the Acl was last updated
50
+ int64 updated_at = 6;
51
+ }
52
+
53
+ // The request message for the Acl.CreateAcl method
54
+ message CreateAclRequest {
55
+ // A friendly name for the Acl
56
+ string name = 1;
57
+ // The list of allowed IP addresses
58
+ repeated string allow = 2;
59
+ // The list of denied IP addresses
60
+ repeated string deny = 3;
61
+ }
62
+
63
+ // The response message for the Acl.CreateAcl method
64
+ message CreateAclResponse {
65
+ // The Acl reference
66
+ string ref = 1;
67
+ }
68
+
69
+ // The request message for the Acl.UpdateAcl method
70
+ message UpdateAclRequest {
71
+ // The Acl reference
72
+ string ref = 1;
73
+ // A friendly name for the Acl
74
+ string name = 2;
75
+ // The list of allowed IP addresses
76
+ repeated string allow = 3;
77
+ // The list of denied IP addresses
78
+ repeated string deny = 4;
79
+ }
80
+
81
+ // The response message for the Acl.UpdateAcl method
82
+ message UpdateAclResponse {
83
+ // The Acl reference
84
+ string ref = 1;
85
+ }
86
+
87
+ // The request message for the Acl.GetAcl method
88
+ message GetAclRequest {
89
+ // The Acl reference
90
+ string ref = 1;
91
+ }
92
+
93
+ // The request message for the Acl.DeleteAcl method
94
+ message DeleteAclRequest {
95
+ // The Acl reference
96
+ string ref = 1;
97
+ }
98
+
99
+ // The response message for the Acl.DeleteAcl method
100
+ message DeleteAclResponse {
101
+ // The Acl reference
102
+ string ref = 1;
103
+ }
104
+
105
+ // The request message for the Acl.ListAcl method
106
+ message ListAclsRequest {
107
+ // The maximum number of items in the list
108
+ int32 page_size = 1;
109
+ // The next_page_token value returned from the previous request, if any
110
+ string page_token = 2;
111
+ }
112
+
113
+ // The response message for the Acl.ListAcl method
114
+ message ListAclsResponse {
115
+ // List of items
116
+ repeated Acl items = 1;
117
+ // Token to retrieve the next page of results, or empty if there are no more results in the list
118
+ string next_page_token = 2;
119
+ }
@@ -0,0 +1,155 @@
1
+ /*
2
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.agents.v1beta2;
22
+
23
+ import "domains.proto";
24
+ import "credentials.proto";
25
+
26
+ // The Agents service definition
27
+ service Agents {
28
+ // Create a new Agent
29
+ rpc CreateAgent (CreateAgentRequest) returns (CreateAgentResponse) {}
30
+ // Update an existing Agent
31
+ rpc UpdateAgent (UpdateAgentRequest) returns (UpdateAgentResponse) {}
32
+ // Get an existing Agent
33
+ rpc GetAgent (GetAgentRequest) returns (Agent) {}
34
+ // Delete an existing Agent
35
+ rpc DeleteAgent (DeleteAgentRequest) returns (DeleteAgentResponse) {}
36
+ // List all Agents
37
+ rpc ListAgents (ListAgentsRequest) returns (ListAgentsResponse) {}
38
+ }
39
+
40
+ // The message for a new Agent
41
+ message Agent {
42
+ // The unique identifier of the Agent
43
+ string ref = 1;
44
+ // The name of the Agent
45
+ string name = 2;
46
+ // The username of the Agent
47
+ string username = 3;
48
+ // The privacy settings of the Agent
49
+ Privacy privacy = 4;
50
+ // The enabled status of the Agent
51
+ bool enabled = 5;
52
+ // The created_at timestamp of the Agent
53
+ int64 created_at = 6;
54
+ // The updated_at timestamp of the Agent
55
+ int64 updated_at = 7;
56
+ // The maximum number of contacts that can be created for this Agent
57
+ int32 max_contacts = 8;
58
+ // Value to override the expires requested by the Agent
59
+ int32 expires = 9;
60
+ // The domain of the Agent
61
+ fonoster.domains.v1beta2.Domain domain = 10;
62
+ // The credentials of the Agent
63
+ fonoster.credentials.v1beta2.Credentials credentials = 11;
64
+ }
65
+
66
+ // The request message for Agents.CreateAgent
67
+ message CreateAgentRequest {
68
+ // The name of the Agent
69
+ string name = 1;
70
+ // The username of the Agent
71
+ string username = 2;
72
+ // The privacy settings of the Agent
73
+ Privacy privacy = 3;
74
+ // The enabled status of the Agent
75
+ bool enabled = 4;
76
+ // Reference to the Domain of the Agent
77
+ string domain_ref = 5;
78
+ // Reference to the Credentials of the Agent
79
+ string credentials_ref = 6;
80
+ // The maximum number of contacts that can be created for this Agent
81
+ int32 max_contacts = 7;
82
+ // Value to override the expires requested by the Agent
83
+ int32 expires = 8;
84
+ }
85
+
86
+ // The response message for Agents.CreateAgent
87
+ message CreateAgentResponse {
88
+ // The unique identifier of the Agent
89
+ string ref = 1;
90
+ }
91
+
92
+ // The request message for Agents.UpdateAgent
93
+ message UpdateAgentRequest {
94
+ // The unique identifier of the Agent
95
+ string ref = 1;
96
+ // The name of the Agent
97
+ string name = 2;
98
+ // The privacy settings of the Agent
99
+ Privacy privacy = 3;
100
+ // The enabled status of the Agent
101
+ bool enabled = 4;
102
+ // Reference to the Domain of the Agent
103
+ string domain_ref = 5;
104
+ // Reference to the Credentials of the Agent
105
+ string credentials_ref = 6;
106
+ // The maximum number of contacts that can be created for this Agent
107
+ int32 max_contacts = 7;
108
+ // Value to override the expires requested by the Agent
109
+ int32 expires = 8;
110
+ }
111
+
112
+ // The response message for Agents.UpdateAgent
113
+ message UpdateAgentResponse {
114
+ // The id of the updated Agent
115
+ string ref = 1;
116
+ }
117
+
118
+ // The request message for Agents.GetAgent
119
+ message GetAgentRequest {
120
+ // The unique identifier of the Agent
121
+ string ref = 1;
122
+ }
123
+
124
+ // The request message for Agents.DeleteAgent
125
+ message DeleteAgentRequest {
126
+ // The unique identifier of the Agent
127
+ string ref = 1;
128
+ }
129
+
130
+ // The response message for Agents.DeleteAgent
131
+ message DeleteAgentResponse {
132
+ // Echo back the id of the deleted Agent
133
+ string ref = 1;
134
+ }
135
+
136
+ // The request message for Agents.ListAgents
137
+ message ListAgentsRequest {
138
+ // The maximum number of items in the list
139
+ int32 page_size = 1;
140
+ // The next_page_token value returned from the previous request, if any
141
+ string page_token = 2;
142
+ }
143
+
144
+ // The response message for Agents.ListAgents
145
+ message ListAgentsResponse {
146
+ // List of Agents
147
+ repeated Agent items = 1;
148
+ // Token to retrieve the next page of results, or empty if there are no more results in the list
149
+ string next_page_token = 2;
150
+ }
151
+
152
+ enum Privacy {
153
+ PRIVATE = 0;
154
+ NONE = 1;
155
+ }
@@ -0,0 +1,154 @@
1
+ /*
2
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.applications.v1beta2;
22
+
23
+ import "google/protobuf/struct.proto";
24
+
25
+ // Applications service definition
26
+ service Applications {
27
+ // Create a new application
28
+ rpc CreateApplication(CreateApplicationRequest) returns (CreateApplicationResponse) {}
29
+ // Get an application
30
+ rpc GetApplication(GetApplicationRequest) returns (Application) {}
31
+ // List applications
32
+ rpc ListApplications(ListApplicationsRequest) returns (ListApplicationsResponse) {}
33
+ // Update an application
34
+ rpc UpdateApplication(UpdateApplicationRequest) returns (UpdateApplicationResponse) {}
35
+ // Delete an application
36
+ rpc DeleteApplication(DeleteApplicationRequest) returns (DeleteApplicationResponse) {}
37
+ }
38
+
39
+ // The type of application
40
+ enum ApplicationType {
41
+ // Programmable Voice
42
+ PROGRAMMABLE_VOICE = 0;
43
+ }
44
+
45
+ message ProductContainer {
46
+ // Product reference
47
+ string product_ref = 1;
48
+ // Product configuration
49
+ google.protobuf.Struct config = 2;
50
+ // Product credentials
51
+ google.protobuf.Struct credentials = 3;
52
+ }
53
+
54
+ // Application definition
55
+ message Application {
56
+ // Reference to the application
57
+ string ref = 1;
58
+ // The application's resource name
59
+ string name = 2;
60
+ // Application type
61
+ ApplicationType type = 3;
62
+ // Endpoint for programmable voice
63
+ string app_endpoint = 4;
64
+ // Text to speech product
65
+ ProductContainer text_to_speech = 5;
66
+ // Speech to text product
67
+ ProductContainer speech_to_text = 6;
68
+ // Conversation product
69
+ ProductContainer conversation = 7;
70
+ // Creation time
71
+ int64 created_at = 8;
72
+ // Update time
73
+ int64 updated_at = 9;
74
+ }
75
+
76
+ // Request to create a new application
77
+ message CreateApplicationRequest {
78
+ // Name of the application
79
+ string name = 1;
80
+ // Application type
81
+ ApplicationType type = 2;
82
+ // App URL for programmable voice
83
+ string app_endpoint = 3;
84
+ // Text to speech product
85
+ ProductContainer text_to_speech = 4;
86
+ // Speech to text product
87
+ ProductContainer speech_to_text = 5;
88
+ // Conversation product
89
+ ProductContainer intelligence = 6;
90
+ }
91
+
92
+ // Response for create application
93
+ message CreateApplicationResponse {
94
+ // Echo the reference of the application
95
+ string ref = 1;
96
+ }
97
+
98
+ // Request to get an application
99
+ message GetApplicationRequest {
100
+ // The reference to the application
101
+ string ref = 1;
102
+ }
103
+
104
+ // Request to list applications
105
+ message ListApplicationsRequest {
106
+ // The number of items to list
107
+ int32 page_size = 1;
108
+ // The page token
109
+ string page_token = 2;
110
+ }
111
+
112
+ // Response for list applications
113
+ message ListApplicationsResponse {
114
+ // List of applications
115
+ repeated Application items = 1;
116
+ // The page token
117
+ string next_page_token = 2;
118
+ }
119
+
120
+ // Request to update an application
121
+ message UpdateApplicationRequest {
122
+ // Reference to the application
123
+ string ref = 1;
124
+ // Name of the application
125
+ string name = 2;
126
+ // Application type
127
+ ApplicationType type = 3;
128
+ // App URL for programmable voice
129
+ string app_endpoint = 4;
130
+ // Text to speech product
131
+ ProductContainer text_to_speech = 5;
132
+ // Speech to text product
133
+ ProductContainer speech_to_text = 6;
134
+ // Conversation product
135
+ ProductContainer intelligence = 7;
136
+ }
137
+
138
+ // Response for update application
139
+ message UpdateApplicationResponse {
140
+ // Echo the reference of the application
141
+ string ref = 1;
142
+ }
143
+
144
+ // Request to delete an application
145
+ message DeleteApplicationRequest {
146
+ // The reference to the application
147
+ string ref = 1;
148
+ }
149
+
150
+ // Response for delete application
151
+ message DeleteApplicationResponse {
152
+ // Echo the reference of the application
153
+ string ref = 1;
154
+ }
@@ -0,0 +1,164 @@
1
+ /*
2
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.calls.v1beta2;
22
+
23
+ // TODO: Consider using Timestamp instead of int64
24
+ // import "google/protobuf/timestamp.proto";
25
+
26
+ // Calls service definition
27
+ service Calls {
28
+ // Call a number and returns the call status
29
+ rpc CreateCall (CreateCallRequest) returns (CreateCallResponse) {}
30
+ // Get a list of Call Detail Records
31
+ rpc ListCalls (ListCallsRequest) returns (ListCallsResponse) {}
32
+ // Get a Call Detail Record
33
+ rpc GetCall (GetCallRequest) returns (CallDetailRecord) {}
34
+ // Stream call status
35
+ rpc TrackCall (TrackCallRequest) returns (stream TrackCallResponse) {}
36
+ }
37
+
38
+ enum CallType {
39
+ PROGRAMMABLE = 0;
40
+ SIP_TRUNKING = 1;
41
+ }
42
+
43
+ enum HangupCause {
44
+ NORMAL_CLEARING = 0;
45
+ CALL_REJECTED = 1;
46
+ UNALLOCATED = 2;
47
+ NO_USER_RESPONSE = 3;
48
+ NO_ROUTE_DESTINATION = 4;
49
+ NO_ANSWER = 5;
50
+ USER_BUSY = 6;
51
+ NOT_ACCEPTABLE_HERE = 7;
52
+ SERVICE_UNAVAILABLE = 8;
53
+ INVALID_NUMBER_FORMAT = 9;
54
+ UNKNOWN = 10;
55
+ }
56
+
57
+ enum CallStatus {
58
+ QUEUED = 0;
59
+ RINGING = 1;
60
+ IN_PROGRESS = 2;
61
+ COMPLETED = 3;
62
+ FAILED = 4;
63
+ BUSY = 5;
64
+ // TODO: Refactor to avoid clash with HangupCause
65
+ // NO_ANSWER = 6;
66
+ CANCELED = 7;
67
+ REJECTED = 8;
68
+ TIMEOUT = 9;
69
+ // TODO: Refactor to avoid clash with HangupCause
70
+ // UNKNOWN = 10;
71
+ }
72
+
73
+ enum CallDirection {
74
+ INBOUND = 0;
75
+ OUTBOUND = 1;
76
+ }
77
+
78
+ // Message for a Call Detail Record
79
+ message CallDetailRecord {
80
+ // The unique identifier of the Call
81
+ string ref = 1;
82
+ // The call type
83
+ CallType type = 2;
84
+ // The call status
85
+ CallStatus status = 3;
86
+ // Hangup cause
87
+ HangupCause hangup_cause = 4;
88
+ // Start time of the call
89
+ int64 started_at = 5;
90
+ // End time of the call
91
+ int64 ended_at = 6;
92
+ // The from number (E.164 format or SIP URI)
93
+ string from = 7;
94
+ // The to number (E.164 format or SIP URI)
95
+ string to = 8;
96
+ // The call duration in seconds
97
+ int32 duration = 9;
98
+ // The call direction
99
+ CallDirection direction = 10;
100
+ }
101
+
102
+ // The request message for Calls.Call
103
+ message CreateCallRequest {
104
+ // The from number (E.164 format or SIP URI)
105
+ string from = 1;
106
+ // The to number (E.164 format or SIP URI)
107
+ string to = 2;
108
+ // Optional application reference
109
+ string app_ref = 3;
110
+ }
111
+
112
+ // The response message for Calls.Call
113
+ message CreateCallResponse {
114
+ // The refence of the call
115
+ string ref = 1;
116
+ }
117
+
118
+ // The request message for Calls.ListCalls
119
+ message ListCallsRequest {
120
+ // Optional start date in RFC3339 format
121
+ string after = 1;
122
+ // Optional end date in RFC3339 format
123
+ string before = 2;
124
+ // Optional call type
125
+ CallType type = 3;
126
+ // Optional call status
127
+ CallStatus status = 4;
128
+ // Optional from number (E.164 format or SIP URI)
129
+ string from = 5;
130
+ // Optional to number (E.164 format or SIP URI)
131
+ string to = 6;
132
+ // The page size
133
+ int32 page_size = 7;
134
+ // The page token
135
+ string page_token = 8;
136
+ }
137
+
138
+ // The response message for Calls.ListCalls
139
+ message ListCallsResponse {
140
+ // The list of Call Detail Records
141
+ repeated CallDetailRecord items = 1;
142
+ // The token to retrieve the next page of results
143
+ string next_page_token = 2;
144
+ }
145
+
146
+ // The request message for Calls.GetCall
147
+ message GetCallRequest {
148
+ // The unique identifier of the Call
149
+ string ref = 1;
150
+ }
151
+
152
+ // The request message for Calls.TrackCall
153
+ message TrackCallRequest {
154
+ // The unique identifier of the Call
155
+ string ref = 1;
156
+ }
157
+
158
+ // The response message for Calls.TrackCall
159
+ message TrackCallResponse {
160
+ // The refence of the call
161
+ string ref = 1;
162
+ // The call status
163
+ CallStatus status = 2;
164
+ }
@@ -0,0 +1,119 @@
1
+ /*
2
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.credentials.v1beta2;
22
+
23
+ // The Credentials service definition
24
+ service CredentialsService {
25
+ // Creates a new set of Credentials
26
+ rpc CreateCredentials (CreateCredentialsRequest) returns (CreateCredentialsResponse) {}
27
+ // Updates an existing set of Credentials
28
+ rpc UpdateCredentials (UpdateCredentialsRequest) returns (UpdateCredentialsResponse) {}
29
+ // Gets the details of a given set of Credentials
30
+ rpc GetCredentials (GetCredentialsRequest) returns (Credentials) {}
31
+ // Deletes an existing set of Credentials
32
+ rpc DeleteCredentials (DeleteCredentialsRequest) returns (DeleteCredentialsResponse) {}
33
+ // Lists all Credentials
34
+ rpc ListCredentials (ListCredentialsRequest) returns (ListCredentialsResponse) {}
35
+ }
36
+
37
+ // The message for the Credentials resource
38
+ message Credentials {
39
+ // The reference of the Credentials
40
+ string ref = 1;
41
+ // The name of the Credentials
42
+ string name = 2;
43
+ // The username of the Credentials
44
+ string username = 3;
45
+ // The password of the Credentials
46
+ string password = 4;
47
+ // The time the Credentials was created
48
+ int64 created_at = 5;
49
+ // The time the Credentials was updated
50
+ int64 updated_at = 6;
51
+ }
52
+
53
+ // The request message for the Credentials.CreateCredentials method
54
+ message CreateCredentialsRequest {
55
+ // The name of the Credentials
56
+ string name = 1;
57
+ // The username of the Credentials
58
+ string username = 2;
59
+ // The password of the Credentials
60
+ string password = 3;
61
+ }
62
+
63
+ // The response message for the Credentials.CreateCredentials method
64
+ message CreateCredentialsResponse {
65
+ // The reference of the created Credentials
66
+ string ref = 1;
67
+ }
68
+
69
+ // The request message for the Credentials.UpdateCredentials method
70
+ message UpdateCredentialsRequest {
71
+ // The reference of the Credentials to update
72
+ string ref = 1;
73
+ // The new name of the Credentials
74
+ string name = 2;
75
+ // The new username of the Credentials
76
+ string username = 3;
77
+ // The new password of the Credentials
78
+ string password = 4;
79
+ }
80
+
81
+ // The response message for the Credentials.UpdateCredentials method
82
+ message UpdateCredentialsResponse {
83
+ // The reference of the updated Credentials
84
+ string ref = 1;
85
+ }
86
+
87
+ // The request message for the Credentials.GetCredentials method
88
+ message GetCredentialsRequest {
89
+ // The reference of the Credentials to retrieve
90
+ string ref = 1;
91
+ }
92
+
93
+ // The request message for the Credentials.DeleteCredentials method
94
+ message DeleteCredentialsRequest {
95
+ // The reference of the Credentials to delete
96
+ string ref = 1;
97
+ }
98
+
99
+ // The response message for the Credentials.DeleteCredentials method
100
+ message DeleteCredentialsResponse {
101
+ // The reference of the deleted Credentials
102
+ string ref = 1;
103
+ }
104
+
105
+ // The request message for the Credentials.ListCredentials method
106
+ message ListCredentialsRequest {
107
+ // The maximum number of items in the list
108
+ int32 page_size = 1;
109
+ // The next_page_token value returned from the previous request, if any
110
+ string page_token = 2;
111
+ }
112
+
113
+ // The response message for the Credentials.ListCredentials method
114
+ message ListCredentialsResponse {
115
+ // List of Credentials
116
+ repeated Credentials items = 1;
117
+ // Token to retrieve the next page of results, or empty if there are no more results in the list
118
+ string next_page_token = 2;
119
+ }