teleleo 0.0.0-stage → 0.2.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 (140) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +21 -0
  3. package/README.md +236 -2
  4. package/api.md +187 -0
  5. package/dist/client.d.ts +28 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/client.js +27 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/core.d.ts +66 -0
  10. package/dist/core.d.ts.map +1 -0
  11. package/dist/core.js +195 -0
  12. package/dist/core.js.map +1 -0
  13. package/dist/errors.d.ts +92 -0
  14. package/dist/errors.d.ts.map +1 -0
  15. package/dist/errors.js +163 -0
  16. package/dist/errors.js.map +1 -0
  17. package/dist/index.d.ts +23 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +23 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/pagination.d.ts +41 -0
  22. package/dist/pagination.d.ts.map +1 -0
  23. package/dist/pagination.js +98 -0
  24. package/dist/pagination.js.map +1 -0
  25. package/dist/resource.d.ts +7 -0
  26. package/dist/resource.d.ts.map +1 -0
  27. package/dist/resource.js +8 -0
  28. package/dist/resource.js.map +1 -0
  29. package/dist/resources/call-scenarios.d.ts +77 -0
  30. package/dist/resources/call-scenarios.d.ts.map +1 -0
  31. package/dist/resources/call-scenarios.js +137 -0
  32. package/dist/resources/call-scenarios.js.map +1 -0
  33. package/dist/resources/calls.d.ts +69 -0
  34. package/dist/resources/calls.d.ts.map +1 -0
  35. package/dist/resources/calls.js +109 -0
  36. package/dist/resources/calls.js.map +1 -0
  37. package/dist/resources/contact-groups.d.ts +65 -0
  38. package/dist/resources/contact-groups.d.ts.map +1 -0
  39. package/dist/resources/contact-groups.js +99 -0
  40. package/dist/resources/contact-groups.js.map +1 -0
  41. package/dist/resources/contacts.d.ts +75 -0
  42. package/dist/resources/contacts.d.ts.map +1 -0
  43. package/dist/resources/contacts.js +132 -0
  44. package/dist/resources/contacts.js.map +1 -0
  45. package/dist/resources/dongles.d.ts +201 -0
  46. package/dist/resources/dongles.d.ts.map +1 -0
  47. package/dist/resources/dongles.js +296 -0
  48. package/dist/resources/dongles.js.map +1 -0
  49. package/dist/resources/files.d.ts +52 -0
  50. package/dist/resources/files.d.ts.map +1 -0
  51. package/dist/resources/files.js +73 -0
  52. package/dist/resources/files.js.map +1 -0
  53. package/dist/resources/follow-up-sms-settings.d.ts +65 -0
  54. package/dist/resources/follow-up-sms-settings.d.ts.map +1 -0
  55. package/dist/resources/follow-up-sms-settings.js +111 -0
  56. package/dist/resources/follow-up-sms-settings.js.map +1 -0
  57. package/dist/resources/index.d.ts +50 -0
  58. package/dist/resources/index.d.ts.map +1 -0
  59. package/dist/resources/index.js +36 -0
  60. package/dist/resources/index.js.map +1 -0
  61. package/dist/resources/mailings.d.ts +85 -0
  62. package/dist/resources/mailings.d.ts.map +1 -0
  63. package/dist/resources/mailings.js +191 -0
  64. package/dist/resources/mailings.js.map +1 -0
  65. package/dist/resources/public-vpn.d.ts +51 -0
  66. package/dist/resources/public-vpn.d.ts.map +1 -0
  67. package/dist/resources/public-vpn.js +67 -0
  68. package/dist/resources/public-vpn.js.map +1 -0
  69. package/dist/resources/redirections.d.ts +65 -0
  70. package/dist/resources/redirections.d.ts.map +1 -0
  71. package/dist/resources/redirections.js +113 -0
  72. package/dist/resources/redirections.js.map +1 -0
  73. package/dist/resources/sip-users.d.ts +30 -0
  74. package/dist/resources/sip-users.d.ts.map +1 -0
  75. package/dist/resources/sip-users.js +40 -0
  76. package/dist/resources/sip-users.js.map +1 -0
  77. package/dist/resources/sms.d.ts +116 -0
  78. package/dist/resources/sms.d.ts.map +1 -0
  79. package/dist/resources/sms.js +203 -0
  80. package/dist/resources/sms.js.map +1 -0
  81. package/dist/resources/socks-proxies.d.ts +65 -0
  82. package/dist/resources/socks-proxies.d.ts.map +1 -0
  83. package/dist/resources/socks-proxies.js +91 -0
  84. package/dist/resources/socks-proxies.js.map +1 -0
  85. package/dist/resources/ussd.d.ts +71 -0
  86. package/dist/resources/ussd.d.ts.map +1 -0
  87. package/dist/resources/ussd.js +89 -0
  88. package/dist/resources/ussd.js.map +1 -0
  89. package/dist/types/enums.d.ts +280 -0
  90. package/dist/types/enums.d.ts.map +1 -0
  91. package/dist/types/enums.js +233 -0
  92. package/dist/types/enums.js.map +1 -0
  93. package/dist/types/index.d.ts +4 -0
  94. package/dist/types/index.d.ts.map +1 -0
  95. package/dist/types/index.js +5 -0
  96. package/dist/types/index.js.map +1 -0
  97. package/dist/types/models.d.ts +686 -0
  98. package/dist/types/models.d.ts.map +1 -0
  99. package/dist/types/models.js +3 -0
  100. package/dist/types/models.js.map +1 -0
  101. package/dist/types/params.d.ts +711 -0
  102. package/dist/types/params.d.ts.map +1 -0
  103. package/dist/types/params.js +3 -0
  104. package/dist/types/params.js.map +1 -0
  105. package/dist/utils.d.ts +32 -0
  106. package/dist/utils.d.ts.map +1 -0
  107. package/dist/utils.js +118 -0
  108. package/dist/utils.js.map +1 -0
  109. package/dist/version.d.ts +2 -0
  110. package/dist/version.d.ts.map +1 -0
  111. package/dist/version.js +2 -0
  112. package/dist/version.js.map +1 -0
  113. package/package.json +63 -4
  114. package/src/client.ts +42 -0
  115. package/src/core.ts +278 -0
  116. package/src/errors.ts +170 -0
  117. package/src/index.ts +46 -0
  118. package/src/pagination.ts +110 -0
  119. package/src/resource.ts +10 -0
  120. package/src/resources/call-scenarios.ts +154 -0
  121. package/src/resources/calls.ts +117 -0
  122. package/src/resources/contact-groups.ts +115 -0
  123. package/src/resources/contacts.ts +149 -0
  124. package/src/resources/dongles.ts +346 -0
  125. package/src/resources/files.ts +79 -0
  126. package/src/resources/follow-up-sms-settings.ts +130 -0
  127. package/src/resources/index.ts +86 -0
  128. package/src/resources/mailings.ts +207 -0
  129. package/src/resources/public-vpn.ts +72 -0
  130. package/src/resources/redirections.ts +129 -0
  131. package/src/resources/sip-users.ts +44 -0
  132. package/src/resources/sms.ts +232 -0
  133. package/src/resources/socks-proxies.ts +107 -0
  134. package/src/resources/ussd.ts +97 -0
  135. package/src/types/enums.ts +300 -0
  136. package/src/types/index.ts +5 -0
  137. package/src/types/models.ts +747 -0
  138. package/src/types/params.ts +767 -0
  139. package/src/utils.ts +123 -0
  140. package/src/version.ts +1 -0
@@ -0,0 +1,113 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { asStatus, pathParam } from '../utils.js';
4
+ /** Rules for incoming SMS and calls: forwarding, auto reply, HTTP callback. */
5
+ export class RedirectionsResource extends APIResource {
6
+ /**
7
+ * List redirections.
8
+ *
9
+ * 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).
10
+ *
11
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION.
12
+ *
13
+ * Capability the role of an organization API key needs: `automation.view`.
14
+ */
15
+ list(params = {}, options) {
16
+ return this._client.getPage('/redirection', {
17
+ query: {
18
+ name: params.name,
19
+ auto_reply_message: params.auto_reply_message,
20
+ dongle_id: params.dongle_id,
21
+ 'dongle_ids[]': params.dongle_ids,
22
+ from: params.from,
23
+ to: params.to,
24
+ page: params.page,
25
+ limit: params.limit,
26
+ order_by: params.order_by,
27
+ order: params.order,
28
+ 'redirection_type_ids[]': params.redirection_type_ids,
29
+ },
30
+ itemKey: 'redirections',
31
+ options,
32
+ });
33
+ }
34
+ /**
35
+ * Create redirection.
36
+ *
37
+ * Creates a redirection rule; condition and params are checked on save (see RedirectionCondition and RedirectionParams).
38
+ *
39
+ * 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.
40
+ *
41
+ * Capability the role of an organization API key needs: `automation.manage`.
42
+ */
43
+ create(params, options) {
44
+ return this._client
45
+ .request('POST', '/redirection', {
46
+ body: {
47
+ condition: params.condition,
48
+ name: params.name,
49
+ params: params.params,
50
+ redirection_type_id: params.redirection_type_id,
51
+ },
52
+ options,
53
+ })
54
+ .then((data) => data);
55
+ }
56
+ /**
57
+ * Get redirection.
58
+ *
59
+ * One redirection rule of the account.
60
+ *
61
+ * @param redirectionId - Identifier in the path
62
+ *
63
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION.
64
+ *
65
+ * Capability the role of an organization API key needs: `automation.view`.
66
+ */
67
+ get(redirectionId, options) {
68
+ return this._client
69
+ .request('GET', `/redirection/${pathParam(redirectionId)}`, { options })
70
+ .then((data) => data);
71
+ }
72
+ /**
73
+ * Update redirection.
74
+ *
75
+ * Replaces the redirection rule; the body is checked as on create.
76
+ *
77
+ * @param redirectionId - Identifier in the path
78
+ *
79
+ * 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.
80
+ *
81
+ * Capability the role of an organization API key needs: `automation.manage`.
82
+ */
83
+ update(redirectionId, params, options) {
84
+ return this._client
85
+ .request('PUT', `/redirection/${pathParam(redirectionId)}`, {
86
+ body: {
87
+ condition: params.condition,
88
+ name: params.name,
89
+ params: params.params,
90
+ redirection_type_id: params.redirection_type_id,
91
+ },
92
+ options,
93
+ })
94
+ .then((data) => data);
95
+ }
96
+ /**
97
+ * Delete redirection.
98
+ *
99
+ * Deletes the redirection rule.
100
+ *
101
+ * @param redirectionId - Identifier in the path
102
+ *
103
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, REDIRECTION_NOT_FOUND_EXCEPTION.
104
+ *
105
+ * Capability the role of an organization API key needs: `automation.manage`.
106
+ */
107
+ delete(redirectionId, options) {
108
+ return this._client
109
+ .request('DELETE', `/redirection/${pathParam(redirectionId)}`, { options })
110
+ .then(asStatus);
111
+ }
112
+ }
113
+ //# sourceMappingURL=redirections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redirections.js","sourceRoot":"","sources":["../../src/resources/redirections.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,+EAA+E;AAC/E,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACnD;;;;;;;;OAQG;IACH,IAAI,CAAC,SAAiC,EAAE,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAc,cAAc,EAAE;YACvD,KAAK,EAAE;gBACL,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;gBAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,cAAc,EAAE,MAAM,CAAC,UAAU;gBACjC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,wBAAwB,EAAE,MAAM,CAAC,oBAAoB;aACtD;YACD,OAAO,EAAE,cAAc;YACvB,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAgC,EAAE,OAAwB;QA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E,EAAE,EAAE,OAAO,EAAE,CAAC;aAC1E,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,30 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import { APIResource } from '../resource.js';
3
+ import type { PbxSipUser } from '../types/models.js';
4
+ import type { SipUsersListParams } from '../types/params.js';
5
+ /** SIP accounts of the modems. */
6
+ export declare class SipUsersResource extends APIResource {
7
+ /**
8
+ * List SIP users.
9
+ *
10
+ * 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).
11
+ *
12
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
13
+ *
14
+ * Capability the role of an organization API key needs: `call.make`.
15
+ */
16
+ list(params?: SipUsersListParams, options?: RequestOptions): Promise<Array<PbxSipUser>>;
17
+ /**
18
+ * Get SIP user.
19
+ *
20
+ * One SIP account of a modem of the account. An unknown id, the SIP account of a deleted modem and the softphone login of the cabinet and the mobile app answer 404 PBX_SIP_ERROR_IDENTIFIER_CANT_FIND_PBX_USER.
21
+ *
22
+ * @param sipUserId - Identifier in the path
23
+ *
24
+ * Error codes (`errorMessage`): PBX_SIP_ERROR_IDENTIFIER_CANT_FIND_PBX_USER.
25
+ *
26
+ * Capability the role of an organization API key needs: `call.make`.
27
+ */
28
+ get(sipUserId: number, options?: RequestOptions): Promise<PbxSipUser>;
29
+ }
30
+ //# sourceMappingURL=sip-users.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sip-users.d.ts","sourceRoot":"","sources":["../../src/resources/sip-users.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,kCAAkC;AAClC,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,GAAE,kBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAS3F;;;;;;;;;;OAUG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;CAKtE"}
@@ -0,0 +1,40 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { asArray, pathParam } from '../utils.js';
4
+ /** SIP accounts of the modems. */
5
+ export class SipUsersResource extends APIResource {
6
+ /**
7
+ * List SIP users.
8
+ *
9
+ * 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).
10
+ *
11
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
12
+ *
13
+ * Capability the role of an organization API key needs: `call.make`.
14
+ */
15
+ list(params = {}, options) {
16
+ return this._client
17
+ .request('GET', '/sip-user', {
18
+ query: { 'dongle_call_type_ids[]': params.dongle_call_type_ids },
19
+ options,
20
+ })
21
+ .then((data) => asArray(data, 'pbx_sip_users'));
22
+ }
23
+ /**
24
+ * Get SIP user.
25
+ *
26
+ * One SIP account of a modem of the account. An unknown id, the SIP account of a deleted modem and the softphone login of the cabinet and the mobile app answer 404 PBX_SIP_ERROR_IDENTIFIER_CANT_FIND_PBX_USER.
27
+ *
28
+ * @param sipUserId - Identifier in the path
29
+ *
30
+ * Error codes (`errorMessage`): PBX_SIP_ERROR_IDENTIFIER_CANT_FIND_PBX_USER.
31
+ *
32
+ * Capability the role of an organization API key needs: `call.make`.
33
+ */
34
+ get(sipUserId, options) {
35
+ return this._client
36
+ .request('GET', `/sip-user/${pathParam(sipUserId)}`, { options })
37
+ .then((data) => data);
38
+ }
39
+ }
40
+ //# sourceMappingURL=sip-users.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sip-users.js","sourceRoot":"","sources":["../../src/resources/sip-users.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAGtF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjD,kCAAkC;AAClC,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;OAQG;IACH,IAAI,CAAC,SAA6B,EAAE,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE;YAC3B,KAAK,EAAE,EAAE,wBAAwB,EAAE,MAAM,CAAC,oBAAoB,EAAE;YAChE,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAsB,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CAAC,SAAiB,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,KAAK,EAAE,aAAa,SAAS,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;aAChE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAkB,CAAC,CAAC;IACxC,CAAC;CACF"}
@@ -0,0 +1,116 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import type { PagePromise } from '../pagination.js';
3
+ import { APIResource } from '../resource.js';
4
+ import type { Sms, SmsThread } from '../types/models.js';
5
+ import type { SmsListForDongleParams, SmsListParams, SmsListThreadsParams, SmsReplyParams, SmsSendParams, SmsSendToContactParams, SmsUpdateParams } from '../types/params.js';
6
+ /** SMS of the modems: history, sending, replies, threads. */
7
+ export declare class SmsResource extends APIResource {
8
+ /**
9
+ * Send SMS.
10
+ *
11
+ * Sends an SMS from the modem to a phone number, now or at scheduled_at. sms_status_id 1 (Sended) means the modem took it for the mobile network, not that the handset received it: delivery is confirmed by 2 (from the delivery report), and 3 means it was not delivered or no report came within about 5 minutes.
12
+ *
13
+ * @param dongleId - ID of the dongle
14
+ *
15
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, SMS_ERROR_INVALID_RECEIVER_NUMBER, SMS_ERROR_IDENTIFIER_INVALID_CALLBACK_URL, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, SMS_ERROR_IDENTIFIER_EMPTY_FIELDS, DONGLE_FIRMWARE_UPDATING_EXCEPTION.
16
+ *
17
+ * Capability the role of an organization API key needs: `sms.send`.
18
+ */
19
+ send(dongleId: number, params: SmsSendParams, options?: RequestOptions): Promise<Sms>;
20
+ /**
21
+ * Send SMS to contact.
22
+ *
23
+ * Sends an SMS from the modem to the phone number of a contact, now or at scheduled_at.
24
+ *
25
+ * @param dongleId - ID of the dongle
26
+ *
27
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, CONTACT_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, SMS_ERROR_IDENTIFIER_EMPTY_FIELDS, DONGLE_FIRMWARE_UPDATING_EXCEPTION.
28
+ *
29
+ * Capability the role of an organization API key needs: `sms.send`.
30
+ */
31
+ sendToContact(dongleId: number, params: SmsSendToContactParams, options?: RequestOptions): Promise<Sms>;
32
+ /**
33
+ * Reply to SMS.
34
+ *
35
+ * Sends an SMS in reply to an SMS of the modem, to its sender; the new SMS carries replied_to_sms_id.
36
+ *
37
+ * @param dongleId - ID of the dongle
38
+ *
39
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, SMS_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, SMS_ERROR_IDENTIFIER_EMPTY_FIELDS, DONGLE_FIRMWARE_UPDATING_EXCEPTION.
40
+ *
41
+ * Capability the role of an organization API key needs: `sms.send`.
42
+ */
43
+ reply(dongleId: number, params: SmsReplyParams, options?: RequestOptions): Promise<Sms>;
44
+ /**
45
+ * List SMS threads.
46
+ *
47
+ * Conversation view: the last SMS per phone number of the modem, newest first.
48
+ *
49
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
50
+ *
51
+ * Capability the role of an organization API key needs: `sms.view`.
52
+ */
53
+ listThreads(params?: SmsListThreadsParams, options?: RequestOptions): PagePromise<SmsThread>;
54
+ /**
55
+ * List SMS.
56
+ *
57
+ * SMS of all modems of the account, incoming and outgoing. Newest first by default (created_at descending, then the id descending).
58
+ *
59
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, SMS_ERROR_IDENTIFIER_INVALID_SMS_TYPE.
60
+ *
61
+ * Capability the role of an organization API key needs: `sms.view`.
62
+ */
63
+ list(params?: SmsListParams, options?: RequestOptions): PagePromise<Sms>;
64
+ /**
65
+ * List modem SMS.
66
+ *
67
+ * SMS of one modem, incoming and outgoing. Newest first by default (created_at descending, then the id descending).
68
+ *
69
+ * @param dongleId - Identifier in the path
70
+ *
71
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, SMS_ERROR_IDENTIFIER_INVALID_SMS_TYPE.
72
+ *
73
+ * Capability the role of an organization API key needs: `sms.view`.
74
+ */
75
+ listForDongle(dongleId: number, params?: SmsListForDongleParams, options?: RequestOptions): PagePromise<Sms>;
76
+ /**
77
+ * Get SMS.
78
+ *
79
+ * One SMS of the modem.
80
+ *
81
+ * @param dongleId - Identifier in the path
82
+ * @param smsId - Identifier in the path
83
+ *
84
+ * Error codes (`errorMessage`): SMS_ERROR_ERROR_SMS_NOT_FOUND.
85
+ *
86
+ * Capability the role of an organization API key needs: `sms.view`.
87
+ */
88
+ get(dongleId: number, smsId: number, options?: RequestOptions): Promise<Sms>;
89
+ /**
90
+ * Update SMS.
91
+ *
92
+ * Changes a scheduled SMS (sms_type_id 5) that is not sent yet: number, text, contact, scheduled_at; omitted fields keep their values. Any other SMS answers SMS_ERROR_ERROR_SMS_NOT_FOUND.
93
+ *
94
+ * @param dongleId - Identifier in the path
95
+ * @param smsId - Identifier in the path
96
+ *
97
+ * Error codes (`errorMessage`): SMS_ERROR_ERROR_SMS_NOT_FOUND, DONGLE_ERROR_DONGLE_NOT_FOUND, CONTACT_ERROR_IDENTIFIER_CONTACT_NOT_FOUND, SMS_ERROR_IDENTIFIER_INVALID_SMS_TYPE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, PARSING_DATE_TIME_EXCEPTION.
98
+ *
99
+ * Capability the role of an organization API key needs: `sms.send`.
100
+ */
101
+ update(dongleId: number, smsId: number, params?: SmsUpdateParams, options?: RequestOptions): Promise<Sms>;
102
+ /**
103
+ * Delete SMS.
104
+ *
105
+ * Deletes the SMS from the history of the modem. An SMS in status 1 (Sended) or 5 (Enqueued) cannot be deleted and answers SMS_ERROR_ERROR_SMS_NOT_FOUND.
106
+ *
107
+ * @param dongleId - Identifier in the path
108
+ * @param smsId - Identifier in the path
109
+ *
110
+ * Error codes (`errorMessage`): SMS_ERROR_ERROR_SMS_NOT_FOUND.
111
+ *
112
+ * Capability the role of an organization API key needs: `sms.send`.
113
+ */
114
+ delete(dongleId: number, smsId: number, options?: RequestOptions): Promise<void>;
115
+ }
116
+ //# sourceMappingURL=sms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../../src/resources/sms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,sBAAsB,EACtB,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAE5B,6DAA6D;AAC7D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAcrF;;;;;;;;;;OAUG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IASvG;;;;;;;;;;OAUG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAavF;;;;;;;;OAQG;IACH,WAAW,CAAC,MAAM,GAAE,oBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,SAAS,CAAC;IAQhG;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,GAAE,aAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,GAAG,CAAC;IAmB5E;;;;;;;;;;OAUG;IACH,aAAa,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,sBAA2B,EACnC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,GAAG,CAAC;IAiBnB;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;IAM5E;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,eAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,GAAG,CAAC;IAef;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAKjF"}
@@ -0,0 +1,203 @@
1
+ // File generated from spec/openapi.yaml by scripts/generate.mjs. Do not edit by hand.
2
+ import { APIResource } from '../resource.js';
3
+ import { pathParam } from '../utils.js';
4
+ /** SMS of the modems: history, sending, replies, threads. */
5
+ export class SmsResource extends APIResource {
6
+ /**
7
+ * Send SMS.
8
+ *
9
+ * Sends an SMS from the modem to a phone number, now or at scheduled_at. sms_status_id 1 (Sended) means the modem took it for the mobile network, not that the handset received it: delivery is confirmed by 2 (from the delivery report), and 3 means it was not delivered or no report came within about 5 minutes.
10
+ *
11
+ * @param dongleId - ID of the dongle
12
+ *
13
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, SMS_ERROR_INVALID_RECEIVER_NUMBER, SMS_ERROR_IDENTIFIER_INVALID_CALLBACK_URL, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, SMS_ERROR_IDENTIFIER_EMPTY_FIELDS, DONGLE_FIRMWARE_UPDATING_EXCEPTION.
14
+ *
15
+ * Capability the role of an organization API key needs: `sms.send`.
16
+ */
17
+ send(dongleId, params, options) {
18
+ return this._client
19
+ .request('POST', `/dongle/${pathParam(dongleId)}/outgoing-sms`, {
20
+ body: {
21
+ number: params.number,
22
+ message: params.message,
23
+ scheduled_at: params.scheduled_at,
24
+ callback_url: params.callback_url,
25
+ },
26
+ options,
27
+ })
28
+ .then((data) => data);
29
+ }
30
+ /**
31
+ * Send SMS to contact.
32
+ *
33
+ * Sends an SMS from the modem to the phone number of a contact, now or at scheduled_at.
34
+ *
35
+ * @param dongleId - ID of the dongle
36
+ *
37
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, CONTACT_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, SMS_ERROR_IDENTIFIER_EMPTY_FIELDS, DONGLE_FIRMWARE_UPDATING_EXCEPTION.
38
+ *
39
+ * Capability the role of an organization API key needs: `sms.send`.
40
+ */
41
+ sendToContact(dongleId, params, options) {
42
+ return this._client
43
+ .request('POST', `/dongle/${pathParam(dongleId)}/outgoing-contact-sms`, {
44
+ body: { contact_id: params.contact_id, message: params.message, scheduled_at: params.scheduled_at },
45
+ options,
46
+ })
47
+ .then((data) => data);
48
+ }
49
+ /**
50
+ * Reply to SMS.
51
+ *
52
+ * Sends an SMS in reply to an SMS of the modem, to its sender; the new SMS carries replied_to_sms_id.
53
+ *
54
+ * @param dongleId - ID of the dongle
55
+ *
56
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, SMS_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, SMS_ERROR_IDENTIFIER_EMPTY_FIELDS, DONGLE_FIRMWARE_UPDATING_EXCEPTION.
57
+ *
58
+ * Capability the role of an organization API key needs: `sms.send`.
59
+ */
60
+ reply(dongleId, params, options) {
61
+ return this._client
62
+ .request('POST', `/dongle/${pathParam(dongleId)}/reply-sms`, {
63
+ body: {
64
+ replied_to_sms_id: params.replied_to_sms_id,
65
+ message: params.message,
66
+ scheduled_at: params.scheduled_at,
67
+ },
68
+ options,
69
+ })
70
+ .then((data) => data);
71
+ }
72
+ /**
73
+ * List SMS threads.
74
+ *
75
+ * Conversation view: the last SMS per phone number of the modem, newest first.
76
+ *
77
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
78
+ *
79
+ * Capability the role of an organization API key needs: `sms.view`.
80
+ */
81
+ listThreads(params = {}, options) {
82
+ return this._client.getPage('/sms/thread', {
83
+ query: { dongle_id: params.dongle_id, page: params.page, limit: params.limit },
84
+ itemKey: 'sms_threads',
85
+ options,
86
+ });
87
+ }
88
+ /**
89
+ * List SMS.
90
+ *
91
+ * SMS of all modems of the account, incoming and outgoing. Newest first by default (created_at descending, then the id descending).
92
+ *
93
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, SMS_ERROR_IDENTIFIER_INVALID_SMS_TYPE.
94
+ *
95
+ * Capability the role of an organization API key needs: `sms.view`.
96
+ */
97
+ list(params = {}, options) {
98
+ return this._client.getPage('/sms', {
99
+ query: {
100
+ 'sms_type_ids[]': params.sms_type_ids,
101
+ 'mailing_history_ids[]': params.mailing_history_ids,
102
+ page: params.page,
103
+ limit: params.limit,
104
+ 'dongle_ids[]': params.dongle_ids,
105
+ number: params.number,
106
+ from: params.from,
107
+ to: params.to,
108
+ order_by: params.order_by,
109
+ order: params.order,
110
+ },
111
+ itemKey: 'smses',
112
+ options,
113
+ });
114
+ }
115
+ /**
116
+ * List modem SMS.
117
+ *
118
+ * SMS of one modem, incoming and outgoing. Newest first by default (created_at descending, then the id descending).
119
+ *
120
+ * @param dongleId - Identifier in the path
121
+ *
122
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, PARSING_DATE_TIME_EXCEPTION, SMS_ERROR_IDENTIFIER_INVALID_SMS_TYPE.
123
+ *
124
+ * Capability the role of an organization API key needs: `sms.view`.
125
+ */
126
+ listForDongle(dongleId, params = {}, options) {
127
+ return this._client.getPage(`/dongle/${pathParam(dongleId)}/sms`, {
128
+ query: {
129
+ 'sms_type_ids[]': params.sms_type_ids,
130
+ number: params.number,
131
+ from: params.from,
132
+ to: params.to,
133
+ page: params.page,
134
+ limit: params.limit,
135
+ order_by: params.order_by,
136
+ order: params.order,
137
+ },
138
+ itemKey: 'smses',
139
+ options,
140
+ });
141
+ }
142
+ /**
143
+ * Get SMS.
144
+ *
145
+ * One SMS of the modem.
146
+ *
147
+ * @param dongleId - Identifier in the path
148
+ * @param smsId - Identifier in the path
149
+ *
150
+ * Error codes (`errorMessage`): SMS_ERROR_ERROR_SMS_NOT_FOUND.
151
+ *
152
+ * Capability the role of an organization API key needs: `sms.view`.
153
+ */
154
+ get(dongleId, smsId, options) {
155
+ return this._client
156
+ .request('GET', `/dongle/${pathParam(dongleId)}/sms/${pathParam(smsId)}`, { options })
157
+ .then((data) => data);
158
+ }
159
+ /**
160
+ * Update SMS.
161
+ *
162
+ * Changes a scheduled SMS (sms_type_id 5) that is not sent yet: number, text, contact, scheduled_at; omitted fields keep their values. Any other SMS answers SMS_ERROR_ERROR_SMS_NOT_FOUND.
163
+ *
164
+ * @param dongleId - Identifier in the path
165
+ * @param smsId - Identifier in the path
166
+ *
167
+ * Error codes (`errorMessage`): SMS_ERROR_ERROR_SMS_NOT_FOUND, DONGLE_ERROR_DONGLE_NOT_FOUND, CONTACT_ERROR_IDENTIFIER_CONTACT_NOT_FOUND, SMS_ERROR_IDENTIFIER_INVALID_SMS_TYPE, SMS_ERROR_IDENTIFIER_LONG_MESSAGE, SMS_ERROR_IDENTIFIER_EMPTY_MESSAGE, SMS_ERROR_IDENTIFIER_INVALID_SCHEDULED_AT, PARSING_DATE_TIME_EXCEPTION.
168
+ *
169
+ * Capability the role of an organization API key needs: `sms.send`.
170
+ */
171
+ update(dongleId, smsId, params = {}, options) {
172
+ return this._client
173
+ .request('PUT', `/dongle/${pathParam(dongleId)}/sms/${pathParam(smsId)}`, {
174
+ body: {
175
+ number: params.number,
176
+ message: params.message,
177
+ contact_id: params.contact_id,
178
+ dongle_id: params.dongle_id,
179
+ scheduled_at: params.scheduled_at,
180
+ },
181
+ options,
182
+ })
183
+ .then((data) => data);
184
+ }
185
+ /**
186
+ * Delete SMS.
187
+ *
188
+ * Deletes the SMS from the history of the modem. An SMS in status 1 (Sended) or 5 (Enqueued) cannot be deleted and answers SMS_ERROR_ERROR_SMS_NOT_FOUND.
189
+ *
190
+ * @param dongleId - Identifier in the path
191
+ * @param smsId - Identifier in the path
192
+ *
193
+ * Error codes (`errorMessage`): SMS_ERROR_ERROR_SMS_NOT_FOUND.
194
+ *
195
+ * Capability the role of an organization API key needs: `sms.send`.
196
+ */
197
+ delete(dongleId, smsId, options) {
198
+ return this._client
199
+ .request('DELETE', `/dongle/${pathParam(dongleId)}/sms/${pathParam(smsId)}`, { options })
200
+ .then(() => undefined);
201
+ }
202
+ }
203
+ //# sourceMappingURL=sms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms.js","sourceRoot":"","sources":["../../src/resources/sms.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAW7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,6DAA6D;AAC7D,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,IAAI,CAAC,QAAgB,EAAE,MAAqB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,MAAM,EAAE,WAAW,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC9D,IAAI,EAAE;gBACJ,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,YAAY,EAAE,MAAM,CAAC,YAAY;aAClC;YACD,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAW,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;;;OAUG;IACH,aAAa,CAAC,QAAgB,EAAE,MAA8B,EAAE,OAAwB;QACtF,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,MAAM,EAAE,WAAW,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE;YACtE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAA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,CAAC,OAAO;aAChB,OAAO,CAAC,KAAK,EAAE,WAAW,SAAS,CAAC,QAAQ,CAAC,QAAQ,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE;YACxE,IAAI,EAAE;gBACJ,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,YAAY,EAAE,MAAM,CAAC,YAAY;aAClC;YACD,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAW,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,QAAgB,EAAE,KAAa,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO;aAChB,OAAO,CAAC,QAAQ,EAAE,WAAW,SAAS,CAAC,QAAQ,CAAC,QAAQ,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;aACxF,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ import type { RequestOptions } from '../core.js';
2
+ import type { PagePromise } from '../pagination.js';
3
+ import { APIResource } from '../resource.js';
4
+ import type { DongleSocksProxy } from '../types/models.js';
5
+ import type { SocksProxiesCreateParams, SocksProxiesListParams, SocksProxiesUpdateParams } from '../types/params.js';
6
+ /** SOCKS5 proxy through the mobile network of a modem. */
7
+ export declare class SocksProxiesResource extends APIResource {
8
+ /**
9
+ * List SOCKS proxies.
10
+ *
11
+ * SOCKS5 proxies of the modems of the account. Newest first by default (created_at descending, then the id descending).
12
+ *
13
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION.
14
+ *
15
+ * Capability the role of an organization API key needs: `network.view`.
16
+ */
17
+ list(params?: SocksProxiesListParams, options?: RequestOptions): PagePromise<DongleSocksProxy>;
18
+ /**
19
+ * Create SOCKS proxy.
20
+ *
21
+ * One proxy per modem; the login is generated by the server. The proxy routes traffic through the mobile network of the modem.
22
+ *
23
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, PASSWORD_TOO_SHORT_EXCEPTION, ALLOWED_IPS_NOT_VALID_EXCEPTION, DONGLE_SOCKS_PROXY_ALREADY_EXISTS_EXCEPTION.
24
+ *
25
+ * Capability the role of an organization API key needs: `network.manage`.
26
+ */
27
+ create(params: SocksProxiesCreateParams, options?: RequestOptions): Promise<DongleSocksProxy>;
28
+ /**
29
+ * Get SOCKS proxy.
30
+ *
31
+ * One SOCKS5 proxy of a modem of the account.
32
+ *
33
+ * @param dongleSocksProxyId - Identifier in the path
34
+ *
35
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_SOCKS_PROXY_NOT_FOUND_EXCEPTION.
36
+ *
37
+ * Capability the role of an organization API key needs: `network.view`.
38
+ */
39
+ get(dongleSocksProxyId: number, options?: RequestOptions): Promise<DongleSocksProxy>;
40
+ /**
41
+ * Update SOCKS proxy.
42
+ *
43
+ * Replaces the password and the allowed client addresses of the proxy.
44
+ *
45
+ * @param dongleSocksProxyId - Identifier in the path
46
+ *
47
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_SOCKS_PROXY_NOT_FOUND_EXCEPTION, DONGLE_NOT_FOUND_EXCEPTION, BILLING_ERROR_IDENTIFIER_DONGLE_SUBSCRIPTION_NOT_ACTIVE, PASSWORD_TOO_SHORT_EXCEPTION, ALLOWED_IPS_NOT_VALID_EXCEPTION.
48
+ *
49
+ * Capability the role of an organization API key needs: `network.manage`.
50
+ */
51
+ update(dongleSocksProxyId: number, params: SocksProxiesUpdateParams, options?: RequestOptions): Promise<DongleSocksProxy>;
52
+ /**
53
+ * Delete SOCKS proxy.
54
+ *
55
+ * Deletes the proxy; its credentials stop working.
56
+ *
57
+ * @param dongleSocksProxyId - Identifier in the path
58
+ *
59
+ * Error codes (`errorMessage`): REQUEST_VALIDATION_EXCEPTION, DONGLE_SOCKS_PROXY_NOT_FOUND_EXCEPTION.
60
+ *
61
+ * Capability the role of an organization API key needs: `network.manage`.
62
+ */
63
+ delete(dongleSocksProxyId: number, options?: RequestOptions): Promise<boolean>;
64
+ }
65
+ //# sourceMappingURL=socks-proxies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socks-proxies.d.ts","sourceRoot":"","sources":["../../src/resources/socks-proxies.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAE5B,0DAA0D;AAC1D,qBAAa,oBAAqB,SAAQ,WAAW;IACnD;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,GAAE,sBAA2B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAQlG;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAS7F;;;;;;;;;;OAUG;IACH,GAAG,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMpF;;;;;;;;;;OAUG;IACH,MAAM,CACJ,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,gBAAgB,CAAC;IAS5B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;CAK/E"}