@fonoster/common 0.5.4 → 0.6.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 (88) hide show
  1. package/README.md +3 -0
  2. package/dist/constants.d.ts +4 -0
  3. package/dist/constants.js +6 -0
  4. package/dist/errors.d.ts +8 -0
  5. package/dist/errors.js +95 -0
  6. package/dist/grpcStatusMap.d.ts +4 -0
  7. package/dist/{envs.js → grpcStatusMap.js} +8 -6
  8. package/dist/index.d.ts +7 -8
  9. package/dist/index.js +38 -14
  10. package/dist/notifications/compileTemplate.d.ts +6 -0
  11. package/dist/{env_is_set.js → notifications/compileTemplate.js} +12 -14
  12. package/dist/notifications/createEmailSender.d.ts +17 -0
  13. package/dist/notifications/createEmailSender.js +55 -0
  14. package/dist/notifications/index.d.ts +2 -0
  15. package/dist/notifications/index.js +36 -0
  16. package/dist/protos/acls.proto +119 -0
  17. package/dist/protos/agents.proto +155 -0
  18. package/dist/protos/applications.proto +154 -0
  19. package/dist/protos/calls.proto +162 -0
  20. package/dist/protos/credentials.proto +119 -0
  21. package/dist/protos/domains.proto +127 -0
  22. package/dist/protos/identity.proto +286 -0
  23. package/dist/protos/numbers.proto +155 -0
  24. package/dist/protos/secrets.proto +113 -0
  25. package/dist/protos/trunks.proto +164 -0
  26. package/dist/protos/voice.proto +421 -0
  27. package/dist/tts/AzureVoices.d.ts +523 -0
  28. package/dist/tts/AzureVoices.js +3622 -0
  29. package/dist/tts/GoogleVoices.d.ts +475 -0
  30. package/dist/tts/GoogleVoices.js +3284 -0
  31. package/dist/tts/index.d.ts +3 -0
  32. package/dist/tts/index.js +37 -0
  33. package/dist/tts/types.d.ts +164 -0
  34. package/dist/tts/types.js +186 -0
  35. package/dist/utils/assertEnvsAreSet.d.ts +7 -0
  36. package/dist/utils/assertEnvsAreSet.js +37 -0
  37. package/dist/utils/assertFileExists.d.ts +5 -0
  38. package/dist/utils/assertFileExists.js +38 -0
  39. package/dist/utils/createInterceptingCall.d.ts +7 -0
  40. package/dist/utils/createInterceptingCall.js +9 -0
  41. package/dist/utils/createService.d.ts +9 -0
  42. package/dist/{service_runner.js → utils/createService.js} +15 -40
  43. package/dist/utils/datesMapper.d.ts +9 -0
  44. package/dist/utils/datesMapper.js +8 -0
  45. package/dist/utils/getServerCredentials.d.ts +10 -0
  46. package/dist/{trust_util.js → utils/getServerCredentials.js} +33 -37
  47. package/dist/utils/index.d.ts +8 -0
  48. package/dist/utils/index.js +42 -0
  49. package/dist/utils/toCamelCase.d.ts +2 -0
  50. package/dist/utils/toCamelCase.js +27 -0
  51. package/dist/utils/toPascalCase.d.ts +2 -0
  52. package/dist/{speech/plugin.js → utils/toPascalCase.js} +9 -13
  53. package/dist/voice/Dial.d.ts +23 -0
  54. package/dist/voice/Dial.js +19 -0
  55. package/dist/voice/Gather.d.ts +18 -0
  56. package/dist/voice/Gather.js +9 -0
  57. package/dist/voice/Mute.d.ts +13 -0
  58. package/dist/voice/Mute.js +9 -0
  59. package/dist/voice/Play.d.ts +12 -0
  60. package/dist/voice/PlayDtmf.d.ts +5 -0
  61. package/dist/voice/PlaybackControl.d.ts +13 -0
  62. package/dist/voice/PlaybackControl.js +11 -0
  63. package/dist/voice/Record.d.ts +18 -0
  64. package/dist/voice/Record.js +7 -0
  65. package/dist/voice/Say.d.ts +15 -0
  66. package/dist/voice/Say.js +2 -0
  67. package/dist/voice/Stream.d.ts +41 -0
  68. package/dist/voice/Stream.js +39 -0
  69. package/dist/voice/Verb.d.ts +9 -0
  70. package/dist/{healthcheck.js → voice/Verb.js} +2 -5
  71. package/dist/voice/index.d.ts +11 -0
  72. package/dist/voice/index.js +45 -0
  73. package/dist/voice/voice.d.ts +101 -0
  74. package/dist/voice/voice.js +44 -0
  75. package/package.json +28 -25
  76. package/LICENSE +0 -21
  77. package/dist/api_client.d.ts +0 -27
  78. package/dist/api_client.js +0 -110
  79. package/dist/env_is_set.d.ts +0 -1
  80. package/dist/envs.d.ts +0 -4
  81. package/dist/healthcheck.d.ts +0 -2
  82. package/dist/service_runner.d.ts +0 -13
  83. package/dist/speech/plugin.d.ts +0 -6
  84. package/dist/speech/types.d.ts +0 -17
  85. package/dist/trust_util.d.ts +0 -4
  86. package/dist/types.d.ts +0 -6
  87. /package/dist/{speech/types.js → voice/Play.js} +0 -0
  88. /package/dist/{types.js → voice/PlayDtmf.js} +0 -0
@@ -0,0 +1,286 @@
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.identity.v1beta2;
22
+
23
+ import "google/protobuf/empty.proto";
24
+
25
+ service Identity {
26
+ // Workspace actions
27
+ rpc CreateWorkspace (CreateWorkspaceRequest) returns (CreateWorkspaceResponse) {}
28
+ rpc DeleteWorkspace (DeleteWorkspaceRequest) returns (DeleteWorkspaceResponse) {}
29
+ rpc GetWorkspace (GetWorkspaceRequest) returns (Workspace) {}
30
+ rpc ListWorkspaces (ListWorkspacesRequest) returns (ListWorkspacesResponse) {}
31
+ rpc UpdateWorkspace (UpdateWorkspaceRequest) returns (UpdateWorkspaceResponse) {}
32
+ rpc InviteUserToWorkspace (InviteUserToWorkspaceRequest) returns (InviteUserToWorkspaceResponse) {}
33
+ rpc RemoveUserFromWorkspace (RemoveUserFromWorkspaceRequest) returns (RemoveUserFromWorkspaceResponse) {}
34
+ rpc ResendWorkspaceMembershipInvitation (ResendWorkspaceMembershipInvitationRequest) returns (ResendWorkspaceMembershipInvitationResponse) {}
35
+
36
+ // User specific actions
37
+ rpc CreateUser (CreateUserRequest) returns (CreateUserResponse) {}
38
+ rpc GetUser (GetUserRequest) returns (GetUserResponse) {}
39
+ rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse) {}
40
+ rpc DeleteUser (DeleteUserRequest) returns (DeleteUserResponse) {}
41
+
42
+ // ApiKey actions
43
+ rpc CreateApiKey (CreateApiKeyRequest) returns (CreateApiKeyResponse) {}
44
+ rpc DeleteApiKey (DeleteApiKeyRequest) returns (DeleteApiKeyResponse) {}
45
+ rpc ListApiKeys (ListApiKeysRequest) returns (ListApiKeysResponse) {}
46
+ rpc RegenerateApiKey (RegenerateApiKeyRequest) returns (RegenerateApiKeyResponse) {}
47
+
48
+ // Token exchange actions
49
+ rpc ExchangeCredentials (ExchangeCredentialsRequest) returns (ExchangeCredentialsResponse) {}
50
+ rpc ExchangeApiKey (ExchangeApiKeyRequest) returns (ExchangeApiKeyResponse) {}
51
+ rpc ExchangeOAuth2Code (ExchangeOAuth2CodeRequest) returns (ExchangeOAuth2CodeResponse) {}
52
+ rpc ExchangeRefreshToken (ExchangeRefreshTokenRequest) returns (ExchangeRefreshTokenResponse) {}
53
+ rpc RevokeToken (RevokeTokenRequest) returns (RevokeTokenResponse) {}
54
+
55
+ // Get the public key for verifying JWTs
56
+ rpc GetPublicKey (google.protobuf.Empty) returns (GetPublicKeyResponse) {}
57
+ }
58
+
59
+ // Workspace Resources
60
+
61
+ message CreateWorkspaceRequest {
62
+ string name = 1;
63
+ }
64
+
65
+ message CreateWorkspaceResponse {
66
+ string ref = 1;
67
+ }
68
+
69
+ message DeleteWorkspaceRequest {
70
+ string ref = 1;
71
+ }
72
+
73
+ message DeleteWorkspaceResponse {
74
+ string ref = 1;
75
+ }
76
+
77
+ message GetWorkspaceRequest {
78
+ string ref = 1;
79
+ }
80
+
81
+ message ListWorkspacesRequest {
82
+ string page_token = 1;
83
+ int32 page_size = 2;
84
+ }
85
+
86
+ message ListWorkspacesResponse {
87
+ repeated Workspace workspaces = 1;
88
+ string next_page_token = 2;
89
+ }
90
+
91
+ message UpdateWorkspaceRequest {
92
+ string ref = 1;
93
+ string name = 2;
94
+ }
95
+
96
+ message UpdateWorkspaceResponse {
97
+ string ref = 1;
98
+ }
99
+
100
+ message InviteUserToWorkspaceRequest {
101
+ string email = 1;
102
+ string role = 2;
103
+ string name = 3;
104
+ }
105
+
106
+ message InviteUserToWorkspaceResponse {
107
+ string user_ref = 1;
108
+ }
109
+
110
+ message RemoveUserFromWorkspaceRequest {
111
+ string user_ref = 1;
112
+ }
113
+
114
+ message RemoveUserFromWorkspaceResponse {
115
+ string user_ref = 1;
116
+ }
117
+
118
+ message ResendWorkspaceMembershipInvitationRequest {
119
+ string user_ref = 1;
120
+ }
121
+
122
+ message ResendWorkspaceMembershipInvitationResponse {
123
+ string user_ref = 1;
124
+ }
125
+
126
+ // User Resources
127
+
128
+ message CreateUserRequest {
129
+ string email = 1;
130
+ string password = 2;
131
+ string name = 3;
132
+ string avatar = 4;
133
+ }
134
+
135
+ message CreateUserResponse {
136
+ string ref = 1;
137
+ }
138
+
139
+ message GetUserRequest {
140
+ string ref = 1;
141
+ }
142
+
143
+ message GetUserResponse {
144
+ string ref = 1;
145
+ string email = 2;
146
+ string name = 3;
147
+ string avatar = 4;
148
+ int64 created_at = 5;
149
+ int64 updated_at = 6;
150
+ }
151
+
152
+ message UpdateUserRequest {
153
+ string ref = 1;
154
+ string password = 2;
155
+ string name = 3;
156
+ string avatar = 4;
157
+ }
158
+
159
+ message UpdateUserResponse {
160
+ string ref = 1;
161
+ }
162
+
163
+ message DeleteUserRequest {
164
+ string ref = 1;
165
+ }
166
+
167
+ message DeleteUserResponse {
168
+ string ref = 1;
169
+ }
170
+
171
+ message Workspace {
172
+ string ref = 1;
173
+ string name = 2;
174
+ string owner_ref = 3;
175
+ int64 created_at = 4;
176
+ int64 updated_at = 5;
177
+ }
178
+
179
+ // ApiKey Resources
180
+
181
+ message CreateApiKeyRequest {
182
+ string role = 1;
183
+ int32 expires_at = 2;
184
+ }
185
+
186
+ message CreateApiKeyResponse {
187
+ string ref = 1;
188
+ string access_key_id = 2;
189
+ string access_key_secret = 3;
190
+ }
191
+
192
+ message DeleteApiKeyRequest {
193
+ string ref = 1;
194
+ }
195
+
196
+ message DeleteApiKeyResponse {
197
+ string ref = 1;
198
+ }
199
+
200
+ message ListApiKeysRequest {
201
+ int32 page_size = 3;
202
+ string page_token = 2;
203
+ }
204
+
205
+ message ListApiKeysResponse {
206
+ repeated ApiKey items = 1;
207
+ string next_page_token = 2;
208
+ }
209
+
210
+ message RegenerateApiKeyRequest {
211
+ string ref = 1;
212
+ }
213
+
214
+ message RegenerateApiKeyResponse {
215
+ string ref = 1;
216
+ string access_key_id = 2;
217
+ string access_key_secret = 3;
218
+ }
219
+
220
+ message ApiKey {
221
+ string ref = 1;
222
+ string access_key_id = 2;
223
+ string role = 3;
224
+ int32 expires_at = 4;
225
+ int64 created_at = 5;
226
+ int64 updated_at = 6;
227
+ }
228
+
229
+ // Token Exchange Resources
230
+
231
+ message ExchangeCredentialsRequest {
232
+ string username = 1;
233
+ string password = 2;
234
+ // Optional code for multi-factor authentication
235
+ string ephemeral_code = 3;
236
+ }
237
+
238
+ message ExchangeCredentialsResponse {
239
+ string id_token = 1;
240
+ string access_token = 2;
241
+ string refresh_token = 3;
242
+ }
243
+
244
+ message ExchangeApiKeyRequest {
245
+ string access_key_id = 1;
246
+ string access_key_secret = 2;
247
+ }
248
+
249
+ message ExchangeApiKeyResponse {
250
+ string id_token = 1;
251
+ string access_token = 2;
252
+ string refresh_token = 3;
253
+ }
254
+
255
+ message ExchangeOAuth2CodeRequest {
256
+ string code = 1;
257
+ }
258
+
259
+ message ExchangeOAuth2CodeResponse {
260
+ string id_token = 1;
261
+ string access_token = 2;
262
+ string refresh_token = 3;
263
+ }
264
+
265
+ message ExchangeRefreshTokenRequest {
266
+ string refresh_token = 1;
267
+ }
268
+
269
+ message ExchangeRefreshTokenResponse {
270
+ string id_token = 1;
271
+ string access_token = 2;
272
+ string refresh_token = 3;
273
+ }
274
+
275
+ message RevokeTokenRequest {
276
+ string token = 1;
277
+ }
278
+
279
+ message RevokeTokenResponse {
280
+ string token = 1;
281
+ }
282
+
283
+ // Message with response with the public key
284
+ message GetPublicKeyResponse {
285
+ string public_key = 1;
286
+ }
@@ -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.numbers.v1beta2;
22
+
23
+ import "trunks.proto";
24
+
25
+ // The Numbers service definition
26
+ service Numbers {
27
+ // Create a new Number
28
+ rpc CreateNumber (CreateNumberRequest) returns (CreateNumberResponse) {}
29
+ // Update an existing Number
30
+ rpc UpdateNumber (UpdateNumberRequest) returns (UpdateNumberResponse) {}
31
+ // Get an existing Number
32
+ rpc GetNumber (GetNumberRequest) returns (Number) {}
33
+ // Delete an existing Number
34
+ rpc DeleteNumber (DeleteNumberRequest) returns (DeleteNumberResponse) {}
35
+ // List Numbers
36
+ rpc ListNumbers (ListNumbersRequest) returns (ListNumbersResponse) {}
37
+ }
38
+
39
+ // The message for the Number resource
40
+ message Number {
41
+ // The unique identifier of the Number
42
+ string ref = 1;
43
+ // The name of the Number
44
+ string name = 2;
45
+ // The tel_url of the Number
46
+ string tel_url = 3;
47
+ // The aor_link of the Number
48
+ string aor_link = 4;
49
+ // The city of the Number
50
+ string city = 5;
51
+ // The country of the Number
52
+ string country = 6;
53
+ // The country_iso_code of the Number
54
+ string country_iso_code = 7;
55
+ // The header to use for session affinity
56
+ string session_affinity_header = 8;
57
+ // Extra headers to send to the trunk
58
+ repeated ExtraHeader extra_headers = 9;
59
+ // The date when the Number was created
60
+ int64 created_at = 10;
61
+ // The date when the Number was last updated
62
+ int64 updated_at = 11;
63
+ // The trunk this number is associated with
64
+ fonoster.trunks.v1beta2.Trunk trunk = 12;
65
+ }
66
+
67
+ // The message for the ExtraHeader field
68
+ message ExtraHeader {
69
+ string name = 1;
70
+ string value = 2;
71
+ }
72
+
73
+ // The request message for Numbers.CreateNumber
74
+ message CreateNumberRequest {
75
+ // The name of the Number
76
+ string name = 1;
77
+ // The tel_url of the Number
78
+ string tel_url = 2;
79
+ // The aor_link of the Number
80
+ string aor_link = 3;
81
+ // The city of the Number
82
+ string city = 4;
83
+ // The country of the Number
84
+ string country = 5;
85
+ // The country_iso_code of the Number
86
+ string country_iso_code = 6;
87
+ // The header to use for session affinity
88
+ string session_affinity_header = 7;
89
+ // Extra headers to send to the trunk
90
+ repeated ExtraHeader extra_headers = 8;
91
+ // Reference to the trunk this number is associated with
92
+ string trunk_ref = 9;
93
+ }
94
+
95
+ // The response message for Numbers.CreateNumber
96
+ message CreateNumberResponse {
97
+ // The reference of the Number
98
+ string ref = 1;
99
+ }
100
+
101
+ // The request message for Numbers.UpdateNumber
102
+ message UpdateNumberRequest {
103
+ // The unique identifier of the Number
104
+ string ref = 1;
105
+ // The name of the Number
106
+ string name = 2;
107
+ // The aor_link of the Number
108
+ string aor_link = 4;
109
+ // The header to use for session affinity
110
+ string session_affinity_header = 8;
111
+ // Extra headers to send to the trunk
112
+ repeated ExtraHeader extra_headers = 9;
113
+ // Reference to the trunk this number is associated with
114
+ string trunk_ref = 10;
115
+ }
116
+
117
+ // The response message for Numbers.UpdateNumber
118
+ message UpdateNumberResponse {
119
+ // The reference of the Number
120
+ string ref = 1;
121
+ }
122
+
123
+ // The request message for Numbers.GetNumber
124
+ message GetNumberRequest {
125
+ // The unique identifier of the Number
126
+ string ref = 1;
127
+ }
128
+
129
+ // The request message for Numbers.DeleteNumber
130
+ message DeleteNumberRequest {
131
+ // The unique identifier of the Number
132
+ string ref = 1;
133
+ }
134
+
135
+ // The response message for Numbers.DeleteNumber
136
+ message DeleteNumberResponse {
137
+ // The reference of the Number
138
+ string ref = 1;
139
+ }
140
+
141
+ // The request message for Numbers.ListNumbers
142
+ message ListNumbersRequest {
143
+ // The maximum number of items in the list
144
+ int32 page_size = 1;
145
+ // The next_page_token value returned from the previous request, if any
146
+ string page_token = 2;
147
+ }
148
+
149
+ // The response message for Numbers.ListNumbers
150
+ message ListNumbersResponse {
151
+ // List of Numbers
152
+ repeated Number items = 1;
153
+ // Token to retrieve the next page of results, or empty if there are no more results in the list
154
+ string next_page_token = 2;
155
+ }
@@ -0,0 +1,113 @@
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.secrets.v1beta2;
22
+
23
+ // The Secrets service definition
24
+ service Secrets {
25
+ // Creates a new Secret
26
+ rpc CreateSecret (CreateSecretRequest) returns (CreateSecretResponse) {}
27
+ // Updates an existing set of Secret
28
+ rpc UpdateSecret (UpdateSecretRequest) returns (UpdateSecretResponse) {}
29
+ // Gets the details of a given set of Secret
30
+ rpc GetSecret (GetSecretRequest) returns (Secret) {}
31
+ // Deletes an existing Secret
32
+ rpc DeleteSecret (DeleteSecretRequest) returns (DeleteSecretResponse) {}
33
+ // Lists all Secrets
34
+ rpc ListSecrets (ListSecretsRequest) returns (ListSecretsResponse) {}
35
+ }
36
+
37
+ // The message for the Secret resource
38
+ message Secret {
39
+ // The reference of the Secret
40
+ string ref = 1;
41
+ // Friendly name of the Secret
42
+ string name = 2;
43
+ // The actual secret
44
+ string secret = 3;
45
+ // The time the Secret was created
46
+ int64 created_at = 4;
47
+ // The time the Secret was updated
48
+ int64 updated_at = 5;
49
+ }
50
+
51
+ // The request message for the Secrets.CreateSecret method
52
+ message CreateSecretRequest {
53
+ // Friendly name of the Secret
54
+ string name = 1;
55
+ // The actual secret
56
+ string secret = 2;
57
+ }
58
+
59
+ // The response message for the Secrets.CreateSecret method
60
+ message CreateSecretResponse {
61
+ // The reference of the created Secret
62
+ string ref = 1;
63
+ }
64
+
65
+ // The request message for the Secrets.UpdateSecret method
66
+ message UpdateSecretRequest {
67
+ // The reference of the Secret to update
68
+ string ref = 1;
69
+ // The new name of the Secret
70
+ string name = 2;
71
+ // Updated secret
72
+ string secret = 3;
73
+ }
74
+
75
+ // The response message for the Secrets.UpdateSecret method
76
+ message UpdateSecretResponse {
77
+ // The reference of the updated Secret
78
+ string ref = 1;
79
+ }
80
+
81
+ // The request message for the Secrets.GetSecret method
82
+ message GetSecretRequest {
83
+ // The reference of the Secret to retrieve
84
+ string ref = 1;
85
+ }
86
+
87
+ // The request message for the Secrets.DeleteSecret method
88
+ message DeleteSecretRequest {
89
+ // The reference of the Secret to delete
90
+ string ref = 1;
91
+ }
92
+
93
+ // The response message for the Secrets.DeleteSecret method
94
+ message DeleteSecretResponse {
95
+ // The reference of the deleted Secret
96
+ string ref = 1;
97
+ }
98
+
99
+ // The request message for the Secrets.ListSecret method
100
+ message ListSecretsRequest {
101
+ // The maximum number of items in the list
102
+ int32 page_size = 1;
103
+ // The next_page_token value returned from the previous request, if any
104
+ string page_token = 2;
105
+ }
106
+
107
+ // The response message for the Secrets.ListSecret method
108
+ message ListSecretsResponse {
109
+ // List of Secret
110
+ repeated Secret items = 1;
111
+ // Token to retrieve the next page of results, or empty if there are no more results in the list
112
+ string next_page_token = 2;
113
+ }
@@ -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.trunks.v1beta2;
22
+
23
+ import "acls.proto";
24
+ import "credentials.proto";
25
+
26
+ // The Trunks service definition
27
+ service Trunks {
28
+ // Create a new Trunk
29
+ rpc CreateTrunk (CreateTrunkRequest) returns (CreateTrunkResponse) {}
30
+ // UpdateTrunk an existing Trunk
31
+ rpc UpdateTrunk (UpdateTrunkRequest) returns (UpdateTrunkResponse) {}
32
+ // Get a Trunk by reference
33
+ rpc GetTrunk (GetTrunkRequest) returns (Trunk) {}
34
+ // Delete a Trunk by reference
35
+ rpc DeleteTrunk (DeleteTrunkRequest) returns (DeleteTrunkResponse) {}
36
+ // List all Trunks
37
+ rpc ListTrunks (ListTrunkRequest) returns (ListTrunksResponse) {}
38
+ }
39
+
40
+ // The message for the Trunk URIs
41
+ message TrunkURI {
42
+ // The host name or IP address of the Trunk
43
+ string host = 1;
44
+ // The port number of the Trunk
45
+ int32 port = 2;
46
+ // The transport protocol of the Trunk
47
+ string transport = 3;
48
+ // The username to use when authenticating with the Trunk
49
+ string user = 4;
50
+ // The weight of the Trunk
51
+ int32 weight = 5;
52
+ // The priority of the Trunk
53
+ int32 priority = 6;
54
+ // The flag to enable or disable the Trunk
55
+ bool enabled = 7;
56
+ }
57
+
58
+ // The message for the Trunk resource
59
+ message Trunk {
60
+ // The reference of the Trunk
61
+ string ref = 1;
62
+ // The name of the Trunk
63
+ string name = 2;
64
+ // A flag to indicate if we should send a REGISTER request to the Trunk
65
+ bool send_register = 3;
66
+ // The URI for inbound requests
67
+ string inbound_uri = 4;
68
+ // The date and time when the Trunk was created
69
+ int64 created_at = 5;
70
+ // The date and time when the Trunk was last updated
71
+ int64 updated_at = 6;
72
+ // The list of IP addresses that are allowed to access the Trunks
73
+ fonoster.acls.v1beta2.Acl access_control_list = 7;
74
+ // The credentials to use when authenticating with the Trunk
75
+ fonoster.credentials.v1beta2.Credentials inbound_credentials = 8;
76
+ // The credentials to use when authenticating with the Provider
77
+ fonoster.credentials.v1beta2.Credentials outbound_credentials = 9;
78
+ // The list of URIs for the Trunk
79
+ repeated TrunkURI uris = 10;
80
+ }
81
+
82
+ // The message for the Trunk.Create
83
+ message CreateTrunkRequest {
84
+ // The name of the Trunk
85
+ string name = 1;
86
+ // A flag to indicate if we should send a REGISTER request to the Trunk
87
+ bool send_register = 2;
88
+ // The URI for inbound requests
89
+ string inbound_uri = 3;
90
+ // Reference to the AccessControlList
91
+ string access_control_list_ref = 4;
92
+ // Reference to the inbound Credentials
93
+ string inbound_credentials_ref = 5;
94
+ // Reference to the outbound Credentials
95
+ string outbound_credentials_ref = 6;
96
+ // The list of URIs for the Trunk
97
+ repeated TrunkURI uris = 7;
98
+ }
99
+
100
+ // The message for the Trunk.CreateTrunk response
101
+ message CreateTrunkResponse {
102
+ // The reference of the Trunk
103
+ string ref = 1;
104
+ }
105
+
106
+ // The message for the Trunk.UpdateTrunk
107
+ message UpdateTrunkRequest {
108
+ // The reference of the Trunk
109
+ string ref = 1;
110
+ // The name of the Trunk
111
+ string name = 2;
112
+ // A flag to indicate if we should send a REGISTER request to the Trunk
113
+ bool send_register = 3;
114
+ // The URI for inbound requests
115
+ string inbound_uri = 4;
116
+ // Reference to the AccessControlList
117
+ string access_control_list_ref = 5;
118
+ // Reference to the inbound Credentials
119
+ string inbound_credentials_ref = 6;
120
+ // Reference to the outbound Credentials
121
+ string outbound_credentials_ref = 7;
122
+ // The list of URIs for the Trunk
123
+ repeated TrunkURI uris = 8;
124
+ }
125
+
126
+ // The message for the Trunk.UpdateTrunk response
127
+ message UpdateTrunkResponse {
128
+ // The reference of the Trunk
129
+ string ref = 1;
130
+ }
131
+
132
+ // The message for the Trunk.GetTrunk
133
+ message GetTrunkRequest {
134
+ // The reference of the Trunk
135
+ string ref = 1;
136
+ }
137
+
138
+ // The message for the Trunk.DeleteTrunk
139
+ message DeleteTrunkRequest {
140
+ // The reference of the Trunk
141
+ string ref = 1;
142
+ }
143
+
144
+ // The message for the Trunk.DeleteTrunk response
145
+ message DeleteTrunkResponse {
146
+ // The reference of the Trunk
147
+ string ref = 1;
148
+ }
149
+
150
+ // The message for the Trunk.ListTrunk request
151
+ message ListTrunkRequest {
152
+ // The maximum number of items in the list
153
+ int32 page_size = 1;
154
+ // The next_page_token value returned from the previous request, if any
155
+ string page_token = 2;
156
+ }
157
+
158
+ // The message for the Trunk.ListTrunk response
159
+ message ListTrunksResponse {
160
+ // List of Trunks
161
+ repeated Trunk items = 1;
162
+ // Token to retrieve the next page of results, or empty if there are no more results in the list
163
+ string next_page_token = 2;
164
+ }