teleleo 0.1.0 → 0.3.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 (113) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +121 -10
  3. package/api.md +130 -112
  4. package/dist/client.d.ts +3 -1
  5. package/dist/client.d.ts.map +1 -1
  6. package/dist/client.js +5 -2
  7. package/dist/client.js.map +1 -1
  8. package/dist/core.d.ts +14 -3
  9. package/dist/core.d.ts.map +1 -1
  10. package/dist/core.js +19 -6
  11. package/dist/core.js.map +1 -1
  12. package/dist/errors.d.ts +23 -5
  13. package/dist/errors.d.ts.map +1 -1
  14. package/dist/errors.js +23 -5
  15. package/dist/errors.js.map +1 -1
  16. package/dist/resources/call-scenarios.d.ts +15 -3
  17. package/dist/resources/call-scenarios.d.ts.map +1 -1
  18. package/dist/resources/call-scenarios.js +15 -3
  19. package/dist/resources/call-scenarios.js.map +1 -1
  20. package/dist/resources/calls.d.ts +26 -6
  21. package/dist/resources/calls.d.ts.map +1 -1
  22. package/dist/resources/calls.js +29 -5
  23. package/dist/resources/calls.js.map +1 -1
  24. package/dist/resources/contact-groups.d.ts +15 -5
  25. package/dist/resources/contact-groups.d.ts.map +1 -1
  26. package/dist/resources/contact-groups.js +15 -5
  27. package/dist/resources/contact-groups.js.map +1 -1
  28. package/dist/resources/contacts.d.ts +18 -6
  29. package/dist/resources/contacts.d.ts.map +1 -1
  30. package/dist/resources/contacts.js +18 -6
  31. package/dist/resources/contacts.js.map +1 -1
  32. package/dist/resources/dongles.d.ts +87 -15
  33. package/dist/resources/dongles.d.ts.map +1 -1
  34. package/dist/resources/dongles.js +103 -13
  35. package/dist/resources/dongles.js.map +1 -1
  36. package/dist/resources/files.d.ts +14 -6
  37. package/dist/resources/files.d.ts.map +1 -1
  38. package/dist/resources/files.js +14 -6
  39. package/dist/resources/files.js.map +1 -1
  40. package/dist/resources/follow-up-sms-settings.d.ts +14 -4
  41. package/dist/resources/follow-up-sms-settings.d.ts.map +1 -1
  42. package/dist/resources/follow-up-sms-settings.js +14 -4
  43. package/dist/resources/follow-up-sms-settings.js.map +1 -1
  44. package/dist/resources/index.d.ts +7 -2
  45. package/dist/resources/index.d.ts.map +1 -1
  46. package/dist/resources/index.js +3 -1
  47. package/dist/resources/index.js.map +1 -1
  48. package/dist/resources/mailings.d.ts +21 -7
  49. package/dist/resources/mailings.d.ts.map +1 -1
  50. package/dist/resources/mailings.js +21 -7
  51. package/dist/resources/mailings.js.map +1 -1
  52. package/dist/resources/plans.d.ts +20 -0
  53. package/dist/resources/plans.d.ts.map +1 -0
  54. package/dist/resources/plans.js +22 -0
  55. package/dist/resources/plans.js.map +1 -0
  56. package/dist/resources/public-vpn.d.ts +11 -1
  57. package/dist/resources/public-vpn.d.ts.map +1 -1
  58. package/dist/resources/public-vpn.js +11 -1
  59. package/dist/resources/public-vpn.js.map +1 -1
  60. package/dist/resources/redirections.d.ts +15 -5
  61. package/dist/resources/redirections.d.ts.map +1 -1
  62. package/dist/resources/redirections.js +15 -5
  63. package/dist/resources/redirections.js.map +1 -1
  64. package/dist/resources/sip-users.d.ts +6 -2
  65. package/dist/resources/sip-users.d.ts.map +1 -1
  66. package/dist/resources/sip-users.js +6 -2
  67. package/dist/resources/sip-users.js.map +1 -1
  68. package/dist/resources/sms.d.ts +28 -10
  69. package/dist/resources/sms.d.ts.map +1 -1
  70. package/dist/resources/sms.js +28 -10
  71. package/dist/resources/sms.js.map +1 -1
  72. package/dist/resources/socks-proxies.d.ts +13 -3
  73. package/dist/resources/socks-proxies.d.ts.map +1 -1
  74. package/dist/resources/socks-proxies.js +13 -3
  75. package/dist/resources/socks-proxies.js.map +1 -1
  76. package/dist/resources/ussd.d.ts +15 -5
  77. package/dist/resources/ussd.d.ts.map +1 -1
  78. package/dist/resources/ussd.js +15 -5
  79. package/dist/resources/ussd.js.map +1 -1
  80. package/dist/types/enums.d.ts +34 -11
  81. package/dist/types/enums.d.ts.map +1 -1
  82. package/dist/types/enums.js +28 -9
  83. package/dist/types/enums.js.map +1 -1
  84. package/dist/types/models.d.ts +191 -22
  85. package/dist/types/models.d.ts.map +1 -1
  86. package/dist/types/params.d.ts +32 -5
  87. package/dist/types/params.d.ts.map +1 -1
  88. package/dist/version.d.ts +1 -1
  89. package/dist/version.js +1 -1
  90. package/package.json +1 -1
  91. package/src/client.ts +5 -2
  92. package/src/core.ts +46 -11
  93. package/src/errors.ts +23 -5
  94. package/src/resources/call-scenarios.ts +15 -3
  95. package/src/resources/calls.ts +31 -6
  96. package/src/resources/contact-groups.ts +15 -5
  97. package/src/resources/contacts.ts +18 -6
  98. package/src/resources/dongles.ts +117 -13
  99. package/src/resources/files.ts +14 -6
  100. package/src/resources/follow-up-sms-settings.ts +14 -4
  101. package/src/resources/index.ts +8 -1
  102. package/src/resources/mailings.ts +21 -7
  103. package/src/resources/plans.ts +25 -0
  104. package/src/resources/public-vpn.ts +11 -1
  105. package/src/resources/redirections.ts +15 -5
  106. package/src/resources/sip-users.ts +6 -2
  107. package/src/resources/sms.ts +28 -10
  108. package/src/resources/socks-proxies.ts +13 -3
  109. package/src/resources/ussd.ts +15 -5
  110. package/src/types/enums.ts +35 -11
  111. package/src/types/models.ts +199 -21
  112. package/src/types/params.ts +35 -5
  113. package/src/version.ts +1 -1
@@ -9,6 +9,7 @@ import type {
9
9
  DongleNetworkInfo,
10
10
  DongleSimIdentifiers,
11
11
  DongleStatistic,
12
+ DongleWifiClientList,
12
13
  } from '../types/models.js';
13
14
  import type {
14
15
  DonglesEnableWifiExtenderParams,
@@ -18,6 +19,8 @@ import type {
18
19
  DonglesSetWifiCredentialsParams,
19
20
  DonglesUpdateOfflineNotificationParams,
20
21
  DonglesUpdateParams,
22
+ DonglesUpdateUsbGatewayParams,
23
+ DonglesUpdateWifiIsolationParams,
21
24
  } from '../types/params.js';
22
25
  import { asArray, asResult, asStatus, pathParam } from '../utils.js';
23
26
  /** Modems of the account and their commands: reboot, Wi-Fi, Wi-Fi extender, number, network info. */
@@ -28,6 +31,8 @@ export class DonglesResource extends APIResource {
28
31
  * Modems of the account. In full mode every field of the Dongle schema that the list serves is returned; dongle_setting and public_vpn_server are present in full mode only. The cheapest call is GET /dongle?is_short=1&limit=1: use it to check that an API key works. Newest first by default (created_at descending, then the id descending).
29
32
  *
30
33
  * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
34
+ *
35
+ * Capability the role of an organization API key needs: `device.view`.
31
36
  */
32
37
  list(params: DonglesListParams = {}, options?: RequestOptions): PagePromise<DongleListItem> {
33
38
  return this._client.getPage<DongleListItem>('/dongle', {
@@ -53,16 +58,37 @@ export class DonglesResource extends APIResource {
53
58
  /**
54
59
  * Reboot modem.
55
60
  *
56
- * 200 means the reboot is accepted, not done: dongle_online_status becomes 7 (REBOOTING) at once and goes back to an online or offline status when the modem returns. A repeated call while a reboot is in progress (about 180 s for the API stage, then the SMS stage) is a no-op that also answers 200. The reboot is accepted regardless of the subscription and of the online state; track progress through dongle_online_status in GET /dongle or GET /dongle/{dongle_id}.
61
+ * 200 means the reboot is accepted, not done: dongle_online_status becomes 7 (REBOOTING) at once and goes back to an online or offline status when the modem returns. A repeated call while a reboot is in progress (about 180 s for the API stage, then the SMS stage) is a no-op that also answers 200. The reboot is accepted regardless of the online state (the subscription is needed, see Subscription); track progress through dongle_online_status in GET /dongle or GET /dongle/{dongle_id}.
57
62
  *
58
63
  * @param dongleId - Identifier in the path
59
64
  *
60
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION.
65
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
66
+ *
67
+ * Capability the role of an organization API key needs: `device.manage`.
61
68
  */
62
69
  reboot(dongleId: number, options?: RequestOptions): Promise<boolean> {
63
70
  return this._client.request('POST', `/dongle/${pathParam(dongleId)}/reboot`, { options }).then(asStatus);
64
71
  }
65
72
 
73
+ /**
74
+ * List devices on modem Wi-Fi.
75
+ *
76
+ * Devices connected to the Wi-Fi hotspot of the modem. The modem is asked only when this is called; its answer, a failure included, is kept for 20 seconds: a call within that time gets it without asking the modem again, and updated_at tells when the modem answered. Turning Wi-Fi on or off and new Wi-Fi credentials drop the kept answer. The computer on USB is not in the list. Available from modem firmware 4.5.8; older firmware answers 409 DONGLE_WIFI_CLIENT_LIST_NOT_SUPPORTED_EXCEPTION.
77
+ *
78
+ * @param dongleId - ID of the dongle
79
+ *
80
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_DONGLE_OFFLINE_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_DONGLE_BUSY_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_NOT_SUPPORTED_EXCEPTION, DONGLE_WIFI_CLIENT_LIST_DONGLE_UNAVAILABLE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
81
+ *
82
+ * Capability the role of an organization API key needs: `network.view`.
83
+ *
84
+ * Needs modem firmware 4.5.8 or later.
85
+ */
86
+ getWifiClients(dongleId: number, options?: RequestOptions): Promise<DongleWifiClientList> {
87
+ return this._client
88
+ .request('GET', `/dongle/${pathParam(dongleId)}/wifi/clients`, { options })
89
+ .then((data) => data as DongleWifiClientList);
90
+ }
91
+
66
92
  /**
67
93
  * Enable modem Wi-Fi.
68
94
  *
@@ -70,7 +96,9 @@ export class DonglesResource extends APIResource {
70
96
  *
71
97
  * @param dongleId - ID of the dongle
72
98
  *
73
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_ALREADY_IN_THE_SAME_STATUS_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
99
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_ALREADY_IN_THE_SAME_STATUS_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
100
+ *
101
+ * Capability the role of an organization API key needs: `device.manage`.
74
102
  */
75
103
  enableWifi(dongleId: number, options?: RequestOptions): Promise<boolean> {
76
104
  return this._client
@@ -85,7 +113,9 @@ export class DonglesResource extends APIResource {
85
113
  *
86
114
  * @param dongleId - ID of the dongle
87
115
  *
88
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_ALREADY_IN_THE_SAME_STATUS_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
116
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_ALREADY_IN_THE_SAME_STATUS_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
117
+ *
118
+ * Capability the role of an organization API key needs: `device.manage`.
89
119
  */
90
120
  disableWifi(dongleId: number, options?: RequestOptions): Promise<boolean> {
91
121
  return this._client
@@ -100,7 +130,9 @@ export class DonglesResource extends APIResource {
100
130
  *
101
131
  * @param dongleId - ID of the dongle
102
132
  *
103
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_INVALID_SSID_EXCEPTION, DONGLE_WIFI_INVALID_PASSWORD_EXCEPTION, DONGLE_WIFI_API_EXCEPTION.
133
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_INVALID_SSID_EXCEPTION, DONGLE_WIFI_INVALID_PASSWORD_EXCEPTION, DONGLE_WIFI_API_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
134
+ *
135
+ * Capability the role of an organization API key needs: `device.manage`.
104
136
  */
105
137
  setWifiCredentials(
106
138
  dongleId: number,
@@ -123,6 +155,8 @@ export class DonglesResource extends APIResource {
123
155
  * @param dongleId - ID of the dongle
124
156
  *
125
157
  * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, DONGLE_WIFI_EXTENDER_LOCKED_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
158
+ *
159
+ * Capability the role of an organization API key needs: `device.manage`.
126
160
  */
127
161
  enableWifiExtender(
128
162
  dongleId: number,
@@ -144,7 +178,9 @@ export class DonglesResource extends APIResource {
144
178
  *
145
179
  * @param dongleId - ID of the dongle
146
180
  *
147
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_EXTENDER_LOCKED_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
181
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_WIFI_EXTENDER_LOCKED_EXCEPTION, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
182
+ *
183
+ * Capability the role of an organization API key needs: `device.manage`.
148
184
  */
149
185
  disableWifiExtender(dongleId: number, options?: RequestOptions): Promise<boolean> {
150
186
  return this._client
@@ -160,6 +196,8 @@ export class DonglesResource extends APIResource {
160
196
  * @param dongleId - ID of the dongle
161
197
  *
162
198
  * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, DONGLE_API_CONNECTION_EXCEPTION, DONGLE_API_HTTP_RESPONSE_EXCEPTION.
199
+ *
200
+ * Capability the role of an organization API key needs: `device.manage`.
163
201
  */
164
202
  scanWifiNetworks(dongleId: number, options?: RequestOptions): Promise<boolean> {
165
203
  return this._client
@@ -174,7 +212,9 @@ export class DonglesResource extends APIResource {
174
212
  *
175
213
  * @param dongleId - ID of the dongle
176
214
  *
177
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_SETTING_NOT_FOUND.
215
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_SETTING_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
216
+ *
217
+ * Capability the role of an organization API key needs: `device.manage`.
178
218
  */
179
219
  updateOfflineNotification(
180
220
  dongleId: number,
@@ -189,6 +229,58 @@ export class DonglesResource extends APIResource {
189
229
  .then(asStatus);
190
230
  }
191
231
 
232
+ /**
233
+ * Set Wi-Fi isolation.
234
+ *
235
+ * Turns the Wi-Fi isolation of the modem on or off: devices on its Wi-Fi do not see each other or the computer on USB. The modem is asked for its mode first, and the mode is sent to it in the same request only when it reports another one. When the modem cannot be reached, answers an error, or loses the answer and then does not report the new mode, the mode stays as it was and the answer is 400 DONGLE_WIFI_API_EXCEPTION. On a loaded modem the request takes up to 45 seconds. Shown as dongle_setting.is_wifi_isolation_enabled in GET /dongle. Available from modem firmware 5.1.0; with older firmware the mode is only saved and the answer is 200: the modem gets it when it connects with 5.1.0 or newer.
236
+ *
237
+ * @param dongleId - ID of the dongle
238
+ *
239
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, DONGLE_SETTING_NOT_FOUND, DONGLE_WIFI_API_EXCEPTION.
240
+ *
241
+ * Capability the role of an organization API key needs: `device.manage`.
242
+ *
243
+ * Needs modem firmware 5.1.0 or later.
244
+ */
245
+ updateWifiIsolation(
246
+ dongleId: number,
247
+ params: DonglesUpdateWifiIsolationParams,
248
+ options?: RequestOptions,
249
+ ): Promise<boolean> {
250
+ return this._client
251
+ .request('PUT', `/dongle/${pathParam(dongleId)}/setting/wifi-isolation`, {
252
+ body: { is_enabled: params.is_enabled },
253
+ options,
254
+ })
255
+ .then(asStatus);
256
+ }
257
+
258
+ /**
259
+ * Set USB gateway mode.
260
+ *
261
+ * Makes the modem the gateway of the computer plugged into it over USB, or not; off by default; shown as dongle_setting.is_usb_gateway_enabled in GET /dongle. The value is sent to the modem at once: if the modem cannot be reached or rejects the command, the saved value is put back (400 DONGLE_SETTING_API_EXCEPTION); if the firmware of the modem cannot turn the gateway off, it is put back too (400 DONGLE_SETTING_USB_GATEWAY_NOT_SUPPORTED). The modem takes the setting with a reboot: after a change it reboots to apply it, even while a reboot is already in progress (dongle_online_status 7 while it reboots). A value equal to the saved one is checked with the modem; it is sent, and applied by a reboot, only when the modem reports another one. When the modem cannot be reached for that check, the answer is 400 DONGLE_SETTING_API_EXCEPTION as well. The modem reports the mode it has saved, not the one in effect: to apply a mode it has saved, reboot it (POST /dongle/{dongle_id}/reboot). Available from modem firmware 5.1.0; older firmware answers 400 DONGLE_SETTING_API_EXCEPTION.
262
+ *
263
+ * @param dongleId - ID of the dongle
264
+ *
265
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, DONGLE_SETTING_NOT_FOUND, DONGLE_SETTING_API_EXCEPTION, DONGLE_SETTING_USB_GATEWAY_NOT_SUPPORTED.
266
+ *
267
+ * Capability the role of an organization API key needs: `device.manage`.
268
+ *
269
+ * Needs modem firmware 5.1.0 or later.
270
+ */
271
+ updateUsbGateway(
272
+ dongleId: number,
273
+ params: DonglesUpdateUsbGatewayParams,
274
+ options?: RequestOptions,
275
+ ): Promise<boolean> {
276
+ return this._client
277
+ .request('PUT', `/dongle/${pathParam(dongleId)}/setting/usb-gateway`, {
278
+ body: { is_enabled: params.is_enabled },
279
+ options,
280
+ })
281
+ .then(asStatus);
282
+ }
283
+
192
284
  /**
193
285
  * Set modem number.
194
286
  *
@@ -196,7 +288,9 @@ export class DonglesResource extends APIResource {
196
288
  *
197
289
  * @param dongleId - ID of the dongle
198
290
  *
199
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_MANUAL_PHONE_DETERMINATION_NUMBER_EXCEPTION, DONGLE_MANUAL_PHONE_DETERMINATION_ALREADY_IN_PROGRESS_EXCEPTION.
291
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_MANUAL_PHONE_DETERMINATION_NUMBER_EXCEPTION, DONGLE_MANUAL_PHONE_DETERMINATION_ALREADY_IN_PROGRESS_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
292
+ *
293
+ * Capability the role of an organization API key needs: `device.manage`.
200
294
  */
201
295
  setNumber(dongleId: number, params: DonglesSetNumberParams, options?: RequestOptions): Promise<boolean> {
202
296
  return this._client
@@ -212,6 +306,8 @@ export class DonglesResource extends APIResource {
212
306
  * @param dongleId - Identifier in the path
213
307
  *
214
308
  * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND.
309
+ *
310
+ * Capability the role of an organization API key needs: `device.view`.
215
311
  */
216
312
  get(dongleId: number, options?: RequestOptions): Promise<Dongle> {
217
313
  return this._client
@@ -222,11 +318,13 @@ export class DonglesResource extends APIResource {
222
318
  /**
223
319
  * Update modem.
224
320
  *
225
- * Only the listed body fields are read; unknown fields are ignored. An omitted field keeps its value. The billing fields tariff_package_id, is_tariff_package_enabled, order_dongle_id, is_deleted and is_active and the field imei_fake are outside the public API: a body with any of them is refused as a whole with 403 PUBLIC_API_FIELD_FORBIDDEN.
321
+ * Only the listed body fields are read; unknown fields are ignored. An omitted field keeps its value. The billing fields tariff_package_id, is_tariff_package_enabled, order_dongle_id, is_deleted and is_active and the field imei_fake are outside the public API: a body with any of them is refused as a whole with 403 PUBLIC_API_FIELD_FORBIDDEN, whatever the role of the key. Switching dongle_call_type_id to 1 (SIP) takes the call scenario off the modem first: a modem that does not take it off answers 400 DONGLE_ERROR_CALL_SCENARIO_NOT_REMOVED, and nothing is changed.
226
322
  *
227
323
  * @param dongleId - Identifier in the path
228
324
  *
229
- * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, PUBLIC_API_FIELD_FORBIDDEN.
325
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_ERROR_DONGLE_NOT_FOUND, DONGLE_ERROR_CALL_SCENARIO_NOT_REMOVED, PUBLIC_API_FIELD_FORBIDDEN, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
326
+ *
327
+ * Capability the role of an organization API key needs: `device.manage`.
230
328
  */
231
329
  update(dongleId: number, params: DonglesUpdateParams = {}, options?: RequestOptions): Promise<Dongle> {
232
330
  return this._client
@@ -249,7 +347,9 @@ export class DonglesResource extends APIResource {
249
347
  *
250
348
  * @param dongleId - Identifier in the path
251
349
  *
252
- * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT.
350
+ * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
351
+ *
352
+ * Capability the role of an organization API key needs: `device.view`.
253
353
  */
254
354
  getNetworkInfo(dongleId: number, options?: RequestOptions): Promise<DongleNetworkInfo> {
255
355
  return this._client
@@ -264,7 +364,9 @@ export class DonglesResource extends APIResource {
264
364
  *
265
365
  * @param dongleId - Identifier in the path
266
366
  *
267
- * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT.
367
+ * Error codes (`errorMessage`): DONGLE_ERROR_DONGLE_NOT_FOUND, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_HTTP_RESPONSE, DONGLE_MANAGEMENT_API_ERROR_IDENTIFIER_INVALID_CONTENT, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
368
+ *
369
+ * Capability the role of an organization API key needs: `device.view`.
268
370
  */
269
371
  getSimIdentifiers(dongleId: number, options?: RequestOptions): Promise<DongleSimIdentifiers> {
270
372
  return this._client
@@ -279,7 +381,9 @@ export class DonglesResource extends APIResource {
279
381
  *
280
382
  * @param dongleId - Identifier in the path
281
383
  *
282
- * Error codes (`errorMessage`): PARSING_DATE_TIME_EXCEPTION, DONGLE_ERROR_DONGLE_NOT_FOUND.
384
+ * Error codes (`errorMessage`): PARSING_DATE_TIME_EXCEPTION, DONGLE_ERROR_DONGLE_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
385
+ *
386
+ * Capability the role of an organization API key needs: `device.view`.
283
387
  */
284
388
  listStatistics(
285
389
  dongleId: number,
@@ -10,11 +10,13 @@ export class FilesResource extends APIResource {
10
10
  /**
11
11
  * Get file.
12
12
  *
13
- * Downloads a file of the account: a call recording, the audio of a call scenario or a mailing, an invoice document. The file_id comes from those objects (file_id, call_scenario_file_id, invoice and receipt files).
13
+ * Downloads a file of the account: a call recording, or the audio of a call scenario or a mailing. The file_id comes from those objects (file_id, call_scenario_file_id).
14
14
  *
15
15
  * @param fileId -
16
16
  *
17
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_NOT_FOUND_EXCEPTION.
17
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
18
+ *
19
+ * Capability the role of an organization API key needs: `device.view`.
18
20
  */
19
21
  download(fileId: number, options?: RequestOptions): Promise<Uint8Array> {
20
22
  return this._client.requestBytes('GET', `/file/${pathParam(fileId)}`, { options });
@@ -27,7 +29,9 @@ export class FilesResource extends APIResource {
27
29
  *
28
30
  * @param fileId - tmp_file_id as returned by POST /file/upload-tmp or POST /file/generate-speech: `<2 hex>/<32 hex>/<file name>`. Put it into the path as is: the slashes are path separators and must not be percent-encoded (most SDK generators encode `/` in a path parameter by default; turn it off for this one). Percent-encode only characters of the file name that are not allowed in a path segment.
29
31
  *
30
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, TMP_FILE_NOT_FOUND.
32
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, TMP_FILE_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
33
+ *
34
+ * Capability the role of an organization API key needs: `automation.manage`.
31
35
  */
32
36
  downloadTmp(fileId: string, options?: RequestOptions): Promise<Uint8Array> {
33
37
  return this._client.requestBytes('GET', `/file/tmp/${pathParam(fileId, true)}`, { options });
@@ -38,7 +42,9 @@ export class FilesResource extends APIResource {
38
42
  *
39
43
  * Uploads an audio file as a temporary file, converted to the modem format; pass the returned tmp_file_id to a call scenario or a call mailing.
40
44
  *
41
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_ERROR_IDENTIFIER_EMPTY_FIELDS, FILE_ERROR_FILE_NOT_VALID_BASE_64, FILE_ERROR_FILE_WRONG_TYPE, FILE_ERROR_FILE_NOT_VALID_SIZE, FILE_ERROR_CONVERT_TO_DONGLE_AUDIO, FILE_ERROR_DONGLE_AUDIO_TOO_LARGE.
45
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FILE_ERROR_IDENTIFIER_EMPTY_FIELDS, FILE_ERROR_FILE_NOT_VALID_BASE_64, FILE_ERROR_FILE_WRONG_TYPE, FILE_ERROR_FILE_NOT_VALID_SIZE, FILE_ERROR_CONVERT_TO_DONGLE_AUDIO, FILE_ERROR_DONGLE_AUDIO_TOO_LARGE, FILE_ERROR_IDENTIFIER_UNKNOWN_SCENARIO, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
46
+ *
47
+ * Capability the role of an organization API key needs: `automation.manage`.
42
48
  */
43
49
  uploadTmp(params: FilesUploadTmpParams, options?: RequestOptions): Promise<TmpFile> {
44
50
  return this._client
@@ -56,9 +62,11 @@ export class FilesResource extends APIResource {
56
62
  /**
57
63
  * Generate speech.
58
64
  *
59
- * Synthesises the text into a temporary audio file for a call scenario or a call mailing; pass the returned tmp_file_id as the audio of those. Limited to 5 calls per day per user: the 6th answers 429 RATE_LIMIT_EXCEEDED.
65
+ * Synthesises the text into a temporary audio file for a call scenario or a call mailing; pass the returned tmp_file_id as the audio of those. Limited to 5 calls per day per account, per organization for an organization API key: the 6th answers 429 RATE_LIMIT_EXCEEDED.
66
+ *
67
+ * Error codes (`errorMessage`): RATE_LIMIT_EXCEEDED, FILE_GENERATE_SPEECH_IDENTIFIER_EMPTY_FIELDS, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_VOICE, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_LANGUAGE, FILE_GENERATE_SPEECH_IDENTIFIER_LONG_TEXT, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
60
68
  *
61
- * Error codes (`errorMessage`): RATE_LIMIT_EXCEEDED, FILE_GENERATE_SPEECH_IDENTIFIER_EMPTY_FIELDS, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_VOICE, FILE_GENERATE_SPEECH_IDENTIFIER_NOT_ALLOWED_LANGUAGE, FILE_GENERATE_SPEECH_IDENTIFIER_LONG_TEXT.
69
+ * Capability the role of an organization API key needs: `automation.manage`.
62
70
  */
63
71
  generateSpeech(params: FilesGenerateSpeechParams, options?: RequestOptions): Promise<TmpFile> {
64
72
  return this._client
@@ -17,7 +17,9 @@ export class FollowUpSmsSettingsResource extends APIResource {
17
17
  *
18
18
  * Follow-up SMS settings of the account: the SMS a modem sends to a caller after a call. Newest first by default (the id descending).
19
19
  *
20
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
20
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
21
+ *
22
+ * Capability the role of an organization API key needs: `automation.view`.
21
23
  */
22
24
  list(
23
25
  params: FollowUpSmsSettingsListParams = {},
@@ -41,7 +43,9 @@ export class FollowUpSmsSettingsResource extends APIResource {
41
43
  *
42
44
  * Creates a follow-up SMS setting for a modem.
43
45
  *
44
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING.
46
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
47
+ *
48
+ * Capability the role of an organization API key needs: `automation.manage`.
45
49
  */
46
50
  create(params: FollowUpSmsSettingsCreateParams, options?: RequestOptions): Promise<FollowUpSmsSetting> {
47
51
  return this._client
@@ -66,7 +70,9 @@ export class FollowUpSmsSettingsResource extends APIResource {
66
70
  *
67
71
  * @param followUpSmsSettingId - Follow Up Sms Setting ID
68
72
  *
69
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION.
73
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
74
+ *
75
+ * Capability the role of an organization API key needs: `automation.view`.
70
76
  */
71
77
  get(followUpSmsSettingId: number, options?: RequestOptions): Promise<FollowUpSmsSetting> {
72
78
  return this._client
@@ -81,7 +87,9 @@ export class FollowUpSmsSettingsResource extends APIResource {
81
87
  *
82
88
  * @param followUpSmsSettingId - Follow-up SMS setting ID
83
89
  *
84
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING.
90
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, INVALID_DONGLE_TYPE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, INVALID_RINGING_DURATION_TIMEOUT, INVALID_CALL_DURATION_TIMEOUT, INVALID_DAILY_SMS_LIMIT, DUPLICATE_DONGLE_FOLLOW_UP_SMS_SETTING, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
91
+ *
92
+ * Capability the role of an organization API key needs: `automation.manage`.
85
93
  */
86
94
  update(
87
95
  followUpSmsSettingId: number,
@@ -111,6 +119,8 @@ export class FollowUpSmsSettingsResource extends APIResource {
111
119
  * @param followUpSmsSettingId - Follow-up SMS setting ID
112
120
  *
113
121
  * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, FOLLOW_UP_SMS_SETTING_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
122
+ *
123
+ * Capability the role of an organization API key needs: `automation.manage`.
114
124
  */
115
125
  delete(followUpSmsSettingId: number, options?: RequestOptions): Promise<boolean> {
116
126
  return this._client
@@ -15,6 +15,7 @@ import { PublicVpnResource } from './public-vpn.js';
15
15
  import { SocksProxiesResource } from './socks-proxies.js';
16
16
  import { SipUsersResource } from './sip-users.js';
17
17
  import { FilesResource } from './files.js';
18
+ import { PlansResource } from './plans.js';
18
19
 
19
20
  export {
20
21
  DonglesResource,
@@ -31,6 +32,7 @@ export {
31
32
  SocksProxiesResource,
32
33
  SipUsersResource,
33
34
  FilesResource,
35
+ PlansResource,
34
36
  };
35
37
 
36
38
  /** Resource groups of the client. */
@@ -39,7 +41,7 @@ export interface Resources {
39
41
  readonly dongles: DonglesResource;
40
42
  /** SMS of the modems: history, sending, replies, threads. */
41
43
  readonly sms: SmsResource;
42
- /** Calls of the modems: history, outgoing calls. */
44
+ /** Calls of the modems: history, outgoing calls, transcripts. */
43
45
  readonly calls: CallsResource;
44
46
  /** USSD requests through a modem. */
45
47
  readonly ussd: UssdResource;
@@ -63,6 +65,10 @@ export interface Resources {
63
65
  readonly sipUsers: SipUsersResource;
64
66
  /** Downloads, temporary audio uploads and text-to-speech. */
65
67
  readonly files: FilesResource;
68
+ /**
69
+ * Prices of Teleleo: the subscriptions of the cabinet and the products of the store. Public, without a key.
70
+ */
71
+ readonly plans: PlansResource;
66
72
  }
67
73
 
68
74
  /** @internal */
@@ -82,5 +88,6 @@ export function createResources(client: BaseClient): Resources {
82
88
  socksProxies: new SocksProxiesResource(client),
83
89
  sipUsers: new SipUsersResource(client),
84
90
  files: new FilesResource(client),
91
+ plans: new PlansResource(client),
85
92
  };
86
93
  }
@@ -19,7 +19,9 @@ export class MailingsResource extends APIResource {
19
19
  *
20
20
  * Mailings (bulk SMS or call campaigns) of the account. Newest first by default (created_at descending, then the id descending).
21
21
  *
22
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION.
22
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
23
+ *
24
+ * Capability the role of an organization API key needs: `automation.view`.
23
25
  */
24
26
  list(params: MailingsListParams = {}, options?: RequestOptions): PagePromise<Mailing> {
25
27
  return this._client.getPage<Mailing>('/mailing', {
@@ -56,7 +58,9 @@ export class MailingsResource extends APIResource {
56
58
  *
57
59
  * Creates an SMS or call mailing. Use POST /mailing/sms or POST /mailing/call instead.
58
60
  *
59
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CREATE, MAILING_MANAGEMENT_INVALID_SCHEDULED_AT, MAILING_MANAGEMENT_DONGLE_TARIFF_INVALID, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, MAILING_MANAGEMENT_DONGLE_SMS_LIMIT_EXCEEDED, TMP_FILE_NOT_FOUND.
61
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CREATE, MAILING_MANAGEMENT_INVALID_SCHEDULED_AT, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, MAILING_MANAGEMENT_DONGLE_SMS_LIMIT_EXCEEDED, TMP_FILE_NOT_FOUND, DONGLE_FIRMWARE_UPDATING_EXCEPTION, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
62
+ *
63
+ * Capability the role of an organization API key needs: `automation.manage`.
60
64
  */
61
65
  create(params: MailingsCreateParams, options?: RequestOptions): Promise<Mailing> {
62
66
  return this._client
@@ -85,7 +89,9 @@ export class MailingsResource extends APIResource {
85
89
  *
86
90
  * Creates an SMS mailing to the listed phones, contacts and contact groups, sent now or at scheduled_at.
87
91
  *
88
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CREATE, MAILING_MANAGEMENT_INVALID_SCHEDULED_AT, MAILING_MANAGEMENT_DONGLE_TARIFF_INVALID, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, MAILING_MANAGEMENT_DONGLE_SMS_LIMIT_EXCEEDED.
92
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CREATE, MAILING_MANAGEMENT_INVALID_SCHEDULED_AT, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, MAILING_MANAGEMENT_DONGLE_SMS_LIMIT_EXCEEDED, DONGLE_FIRMWARE_UPDATING_EXCEPTION, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
93
+ *
94
+ * Capability the role of an organization API key needs: `automation.manage`.
89
95
  */
90
96
  createSms(params: MailingsCreateSmsParams, options?: RequestOptions): Promise<Mailing> {
91
97
  return this._client
@@ -111,7 +117,9 @@ export class MailingsResource extends APIResource {
111
117
  *
112
118
  * Creates a call mailing that plays an audio file (tmp_file_id) to the listed phones, contacts and contact groups.
113
119
  *
114
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CREATE, MAILING_MANAGEMENT_INVALID_SCHEDULED_AT, MAILING_MANAGEMENT_DONGLE_TARIFF_INVALID, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, TMP_FILE_NOT_FOUND.
120
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CREATE, MAILING_MANAGEMENT_INVALID_SCHEDULED_AT, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, TMP_FILE_NOT_FOUND, DONGLE_FIRMWARE_UPDATING_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
121
+ *
122
+ * Capability the role of an organization API key needs: `automation.manage`.
115
123
  */
116
124
  createCall(params: MailingsCreateCallParams, options?: RequestOptions): Promise<Mailing> {
117
125
  return this._client
@@ -141,7 +149,9 @@ export class MailingsResource extends APIResource {
141
149
  *
142
150
  * @param mailingId - Identifier in the path
143
151
  *
144
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, MAILING_NOT_FOUND.
152
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, MAILING_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
153
+ *
154
+ * Capability the role of an organization API key needs: `automation.view`.
145
155
  */
146
156
  get(mailingId: number, options?: RequestOptions): Promise<Mailing> {
147
157
  return this._client
@@ -156,7 +166,9 @@ export class MailingsResource extends APIResource {
156
166
  *
157
167
  * @param mailingId - Identifier in the path
158
168
  *
159
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, MAILING_NOT_FOUND, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_UPDATE, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CANCEL, MAILING_MANAGEMENT_INVALID_STATUS_FOR_SOFT_DELETE, MAILING_MANAGEMENT_DONGLE_TARIFF_INVALID, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, MAILING_MANAGEMENT_DONGLE_SMS_LIMIT_EXCEEDED, TMP_FILE_NOT_FOUND.
169
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, MAILING_NOT_FOUND, PARSING_DATE_TIME_EXCEPTION, MAILING_MANAGEMENT_INVALID_STATUS_FOR_UPDATE, MAILING_MANAGEMENT_INVALID_STATUS_FOR_CANCEL, MAILING_MANAGEMENT_INVALID_STATUS_FOR_SOFT_DELETE, MAILING_MANAGEMENT_INVALID_PHONE, MAILING_MANAGEMENT_NO_RECIPIENTS, MAILING_MANAGEMENT_CONTACT_NOT_FOUND, MAILING_MANAGEMENT_CONTACT_GROUP_NOT_FOUND, MAILING_MANAGEMENT_DONGLE_SMS_LIMIT_EXCEEDED, TMP_FILE_NOT_FOUND, DONGLE_FIRMWARE_UPDATING_EXCEPTION, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
170
+ *
171
+ * Capability the role of an organization API key needs: `automation.manage`.
160
172
  */
161
173
  update(mailingId: number, params: MailingsUpdateParams = {}, options?: RequestOptions): Promise<Mailing> {
162
174
  return this._client
@@ -185,7 +197,9 @@ export class MailingsResource extends APIResource {
185
197
  *
186
198
  * @param mailingId - Identifier in the path
187
199
  *
188
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, MAILING_NOT_FOUND, MAILING_MANAGEMENT_INVALID_STATUS_FOR_HARD_DELETE, DONGLE_NOT_FOUND_EXCEPTION, MAILING_MANAGEMENT_DONGLE_TARIFF_INVALID.
200
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, MAILING_NOT_FOUND, MAILING_MANAGEMENT_INVALID_STATUS_FOR_HARD_DELETE, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
201
+ *
202
+ * Capability the role of an organization API key needs: `automation.manage`.
189
203
  */
190
204
  delete(mailingId: number, options?: RequestOptions): Promise<boolean> {
191
205
  return this._client.request('DELETE', `/mailing/${pathParam(mailingId)}`, { options }).then(asStatus);
@@ -0,0 +1,25 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+
3
+ import type { RequestOptions } from '../core.js';
4
+ import { APIResource } from '../resource.js';
5
+ import type { PlanCatalog } from '../types/models.js';
6
+ import type { PlansGetCatalogParams } from '../types/params.js';
7
+ /**
8
+ * Prices of Teleleo: the subscriptions of the cabinet and the products of the store. Public, without a key.
9
+ */
10
+ export class PlansResource extends APIResource {
11
+ /**
12
+ * List plans and prices.
13
+ *
14
+ * The prices of Teleleo and what each plan or product includes, in one currency: the subscriptions of the cabinet (monthly and yearly, paid per modem) and the products of the store (the modem alone and the modem with months of subscription). Public, the one operation without a key: no auth-key is needed, but a key sent with it must be valid, or the answer is 401. A subscription costs what the cabinet charges for it; a product costs what the store asks in that currency, with the store page in url. The answer is cached for 5 minutes, so a new price shows within 5 minutes. When the prices cannot be read, the last good answer is served for up to 24 hours (updated_at tells how old it is); with none, 503 PLAN_CATALOG_UNAVAILABLE.
15
+ *
16
+ * Error codes (`errorMessage`): PLAN_CURRENCY_NOT_SUPPORTED, PLAN_CATALOG_UNAVAILABLE.
17
+ *
18
+ * Needs no API key: a client made with `apiKey: null` can call it. A key the client has is sent, and it must be valid.
19
+ */
20
+ getCatalog(params: PlansGetCatalogParams = {}, options?: RequestOptions): Promise<PlanCatalog> {
21
+ return this._client
22
+ .request('GET', '/plan', { query: { currency: params.currency }, keyOptional: true, options })
23
+ .then((data) => data as PlanCatalog);
24
+ }
25
+ }
@@ -14,6 +14,8 @@ export class PublicVpnResource extends APIResource {
14
14
  * @param dongleId - ID of the dongle
15
15
  *
16
16
  * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, DONGLE_PUBLIC_VPN_ALREADY_ENABLED_EXCEPTION.
17
+ *
18
+ * Capability the role of an organization API key needs: `network.manage`.
17
19
  */
18
20
  enable(dongleId: number, options?: RequestOptions): Promise<boolean> {
19
21
  return this._client
@@ -28,7 +30,9 @@ export class PublicVpnResource extends APIResource {
28
30
  *
29
31
  * @param dongleId - ID of the dongle
30
32
  *
31
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_PUBLIC_VPN_ALREADY_DISABLED_EXCEPTION.
33
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, DONGLE_PUBLIC_VPN_ALREADY_DISABLED_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
34
+ *
35
+ * Capability the role of an organization API key needs: `network.manage`.
32
36
  */
33
37
  disable(dongleId: number, options?: RequestOptions): Promise<boolean> {
34
38
  return this._client
@@ -44,6 +48,8 @@ export class PublicVpnResource extends APIResource {
44
48
  * @param dongleId - ID of the dongle
45
49
  *
46
50
  * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
51
+ *
52
+ * Capability the role of an organization API key needs: `network.manage`.
47
53
  */
48
54
  refreshPassword(dongleId: number, options?: RequestOptions): Promise<boolean> {
49
55
  return this._client
@@ -55,6 +61,10 @@ export class PublicVpnResource extends APIResource {
55
61
  * List public VPN sessions.
56
62
  *
57
63
  * Live VPN sessions of the modems of the account, as the VPN gateway reports them. Not paginated.
64
+ *
65
+ * Error codes (`errorMessage`): BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
66
+ *
67
+ * Capability the role of an organization API key needs: `network.view`.
58
68
  */
59
69
  listSessions(options?: RequestOptions): Promise<Array<PublicVpnSession>> {
60
70
  return this._client
@@ -17,7 +17,9 @@ export class RedirectionsResource extends APIResource {
17
17
  *
18
18
  * Redirection rules of the account: forwarding of incoming SMS and calls, auto replies and HTTP callbacks. Newest first by default (created_at descending, then the id descending).
19
19
  *
20
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION.
20
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
21
+ *
22
+ * Capability the role of an organization API key needs: `automation.view`.
21
23
  */
22
24
  list(params: RedirectionsListParams = {}, options?: RequestOptions): PagePromise<Redirection> {
23
25
  return this._client.getPage<Redirection>('/redirection', {
@@ -44,7 +46,9 @@ export class RedirectionsResource extends APIResource {
44
46
  *
45
47
  * Creates a redirection rule; condition and params are checked on save (see RedirectionCondition and RedirectionParams).
46
48
  *
47
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARAMS_NOT_VALID_EXCEPTION, CONDITION_NOT_VALID_EXCEPTION, DONGLE_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
49
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARAMS_NOT_VALID_EXCEPTION, CONDITION_NOT_VALID_EXCEPTION, DONGLE_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
50
+ *
51
+ * Capability the role of an organization API key needs: `automation.manage`.
48
52
  */
49
53
  create(params: RedirectionsCreateParams, options?: RequestOptions): Promise<Redirection> {
50
54
  return this._client
@@ -67,7 +71,9 @@ export class RedirectionsResource extends APIResource {
67
71
  *
68
72
  * @param redirectionId - Identifier in the path
69
73
  *
70
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION.
74
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
75
+ *
76
+ * Capability the role of an organization API key needs: `automation.view`.
71
77
  */
72
78
  get(redirectionId: number, options?: RequestOptions): Promise<Redirection> {
73
79
  return this._client
@@ -82,7 +88,9 @@ export class RedirectionsResource extends APIResource {
82
88
  *
83
89
  * @param redirectionId - Identifier in the path
84
90
  *
85
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION, PARAMS_NOT_VALID_EXCEPTION, CONDITION_NOT_VALID_EXCEPTION, DONGLE_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
91
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION, PARAMS_NOT_VALID_EXCEPTION, CONDITION_NOT_VALID_EXCEPTION, DONGLE_NOT_FOUND, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE.
92
+ *
93
+ * Capability the role of an organization API key needs: `automation.manage`.
86
94
  */
87
95
  update(
88
96
  redirectionId: number,
@@ -109,7 +117,9 @@ export class RedirectionsResource extends APIResource {
109
117
  *
110
118
  * @param redirectionId - Identifier in the path
111
119
  *
112
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION.
120
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
121
+ *
122
+ * Capability the role of an organization API key needs: `automation.manage`.
113
123
  */
114
124
  delete(redirectionId: number, options?: RequestOptions): Promise<boolean> {
115
125
  return this._client
@@ -12,7 +12,9 @@ export class SipUsersResource extends APIResource {
12
12
  *
13
13
  * SIP accounts of the modems of the account, one per modem (dongle_id is always set; the softphone login of the cabinet and the mobile app is not listed). Modems deleted from the account are not listed. pbx_sip_connections lists the SIP servers to register at (TLS and UDP/TCP).
14
14
  *
15
- * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
15
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
16
+ *
17
+ * Capability the role of an organization API key needs: `call.make`.
16
18
  */
17
19
  list(params: SipUsersListParams = {}, options?: RequestOptions): Promise<Array<PbxSipUser>> {
18
20
  return this._client
@@ -30,7 +32,9 @@ export class SipUsersResource extends APIResource {
30
32
  *
31
33
  * @param sipUserId - Identifier in the path
32
34
  *
33
- * Error codes (`errorMessage`): PBX_SIP_ERROR_IDENTIFIER_CANT_FIND_PBX_USER.
35
+ * Error codes (`errorMessage`): PBX_SIP_ERROR_IDENTIFIER_CANT_FIND_PBX_USER, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE.
36
+ *
37
+ * Capability the role of an organization API key needs: `call.make`.
34
38
  */
35
39
  get(sipUserId: number, options?: RequestOptions): Promise<PbxSipUser> {
36
40
  return this._client