@ngrok/ngrok-api 0.9.0 → 0.11.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 (293) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +2 -0
  3. package/.prettierrc.js +2 -0
  4. package/CHANGELOG.md +16 -3
  5. package/CODE_OF_CONDUCT.md +45 -0
  6. package/README.md +9 -3
  7. package/docs/assets/js/search.js +1 -1
  8. package/docs/classes/client.Ngrok.html +82 -28
  9. package/docs/classes/services.APIKeys.html +20 -11
  10. package/docs/classes/services.AbuseReports.html +5 -5
  11. package/docs/classes/services.AgentIngresses.html +20 -11
  12. package/docs/classes/services.ApplicationSessions.html +288 -0
  13. package/docs/classes/services.ApplicationUsers.html +288 -0
  14. package/docs/classes/services.BotUsers.html +352 -0
  15. package/docs/classes/services.CertificateAuthorities.html +20 -11
  16. package/docs/classes/services.Credentials.html +21 -12
  17. package/docs/classes/services.EdgeRouteBackendModule.html +4 -4
  18. package/docs/classes/services.EdgeRouteCircuitBreakerModule.html +4 -4
  19. package/docs/classes/services.EdgeRouteCompressionModule.html +4 -4
  20. package/docs/classes/services.EdgeRouteIPRestrictionModule.html +4 -4
  21. package/docs/classes/services.EdgeRouteOAuthModule.html +4 -4
  22. package/docs/classes/services.EdgeRouteOIDCModule.html +4 -4
  23. package/docs/classes/services.EdgeRoutePolicyModule.html +270 -0
  24. package/docs/classes/services.EdgeRouteRequestHeadersModule.html +4 -4
  25. package/docs/classes/services.EdgeRouteResponseHeadersModule.html +4 -4
  26. package/docs/classes/services.EdgeRouteSAMLModule.html +4 -4
  27. package/docs/classes/services.EdgeRouteUserAgentFilterModule.html +270 -0
  28. package/docs/classes/services.EdgeRouteWebhookVerificationModule.html +4 -4
  29. package/docs/classes/services.EdgeRouteWebsocketTCPConverterModule.html +4 -4
  30. package/docs/classes/services.EdgesHTTPS.html +20 -11
  31. package/docs/classes/services.EdgesHTTPSRoutes.html +5 -5
  32. package/docs/classes/services.EdgesTCP.html +20 -11
  33. package/docs/classes/services.EdgesTLS.html +20 -11
  34. package/docs/classes/services.Endpoints.html +15 -6
  35. package/docs/classes/services.EventDestinations.html +21 -12
  36. package/docs/classes/services.EventSources.html +6 -6
  37. package/docs/classes/services.EventSubscriptions.html +20 -11
  38. package/docs/classes/services.FailoverBackends.html +20 -11
  39. package/docs/classes/services.HTTPResponseBackends.html +20 -11
  40. package/docs/classes/services.HTTPSEdgeMutualTLSModule.html +8 -8
  41. package/docs/classes/services.HTTPSEdgeTLSTerminationModule.html +8 -8
  42. package/docs/classes/services.IPPolicies.html +20 -11
  43. package/docs/classes/services.IPPolicyRules.html +20 -11
  44. package/docs/classes/services.IPRestrictions.html +20 -11
  45. package/docs/classes/services.ReservedAddrs.html +20 -11
  46. package/docs/classes/services.ReservedDomains.html +26 -17
  47. package/docs/classes/services.SSHCertificateAuthorities.html +20 -11
  48. package/docs/classes/services.SSHCredentials.html +20 -11
  49. package/docs/classes/services.SSHHostCertificates.html +20 -11
  50. package/docs/classes/services.SSHUserCertificates.html +20 -11
  51. package/docs/classes/services.StaticBackends.html +360 -0
  52. package/docs/classes/services.TCPEdgeBackendModule.html +8 -8
  53. package/docs/classes/services.TCPEdgeIPRestrictionModule.html +8 -8
  54. package/docs/classes/services.TCPEdgePolicyModule.html +270 -0
  55. package/docs/classes/services.TLSCertificates.html +20 -11
  56. package/docs/classes/services.TLSEdgeBackendModule.html +8 -8
  57. package/docs/classes/services.TLSEdgeIPRestrictionModule.html +8 -8
  58. package/docs/classes/services.TLSEdgeMutualTLSModule.html +8 -8
  59. package/docs/classes/services.TLSEdgePolicyModule.html +270 -0
  60. package/docs/classes/services.TLSEdgeTLSTerminationModule.html +8 -8
  61. package/docs/classes/services.TunnelGroupBackends.html +20 -11
  62. package/docs/classes/services.TunnelSessions.html +22 -13
  63. package/docs/classes/services.Tunnels.html +15 -6
  64. package/docs/classes/services.WeightedBackends.html +20 -11
  65. package/docs/index.html +8 -3
  66. package/docs/interfaces/client.NgrokConfig.html +3 -3
  67. package/docs/interfaces/datatypes.APIKey.html +28 -9
  68. package/docs/interfaces/datatypes.APIKeyCreate.html +23 -4
  69. package/docs/interfaces/datatypes.APIKeyList.html +3 -3
  70. package/docs/interfaces/datatypes.APIKeyUpdate.html +3 -3
  71. package/docs/interfaces/datatypes.AWSAuth.html +2 -2
  72. package/docs/interfaces/datatypes.AWSCredentials.html +2 -2
  73. package/docs/interfaces/datatypes.AWSRole.html +1 -1
  74. package/docs/interfaces/datatypes.AbuseReport.html +9 -9
  75. package/docs/interfaces/datatypes.AbuseReportCreate.html +3 -3
  76. package/docs/interfaces/datatypes.AbuseReportHostname.html +2 -2
  77. package/docs/interfaces/datatypes.AgentIngress.html +49 -11
  78. package/docs/interfaces/datatypes.AgentIngressCertJob.html +224 -0
  79. package/docs/interfaces/datatypes.AgentIngressCertPolicy.html +186 -0
  80. package/docs/interfaces/datatypes.AgentIngressCertStatus.html +186 -0
  81. package/docs/interfaces/datatypes.AgentIngressCreate.html +24 -5
  82. package/docs/interfaces/datatypes.AgentIngressList.html +3 -3
  83. package/docs/interfaces/datatypes.AgentIngressUpdate.html +22 -3
  84. package/docs/interfaces/datatypes.ApplicationSession.html +357 -0
  85. package/docs/interfaces/datatypes.ApplicationSessionList.html +205 -0
  86. package/docs/interfaces/datatypes.ApplicationUser.html +338 -0
  87. package/docs/interfaces/datatypes.ApplicationUserList.html +205 -0
  88. package/docs/interfaces/datatypes.BotUser.html +243 -0
  89. package/docs/interfaces/datatypes.BotUserCreate.html +186 -0
  90. package/docs/interfaces/datatypes.BotUserList.html +205 -0
  91. package/docs/interfaces/datatypes.BotUserUpdate.html +200 -0
  92. package/docs/interfaces/datatypes.BrowserSession.html +205 -0
  93. package/docs/interfaces/datatypes.CertificateAuthority.html +16 -16
  94. package/docs/interfaces/datatypes.CertificateAuthorityCreate.html +5 -5
  95. package/docs/interfaces/datatypes.CertificateAuthorityList.html +3 -3
  96. package/docs/interfaces/datatypes.CertificateAuthorityUpdate.html +3 -3
  97. package/docs/interfaces/datatypes.Credential.html +30 -11
  98. package/docs/interfaces/datatypes.CredentialCreate.html +25 -6
  99. package/docs/interfaces/datatypes.CredentialList.html +3 -3
  100. package/docs/interfaces/datatypes.CredentialUpdate.html +5 -5
  101. package/docs/interfaces/datatypes.EdgeBackendReplace.html +2 -2
  102. package/docs/interfaces/datatypes.EdgeIPRestrictionReplace.html +2 -2
  103. package/docs/interfaces/datatypes.EdgeMutualTLSReplace.html +2 -2
  104. package/docs/interfaces/datatypes.EdgePolicyReplace.html +176 -0
  105. package/docs/interfaces/datatypes.EdgeRouteBackendReplace.html +3 -3
  106. package/docs/interfaces/datatypes.EdgeRouteCircuitBreakerReplace.html +3 -3
  107. package/docs/interfaces/datatypes.EdgeRouteCompressionReplace.html +3 -3
  108. package/docs/interfaces/datatypes.EdgeRouteIPRestrictionReplace.html +3 -3
  109. package/docs/interfaces/datatypes.EdgeRouteItem.html +2 -2
  110. package/docs/interfaces/datatypes.EdgeRouteOAuthReplace.html +3 -3
  111. package/docs/interfaces/datatypes.EdgeRouteOIDCReplace.html +3 -3
  112. package/docs/interfaces/datatypes.EdgeRoutePolicyReplace.html +190 -0
  113. package/docs/interfaces/datatypes.EdgeRouteRequestHeadersReplace.html +3 -3
  114. package/docs/interfaces/datatypes.EdgeRouteResponseHeadersReplace.html +3 -3
  115. package/docs/interfaces/datatypes.EdgeRouteSAMLReplace.html +3 -3
  116. package/docs/interfaces/datatypes.EdgeRouteUserAgentFilterReplace.html +190 -0
  117. package/docs/interfaces/datatypes.EdgeRouteWebhookVerificationReplace.html +3 -3
  118. package/docs/interfaces/datatypes.EdgeRouteWebsocketTCPConverterReplace.html +3 -3
  119. package/docs/interfaces/datatypes.EdgeTLSTerminationAtEdgeReplace.html +2 -2
  120. package/docs/interfaces/datatypes.EdgeTLSTerminationReplace.html +2 -2
  121. package/docs/interfaces/datatypes.Endpoint.html +19 -19
  122. package/docs/interfaces/datatypes.EndpointAction.html +186 -0
  123. package/docs/interfaces/datatypes.EndpointBackend.html +2 -2
  124. package/docs/interfaces/datatypes.EndpointBackendMutate.html +2 -2
  125. package/docs/interfaces/datatypes.EndpointCircuitBreaker.html +6 -6
  126. package/docs/interfaces/datatypes.EndpointCompression.html +1 -1
  127. package/docs/interfaces/datatypes.EndpointIPPolicy.html +7 -2
  128. package/docs/interfaces/datatypes.EndpointIPPolicyMutate.html +2 -2
  129. package/docs/interfaces/datatypes.EndpointList.html +3 -3
  130. package/docs/interfaces/datatypes.EndpointMutualTLS.html +2 -2
  131. package/docs/interfaces/datatypes.EndpointMutualTLSMutate.html +2 -2
  132. package/docs/interfaces/datatypes.EndpointOAuth.html +7 -7
  133. package/docs/interfaces/datatypes.EndpointOAuthAmazon.html +218 -0
  134. package/docs/interfaces/datatypes.EndpointOAuthFacebook.html +5 -5
  135. package/docs/interfaces/datatypes.EndpointOAuthGitHub.html +12 -12
  136. package/docs/interfaces/datatypes.EndpointOAuthGitLab.html +218 -0
  137. package/docs/interfaces/datatypes.EndpointOAuthGoogle.html +5 -5
  138. package/docs/interfaces/datatypes.EndpointOAuthLinkedIn.html +218 -0
  139. package/docs/interfaces/datatypes.EndpointOAuthMicrosoft.html +5 -5
  140. package/docs/interfaces/datatypes.EndpointOAuthProvider.html +80 -4
  141. package/docs/interfaces/datatypes.EndpointOAuthTwitch.html +218 -0
  142. package/docs/interfaces/datatypes.EndpointOIDC.html +9 -9
  143. package/docs/interfaces/datatypes.EndpointPolicy.html +205 -0
  144. package/docs/interfaces/datatypes.EndpointRequestHeaders.html +3 -3
  145. package/docs/interfaces/datatypes.EndpointResponseHeaders.html +3 -3
  146. package/docs/interfaces/datatypes.EndpointRule.html +205 -0
  147. package/docs/interfaces/datatypes.EndpointSAML.html +15 -15
  148. package/docs/interfaces/datatypes.EndpointSAMLMutate.html +10 -10
  149. package/docs/interfaces/datatypes.EndpointTLSTermination.html +3 -3
  150. package/docs/interfaces/datatypes.EndpointTLSTerminationAtEdge.html +2 -2
  151. package/docs/interfaces/datatypes.EndpointUserAgentFilter.html +190 -0
  152. package/docs/interfaces/datatypes.EndpointWebhookValidation.html +4 -4
  153. package/docs/interfaces/datatypes.EndpointWebsocketTCPConverter.html +1 -1
  154. package/docs/interfaces/datatypes.Error.html +4 -4
  155. package/docs/interfaces/datatypes.EventDestination.html +10 -10
  156. package/docs/interfaces/datatypes.EventDestinationCreate.html +6 -6
  157. package/docs/interfaces/datatypes.EventDestinationList.html +3 -3
  158. package/docs/interfaces/datatypes.EventDestinationUpdate.html +5 -5
  159. package/docs/interfaces/datatypes.EventSource.html +2 -2
  160. package/docs/interfaces/datatypes.EventSourceCreate.html +2 -2
  161. package/docs/interfaces/datatypes.EventSourceItem.html +2 -2
  162. package/docs/interfaces/datatypes.EventSourceList.html +2 -2
  163. package/docs/interfaces/datatypes.EventSourcePaging.html +1 -1
  164. package/docs/interfaces/datatypes.EventSourceReplace.html +1 -1
  165. package/docs/interfaces/datatypes.EventSourceUpdate.html +2 -2
  166. package/docs/interfaces/datatypes.EventSubscription.html +10 -10
  167. package/docs/interfaces/datatypes.EventSubscriptionCreate.html +6 -6
  168. package/docs/interfaces/datatypes.EventSubscriptionList.html +3 -3
  169. package/docs/interfaces/datatypes.EventSubscriptionUpdate.html +5 -5
  170. package/docs/interfaces/datatypes.EventTarget.html +22 -3
  171. package/docs/interfaces/datatypes.EventTargetCloudwatchLogs.html +2 -2
  172. package/docs/interfaces/datatypes.EventTargetDatadog.html +224 -0
  173. package/docs/interfaces/datatypes.EventTargetFirehose.html +2 -2
  174. package/docs/interfaces/datatypes.EventTargetKinesis.html +2 -2
  175. package/docs/interfaces/datatypes.FailoverBackend.html +9 -9
  176. package/docs/interfaces/datatypes.FailoverBackendCreate.html +5 -5
  177. package/docs/interfaces/datatypes.FailoverBackendList.html +3 -3
  178. package/docs/interfaces/datatypes.FailoverBackendUpdate.html +4 -4
  179. package/docs/interfaces/datatypes.HTTPResponseBackend.html +11 -11
  180. package/docs/interfaces/datatypes.HTTPResponseBackendCreate.html +7 -7
  181. package/docs/interfaces/datatypes.HTTPResponseBackendList.html +3 -3
  182. package/docs/interfaces/datatypes.HTTPResponseBackendUpdate.html +6 -6
  183. package/docs/interfaces/datatypes.HTTPSEdge.html +12 -12
  184. package/docs/interfaces/datatypes.HTTPSEdgeCreate.html +7 -7
  185. package/docs/interfaces/datatypes.HTTPSEdgeList.html +3 -3
  186. package/docs/interfaces/datatypes.HTTPSEdgeRoute.html +55 -22
  187. package/docs/interfaces/datatypes.HTTPSEdgeRouteCreate.html +51 -18
  188. package/docs/interfaces/datatypes.HTTPSEdgeRouteUpdate.html +52 -19
  189. package/docs/interfaces/datatypes.HTTPSEdgeUpdate.html +6 -6
  190. package/docs/interfaces/datatypes.IPPolicy.html +8 -8
  191. package/docs/interfaces/datatypes.IPPolicyCreate.html +4 -4
  192. package/docs/interfaces/datatypes.IPPolicyList.html +3 -3
  193. package/docs/interfaces/datatypes.IPPolicyRule.html +11 -11
  194. package/docs/interfaces/datatypes.IPPolicyRuleCreate.html +7 -7
  195. package/docs/interfaces/datatypes.IPPolicyRuleList.html +3 -3
  196. package/docs/interfaces/datatypes.IPPolicyRuleUpdate.html +4 -4
  197. package/docs/interfaces/datatypes.IPPolicyUpdate.html +3 -3
  198. package/docs/interfaces/datatypes.IPRestriction.html +11 -11
  199. package/docs/interfaces/datatypes.IPRestrictionCreate.html +7 -7
  200. package/docs/interfaces/datatypes.IPRestrictionList.html +3 -3
  201. package/docs/interfaces/datatypes.IPRestrictionUpdate.html +5 -5
  202. package/docs/interfaces/datatypes.IdentityProvider.html +186 -0
  203. package/docs/interfaces/datatypes.Item.html +1 -1
  204. package/docs/interfaces/datatypes.Location.html +224 -0
  205. package/docs/interfaces/datatypes.Paging.html +2 -2
  206. package/docs/interfaces/datatypes.Ref.html +2 -2
  207. package/docs/interfaces/datatypes.ReservedAddr.html +10 -10
  208. package/docs/interfaces/datatypes.ReservedAddrCreate.html +5 -5
  209. package/docs/interfaces/datatypes.ReservedAddrList.html +3 -3
  210. package/docs/interfaces/datatypes.ReservedAddrUpdate.html +3 -3
  211. package/docs/interfaces/datatypes.ReservedDomain.html +17 -17
  212. package/docs/interfaces/datatypes.ReservedDomainCertJob.html +6 -6
  213. package/docs/interfaces/datatypes.ReservedDomainCertPolicy.html +2 -2
  214. package/docs/interfaces/datatypes.ReservedDomainCertStatus.html +3 -3
  215. package/docs/interfaces/datatypes.ReservedDomainCreate.html +19 -19
  216. package/docs/interfaces/datatypes.ReservedDomainList.html +3 -3
  217. package/docs/interfaces/datatypes.ReservedDomainUpdate.html +5 -5
  218. package/docs/interfaces/datatypes.SSHCertificateAuthority.html +10 -10
  219. package/docs/interfaces/datatypes.SSHCertificateAuthorityCreate.html +7 -7
  220. package/docs/interfaces/datatypes.SSHCertificateAuthorityList.html +3 -3
  221. package/docs/interfaces/datatypes.SSHCertificateAuthorityUpdate.html +3 -3
  222. package/docs/interfaces/datatypes.SSHCredential.html +30 -11
  223. package/docs/interfaces/datatypes.SSHCredentialCreate.html +26 -7
  224. package/docs/interfaces/datatypes.SSHCredentialList.html +3 -3
  225. package/docs/interfaces/datatypes.SSHCredentialUpdate.html +5 -5
  226. package/docs/interfaces/datatypes.SSHHostCertificate.html +17 -17
  227. package/docs/interfaces/datatypes.SSHHostCertificateCreate.html +11 -11
  228. package/docs/interfaces/datatypes.SSHHostCertificateList.html +3 -3
  229. package/docs/interfaces/datatypes.SSHHostCertificateUpdate.html +3 -3
  230. package/docs/interfaces/datatypes.SSHUserCertificate.html +19 -19
  231. package/docs/interfaces/datatypes.SSHUserCertificateCreate.html +13 -13
  232. package/docs/interfaces/datatypes.SSHUserCertificateList.html +3 -3
  233. package/docs/interfaces/datatypes.SSHUserCertificateUpdate.html +3 -3
  234. package/docs/interfaces/datatypes.StaticBackend.html +281 -0
  235. package/docs/interfaces/datatypes.StaticBackendCreate.html +224 -0
  236. package/docs/interfaces/datatypes.StaticBackendList.html +205 -0
  237. package/docs/interfaces/datatypes.StaticBackendTLS.html +167 -0
  238. package/docs/interfaces/datatypes.StaticBackendUpdate.html +238 -0
  239. package/docs/interfaces/datatypes.TCPEdge.html +30 -11
  240. package/docs/interfaces/datatypes.TCPEdgeCreate.html +26 -7
  241. package/docs/interfaces/datatypes.TCPEdgeList.html +3 -3
  242. package/docs/interfaces/datatypes.TCPEdgeUpdate.html +25 -6
  243. package/docs/interfaces/datatypes.TLSCertificate.html +28 -28
  244. package/docs/interfaces/datatypes.TLSCertificateCreate.html +8 -8
  245. package/docs/interfaces/datatypes.TLSCertificateList.html +3 -3
  246. package/docs/interfaces/datatypes.TLSCertificateSANs.html +2 -2
  247. package/docs/interfaces/datatypes.TLSCertificateUpdate.html +3 -3
  248. package/docs/interfaces/datatypes.TLSEdge.html +32 -13
  249. package/docs/interfaces/datatypes.TLSEdgeCreate.html +28 -9
  250. package/docs/interfaces/datatypes.TLSEdgeList.html +3 -3
  251. package/docs/interfaces/datatypes.TLSEdgeUpdate.html +27 -8
  252. package/docs/interfaces/datatypes.Tunnel.html +17 -17
  253. package/docs/interfaces/datatypes.TunnelGroupBackend.html +10 -10
  254. package/docs/interfaces/datatypes.TunnelGroupBackendCreate.html +5 -5
  255. package/docs/interfaces/datatypes.TunnelGroupBackendList.html +3 -3
  256. package/docs/interfaces/datatypes.TunnelGroupBackendUpdate.html +4 -4
  257. package/docs/interfaces/datatypes.TunnelList.html +3 -3
  258. package/docs/interfaces/datatypes.TunnelSession.html +12 -12
  259. package/docs/interfaces/datatypes.TunnelSessionList.html +3 -3
  260. package/docs/interfaces/datatypes.TunnelSessionsUpdate.html +1 -1
  261. package/docs/interfaces/datatypes.UserAgent.html +262 -0
  262. package/docs/interfaces/datatypes.WeightedBackend.html +9 -9
  263. package/docs/interfaces/datatypes.WeightedBackendCreate.html +5 -5
  264. package/docs/interfaces/datatypes.WeightedBackendList.html +3 -3
  265. package/docs/interfaces/datatypes.WeightedBackendUpdate.html +4 -4
  266. package/docs/modules/datatypes.html +128 -0
  267. package/docs/modules/services.html +32 -0
  268. package/jest.config.js +2 -0
  269. package/lib/client.d.ts +17 -8
  270. package/lib/client.d.ts.map +1 -1
  271. package/lib/client.js +92 -119
  272. package/lib/client.js.map +1 -1
  273. package/lib/datatypes.d.ts +539 -204
  274. package/lib/datatypes.d.ts.map +1 -1
  275. package/lib/datatypes.js +4 -3
  276. package/lib/datatypes.js.map +1 -1
  277. package/lib/index.d.ts.map +1 -1
  278. package/lib/index.js +16 -28
  279. package/lib/index.js.map +1 -1
  280. package/lib/services.d.ts +254 -126
  281. package/lib/services.d.ts.map +1 -1
  282. package/lib/services.js +3613 -3356
  283. package/lib/services.js.map +1 -1
  284. package/lib/util.d.ts.map +1 -1
  285. package/lib/util.js +35 -34
  286. package/lib/util.js.map +1 -1
  287. package/package.json +4 -3
  288. package/src/client.ts +28 -33
  289. package/src/datatypes.ts +576 -207
  290. package/src/index.ts +2 -0
  291. package/src/services.ts +1136 -553
  292. package/src/util.ts +2 -0
  293. package/test/apikey.test.js +62 -63
package/src/services.ts CHANGED
@@ -1,3 +1,5 @@
1
+ // Code generated for API Clients. DO NOT EDIT.
2
+
1
3
  import { Wretcher } from 'wretch';
2
4
 
3
5
  import * as datatypes from './datatypes';
@@ -26,14 +28,13 @@ export class AbuseReports {
26
28
  .json(payload => util.deserializeResult(payload))
27
29
  .then(f => f, util.onRejected);
28
30
  }
29
-
30
31
  /**
31
32
  * Get the detailed status of abuse report by ID.
32
33
  */
33
- public get(arg: datatypes.Item): Promise<datatypes.AbuseReport> {
34
+ public get(id): Promise<datatypes.AbuseReport> {
34
35
  return this.httpClient
35
- .url(`/abuse_reports/${arg.id}`)
36
- .get()
36
+ .url(`/abuse_reports/${id}`)
37
+ .get(id)
37
38
  .json(payload => util.deserializeResult(payload))
38
39
  .then(f => f, util.onRejected);
39
40
  }
@@ -58,39 +59,40 @@ export class AgentIngresses {
58
59
  .json(payload => util.deserializeResult(payload))
59
60
  .then(f => f, util.onRejected);
60
61
  }
61
-
62
62
  /**
63
63
  * Delete an Agent Ingress by ID
64
64
  */
65
- public delete(arg: datatypes.Item): Promise<void> {
65
+ public delete(id): Promise<void> {
66
66
  return this.httpClient
67
- .url(`/agent_ingresses/${arg.id}`)
68
- .delete()
67
+ .url(`/agent_ingresses/${id}`)
68
+ .delete(id)
69
69
  .json(payload => util.deserializeResult(payload))
70
70
  .then(f => f, util.onRejected);
71
71
  }
72
-
73
72
  /**
74
73
  * Get the details of an Agent Ingress by ID.
75
74
  */
76
- public get(arg: datatypes.Item): Promise<datatypes.AgentIngress> {
75
+ public get(id): Promise<datatypes.AgentIngress> {
77
76
  return this.httpClient
78
- .url(`/agent_ingresses/${arg.id}`)
79
- .get()
77
+ .url(`/agent_ingresses/${id}`)
78
+ .get(id)
80
79
  .json(payload => util.deserializeResult(payload))
81
80
  .then(f => f, util.onRejected);
82
81
  }
83
-
84
82
  /**
85
83
  * List all Agent Ingresses owned by this account
86
84
  */
87
- public async list(): Promise<Array<datatypes.AgentIngress>> {
85
+ public async list(
86
+ beforeId?: string,
87
+ limit?: string
88
+ ): Promise<Array<datatypes.AgentIngress>> {
88
89
  const array: Array<datatypes.AgentIngress> = [];
89
- for await (const item of this._asyncList()) {
90
+ for await (const item of this._asyncList(beforeId, limit)) {
90
91
  array.push(item);
91
92
  }
92
93
  return array;
93
94
  }
95
+
94
96
  private _pagedList(
95
97
  arg: datatypes.Paging
96
98
  ): Promise<datatypes.AgentIngressList> {
@@ -101,11 +103,15 @@ export class AgentIngresses {
101
103
  .json(payload => util.deserializeResult(payload))
102
104
  .then(util.onFulfilled, util.onRejected);
103
105
  }
104
- private async *_asyncList() {
105
- const limit = '100';
106
+
107
+ private async *_asyncList(beforeId: string, limit = '100') {
106
108
  let nextPage = 'initial loop';
107
109
  let page: datatypes.Paging = { limit: limit };
108
110
 
111
+ if (beforeId) {
112
+ page.beforeId = beforeId;
113
+ }
114
+
109
115
  while (nextPage) {
110
116
  const pagedList = await this._pagedList(page);
111
117
  nextPage = pagedList.nextPageUri;
@@ -161,39 +167,40 @@ export class APIKeys {
161
167
  .json(payload => util.deserializeResult(payload))
162
168
  .then(f => f, util.onRejected);
163
169
  }
164
-
165
170
  /**
166
171
  * Delete an API key by ID
167
172
  */
168
- public delete(arg: datatypes.Item): Promise<void> {
173
+ public delete(id): Promise<void> {
169
174
  return this.httpClient
170
- .url(`/api_keys/${arg.id}`)
171
- .delete()
175
+ .url(`/api_keys/${id}`)
176
+ .delete(id)
172
177
  .json(payload => util.deserializeResult(payload))
173
178
  .then(f => f, util.onRejected);
174
179
  }
175
-
176
180
  /**
177
181
  * Get the details of an API key by ID.
178
182
  */
179
- public get(arg: datatypes.Item): Promise<datatypes.APIKey> {
183
+ public get(id): Promise<datatypes.APIKey> {
180
184
  return this.httpClient
181
- .url(`/api_keys/${arg.id}`)
182
- .get()
185
+ .url(`/api_keys/${id}`)
186
+ .get(id)
183
187
  .json(payload => util.deserializeResult(payload))
184
188
  .then(f => f, util.onRejected);
185
189
  }
186
-
187
190
  /**
188
191
  * List all API keys owned by this account
189
192
  */
190
- public async list(): Promise<Array<datatypes.APIKey>> {
193
+ public async list(
194
+ beforeId?: string,
195
+ limit?: string
196
+ ): Promise<Array<datatypes.APIKey>> {
191
197
  const array: Array<datatypes.APIKey> = [];
192
- for await (const item of this._asyncList()) {
198
+ for await (const item of this._asyncList(beforeId, limit)) {
193
199
  array.push(item);
194
200
  }
195
201
  return array;
196
202
  }
203
+
197
204
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.APIKeyList> {
198
205
  return this.httpClient
199
206
  .url(`/api_keys`)
@@ -202,11 +209,15 @@ export class APIKeys {
202
209
  .json(payload => util.deserializeResult(payload))
203
210
  .then(util.onFulfilled, util.onRejected);
204
211
  }
205
- private async *_asyncList() {
206
- const limit = '100';
212
+
213
+ private async *_asyncList(beforeId: string, limit = '100') {
207
214
  let nextPage = 'initial loop';
208
215
  let page: datatypes.Paging = { limit: limit };
209
216
 
217
+ if (beforeId) {
218
+ page.beforeId = beforeId;
219
+ }
220
+
210
221
  while (nextPage) {
211
222
  const pagedList = await this._pagedList(page);
212
223
  nextPage = pagedList.nextPageUri;
@@ -236,6 +247,269 @@ export class APIKeys {
236
247
  }
237
248
  }
238
249
 
250
+ export class ApplicationSessions {
251
+ private httpClient: Wretcher;
252
+
253
+ /** Do not construct this object directly, use the <code>applicationSessions</code> property of an <code>Ngrok</code> client object instead. */
254
+ public constructor(httpClient: Wretcher) {
255
+ this.httpClient = httpClient;
256
+ }
257
+ /**
258
+ * Get an application session by ID.
259
+ */
260
+ public get(id): Promise<datatypes.ApplicationSession> {
261
+ return this.httpClient
262
+ .url(`/app/sessions/${id}`)
263
+ .get(id)
264
+ .json(payload => util.deserializeResult(payload))
265
+ .then(f => f, util.onRejected);
266
+ }
267
+ /**
268
+ * Delete an application session by ID.
269
+ */
270
+ public delete(id): Promise<void> {
271
+ return this.httpClient
272
+ .url(`/app/sessions/${id}`)
273
+ .delete(id)
274
+ .json(payload => util.deserializeResult(payload))
275
+ .then(f => f, util.onRejected);
276
+ }
277
+ /**
278
+ * List all application sessions for this account.
279
+ */
280
+ public async list(
281
+ beforeId?: string,
282
+ limit?: string
283
+ ): Promise<Array<datatypes.ApplicationSession>> {
284
+ const array: Array<datatypes.ApplicationSession> = [];
285
+ for await (const item of this._asyncList(beforeId, limit)) {
286
+ array.push(item);
287
+ }
288
+ return array;
289
+ }
290
+
291
+ private _pagedList(
292
+ arg: datatypes.Paging
293
+ ): Promise<datatypes.ApplicationSessionList> {
294
+ return this.httpClient
295
+ .url(`/app/sessions`)
296
+ .query(arg)
297
+ .get()
298
+ .json(payload => util.deserializeResult(payload))
299
+ .then(util.onFulfilled, util.onRejected);
300
+ }
301
+
302
+ private async *_asyncList(beforeId: string, limit = '100') {
303
+ let nextPage = 'initial loop';
304
+ let page: datatypes.Paging = { limit: limit };
305
+
306
+ if (beforeId) {
307
+ page.beforeId = beforeId;
308
+ }
309
+
310
+ while (nextPage) {
311
+ const pagedList = await this._pagedList(page);
312
+ nextPage = pagedList.nextPageUri;
313
+ const items: datatypes.ApplicationSession[] =
314
+ pagedList.applicationSessions;
315
+
316
+ if (nextPage) {
317
+ page = {
318
+ beforeId: items[items.length - 1].id,
319
+ limit: limit,
320
+ };
321
+ }
322
+
323
+ for (const item of items) {
324
+ yield item;
325
+ }
326
+ }
327
+ }
328
+ }
329
+
330
+ export class ApplicationUsers {
331
+ private httpClient: Wretcher;
332
+
333
+ /** Do not construct this object directly, use the <code>applicationUsers</code> property of an <code>Ngrok</code> client object instead. */
334
+ public constructor(httpClient: Wretcher) {
335
+ this.httpClient = httpClient;
336
+ }
337
+ /**
338
+ * Get an application user by ID.
339
+ */
340
+ public get(id): Promise<datatypes.ApplicationUser> {
341
+ return this.httpClient
342
+ .url(`/app/users/${id}`)
343
+ .get(id)
344
+ .json(payload => util.deserializeResult(payload))
345
+ .then(f => f, util.onRejected);
346
+ }
347
+ /**
348
+ * Delete an application user by ID.
349
+ */
350
+ public delete(id): Promise<void> {
351
+ return this.httpClient
352
+ .url(`/app/users/${id}`)
353
+ .delete(id)
354
+ .json(payload => util.deserializeResult(payload))
355
+ .then(f => f, util.onRejected);
356
+ }
357
+ /**
358
+ * List all application users for this account.
359
+ */
360
+ public async list(
361
+ beforeId?: string,
362
+ limit?: string
363
+ ): Promise<Array<datatypes.ApplicationUser>> {
364
+ const array: Array<datatypes.ApplicationUser> = [];
365
+ for await (const item of this._asyncList(beforeId, limit)) {
366
+ array.push(item);
367
+ }
368
+ return array;
369
+ }
370
+
371
+ private _pagedList(
372
+ arg: datatypes.Paging
373
+ ): Promise<datatypes.ApplicationUserList> {
374
+ return this.httpClient
375
+ .url(`/app/users`)
376
+ .query(arg)
377
+ .get()
378
+ .json(payload => util.deserializeResult(payload))
379
+ .then(util.onFulfilled, util.onRejected);
380
+ }
381
+
382
+ private async *_asyncList(beforeId: string, limit = '100') {
383
+ let nextPage = 'initial loop';
384
+ let page: datatypes.Paging = { limit: limit };
385
+
386
+ if (beforeId) {
387
+ page.beforeId = beforeId;
388
+ }
389
+
390
+ while (nextPage) {
391
+ const pagedList = await this._pagedList(page);
392
+ nextPage = pagedList.nextPageUri;
393
+ const items: datatypes.ApplicationUser[] = pagedList.applicationUsers;
394
+
395
+ if (nextPage) {
396
+ page = {
397
+ beforeId: items[items.length - 1].id,
398
+ limit: limit,
399
+ };
400
+ }
401
+
402
+ for (const item of items) {
403
+ yield item;
404
+ }
405
+ }
406
+ }
407
+ }
408
+
409
+ /**
410
+ * Tunnel Sessions represent instances of ngrok agents or SSH reverse tunnel
411
+ sessions that are running and connected to the ngrok service. Each tunnel
412
+ session can include one or more Tunnels.
413
+ */
414
+ export class TunnelSessions {
415
+ private httpClient: Wretcher;
416
+
417
+ /** Do not construct this object directly, use the <code>tunnelSessions</code> property of an <code>Ngrok</code> client object instead. */
418
+ public constructor(httpClient: Wretcher) {
419
+ this.httpClient = httpClient;
420
+ }
421
+ /**
422
+ * List all online tunnel sessions running on this account.
423
+ */
424
+ public async list(
425
+ beforeId?: string,
426
+ limit?: string
427
+ ): Promise<Array<datatypes.TunnelSession>> {
428
+ const array: Array<datatypes.TunnelSession> = [];
429
+ for await (const item of this._asyncList(beforeId, limit)) {
430
+ array.push(item);
431
+ }
432
+ return array;
433
+ }
434
+
435
+ private _pagedList(
436
+ arg: datatypes.Paging
437
+ ): Promise<datatypes.TunnelSessionList> {
438
+ return this.httpClient
439
+ .url(`/tunnel_sessions`)
440
+ .query(arg)
441
+ .get()
442
+ .json(payload => util.deserializeResult(payload))
443
+ .then(util.onFulfilled, util.onRejected);
444
+ }
445
+
446
+ private async *_asyncList(beforeId: string, limit = '100') {
447
+ let nextPage = 'initial loop';
448
+ let page: datatypes.Paging = { limit: limit };
449
+
450
+ if (beforeId) {
451
+ page.beforeId = beforeId;
452
+ }
453
+
454
+ while (nextPage) {
455
+ const pagedList = await this._pagedList(page);
456
+ nextPage = pagedList.nextPageUri;
457
+ const items: datatypes.TunnelSession[] = pagedList.tunnelSessions;
458
+
459
+ if (nextPage) {
460
+ page = {
461
+ beforeId: items[items.length - 1].id,
462
+ limit: limit,
463
+ };
464
+ }
465
+
466
+ for (const item of items) {
467
+ yield item;
468
+ }
469
+ }
470
+ }
471
+ /**
472
+ * Get the detailed status of a tunnel session by ID
473
+ */
474
+ public get(id): Promise<datatypes.TunnelSession> {
475
+ return this.httpClient
476
+ .url(`/tunnel_sessions/${id}`)
477
+ .get(id)
478
+ .json(payload => util.deserializeResult(payload))
479
+ .then(f => f, util.onRejected);
480
+ }
481
+ /**
482
+ * Issues a command instructing the ngrok agent to restart. The agent restarts itself by calling exec() on platforms that support it. This operation is notably not supported on Windows. When an agent restarts, it reconnects with a new tunnel session ID.
483
+ */
484
+ public restart(id): Promise<void> {
485
+ return this.httpClient
486
+ .url(`/tunnel_sessions/${id}/restart`)
487
+ .post(id)
488
+ .json(payload => util.deserializeResult(payload))
489
+ .then(f => f, util.onRejected);
490
+ }
491
+ /**
492
+ * Issues a command instructing the ngrok agent that started this tunnel session to exit.
493
+ */
494
+ public stop(id): Promise<void> {
495
+ return this.httpClient
496
+ .url(`/tunnel_sessions/${id}/stop`)
497
+ .post(id)
498
+ .json(payload => util.deserializeResult(payload))
499
+ .then(f => f, util.onRejected);
500
+ }
501
+ /**
502
+ * Issues a command instructing the ngrok agent to update itself to the latest version. After this call completes successfully, the ngrok agent will be in the update process. A caller should wait some amount of time to allow the update to complete (at least 10 seconds) before making a call to the Restart endpoint to request that the agent restart itself to start using the new code. This call will never update an ngrok agent to a new major version which could cause breaking compatibility issues. If you wish to update to a new major version, that must be done manually. Still, please be aware that updating your ngrok agent could break your integration. This call will fail in any of the following circumstances: there is no update available the ngrok agent's configuration disabled update checks the agent is currently in process of updating the agent has already successfully updated but has not yet been restarted
503
+ */
504
+ public update(arg: datatypes.TunnelSessionsUpdate): Promise<void> {
505
+ return this.httpClient
506
+ .url(`/tunnel_sessions/${arg.id}/update`)
507
+ .post(util.serializeArgument(arg))
508
+ .json(payload => util.deserializeResult(payload))
509
+ .then(f => f, util.onRejected);
510
+ }
511
+ }
512
+
239
513
  /**
240
514
  * A Failover backend defines failover behavior within a list of referenced
241
515
  backends. Traffic is sent to the first backend in the list. If that backend
@@ -261,39 +535,40 @@ export class FailoverBackends {
261
535
  .json(payload => util.deserializeResult(payload))
262
536
  .then(f => f, util.onRejected);
263
537
  }
264
-
265
538
  /**
266
539
  * Delete a Failover backend by ID.
267
540
  */
268
- public delete(arg: datatypes.Item): Promise<void> {
541
+ public delete(id): Promise<void> {
269
542
  return this.httpClient
270
- .url(`/backends/failover/${arg.id}`)
271
- .delete()
543
+ .url(`/backends/failover/${id}`)
544
+ .delete(id)
272
545
  .json(payload => util.deserializeResult(payload))
273
546
  .then(f => f, util.onRejected);
274
547
  }
275
-
276
548
  /**
277
549
  * Get detailed information about a Failover backend by ID
278
550
  */
279
- public get(arg: datatypes.Item): Promise<datatypes.FailoverBackend> {
551
+ public get(id): Promise<datatypes.FailoverBackend> {
280
552
  return this.httpClient
281
- .url(`/backends/failover/${arg.id}`)
282
- .get()
553
+ .url(`/backends/failover/${id}`)
554
+ .get(id)
283
555
  .json(payload => util.deserializeResult(payload))
284
556
  .then(f => f, util.onRejected);
285
557
  }
286
-
287
558
  /**
288
559
  * List all Failover backends on this account
289
560
  */
290
- public async list(): Promise<Array<datatypes.FailoverBackend>> {
561
+ public async list(
562
+ beforeId?: string,
563
+ limit?: string
564
+ ): Promise<Array<datatypes.FailoverBackend>> {
291
565
  const array: Array<datatypes.FailoverBackend> = [];
292
- for await (const item of this._asyncList()) {
566
+ for await (const item of this._asyncList(beforeId, limit)) {
293
567
  array.push(item);
294
568
  }
295
569
  return array;
296
570
  }
571
+
297
572
  private _pagedList(
298
573
  arg: datatypes.Paging
299
574
  ): Promise<datatypes.FailoverBackendList> {
@@ -304,11 +579,15 @@ export class FailoverBackends {
304
579
  .json(payload => util.deserializeResult(payload))
305
580
  .then(util.onFulfilled, util.onRejected);
306
581
  }
307
- private async *_asyncList() {
308
- const limit = '100';
582
+
583
+ private async *_asyncList(beforeId: string, limit = '100') {
309
584
  let nextPage = 'initial loop';
310
585
  let page: datatypes.Paging = { limit: limit };
311
586
 
587
+ if (beforeId) {
588
+ page.beforeId = beforeId;
589
+ }
590
+
312
591
  while (nextPage) {
313
592
  const pagedList = await this._pagedList(page);
314
593
  nextPage = pagedList.nextPageUri;
@@ -356,30 +635,31 @@ export class HTTPResponseBackends {
356
635
  .json(payload => util.deserializeResult(payload))
357
636
  .then(f => f, util.onRejected);
358
637
  }
359
-
360
- public delete(arg: datatypes.Item): Promise<void> {
638
+ public delete(id): Promise<void> {
361
639
  return this.httpClient
362
- .url(`/backends/http_response/${arg.id}`)
363
- .delete()
640
+ .url(`/backends/http_response/${id}`)
641
+ .delete(id)
364
642
  .json(payload => util.deserializeResult(payload))
365
643
  .then(f => f, util.onRejected);
366
644
  }
367
-
368
- public get(arg: datatypes.Item): Promise<datatypes.HTTPResponseBackend> {
645
+ public get(id): Promise<datatypes.HTTPResponseBackend> {
369
646
  return this.httpClient
370
- .url(`/backends/http_response/${arg.id}`)
371
- .get()
647
+ .url(`/backends/http_response/${id}`)
648
+ .get(id)
372
649
  .json(payload => util.deserializeResult(payload))
373
650
  .then(f => f, util.onRejected);
374
651
  }
375
-
376
- public async list(): Promise<Array<datatypes.HTTPResponseBackend>> {
652
+ public async list(
653
+ beforeId?: string,
654
+ limit?: string
655
+ ): Promise<Array<datatypes.HTTPResponseBackend>> {
377
656
  const array: Array<datatypes.HTTPResponseBackend> = [];
378
- for await (const item of this._asyncList()) {
657
+ for await (const item of this._asyncList(beforeId, limit)) {
379
658
  array.push(item);
380
659
  }
381
660
  return array;
382
661
  }
662
+
383
663
  private _pagedList(
384
664
  arg: datatypes.Paging
385
665
  ): Promise<datatypes.HTTPResponseBackendList> {
@@ -390,11 +670,15 @@ export class HTTPResponseBackends {
390
670
  .json(payload => util.deserializeResult(payload))
391
671
  .then(util.onFulfilled, util.onRejected);
392
672
  }
393
- private async *_asyncList() {
394
- const limit = '100';
673
+
674
+ private async *_asyncList(beforeId: string, limit = '100') {
395
675
  let nextPage = 'initial loop';
396
676
  let page: datatypes.Paging = { limit: limit };
397
677
 
678
+ if (beforeId) {
679
+ page.beforeId = beforeId;
680
+ }
681
+
398
682
  while (nextPage) {
399
683
  const pagedList = await this._pagedList(page);
400
684
  nextPage = pagedList.nextPageUri;
@@ -423,6 +707,113 @@ export class HTTPResponseBackends {
423
707
  }
424
708
  }
425
709
 
710
+ /**
711
+ * A static backend sends traffic to a TCP address (hostname and port) that
712
+ is reachable on the public internet.
713
+ */
714
+ export class StaticBackends {
715
+ private httpClient: Wretcher;
716
+
717
+ /** Do not construct this object directly, use the <code>staticBackends</code> property of an <code>Ngrok</code> client object instead. */
718
+ public constructor(httpClient: Wretcher) {
719
+ this.httpClient = httpClient;
720
+ }
721
+ /**
722
+ * Create a new static backend
723
+ */
724
+ public create(
725
+ arg: datatypes.StaticBackendCreate
726
+ ): Promise<datatypes.StaticBackend> {
727
+ return this.httpClient
728
+ .url(`/backends/static`)
729
+ .post(util.serializeArgument(arg))
730
+ .json(payload => util.deserializeResult(payload))
731
+ .then(f => f, util.onRejected);
732
+ }
733
+ /**
734
+ * Delete a static backend by ID.
735
+ */
736
+ public delete(id): Promise<void> {
737
+ return this.httpClient
738
+ .url(`/backends/static/${id}`)
739
+ .delete(id)
740
+ .json(payload => util.deserializeResult(payload))
741
+ .then(f => f, util.onRejected);
742
+ }
743
+ /**
744
+ * Get detailed information about a static backend by ID
745
+ */
746
+ public get(id): Promise<datatypes.StaticBackend> {
747
+ return this.httpClient
748
+ .url(`/backends/static/${id}`)
749
+ .get(id)
750
+ .json(payload => util.deserializeResult(payload))
751
+ .then(f => f, util.onRejected);
752
+ }
753
+ /**
754
+ * List all static backends on this account
755
+ */
756
+ public async list(
757
+ beforeId?: string,
758
+ limit?: string
759
+ ): Promise<Array<datatypes.StaticBackend>> {
760
+ const array: Array<datatypes.StaticBackend> = [];
761
+ for await (const item of this._asyncList(beforeId, limit)) {
762
+ array.push(item);
763
+ }
764
+ return array;
765
+ }
766
+
767
+ private _pagedList(
768
+ arg: datatypes.Paging
769
+ ): Promise<datatypes.StaticBackendList> {
770
+ return this.httpClient
771
+ .url(`/backends/static`)
772
+ .query(arg)
773
+ .get()
774
+ .json(payload => util.deserializeResult(payload))
775
+ .then(util.onFulfilled, util.onRejected);
776
+ }
777
+
778
+ private async *_asyncList(beforeId: string, limit = '100') {
779
+ let nextPage = 'initial loop';
780
+ let page: datatypes.Paging = { limit: limit };
781
+
782
+ if (beforeId) {
783
+ page.beforeId = beforeId;
784
+ }
785
+
786
+ while (nextPage) {
787
+ const pagedList = await this._pagedList(page);
788
+ nextPage = pagedList.nextPageUri;
789
+ const items: datatypes.StaticBackend[] = pagedList.backends;
790
+
791
+ if (nextPage) {
792
+ page = {
793
+ beforeId: items[items.length - 1].id,
794
+ limit: limit,
795
+ };
796
+ }
797
+
798
+ for (const item of items) {
799
+ yield item;
800
+ }
801
+ }
802
+ }
803
+ /**
804
+ * Update static backend by ID
805
+ */
806
+ public update(
807
+ arg: datatypes.StaticBackendUpdate
808
+ ): Promise<datatypes.StaticBackend> {
809
+ return this.httpClient
810
+ .url(`/backends/static/${arg.id}`)
811
+ .patch(util.serializeArgument(arg))
812
+ .json(payload => util.deserializeResult(payload))
813
+ .then(f => f, util.onRejected);
814
+ }
815
+ }
816
+
426
817
  /**
427
818
  * A Tunnel Group Backend balances traffic among all online tunnels that match
428
819
  a label selector.
@@ -446,39 +837,40 @@ export class TunnelGroupBackends {
446
837
  .json(payload => util.deserializeResult(payload))
447
838
  .then(f => f, util.onRejected);
448
839
  }
449
-
450
840
  /**
451
841
  * Delete a TunnelGroup backend by ID.
452
842
  */
453
- public delete(arg: datatypes.Item): Promise<void> {
843
+ public delete(id): Promise<void> {
454
844
  return this.httpClient
455
- .url(`/backends/tunnel_group/${arg.id}`)
456
- .delete()
845
+ .url(`/backends/tunnel_group/${id}`)
846
+ .delete(id)
457
847
  .json(payload => util.deserializeResult(payload))
458
848
  .then(f => f, util.onRejected);
459
849
  }
460
-
461
850
  /**
462
851
  * Get detailed information about a TunnelGroup backend by ID
463
852
  */
464
- public get(arg: datatypes.Item): Promise<datatypes.TunnelGroupBackend> {
853
+ public get(id): Promise<datatypes.TunnelGroupBackend> {
465
854
  return this.httpClient
466
- .url(`/backends/tunnel_group/${arg.id}`)
467
- .get()
855
+ .url(`/backends/tunnel_group/${id}`)
856
+ .get(id)
468
857
  .json(payload => util.deserializeResult(payload))
469
858
  .then(f => f, util.onRejected);
470
859
  }
471
-
472
860
  /**
473
861
  * List all TunnelGroup backends on this account
474
862
  */
475
- public async list(): Promise<Array<datatypes.TunnelGroupBackend>> {
863
+ public async list(
864
+ beforeId?: string,
865
+ limit?: string
866
+ ): Promise<Array<datatypes.TunnelGroupBackend>> {
476
867
  const array: Array<datatypes.TunnelGroupBackend> = [];
477
- for await (const item of this._asyncList()) {
868
+ for await (const item of this._asyncList(beforeId, limit)) {
478
869
  array.push(item);
479
870
  }
480
871
  return array;
481
872
  }
873
+
482
874
  private _pagedList(
483
875
  arg: datatypes.Paging
484
876
  ): Promise<datatypes.TunnelGroupBackendList> {
@@ -489,11 +881,15 @@ export class TunnelGroupBackends {
489
881
  .json(payload => util.deserializeResult(payload))
490
882
  .then(util.onFulfilled, util.onRejected);
491
883
  }
492
- private async *_asyncList() {
493
- const limit = '100';
884
+
885
+ private async *_asyncList(beforeId: string, limit = '100') {
494
886
  let nextPage = 'initial loop';
495
887
  let page: datatypes.Paging = { limit: limit };
496
888
 
889
+ if (beforeId) {
890
+ page.beforeId = beforeId;
891
+ }
892
+
497
893
  while (nextPage) {
498
894
  const pagedList = await this._pagedList(page);
499
895
  nextPage = pagedList.nextPageUri;
@@ -515,93 +911,197 @@ export class TunnelGroupBackends {
515
911
  * Update TunnelGroup backend by ID
516
912
  */
517
913
  public update(
518
- arg: datatypes.TunnelGroupBackendUpdate
519
- ): Promise<datatypes.TunnelGroupBackend> {
914
+ arg: datatypes.TunnelGroupBackendUpdate
915
+ ): Promise<datatypes.TunnelGroupBackend> {
916
+ return this.httpClient
917
+ .url(`/backends/tunnel_group/${arg.id}`)
918
+ .patch(util.serializeArgument(arg))
919
+ .json(payload => util.deserializeResult(payload))
920
+ .then(f => f, util.onRejected);
921
+ }
922
+ }
923
+
924
+ /**
925
+ * A Weighted Backend balances traffic among the referenced backends. Traffic
926
+ is assigned proportionally to each based on its weight. The percentage of
927
+ traffic is calculated by dividing a backend's weight by the sum of all
928
+ weights.
929
+ */
930
+ export class WeightedBackends {
931
+ private httpClient: Wretcher;
932
+
933
+ /** Do not construct this object directly, use the <code>weightedBackends</code> property of an <code>Ngrok</code> client object instead. */
934
+ public constructor(httpClient: Wretcher) {
935
+ this.httpClient = httpClient;
936
+ }
937
+ /**
938
+ * Create a new Weighted backend
939
+ */
940
+ public create(
941
+ arg: datatypes.WeightedBackendCreate
942
+ ): Promise<datatypes.WeightedBackend> {
943
+ return this.httpClient
944
+ .url(`/backends/weighted`)
945
+ .post(util.serializeArgument(arg))
946
+ .json(payload => util.deserializeResult(payload))
947
+ .then(f => f, util.onRejected);
948
+ }
949
+ /**
950
+ * Delete a Weighted backend by ID.
951
+ */
952
+ public delete(id): Promise<void> {
953
+ return this.httpClient
954
+ .url(`/backends/weighted/${id}`)
955
+ .delete(id)
956
+ .json(payload => util.deserializeResult(payload))
957
+ .then(f => f, util.onRejected);
958
+ }
959
+ /**
960
+ * Get detailed information about a Weighted backend by ID
961
+ */
962
+ public get(id): Promise<datatypes.WeightedBackend> {
963
+ return this.httpClient
964
+ .url(`/backends/weighted/${id}`)
965
+ .get(id)
966
+ .json(payload => util.deserializeResult(payload))
967
+ .then(f => f, util.onRejected);
968
+ }
969
+ /**
970
+ * List all Weighted backends on this account
971
+ */
972
+ public async list(
973
+ beforeId?: string,
974
+ limit?: string
975
+ ): Promise<Array<datatypes.WeightedBackend>> {
976
+ const array: Array<datatypes.WeightedBackend> = [];
977
+ for await (const item of this._asyncList(beforeId, limit)) {
978
+ array.push(item);
979
+ }
980
+ return array;
981
+ }
982
+
983
+ private _pagedList(
984
+ arg: datatypes.Paging
985
+ ): Promise<datatypes.WeightedBackendList> {
986
+ return this.httpClient
987
+ .url(`/backends/weighted`)
988
+ .query(arg)
989
+ .get()
990
+ .json(payload => util.deserializeResult(payload))
991
+ .then(util.onFulfilled, util.onRejected);
992
+ }
993
+
994
+ private async *_asyncList(beforeId: string, limit = '100') {
995
+ let nextPage = 'initial loop';
996
+ let page: datatypes.Paging = { limit: limit };
997
+
998
+ if (beforeId) {
999
+ page.beforeId = beforeId;
1000
+ }
1001
+
1002
+ while (nextPage) {
1003
+ const pagedList = await this._pagedList(page);
1004
+ nextPage = pagedList.nextPageUri;
1005
+ const items: datatypes.WeightedBackend[] = pagedList.backends;
1006
+
1007
+ if (nextPage) {
1008
+ page = {
1009
+ beforeId: items[items.length - 1].id,
1010
+ limit: limit,
1011
+ };
1012
+ }
1013
+
1014
+ for (const item of items) {
1015
+ yield item;
1016
+ }
1017
+ }
1018
+ }
1019
+ /**
1020
+ * Update Weighted backend by ID
1021
+ */
1022
+ public update(
1023
+ arg: datatypes.WeightedBackendUpdate
1024
+ ): Promise<datatypes.WeightedBackend> {
520
1025
  return this.httpClient
521
- .url(`/backends/tunnel_group/${arg.id}`)
1026
+ .url(`/backends/weighted/${arg.id}`)
522
1027
  .patch(util.serializeArgument(arg))
523
1028
  .json(payload => util.deserializeResult(payload))
524
1029
  .then(f => f, util.onRejected);
525
1030
  }
526
1031
  }
527
1032
 
528
- /**
529
- * A Weighted Backend balances traffic among the referenced backends. Traffic
530
- is assigned proportionally to each based on its weight. The percentage of
531
- traffic is calculated by dividing a backend's weight by the sum of all
532
- weights.
533
- */
534
- export class WeightedBackends {
1033
+ export class BotUsers {
535
1034
  private httpClient: Wretcher;
536
1035
 
537
- /** Do not construct this object directly, use the <code>weightedBackends</code> property of an <code>Ngrok</code> client object instead. */
1036
+ /** Do not construct this object directly, use the <code>botUsers</code> property of an <code>Ngrok</code> client object instead. */
538
1037
  public constructor(httpClient: Wretcher) {
539
1038
  this.httpClient = httpClient;
540
1039
  }
541
1040
  /**
542
- * Create a new Weighted backend
1041
+ * Create a new bot user
543
1042
  */
544
- public create(
545
- arg: datatypes.WeightedBackendCreate
546
- ): Promise<datatypes.WeightedBackend> {
1043
+ public create(arg: datatypes.BotUserCreate): Promise<datatypes.BotUser> {
547
1044
  return this.httpClient
548
- .url(`/backends/weighted`)
1045
+ .url(`/bot_users`)
549
1046
  .post(util.serializeArgument(arg))
550
1047
  .json(payload => util.deserializeResult(payload))
551
1048
  .then(f => f, util.onRejected);
552
1049
  }
553
-
554
1050
  /**
555
- * Delete a Weighted backend by ID.
1051
+ * Delete a bot user by ID
556
1052
  */
557
- public delete(arg: datatypes.Item): Promise<void> {
1053
+ public delete(id): Promise<void> {
558
1054
  return this.httpClient
559
- .url(`/backends/weighted/${arg.id}`)
560
- .delete()
1055
+ .url(`/bot_users/${id}`)
1056
+ .delete(id)
561
1057
  .json(payload => util.deserializeResult(payload))
562
1058
  .then(f => f, util.onRejected);
563
1059
  }
564
-
565
1060
  /**
566
- * Get detailed information about a Weighted backend by ID
1061
+ * Get the details of a Bot User by ID.
567
1062
  */
568
- public get(arg: datatypes.Item): Promise<datatypes.WeightedBackend> {
1063
+ public get(id): Promise<datatypes.BotUser> {
569
1064
  return this.httpClient
570
- .url(`/backends/weighted/${arg.id}`)
571
- .get()
1065
+ .url(`/bot_users/${id}`)
1066
+ .get(id)
572
1067
  .json(payload => util.deserializeResult(payload))
573
1068
  .then(f => f, util.onRejected);
574
1069
  }
575
-
576
1070
  /**
577
- * List all Weighted backends on this account
1071
+ * List all bot users in this account.
578
1072
  */
579
- public async list(): Promise<Array<datatypes.WeightedBackend>> {
580
- const array: Array<datatypes.WeightedBackend> = [];
581
- for await (const item of this._asyncList()) {
1073
+ public async list(
1074
+ beforeId?: string,
1075
+ limit?: string
1076
+ ): Promise<Array<datatypes.BotUser>> {
1077
+ const array: Array<datatypes.BotUser> = [];
1078
+ for await (const item of this._asyncList(beforeId, limit)) {
582
1079
  array.push(item);
583
1080
  }
584
1081
  return array;
585
1082
  }
586
- private _pagedList(
587
- arg: datatypes.Paging
588
- ): Promise<datatypes.WeightedBackendList> {
1083
+
1084
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.BotUserList> {
589
1085
  return this.httpClient
590
- .url(`/backends/weighted`)
1086
+ .url(`/bot_users`)
591
1087
  .query(arg)
592
1088
  .get()
593
1089
  .json(payload => util.deserializeResult(payload))
594
1090
  .then(util.onFulfilled, util.onRejected);
595
1091
  }
596
- private async *_asyncList() {
597
- const limit = '100';
1092
+
1093
+ private async *_asyncList(beforeId: string, limit = '100') {
598
1094
  let nextPage = 'initial loop';
599
1095
  let page: datatypes.Paging = { limit: limit };
600
1096
 
1097
+ if (beforeId) {
1098
+ page.beforeId = beforeId;
1099
+ }
1100
+
601
1101
  while (nextPage) {
602
1102
  const pagedList = await this._pagedList(page);
603
1103
  nextPage = pagedList.nextPageUri;
604
- const items: datatypes.WeightedBackend[] = pagedList.backends;
1104
+ const items: datatypes.BotUser[] = pagedList.botUsers;
605
1105
 
606
1106
  if (nextPage) {
607
1107
  page = {
@@ -616,13 +1116,11 @@ export class WeightedBackends {
616
1116
  }
617
1117
  }
618
1118
  /**
619
- * Update Weighted backend by ID
1119
+ * Update attributes of a bot user by ID.
620
1120
  */
621
- public update(
622
- arg: datatypes.WeightedBackendUpdate
623
- ): Promise<datatypes.WeightedBackend> {
1121
+ public update(arg: datatypes.BotUserUpdate): Promise<datatypes.BotUser> {
624
1122
  return this.httpClient
625
- .url(`/backends/weighted/${arg.id}`)
1123
+ .url(`/bot_users/${arg.id}`)
626
1124
  .patch(util.serializeArgument(arg))
627
1125
  .json(payload => util.deserializeResult(payload))
628
1126
  .then(f => f, util.onRejected);
@@ -655,39 +1153,40 @@ export class CertificateAuthorities {
655
1153
  .json(payload => util.deserializeResult(payload))
656
1154
  .then(f => f, util.onRejected);
657
1155
  }
658
-
659
1156
  /**
660
1157
  * Delete a Certificate Authority
661
1158
  */
662
- public delete(arg: datatypes.Item): Promise<void> {
1159
+ public delete(id): Promise<void> {
663
1160
  return this.httpClient
664
- .url(`/certificate_authorities/${arg.id}`)
665
- .delete()
1161
+ .url(`/certificate_authorities/${id}`)
1162
+ .delete(id)
666
1163
  .json(payload => util.deserializeResult(payload))
667
1164
  .then(f => f, util.onRejected);
668
1165
  }
669
-
670
1166
  /**
671
1167
  * Get detailed information about a certficate authority
672
1168
  */
673
- public get(arg: datatypes.Item): Promise<datatypes.CertificateAuthority> {
1169
+ public get(id): Promise<datatypes.CertificateAuthority> {
674
1170
  return this.httpClient
675
- .url(`/certificate_authorities/${arg.id}`)
676
- .get()
1171
+ .url(`/certificate_authorities/${id}`)
1172
+ .get(id)
677
1173
  .json(payload => util.deserializeResult(payload))
678
1174
  .then(f => f, util.onRejected);
679
1175
  }
680
-
681
1176
  /**
682
1177
  * List all Certificate Authority on this account
683
1178
  */
684
- public async list(): Promise<Array<datatypes.CertificateAuthority>> {
1179
+ public async list(
1180
+ beforeId?: string,
1181
+ limit?: string
1182
+ ): Promise<Array<datatypes.CertificateAuthority>> {
685
1183
  const array: Array<datatypes.CertificateAuthority> = [];
686
- for await (const item of this._asyncList()) {
1184
+ for await (const item of this._asyncList(beforeId, limit)) {
687
1185
  array.push(item);
688
1186
  }
689
1187
  return array;
690
1188
  }
1189
+
691
1190
  private _pagedList(
692
1191
  arg: datatypes.Paging
693
1192
  ): Promise<datatypes.CertificateAuthorityList> {
@@ -698,11 +1197,15 @@ export class CertificateAuthorities {
698
1197
  .json(payload => util.deserializeResult(payload))
699
1198
  .then(util.onFulfilled, util.onRejected);
700
1199
  }
701
- private async *_asyncList() {
702
- const limit = '100';
1200
+
1201
+ private async *_asyncList(beforeId: string, limit = '100') {
703
1202
  let nextPage = 'initial loop';
704
1203
  let page: datatypes.Paging = { limit: limit };
705
1204
 
1205
+ if (beforeId) {
1206
+ page.beforeId = beforeId;
1207
+ }
1208
+
706
1209
  while (nextPage) {
707
1210
  const pagedList = await this._pagedList(page);
708
1211
  nextPage = pagedList.nextPageUri;
@@ -738,7 +1241,7 @@ export class CertificateAuthorities {
738
1241
  /**
739
1242
  * Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
740
1243
  agent to connect the ngrok service as your account. They are installed with
741
- the `ngrok authtoken` command or by specifying it in the `ngrok.yml`
1244
+ the `ngrok config add-authtoken` command or by specifying it in the `ngrok.yml`
742
1245
  configuration file with the `authtoken` property.
743
1246
  */
744
1247
  export class Credentials {
@@ -760,39 +1263,40 @@ export class Credentials {
760
1263
  .json(payload => util.deserializeResult(payload))
761
1264
  .then(f => f, util.onRejected);
762
1265
  }
763
-
764
1266
  /**
765
1267
  * Delete a tunnel authtoken credential by ID
766
1268
  */
767
- public delete(arg: datatypes.Item): Promise<void> {
1269
+ public delete(id): Promise<void> {
768
1270
  return this.httpClient
769
- .url(`/credentials/${arg.id}`)
770
- .delete()
1271
+ .url(`/credentials/${id}`)
1272
+ .delete(id)
771
1273
  .json(payload => util.deserializeResult(payload))
772
1274
  .then(f => f, util.onRejected);
773
1275
  }
774
-
775
1276
  /**
776
1277
  * Get detailed information about a tunnel authtoken credential
777
1278
  */
778
- public get(arg: datatypes.Item): Promise<datatypes.Credential> {
1279
+ public get(id): Promise<datatypes.Credential> {
779
1280
  return this.httpClient
780
- .url(`/credentials/${arg.id}`)
781
- .get()
1281
+ .url(`/credentials/${id}`)
1282
+ .get(id)
782
1283
  .json(payload => util.deserializeResult(payload))
783
1284
  .then(f => f, util.onRejected);
784
1285
  }
785
-
786
1286
  /**
787
1287
  * List all tunnel authtoken credentials on this account
788
1288
  */
789
- public async list(): Promise<Array<datatypes.Credential>> {
1289
+ public async list(
1290
+ beforeId?: string,
1291
+ limit?: string
1292
+ ): Promise<Array<datatypes.Credential>> {
790
1293
  const array: Array<datatypes.Credential> = [];
791
- for await (const item of this._asyncList()) {
1294
+ for await (const item of this._asyncList(beforeId, limit)) {
792
1295
  array.push(item);
793
1296
  }
794
1297
  return array;
795
1298
  }
1299
+
796
1300
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.CredentialList> {
797
1301
  return this.httpClient
798
1302
  .url(`/credentials`)
@@ -801,11 +1305,15 @@ export class Credentials {
801
1305
  .json(payload => util.deserializeResult(payload))
802
1306
  .then(util.onFulfilled, util.onRejected);
803
1307
  }
804
- private async *_asyncList() {
805
- const limit = '100';
1308
+
1309
+ private async *_asyncList(beforeId: string, limit = '100') {
806
1310
  let nextPage = 'initial loop';
807
1311
  let page: datatypes.Paging = { limit: limit };
808
1312
 
1313
+ if (beforeId) {
1314
+ page.beforeId = beforeId;
1315
+ }
1316
+
809
1317
  while (nextPage) {
810
1318
  const pagedList = await this._pagedList(page);
811
1319
  nextPage = pagedList.nextPageUri;
@@ -856,7 +1364,6 @@ export class EdgesHTTPSRoutes {
856
1364
  .json(payload => util.deserializeResult(payload))
857
1365
  .then(f => f, util.onRejected);
858
1366
  }
859
-
860
1367
  /**
861
1368
  * Get an HTTPS Edge Route by ID
862
1369
  */
@@ -867,7 +1374,6 @@ export class EdgesHTTPSRoutes {
867
1374
  .json(payload => util.deserializeResult(payload))
868
1375
  .then(f => f, util.onRejected);
869
1376
  }
870
-
871
1377
  /**
872
1378
  * Updates an HTTPS Edge Route by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
873
1379
  */
@@ -880,7 +1386,6 @@ export class EdgesHTTPSRoutes {
880
1386
  .json(payload => util.deserializeResult(payload))
881
1387
  .then(f => f, util.onRejected);
882
1388
  }
883
-
884
1389
  /**
885
1390
  * Delete an HTTPS Edge Route by ID
886
1391
  */
@@ -910,28 +1415,30 @@ export class EdgesHTTPS {
910
1415
  .json(payload => util.deserializeResult(payload))
911
1416
  .then(f => f, util.onRejected);
912
1417
  }
913
-
914
1418
  /**
915
1419
  * Get an HTTPS Edge by ID
916
1420
  */
917
- public get(arg: datatypes.Item): Promise<datatypes.HTTPSEdge> {
1421
+ public get(id): Promise<datatypes.HTTPSEdge> {
918
1422
  return this.httpClient
919
- .url(`/edges/https/${arg.id}`)
920
- .get()
1423
+ .url(`/edges/https/${id}`)
1424
+ .get(id)
921
1425
  .json(payload => util.deserializeResult(payload))
922
1426
  .then(f => f, util.onRejected);
923
1427
  }
924
-
925
1428
  /**
926
1429
  * Returns a list of all HTTPS Edges on this account
927
1430
  */
928
- public async list(): Promise<Array<datatypes.HTTPSEdge>> {
1431
+ public async list(
1432
+ beforeId?: string,
1433
+ limit?: string
1434
+ ): Promise<Array<datatypes.HTTPSEdge>> {
929
1435
  const array: Array<datatypes.HTTPSEdge> = [];
930
- for await (const item of this._asyncList()) {
1436
+ for await (const item of this._asyncList(beforeId, limit)) {
931
1437
  array.push(item);
932
1438
  }
933
1439
  return array;
934
1440
  }
1441
+
935
1442
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.HTTPSEdgeList> {
936
1443
  return this.httpClient
937
1444
  .url(`/edges/https`)
@@ -940,11 +1447,15 @@ export class EdgesHTTPS {
940
1447
  .json(payload => util.deserializeResult(payload))
941
1448
  .then(util.onFulfilled, util.onRejected);
942
1449
  }
943
- private async *_asyncList() {
944
- const limit = '100';
1450
+
1451
+ private async *_asyncList(beforeId: string, limit = '100') {
945
1452
  let nextPage = 'initial loop';
946
1453
  let page: datatypes.Paging = { limit: limit };
947
1454
 
1455
+ if (beforeId) {
1456
+ page.beforeId = beforeId;
1457
+ }
1458
+
948
1459
  while (nextPage) {
949
1460
  const pagedList = await this._pagedList(page);
950
1461
  nextPage = pagedList.nextPageUri;
@@ -972,14 +1483,13 @@ export class EdgesHTTPS {
972
1483
  .json(payload => util.deserializeResult(payload))
973
1484
  .then(f => f, util.onRejected);
974
1485
  }
975
-
976
1486
  /**
977
1487
  * Delete an HTTPS Edge by ID
978
1488
  */
979
- public delete(arg: datatypes.Item): Promise<void> {
1489
+ public delete(id): Promise<void> {
980
1490
  return this.httpClient
981
- .url(`/edges/https/${arg.id}`)
982
- .delete()
1491
+ .url(`/edges/https/${id}`)
1492
+ .delete(id)
983
1493
  .json(payload => util.deserializeResult(payload))
984
1494
  .then(f => f, util.onRejected);
985
1495
  }
@@ -1001,19 +1511,17 @@ export class HTTPSEdgeMutualTLSModule {
1001
1511
  .json(payload => util.deserializeResult(payload))
1002
1512
  .then(f => f, util.onRejected);
1003
1513
  }
1004
-
1005
- public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
1514
+ public get(id): Promise<datatypes.EndpointMutualTLS> {
1006
1515
  return this.httpClient
1007
- .url(`/edges/https/${arg.id}/mutual_tls`)
1008
- .get()
1516
+ .url(`/edges/https/${id}/mutual_tls`)
1517
+ .get(id)
1009
1518
  .json(payload => util.deserializeResult(payload))
1010
1519
  .then(f => f, util.onRejected);
1011
1520
  }
1012
-
1013
- public delete(arg: datatypes.Item): Promise<void> {
1521
+ public delete(id): Promise<void> {
1014
1522
  return this.httpClient
1015
- .url(`/edges/https/${arg.id}/mutual_tls`)
1016
- .delete()
1523
+ .url(`/edges/https/${id}/mutual_tls`)
1524
+ .delete(id)
1017
1525
  .json(payload => util.deserializeResult(payload))
1018
1526
  .then(f => f, util.onRejected);
1019
1527
  }
@@ -1035,19 +1543,17 @@ export class HTTPSEdgeTLSTerminationModule {
1035
1543
  .json(payload => util.deserializeResult(payload))
1036
1544
  .then(f => f, util.onRejected);
1037
1545
  }
1038
-
1039
- public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
1546
+ public get(id): Promise<datatypes.EndpointTLSTermination> {
1040
1547
  return this.httpClient
1041
- .url(`/edges/https/${arg.id}/tls_termination`)
1042
- .get()
1548
+ .url(`/edges/https/${id}/tls_termination`)
1549
+ .get(id)
1043
1550
  .json(payload => util.deserializeResult(payload))
1044
1551
  .then(f => f, util.onRejected);
1045
1552
  }
1046
-
1047
- public delete(arg: datatypes.Item): Promise<void> {
1553
+ public delete(id): Promise<void> {
1048
1554
  return this.httpClient
1049
- .url(`/edges/https/${arg.id}/tls_termination`)
1050
- .delete()
1555
+ .url(`/edges/https/${id}/tls_termination`)
1556
+ .delete(id)
1051
1557
  .json(payload => util.deserializeResult(payload))
1052
1558
  .then(f => f, util.onRejected);
1053
1559
  }
@@ -1069,7 +1575,6 @@ export class EdgeRouteBackendModule {
1069
1575
  .json(payload => util.deserializeResult(payload))
1070
1576
  .then(f => f, util.onRejected);
1071
1577
  }
1072
-
1073
1578
  public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointBackend> {
1074
1579
  return this.httpClient
1075
1580
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
@@ -1077,7 +1582,6 @@ export class EdgeRouteBackendModule {
1077
1582
  .json(payload => util.deserializeResult(payload))
1078
1583
  .then(f => f, util.onRejected);
1079
1584
  }
1080
-
1081
1585
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1082
1586
  return this.httpClient
1083
1587
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
@@ -1103,7 +1607,6 @@ export class EdgeRouteIPRestrictionModule {
1103
1607
  .json(payload => util.deserializeResult(payload))
1104
1608
  .then(f => f, util.onRejected);
1105
1609
  }
1106
-
1107
1610
  public get(
1108
1611
  arg: datatypes.EdgeRouteItem
1109
1612
  ): Promise<datatypes.EndpointIPPolicy> {
@@ -1113,7 +1616,6 @@ export class EdgeRouteIPRestrictionModule {
1113
1616
  .json(payload => util.deserializeResult(payload))
1114
1617
  .then(f => f, util.onRejected);
1115
1618
  }
1116
-
1117
1619
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1118
1620
  return this.httpClient
1119
1621
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
@@ -1139,7 +1641,6 @@ export class EdgeRouteRequestHeadersModule {
1139
1641
  .json(payload => util.deserializeResult(payload))
1140
1642
  .then(f => f, util.onRejected);
1141
1643
  }
1142
-
1143
1644
  public get(
1144
1645
  arg: datatypes.EdgeRouteItem
1145
1646
  ): Promise<datatypes.EndpointRequestHeaders> {
@@ -1149,7 +1650,6 @@ export class EdgeRouteRequestHeadersModule {
1149
1650
  .json(payload => util.deserializeResult(payload))
1150
1651
  .then(f => f, util.onRejected);
1151
1652
  }
1152
-
1153
1653
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1154
1654
  return this.httpClient
1155
1655
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
@@ -1175,7 +1675,6 @@ export class EdgeRouteResponseHeadersModule {
1175
1675
  .json(payload => util.deserializeResult(payload))
1176
1676
  .then(f => f, util.onRejected);
1177
1677
  }
1178
-
1179
1678
  public get(
1180
1679
  arg: datatypes.EdgeRouteItem
1181
1680
  ): Promise<datatypes.EndpointResponseHeaders> {
@@ -1185,7 +1684,6 @@ export class EdgeRouteResponseHeadersModule {
1185
1684
  .json(payload => util.deserializeResult(payload))
1186
1685
  .then(f => f, util.onRejected);
1187
1686
  }
1188
-
1189
1687
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1190
1688
  return this.httpClient
1191
1689
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
@@ -1211,7 +1709,6 @@ export class EdgeRouteCompressionModule {
1211
1709
  .json(payload => util.deserializeResult(payload))
1212
1710
  .then(f => f, util.onRejected);
1213
1711
  }
1214
-
1215
1712
  public get(
1216
1713
  arg: datatypes.EdgeRouteItem
1217
1714
  ): Promise<datatypes.EndpointCompression> {
@@ -1221,7 +1718,6 @@ export class EdgeRouteCompressionModule {
1221
1718
  .json(payload => util.deserializeResult(payload))
1222
1719
  .then(f => f, util.onRejected);
1223
1720
  }
1224
-
1225
1721
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1226
1722
  return this.httpClient
1227
1723
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
@@ -1247,7 +1743,6 @@ export class EdgeRouteCircuitBreakerModule {
1247
1743
  .json(payload => util.deserializeResult(payload))
1248
1744
  .then(f => f, util.onRejected);
1249
1745
  }
1250
-
1251
1746
  public get(
1252
1747
  arg: datatypes.EdgeRouteItem
1253
1748
  ): Promise<datatypes.EndpointCircuitBreaker> {
@@ -1257,7 +1752,6 @@ export class EdgeRouteCircuitBreakerModule {
1257
1752
  .json(payload => util.deserializeResult(payload))
1258
1753
  .then(f => f, util.onRejected);
1259
1754
  }
1260
-
1261
1755
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1262
1756
  return this.httpClient
1263
1757
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
@@ -1283,7 +1777,6 @@ export class EdgeRouteWebhookVerificationModule {
1283
1777
  .json(payload => util.deserializeResult(payload))
1284
1778
  .then(f => f, util.onRejected);
1285
1779
  }
1286
-
1287
1780
  public get(
1288
1781
  arg: datatypes.EdgeRouteItem
1289
1782
  ): Promise<datatypes.EndpointWebhookValidation> {
@@ -1293,7 +1786,6 @@ export class EdgeRouteWebhookVerificationModule {
1293
1786
  .json(payload => util.deserializeResult(payload))
1294
1787
  .then(f => f, util.onRejected);
1295
1788
  }
1296
-
1297
1789
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1298
1790
  return this.httpClient
1299
1791
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
@@ -1319,7 +1811,6 @@ export class EdgeRouteOAuthModule {
1319
1811
  .json(payload => util.deserializeResult(payload))
1320
1812
  .then(f => f, util.onRejected);
1321
1813
  }
1322
-
1323
1814
  public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointOAuth> {
1324
1815
  return this.httpClient
1325
1816
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
@@ -1327,7 +1818,6 @@ export class EdgeRouteOAuthModule {
1327
1818
  .json(payload => util.deserializeResult(payload))
1328
1819
  .then(f => f, util.onRejected);
1329
1820
  }
1330
-
1331
1821
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1332
1822
  return this.httpClient
1333
1823
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
@@ -1353,7 +1843,6 @@ export class EdgeRouteSAMLModule {
1353
1843
  .json(payload => util.deserializeResult(payload))
1354
1844
  .then(f => f, util.onRejected);
1355
1845
  }
1356
-
1357
1846
  public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointSAML> {
1358
1847
  return this.httpClient
1359
1848
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
@@ -1361,7 +1850,6 @@ export class EdgeRouteSAMLModule {
1361
1850
  .json(payload => util.deserializeResult(payload))
1362
1851
  .then(f => f, util.onRejected);
1363
1852
  }
1364
-
1365
1853
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1366
1854
  return this.httpClient
1367
1855
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
@@ -1387,7 +1875,6 @@ export class EdgeRouteOIDCModule {
1387
1875
  .json(payload => util.deserializeResult(payload))
1388
1876
  .then(f => f, util.onRejected);
1389
1877
  }
1390
-
1391
1878
  public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointOIDC> {
1392
1879
  return this.httpClient
1393
1880
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
@@ -1395,7 +1882,6 @@ export class EdgeRouteOIDCModule {
1395
1882
  .json(payload => util.deserializeResult(payload))
1396
1883
  .then(f => f, util.onRejected);
1397
1884
  }
1398
-
1399
1885
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1400
1886
  return this.httpClient
1401
1887
  .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
@@ -1423,7 +1909,6 @@ export class EdgeRouteWebsocketTCPConverterModule {
1423
1909
  .json(payload => util.deserializeResult(payload))
1424
1910
  .then(f => f, util.onRejected);
1425
1911
  }
1426
-
1427
1912
  public get(
1428
1913
  arg: datatypes.EdgeRouteItem
1429
1914
  ): Promise<datatypes.EndpointWebsocketTCPConverter> {
@@ -1435,7 +1920,6 @@ export class EdgeRouteWebsocketTCPConverterModule {
1435
1920
  .json(payload => util.deserializeResult(payload))
1436
1921
  .then(f => f, util.onRejected);
1437
1922
  }
1438
-
1439
1923
  public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1440
1924
  return this.httpClient
1441
1925
  .url(
@@ -1447,6 +1931,72 @@ export class EdgeRouteWebsocketTCPConverterModule {
1447
1931
  }
1448
1932
  }
1449
1933
 
1934
+ export class EdgeRouteUserAgentFilterModule {
1935
+ private httpClient: Wretcher;
1936
+
1937
+ /** Do not construct this object directly, use the <code>edgeRouteUserAgentFilterModule</code> property of an <code>Ngrok</code> client object instead. */
1938
+ public constructor(httpClient: Wretcher) {
1939
+ this.httpClient = httpClient;
1940
+ }
1941
+ public replace(
1942
+ arg: datatypes.EdgeRouteUserAgentFilterReplace
1943
+ ): Promise<datatypes.EndpointUserAgentFilter> {
1944
+ return this.httpClient
1945
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/user_agent_filter`)
1946
+ .put(util.serializeArgument(arg))
1947
+ .json(payload => util.deserializeResult(payload))
1948
+ .then(f => f, util.onRejected);
1949
+ }
1950
+ public get(
1951
+ arg: datatypes.EdgeRouteItem
1952
+ ): Promise<datatypes.EndpointUserAgentFilter> {
1953
+ return this.httpClient
1954
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/user_agent_filter`)
1955
+ .get()
1956
+ .json(payload => util.deserializeResult(payload))
1957
+ .then(f => f, util.onRejected);
1958
+ }
1959
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1960
+ return this.httpClient
1961
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/user_agent_filter`)
1962
+ .delete()
1963
+ .json(payload => util.deserializeResult(payload))
1964
+ .then(f => f, util.onRejected);
1965
+ }
1966
+ }
1967
+
1968
+ export class EdgeRoutePolicyModule {
1969
+ private httpClient: Wretcher;
1970
+
1971
+ /** Do not construct this object directly, use the <code>edgeRoutePolicyModule</code> property of an <code>Ngrok</code> client object instead. */
1972
+ public constructor(httpClient: Wretcher) {
1973
+ this.httpClient = httpClient;
1974
+ }
1975
+ public replace(
1976
+ arg: datatypes.EdgeRoutePolicyReplace
1977
+ ): Promise<datatypes.EndpointPolicy> {
1978
+ return this.httpClient
1979
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/policy`)
1980
+ .put(util.serializeArgument(arg))
1981
+ .json(payload => util.deserializeResult(payload))
1982
+ .then(f => f, util.onRejected);
1983
+ }
1984
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointPolicy> {
1985
+ return this.httpClient
1986
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/policy`)
1987
+ .get()
1988
+ .json(payload => util.deserializeResult(payload))
1989
+ .then(f => f, util.onRejected);
1990
+ }
1991
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1992
+ return this.httpClient
1993
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/policy`)
1994
+ .delete()
1995
+ .json(payload => util.deserializeResult(payload))
1996
+ .then(f => f, util.onRejected);
1997
+ }
1998
+ }
1999
+
1450
2000
  export class EdgesTCP {
1451
2001
  private httpClient: Wretcher;
1452
2002
 
@@ -1464,28 +2014,30 @@ export class EdgesTCP {
1464
2014
  .json(payload => util.deserializeResult(payload))
1465
2015
  .then(f => f, util.onRejected);
1466
2016
  }
1467
-
1468
2017
  /**
1469
2018
  * Get a TCP Edge by ID
1470
2019
  */
1471
- public get(arg: datatypes.Item): Promise<datatypes.TCPEdge> {
2020
+ public get(id): Promise<datatypes.TCPEdge> {
1472
2021
  return this.httpClient
1473
- .url(`/edges/tcp/${arg.id}`)
1474
- .get()
2022
+ .url(`/edges/tcp/${id}`)
2023
+ .get(id)
1475
2024
  .json(payload => util.deserializeResult(payload))
1476
2025
  .then(f => f, util.onRejected);
1477
2026
  }
1478
-
1479
2027
  /**
1480
2028
  * Returns a list of all TCP Edges on this account
1481
2029
  */
1482
- public async list(): Promise<Array<datatypes.TCPEdge>> {
2030
+ public async list(
2031
+ beforeId?: string,
2032
+ limit?: string
2033
+ ): Promise<Array<datatypes.TCPEdge>> {
1483
2034
  const array: Array<datatypes.TCPEdge> = [];
1484
- for await (const item of this._asyncList()) {
2035
+ for await (const item of this._asyncList(beforeId, limit)) {
1485
2036
  array.push(item);
1486
2037
  }
1487
2038
  return array;
1488
2039
  }
2040
+
1489
2041
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.TCPEdgeList> {
1490
2042
  return this.httpClient
1491
2043
  .url(`/edges/tcp`)
@@ -1494,11 +2046,15 @@ export class EdgesTCP {
1494
2046
  .json(payload => util.deserializeResult(payload))
1495
2047
  .then(util.onFulfilled, util.onRejected);
1496
2048
  }
1497
- private async *_asyncList() {
1498
- const limit = '100';
2049
+
2050
+ private async *_asyncList(beforeId: string, limit = '100') {
1499
2051
  let nextPage = 'initial loop';
1500
2052
  let page: datatypes.Paging = { limit: limit };
1501
2053
 
2054
+ if (beforeId) {
2055
+ page.beforeId = beforeId;
2056
+ }
2057
+
1502
2058
  while (nextPage) {
1503
2059
  const pagedList = await this._pagedList(page);
1504
2060
  nextPage = pagedList.nextPageUri;
@@ -1526,14 +2082,13 @@ export class EdgesTCP {
1526
2082
  .json(payload => util.deserializeResult(payload))
1527
2083
  .then(f => f, util.onRejected);
1528
2084
  }
1529
-
1530
2085
  /**
1531
2086
  * Delete a TCP Edge by ID
1532
2087
  */
1533
- public delete(arg: datatypes.Item): Promise<void> {
2088
+ public delete(id): Promise<void> {
1534
2089
  return this.httpClient
1535
- .url(`/edges/tcp/${arg.id}`)
1536
- .delete()
2090
+ .url(`/edges/tcp/${id}`)
2091
+ .delete(id)
1537
2092
  .json(payload => util.deserializeResult(payload))
1538
2093
  .then(f => f, util.onRejected);
1539
2094
  }
@@ -1555,19 +2110,17 @@ export class TCPEdgeBackendModule {
1555
2110
  .json(payload => util.deserializeResult(payload))
1556
2111
  .then(f => f, util.onRejected);
1557
2112
  }
1558
-
1559
- public get(arg: datatypes.Item): Promise<datatypes.EndpointBackend> {
2113
+ public get(id): Promise<datatypes.EndpointBackend> {
1560
2114
  return this.httpClient
1561
- .url(`/edges/tcp/${arg.id}/backend`)
1562
- .get()
2115
+ .url(`/edges/tcp/${id}/backend`)
2116
+ .get(id)
1563
2117
  .json(payload => util.deserializeResult(payload))
1564
2118
  .then(f => f, util.onRejected);
1565
2119
  }
1566
-
1567
- public delete(arg: datatypes.Item): Promise<void> {
2120
+ public delete(id): Promise<void> {
1568
2121
  return this.httpClient
1569
- .url(`/edges/tcp/${arg.id}/backend`)
1570
- .delete()
2122
+ .url(`/edges/tcp/${id}/backend`)
2123
+ .delete(id)
1571
2124
  .json(payload => util.deserializeResult(payload))
1572
2125
  .then(f => f, util.onRejected);
1573
2126
  }
@@ -1589,19 +2142,49 @@ export class TCPEdgeIPRestrictionModule {
1589
2142
  .json(payload => util.deserializeResult(payload))
1590
2143
  .then(f => f, util.onRejected);
1591
2144
  }
1592
-
1593
- public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
2145
+ public get(id): Promise<datatypes.EndpointIPPolicy> {
1594
2146
  return this.httpClient
1595
- .url(`/edges/tcp/${arg.id}/ip_restriction`)
1596
- .get()
2147
+ .url(`/edges/tcp/${id}/ip_restriction`)
2148
+ .get(id)
2149
+ .json(payload => util.deserializeResult(payload))
2150
+ .then(f => f, util.onRejected);
2151
+ }
2152
+ public delete(id): Promise<void> {
2153
+ return this.httpClient
2154
+ .url(`/edges/tcp/${id}/ip_restriction`)
2155
+ .delete(id)
1597
2156
  .json(payload => util.deserializeResult(payload))
1598
2157
  .then(f => f, util.onRejected);
1599
2158
  }
2159
+ }
2160
+
2161
+ export class TCPEdgePolicyModule {
2162
+ private httpClient: Wretcher;
1600
2163
 
1601
- public delete(arg: datatypes.Item): Promise<void> {
2164
+ /** Do not construct this object directly, use the <code>tcpEdgePolicyModule</code> property of an <code>Ngrok</code> client object instead. */
2165
+ public constructor(httpClient: Wretcher) {
2166
+ this.httpClient = httpClient;
2167
+ }
2168
+ public replace(
2169
+ arg: datatypes.EdgePolicyReplace
2170
+ ): Promise<datatypes.EndpointPolicy> {
1602
2171
  return this.httpClient
1603
- .url(`/edges/tcp/${arg.id}/ip_restriction`)
1604
- .delete()
2172
+ .url(`/edges/tcp/${arg.id}/policy`)
2173
+ .put(util.serializeArgument(arg))
2174
+ .json(payload => util.deserializeResult(payload))
2175
+ .then(f => f, util.onRejected);
2176
+ }
2177
+ public get(id): Promise<datatypes.EndpointPolicy> {
2178
+ return this.httpClient
2179
+ .url(`/edges/tcp/${id}/policy`)
2180
+ .get(id)
2181
+ .json(payload => util.deserializeResult(payload))
2182
+ .then(f => f, util.onRejected);
2183
+ }
2184
+ public delete(id): Promise<void> {
2185
+ return this.httpClient
2186
+ .url(`/edges/tcp/${id}/policy`)
2187
+ .delete(id)
1605
2188
  .json(payload => util.deserializeResult(payload))
1606
2189
  .then(f => f, util.onRejected);
1607
2190
  }
@@ -1624,28 +2207,30 @@ export class EdgesTLS {
1624
2207
  .json(payload => util.deserializeResult(payload))
1625
2208
  .then(f => f, util.onRejected);
1626
2209
  }
1627
-
1628
2210
  /**
1629
2211
  * Get a TLS Edge by ID
1630
2212
  */
1631
- public get(arg: datatypes.Item): Promise<datatypes.TLSEdge> {
2213
+ public get(id): Promise<datatypes.TLSEdge> {
1632
2214
  return this.httpClient
1633
- .url(`/edges/tls/${arg.id}`)
1634
- .get()
2215
+ .url(`/edges/tls/${id}`)
2216
+ .get(id)
1635
2217
  .json(payload => util.deserializeResult(payload))
1636
2218
  .then(f => f, util.onRejected);
1637
2219
  }
1638
-
1639
2220
  /**
1640
2221
  * Returns a list of all TLS Edges on this account
1641
2222
  */
1642
- public async list(): Promise<Array<datatypes.TLSEdge>> {
2223
+ public async list(
2224
+ beforeId?: string,
2225
+ limit?: string
2226
+ ): Promise<Array<datatypes.TLSEdge>> {
1643
2227
  const array: Array<datatypes.TLSEdge> = [];
1644
- for await (const item of this._asyncList()) {
2228
+ for await (const item of this._asyncList(beforeId, limit)) {
1645
2229
  array.push(item);
1646
2230
  }
1647
2231
  return array;
1648
2232
  }
2233
+
1649
2234
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.TLSEdgeList> {
1650
2235
  return this.httpClient
1651
2236
  .url(`/edges/tls`)
@@ -1654,11 +2239,15 @@ export class EdgesTLS {
1654
2239
  .json(payload => util.deserializeResult(payload))
1655
2240
  .then(util.onFulfilled, util.onRejected);
1656
2241
  }
1657
- private async *_asyncList() {
1658
- const limit = '100';
2242
+
2243
+ private async *_asyncList(beforeId: string, limit = '100') {
1659
2244
  let nextPage = 'initial loop';
1660
2245
  let page: datatypes.Paging = { limit: limit };
1661
2246
 
2247
+ if (beforeId) {
2248
+ page.beforeId = beforeId;
2249
+ }
2250
+
1662
2251
  while (nextPage) {
1663
2252
  const pagedList = await this._pagedList(page);
1664
2253
  nextPage = pagedList.nextPageUri;
@@ -1686,14 +2275,13 @@ export class EdgesTLS {
1686
2275
  .json(payload => util.deserializeResult(payload))
1687
2276
  .then(f => f, util.onRejected);
1688
2277
  }
1689
-
1690
2278
  /**
1691
2279
  * Delete a TLS Edge by ID
1692
2280
  */
1693
- public delete(arg: datatypes.Item): Promise<void> {
2281
+ public delete(id): Promise<void> {
1694
2282
  return this.httpClient
1695
- .url(`/edges/tls/${arg.id}`)
1696
- .delete()
2283
+ .url(`/edges/tls/${id}`)
2284
+ .delete(id)
1697
2285
  .json(payload => util.deserializeResult(payload))
1698
2286
  .then(f => f, util.onRejected);
1699
2287
  }
@@ -1715,19 +2303,17 @@ export class TLSEdgeBackendModule {
1715
2303
  .json(payload => util.deserializeResult(payload))
1716
2304
  .then(f => f, util.onRejected);
1717
2305
  }
1718
-
1719
- public get(arg: datatypes.Item): Promise<datatypes.EndpointBackend> {
2306
+ public get(id): Promise<datatypes.EndpointBackend> {
1720
2307
  return this.httpClient
1721
- .url(`/edges/tls/${arg.id}/backend`)
1722
- .get()
2308
+ .url(`/edges/tls/${id}/backend`)
2309
+ .get(id)
1723
2310
  .json(payload => util.deserializeResult(payload))
1724
2311
  .then(f => f, util.onRejected);
1725
2312
  }
1726
-
1727
- public delete(arg: datatypes.Item): Promise<void> {
2313
+ public delete(id): Promise<void> {
1728
2314
  return this.httpClient
1729
- .url(`/edges/tls/${arg.id}/backend`)
1730
- .delete()
2315
+ .url(`/edges/tls/${id}/backend`)
2316
+ .delete(id)
1731
2317
  .json(payload => util.deserializeResult(payload))
1732
2318
  .then(f => f, util.onRejected);
1733
2319
  }
@@ -1749,19 +2335,17 @@ export class TLSEdgeIPRestrictionModule {
1749
2335
  .json(payload => util.deserializeResult(payload))
1750
2336
  .then(f => f, util.onRejected);
1751
2337
  }
1752
-
1753
- public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
2338
+ public get(id): Promise<datatypes.EndpointIPPolicy> {
1754
2339
  return this.httpClient
1755
- .url(`/edges/tls/${arg.id}/ip_restriction`)
1756
- .get()
2340
+ .url(`/edges/tls/${id}/ip_restriction`)
2341
+ .get(id)
1757
2342
  .json(payload => util.deserializeResult(payload))
1758
2343
  .then(f => f, util.onRejected);
1759
2344
  }
1760
-
1761
- public delete(arg: datatypes.Item): Promise<void> {
2345
+ public delete(id): Promise<void> {
1762
2346
  return this.httpClient
1763
- .url(`/edges/tls/${arg.id}/ip_restriction`)
1764
- .delete()
2347
+ .url(`/edges/tls/${id}/ip_restriction`)
2348
+ .delete(id)
1765
2349
  .json(payload => util.deserializeResult(payload))
1766
2350
  .then(f => f, util.onRejected);
1767
2351
  }
@@ -1783,53 +2367,81 @@ export class TLSEdgeMutualTLSModule {
1783
2367
  .json(payload => util.deserializeResult(payload))
1784
2368
  .then(f => f, util.onRejected);
1785
2369
  }
1786
-
1787
- public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
2370
+ public get(id): Promise<datatypes.EndpointMutualTLS> {
2371
+ return this.httpClient
2372
+ .url(`/edges/tls/${id}/mutual_tls`)
2373
+ .get(id)
2374
+ .json(payload => util.deserializeResult(payload))
2375
+ .then(f => f, util.onRejected);
2376
+ }
2377
+ public delete(id): Promise<void> {
2378
+ return this.httpClient
2379
+ .url(`/edges/tls/${id}/mutual_tls`)
2380
+ .delete(id)
2381
+ .json(payload => util.deserializeResult(payload))
2382
+ .then(f => f, util.onRejected);
2383
+ }
2384
+ }
2385
+
2386
+ export class TLSEdgeTLSTerminationModule {
2387
+ private httpClient: Wretcher;
2388
+
2389
+ /** Do not construct this object directly, use the <code>tlsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
2390
+ public constructor(httpClient: Wretcher) {
2391
+ this.httpClient = httpClient;
2392
+ }
2393
+ public replace(
2394
+ arg: datatypes.EdgeTLSTerminationReplace
2395
+ ): Promise<datatypes.EndpointTLSTermination> {
2396
+ return this.httpClient
2397
+ .url(`/edges/tls/${arg.id}/tls_termination`)
2398
+ .put(util.serializeArgument(arg))
2399
+ .json(payload => util.deserializeResult(payload))
2400
+ .then(f => f, util.onRejected);
2401
+ }
2402
+ public get(id): Promise<datatypes.EndpointTLSTermination> {
1788
2403
  return this.httpClient
1789
- .url(`/edges/tls/${arg.id}/mutual_tls`)
1790
- .get()
2404
+ .url(`/edges/tls/${id}/tls_termination`)
2405
+ .get(id)
1791
2406
  .json(payload => util.deserializeResult(payload))
1792
2407
  .then(f => f, util.onRejected);
1793
2408
  }
1794
-
1795
- public delete(arg: datatypes.Item): Promise<void> {
2409
+ public delete(id): Promise<void> {
1796
2410
  return this.httpClient
1797
- .url(`/edges/tls/${arg.id}/mutual_tls`)
1798
- .delete()
2411
+ .url(`/edges/tls/${id}/tls_termination`)
2412
+ .delete(id)
1799
2413
  .json(payload => util.deserializeResult(payload))
1800
2414
  .then(f => f, util.onRejected);
1801
2415
  }
1802
2416
  }
1803
2417
 
1804
- export class TLSEdgeTLSTerminationModule {
2418
+ export class TLSEdgePolicyModule {
1805
2419
  private httpClient: Wretcher;
1806
2420
 
1807
- /** Do not construct this object directly, use the <code>tlsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
2421
+ /** Do not construct this object directly, use the <code>tlsEdgePolicyModule</code> property of an <code>Ngrok</code> client object instead. */
1808
2422
  public constructor(httpClient: Wretcher) {
1809
2423
  this.httpClient = httpClient;
1810
2424
  }
1811
2425
  public replace(
1812
- arg: datatypes.EdgeTLSTerminationReplace
1813
- ): Promise<datatypes.EndpointTLSTermination> {
2426
+ arg: datatypes.EdgePolicyReplace
2427
+ ): Promise<datatypes.EndpointPolicy> {
1814
2428
  return this.httpClient
1815
- .url(`/edges/tls/${arg.id}/tls_termination`)
2429
+ .url(`/edges/tls/${arg.id}/policy`)
1816
2430
  .put(util.serializeArgument(arg))
1817
2431
  .json(payload => util.deserializeResult(payload))
1818
2432
  .then(f => f, util.onRejected);
1819
2433
  }
1820
-
1821
- public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
2434
+ public get(id): Promise<datatypes.EndpointPolicy> {
1822
2435
  return this.httpClient
1823
- .url(`/edges/tls/${arg.id}/tls_termination`)
1824
- .get()
2436
+ .url(`/edges/tls/${id}/policy`)
2437
+ .get(id)
1825
2438
  .json(payload => util.deserializeResult(payload))
1826
2439
  .then(f => f, util.onRejected);
1827
2440
  }
1828
-
1829
- public delete(arg: datatypes.Item): Promise<void> {
2441
+ public delete(id): Promise<void> {
1830
2442
  return this.httpClient
1831
- .url(`/edges/tls/${arg.id}/tls_termination`)
1832
- .delete()
2443
+ .url(`/edges/tls/${id}/policy`)
2444
+ .delete(id)
1833
2445
  .json(payload => util.deserializeResult(payload))
1834
2446
  .then(f => f, util.onRejected);
1835
2447
  }
@@ -1850,13 +2462,17 @@ export class Endpoints {
1850
2462
  /**
1851
2463
  * List all active endpoints on the account
1852
2464
  */
1853
- public async list(): Promise<Array<datatypes.Endpoint>> {
2465
+ public async list(
2466
+ beforeId?: string,
2467
+ limit?: string
2468
+ ): Promise<Array<datatypes.Endpoint>> {
1854
2469
  const array: Array<datatypes.Endpoint> = [];
1855
- for await (const item of this._asyncList()) {
2470
+ for await (const item of this._asyncList(beforeId, limit)) {
1856
2471
  array.push(item);
1857
2472
  }
1858
2473
  return array;
1859
2474
  }
2475
+
1860
2476
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.EndpointList> {
1861
2477
  return this.httpClient
1862
2478
  .url(`/endpoints`)
@@ -1865,11 +2481,15 @@ export class Endpoints {
1865
2481
  .json(payload => util.deserializeResult(payload))
1866
2482
  .then(util.onFulfilled, util.onRejected);
1867
2483
  }
1868
- private async *_asyncList() {
1869
- const limit = '100';
2484
+
2485
+ private async *_asyncList(beforeId: string, limit = '100') {
1870
2486
  let nextPage = 'initial loop';
1871
2487
  let page: datatypes.Paging = { limit: limit };
1872
2488
 
2489
+ if (beforeId) {
2490
+ page.beforeId = beforeId;
2491
+ }
2492
+
1873
2493
  while (nextPage) {
1874
2494
  const pagedList = await this._pagedList(page);
1875
2495
  nextPage = pagedList.nextPageUri;
@@ -1890,10 +2510,10 @@ export class Endpoints {
1890
2510
  /**
1891
2511
  * Get the status of an endpoint by ID
1892
2512
  */
1893
- public get(arg: datatypes.Item): Promise<datatypes.Endpoint> {
2513
+ public get(id): Promise<datatypes.Endpoint> {
1894
2514
  return this.httpClient
1895
- .url(`/endpoints/${arg.id}`)
1896
- .get()
2515
+ .url(`/endpoints/${id}`)
2516
+ .get(id)
1897
2517
  .json(payload => util.deserializeResult(payload))
1898
2518
  .then(f => f, util.onRejected);
1899
2519
  }
@@ -1907,7 +2527,7 @@ export class EventDestinations {
1907
2527
  this.httpClient = httpClient;
1908
2528
  }
1909
2529
  /**
1910
- * Create a new Event Destination. It will not apply to anything until it is associated with an Event Stream, and that Event Stream is associated with an Endpoint Config.
2530
+ * Create a new Event Destination. It will not apply to anything until it is associated with an Event Subscription.
1911
2531
  */
1912
2532
  public create(
1913
2533
  arg: datatypes.EventDestinationCreate
@@ -1918,39 +2538,40 @@ export class EventDestinations {
1918
2538
  .json(payload => util.deserializeResult(payload))
1919
2539
  .then(f => f, util.onRejected);
1920
2540
  }
1921
-
1922
2541
  /**
1923
2542
  * Delete an Event Destination. If the Event Destination is still referenced by an Event Subscription.
1924
2543
  */
1925
- public delete(arg: datatypes.Item): Promise<void> {
2544
+ public delete(id): Promise<void> {
1926
2545
  return this.httpClient
1927
- .url(`/event_destinations/${arg.id}`)
1928
- .delete()
2546
+ .url(`/event_destinations/${id}`)
2547
+ .delete(id)
1929
2548
  .json(payload => util.deserializeResult(payload))
1930
2549
  .then(f => f, util.onRejected);
1931
2550
  }
1932
-
1933
2551
  /**
1934
2552
  * Get detailed information about an Event Destination by ID.
1935
2553
  */
1936
- public get(arg: datatypes.Item): Promise<datatypes.EventDestination> {
2554
+ public get(id): Promise<datatypes.EventDestination> {
1937
2555
  return this.httpClient
1938
- .url(`/event_destinations/${arg.id}`)
1939
- .get()
2556
+ .url(`/event_destinations/${id}`)
2557
+ .get(id)
1940
2558
  .json(payload => util.deserializeResult(payload))
1941
2559
  .then(f => f, util.onRejected);
1942
2560
  }
1943
-
1944
2561
  /**
1945
2562
  * List all Event Destinations on this account.
1946
2563
  */
1947
- public async list(): Promise<Array<datatypes.EventDestination>> {
2564
+ public async list(
2565
+ beforeId?: string,
2566
+ limit?: string
2567
+ ): Promise<Array<datatypes.EventDestination>> {
1948
2568
  const array: Array<datatypes.EventDestination> = [];
1949
- for await (const item of this._asyncList()) {
2569
+ for await (const item of this._asyncList(beforeId, limit)) {
1950
2570
  array.push(item);
1951
2571
  }
1952
2572
  return array;
1953
2573
  }
2574
+
1954
2575
  private _pagedList(
1955
2576
  arg: datatypes.Paging
1956
2577
  ): Promise<datatypes.EventDestinationList> {
@@ -1961,11 +2582,15 @@ export class EventDestinations {
1961
2582
  .json(payload => util.deserializeResult(payload))
1962
2583
  .then(util.onFulfilled, util.onRejected);
1963
2584
  }
1964
- private async *_asyncList() {
1965
- const limit = '100';
2585
+
2586
+ private async *_asyncList(beforeId: string, limit = '100') {
1966
2587
  let nextPage = 'initial loop';
1967
2588
  let page: datatypes.Paging = { limit: limit };
1968
2589
 
2590
+ if (beforeId) {
2591
+ page.beforeId = beforeId;
2592
+ }
2593
+
1969
2594
  while (nextPage) {
1970
2595
  const pagedList = await this._pagedList(page);
1971
2596
  nextPage = pagedList.nextPageUri;
@@ -2016,39 +2641,40 @@ export class EventSubscriptions {
2016
2641
  .json(payload => util.deserializeResult(payload))
2017
2642
  .then(f => f, util.onRejected);
2018
2643
  }
2019
-
2020
2644
  /**
2021
2645
  * Delete an Event Subscription.
2022
2646
  */
2023
- public delete(arg: datatypes.Item): Promise<void> {
2647
+ public delete(id): Promise<void> {
2024
2648
  return this.httpClient
2025
- .url(`/event_subscriptions/${arg.id}`)
2026
- .delete()
2649
+ .url(`/event_subscriptions/${id}`)
2650
+ .delete(id)
2027
2651
  .json(payload => util.deserializeResult(payload))
2028
2652
  .then(f => f, util.onRejected);
2029
2653
  }
2030
-
2031
2654
  /**
2032
2655
  * Get an Event Subscription by ID.
2033
2656
  */
2034
- public get(arg: datatypes.Item): Promise<datatypes.EventSubscription> {
2657
+ public get(id): Promise<datatypes.EventSubscription> {
2035
2658
  return this.httpClient
2036
- .url(`/event_subscriptions/${arg.id}`)
2037
- .get()
2659
+ .url(`/event_subscriptions/${id}`)
2660
+ .get(id)
2038
2661
  .json(payload => util.deserializeResult(payload))
2039
2662
  .then(f => f, util.onRejected);
2040
2663
  }
2041
-
2042
2664
  /**
2043
2665
  * List this Account's Event Subscriptions.
2044
2666
  */
2045
- public async list(): Promise<Array<datatypes.EventSubscription>> {
2667
+ public async list(
2668
+ beforeId?: string,
2669
+ limit?: string
2670
+ ): Promise<Array<datatypes.EventSubscription>> {
2046
2671
  const array: Array<datatypes.EventSubscription> = [];
2047
- for await (const item of this._asyncList()) {
2672
+ for await (const item of this._asyncList(beforeId, limit)) {
2048
2673
  array.push(item);
2049
2674
  }
2050
2675
  return array;
2051
2676
  }
2677
+
2052
2678
  private _pagedList(
2053
2679
  arg: datatypes.Paging
2054
2680
  ): Promise<datatypes.EventSubscriptionList> {
@@ -2059,11 +2685,15 @@ export class EventSubscriptions {
2059
2685
  .json(payload => util.deserializeResult(payload))
2060
2686
  .then(util.onFulfilled, util.onRejected);
2061
2687
  }
2062
- private async *_asyncList() {
2063
- const limit = '100';
2688
+
2689
+ private async *_asyncList(beforeId: string, limit = '100') {
2064
2690
  let nextPage = 'initial loop';
2065
2691
  let page: datatypes.Paging = { limit: limit };
2066
2692
 
2693
+ if (beforeId) {
2694
+ page.beforeId = beforeId;
2695
+ }
2696
+
2067
2697
  while (nextPage) {
2068
2698
  const pagedList = await this._pagedList(page);
2069
2699
  nextPage = pagedList.nextPageUri;
@@ -2114,7 +2744,6 @@ export class EventSources {
2114
2744
  .json(payload => util.deserializeResult(payload))
2115
2745
  .then(f => f, util.onRejected);
2116
2746
  }
2117
-
2118
2747
  /**
2119
2748
  * Remove a type for which this event subscription will trigger
2120
2749
  */
@@ -2125,7 +2754,6 @@ export class EventSources {
2125
2754
  .json(payload => util.deserializeResult(payload))
2126
2755
  .then(f => f, util.onRejected);
2127
2756
  }
2128
-
2129
2757
  /**
2130
2758
  * Get the details for a given type that triggers for the given event subscription
2131
2759
  */
@@ -2136,7 +2764,6 @@ export class EventSources {
2136
2764
  .json(payload => util.deserializeResult(payload))
2137
2765
  .then(f => f, util.onRejected);
2138
2766
  }
2139
-
2140
2767
  /**
2141
2768
  * List the types for which this event subscription will trigger
2142
2769
  */
@@ -2149,7 +2776,6 @@ export class EventSources {
2149
2776
  .json(payload => util.deserializeResult(payload))
2150
2777
  .then(f => f, util.onRejected);
2151
2778
  }
2152
-
2153
2779
  /**
2154
2780
  * Update the type for which this event subscription will trigger
2155
2781
  */
@@ -2187,39 +2813,40 @@ export class IPPolicies {
2187
2813
  .json(payload => util.deserializeResult(payload))
2188
2814
  .then(f => f, util.onRejected);
2189
2815
  }
2190
-
2191
2816
  /**
2192
2817
  * Delete an IP policy. If the IP policy is referenced by another object for the purposes of traffic restriction it will be treated as if the IP policy remains but has zero rules.
2193
2818
  */
2194
- public delete(arg: datatypes.Item): Promise<void> {
2819
+ public delete(id): Promise<void> {
2195
2820
  return this.httpClient
2196
- .url(`/ip_policies/${arg.id}`)
2197
- .delete()
2821
+ .url(`/ip_policies/${id}`)
2822
+ .delete(id)
2198
2823
  .json(payload => util.deserializeResult(payload))
2199
2824
  .then(f => f, util.onRejected);
2200
2825
  }
2201
-
2202
2826
  /**
2203
2827
  * Get detailed information about an IP policy by ID.
2204
2828
  */
2205
- public get(arg: datatypes.Item): Promise<datatypes.IPPolicy> {
2829
+ public get(id): Promise<datatypes.IPPolicy> {
2206
2830
  return this.httpClient
2207
- .url(`/ip_policies/${arg.id}`)
2208
- .get()
2831
+ .url(`/ip_policies/${id}`)
2832
+ .get(id)
2209
2833
  .json(payload => util.deserializeResult(payload))
2210
2834
  .then(f => f, util.onRejected);
2211
2835
  }
2212
-
2213
2836
  /**
2214
2837
  * List all IP policies on this account
2215
2838
  */
2216
- public async list(): Promise<Array<datatypes.IPPolicy>> {
2839
+ public async list(
2840
+ beforeId?: string,
2841
+ limit?: string
2842
+ ): Promise<Array<datatypes.IPPolicy>> {
2217
2843
  const array: Array<datatypes.IPPolicy> = [];
2218
- for await (const item of this._asyncList()) {
2844
+ for await (const item of this._asyncList(beforeId, limit)) {
2219
2845
  array.push(item);
2220
2846
  }
2221
2847
  return array;
2222
2848
  }
2849
+
2223
2850
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.IPPolicyList> {
2224
2851
  return this.httpClient
2225
2852
  .url(`/ip_policies`)
@@ -2228,11 +2855,15 @@ export class IPPolicies {
2228
2855
  .json(payload => util.deserializeResult(payload))
2229
2856
  .then(util.onFulfilled, util.onRejected);
2230
2857
  }
2231
- private async *_asyncList() {
2232
- const limit = '100';
2858
+
2859
+ private async *_asyncList(beforeId: string, limit = '100') {
2233
2860
  let nextPage = 'initial loop';
2234
2861
  let page: datatypes.Paging = { limit: limit };
2235
2862
 
2863
+ if (beforeId) {
2864
+ page.beforeId = beforeId;
2865
+ }
2866
+
2236
2867
  while (nextPage) {
2237
2868
  const pagedList = await this._pagedList(page);
2238
2869
  nextPage = pagedList.nextPageUri;
@@ -2285,39 +2916,40 @@ export class IPPolicyRules {
2285
2916
  .json(payload => util.deserializeResult(payload))
2286
2917
  .then(f => f, util.onRejected);
2287
2918
  }
2288
-
2289
2919
  /**
2290
2920
  * Delete an IP policy rule.
2291
2921
  */
2292
- public delete(arg: datatypes.Item): Promise<void> {
2922
+ public delete(id): Promise<void> {
2293
2923
  return this.httpClient
2294
- .url(`/ip_policy_rules/${arg.id}`)
2295
- .delete()
2924
+ .url(`/ip_policy_rules/${id}`)
2925
+ .delete(id)
2296
2926
  .json(payload => util.deserializeResult(payload))
2297
2927
  .then(f => f, util.onRejected);
2298
2928
  }
2299
-
2300
2929
  /**
2301
2930
  * Get detailed information about an IP policy rule by ID.
2302
2931
  */
2303
- public get(arg: datatypes.Item): Promise<datatypes.IPPolicyRule> {
2932
+ public get(id): Promise<datatypes.IPPolicyRule> {
2304
2933
  return this.httpClient
2305
- .url(`/ip_policy_rules/${arg.id}`)
2306
- .get()
2934
+ .url(`/ip_policy_rules/${id}`)
2935
+ .get(id)
2307
2936
  .json(payload => util.deserializeResult(payload))
2308
2937
  .then(f => f, util.onRejected);
2309
2938
  }
2310
-
2311
2939
  /**
2312
2940
  * List all IP policy rules on this account
2313
2941
  */
2314
- public async list(): Promise<Array<datatypes.IPPolicyRule>> {
2942
+ public async list(
2943
+ beforeId?: string,
2944
+ limit?: string
2945
+ ): Promise<Array<datatypes.IPPolicyRule>> {
2315
2946
  const array: Array<datatypes.IPPolicyRule> = [];
2316
- for await (const item of this._asyncList()) {
2947
+ for await (const item of this._asyncList(beforeId, limit)) {
2317
2948
  array.push(item);
2318
2949
  }
2319
2950
  return array;
2320
2951
  }
2952
+
2321
2953
  private _pagedList(
2322
2954
  arg: datatypes.Paging
2323
2955
  ): Promise<datatypes.IPPolicyRuleList> {
@@ -2328,11 +2960,15 @@ export class IPPolicyRules {
2328
2960
  .json(payload => util.deserializeResult(payload))
2329
2961
  .then(util.onFulfilled, util.onRejected);
2330
2962
  }
2331
- private async *_asyncList() {
2332
- const limit = '100';
2963
+
2964
+ private async *_asyncList(beforeId: string, limit = '100') {
2333
2965
  let nextPage = 'initial loop';
2334
2966
  let page: datatypes.Paging = { limit: limit };
2335
2967
 
2968
+ if (beforeId) {
2969
+ page.beforeId = beforeId;
2970
+ }
2971
+
2336
2972
  while (nextPage) {
2337
2973
  const pagedList = await this._pagedList(page);
2338
2974
  nextPage = pagedList.nextPageUri;
@@ -2391,39 +3027,40 @@ export class IPRestrictions {
2391
3027
  .json(payload => util.deserializeResult(payload))
2392
3028
  .then(f => f, util.onRejected);
2393
3029
  }
2394
-
2395
3030
  /**
2396
3031
  * Delete an IP restriction
2397
3032
  */
2398
- public delete(arg: datatypes.Item): Promise<void> {
3033
+ public delete(id): Promise<void> {
2399
3034
  return this.httpClient
2400
- .url(`/ip_restrictions/${arg.id}`)
2401
- .delete()
3035
+ .url(`/ip_restrictions/${id}`)
3036
+ .delete(id)
2402
3037
  .json(payload => util.deserializeResult(payload))
2403
3038
  .then(f => f, util.onRejected);
2404
3039
  }
2405
-
2406
3040
  /**
2407
3041
  * Get detailed information about an IP restriction
2408
3042
  */
2409
- public get(arg: datatypes.Item): Promise<datatypes.IPRestriction> {
3043
+ public get(id): Promise<datatypes.IPRestriction> {
2410
3044
  return this.httpClient
2411
- .url(`/ip_restrictions/${arg.id}`)
2412
- .get()
3045
+ .url(`/ip_restrictions/${id}`)
3046
+ .get(id)
2413
3047
  .json(payload => util.deserializeResult(payload))
2414
3048
  .then(f => f, util.onRejected);
2415
3049
  }
2416
-
2417
3050
  /**
2418
3051
  * List all IP restrictions on this account
2419
3052
  */
2420
- public async list(): Promise<Array<datatypes.IPRestriction>> {
3053
+ public async list(
3054
+ beforeId?: string,
3055
+ limit?: string
3056
+ ): Promise<Array<datatypes.IPRestriction>> {
2421
3057
  const array: Array<datatypes.IPRestriction> = [];
2422
- for await (const item of this._asyncList()) {
3058
+ for await (const item of this._asyncList(beforeId, limit)) {
2423
3059
  array.push(item);
2424
3060
  }
2425
3061
  return array;
2426
3062
  }
3063
+
2427
3064
  private _pagedList(
2428
3065
  arg: datatypes.Paging
2429
3066
  ): Promise<datatypes.IPRestrictionList> {
@@ -2434,11 +3071,15 @@ export class IPRestrictions {
2434
3071
  .json(payload => util.deserializeResult(payload))
2435
3072
  .then(util.onFulfilled, util.onRejected);
2436
3073
  }
2437
- private async *_asyncList() {
2438
- const limit = '100';
3074
+
3075
+ private async *_asyncList(beforeId: string, limit = '100') {
2439
3076
  let nextPage = 'initial loop';
2440
3077
  let page: datatypes.Paging = { limit: limit };
2441
3078
 
3079
+ if (beforeId) {
3080
+ page.beforeId = beforeId;
3081
+ }
3082
+
2442
3083
  while (nextPage) {
2443
3084
  const pagedList = await this._pagedList(page);
2444
3085
  nextPage = pagedList.nextPageUri;
@@ -2494,39 +3135,40 @@ export class ReservedAddrs {
2494
3135
  .json(payload => util.deserializeResult(payload))
2495
3136
  .then(f => f, util.onRejected);
2496
3137
  }
2497
-
2498
3138
  /**
2499
3139
  * Delete a reserved address.
2500
3140
  */
2501
- public delete(arg: datatypes.Item): Promise<void> {
3141
+ public delete(id): Promise<void> {
2502
3142
  return this.httpClient
2503
- .url(`/reserved_addrs/${arg.id}`)
2504
- .delete()
3143
+ .url(`/reserved_addrs/${id}`)
3144
+ .delete(id)
2505
3145
  .json(payload => util.deserializeResult(payload))
2506
3146
  .then(f => f, util.onRejected);
2507
3147
  }
2508
-
2509
3148
  /**
2510
3149
  * Get the details of a reserved address.
2511
3150
  */
2512
- public get(arg: datatypes.Item): Promise<datatypes.ReservedAddr> {
3151
+ public get(id): Promise<datatypes.ReservedAddr> {
2513
3152
  return this.httpClient
2514
- .url(`/reserved_addrs/${arg.id}`)
2515
- .get()
3153
+ .url(`/reserved_addrs/${id}`)
3154
+ .get(id)
2516
3155
  .json(payload => util.deserializeResult(payload))
2517
3156
  .then(f => f, util.onRejected);
2518
3157
  }
2519
-
2520
3158
  /**
2521
3159
  * List all reserved addresses on this account.
2522
3160
  */
2523
- public async list(): Promise<Array<datatypes.ReservedAddr>> {
3161
+ public async list(
3162
+ beforeId?: string,
3163
+ limit?: string
3164
+ ): Promise<Array<datatypes.ReservedAddr>> {
2524
3165
  const array: Array<datatypes.ReservedAddr> = [];
2525
- for await (const item of this._asyncList()) {
3166
+ for await (const item of this._asyncList(beforeId, limit)) {
2526
3167
  array.push(item);
2527
3168
  }
2528
3169
  return array;
2529
3170
  }
3171
+
2530
3172
  private _pagedList(
2531
3173
  arg: datatypes.Paging
2532
3174
  ): Promise<datatypes.ReservedAddrList> {
@@ -2537,11 +3179,15 @@ export class ReservedAddrs {
2537
3179
  .json(payload => util.deserializeResult(payload))
2538
3180
  .then(util.onFulfilled, util.onRejected);
2539
3181
  }
2540
- private async *_asyncList() {
2541
- const limit = '100';
3182
+
3183
+ private async *_asyncList(beforeId: string, limit = '100') {
2542
3184
  let nextPage = 'initial loop';
2543
3185
  let page: datatypes.Paging = { limit: limit };
2544
3186
 
3187
+ if (beforeId) {
3188
+ page.beforeId = beforeId;
3189
+ }
3190
+
2545
3191
  while (nextPage) {
2546
3192
  const pagedList = await this._pagedList(page);
2547
3193
  nextPage = pagedList.nextPageUri;
@@ -2598,39 +3244,40 @@ export class ReservedDomains {
2598
3244
  .json(payload => util.deserializeResult(payload))
2599
3245
  .then(f => f, util.onRejected);
2600
3246
  }
2601
-
2602
3247
  /**
2603
3248
  * Delete a reserved domain.
2604
3249
  */
2605
- public delete(arg: datatypes.Item): Promise<void> {
3250
+ public delete(id): Promise<void> {
2606
3251
  return this.httpClient
2607
- .url(`/reserved_domains/${arg.id}`)
2608
- .delete()
3252
+ .url(`/reserved_domains/${id}`)
3253
+ .delete(id)
2609
3254
  .json(payload => util.deserializeResult(payload))
2610
3255
  .then(f => f, util.onRejected);
2611
3256
  }
2612
-
2613
3257
  /**
2614
3258
  * Get the details of a reserved domain.
2615
3259
  */
2616
- public get(arg: datatypes.Item): Promise<datatypes.ReservedDomain> {
3260
+ public get(id): Promise<datatypes.ReservedDomain> {
2617
3261
  return this.httpClient
2618
- .url(`/reserved_domains/${arg.id}`)
2619
- .get()
3262
+ .url(`/reserved_domains/${id}`)
3263
+ .get(id)
2620
3264
  .json(payload => util.deserializeResult(payload))
2621
3265
  .then(f => f, util.onRejected);
2622
3266
  }
2623
-
2624
3267
  /**
2625
3268
  * List all reserved domains on this account.
2626
3269
  */
2627
- public async list(): Promise<Array<datatypes.ReservedDomain>> {
3270
+ public async list(
3271
+ beforeId?: string,
3272
+ limit?: string
3273
+ ): Promise<Array<datatypes.ReservedDomain>> {
2628
3274
  const array: Array<datatypes.ReservedDomain> = [];
2629
- for await (const item of this._asyncList()) {
3275
+ for await (const item of this._asyncList(beforeId, limit)) {
2630
3276
  array.push(item);
2631
3277
  }
2632
3278
  return array;
2633
3279
  }
3280
+
2634
3281
  private _pagedList(
2635
3282
  arg: datatypes.Paging
2636
3283
  ): Promise<datatypes.ReservedDomainList> {
@@ -2641,11 +3288,15 @@ export class ReservedDomains {
2641
3288
  .json(payload => util.deserializeResult(payload))
2642
3289
  .then(util.onFulfilled, util.onRejected);
2643
3290
  }
2644
- private async *_asyncList() {
2645
- const limit = '100';
3291
+
3292
+ private async *_asyncList(beforeId: string, limit = '100') {
2646
3293
  let nextPage = 'initial loop';
2647
3294
  let page: datatypes.Paging = { limit: limit };
2648
3295
 
3296
+ if (beforeId) {
3297
+ page.beforeId = beforeId;
3298
+ }
3299
+
2649
3300
  while (nextPage) {
2650
3301
  const pagedList = await this._pagedList(page);
2651
3302
  nextPage = pagedList.nextPageUri;
@@ -2675,25 +3326,23 @@ export class ReservedDomains {
2675
3326
  .json(payload => util.deserializeResult(payload))
2676
3327
  .then(f => f, util.onRejected);
2677
3328
  }
2678
-
2679
3329
  /**
2680
3330
  * Detach the certificate management policy attached to a reserved domain.
2681
3331
  */
2682
- public deleteCertificateManagementPolicy(arg: datatypes.Item): Promise<void> {
3332
+ public deleteCertificateManagementPolicy(id): Promise<void> {
2683
3333
  return this.httpClient
2684
- .url(`/reserved_domains/${arg.id}/certificate_management_policy`)
2685
- .delete()
3334
+ .url(`/reserved_domains/${id}/certificate_management_policy`)
3335
+ .delete(id)
2686
3336
  .json(payload => util.deserializeResult(payload))
2687
3337
  .then(f => f, util.onRejected);
2688
3338
  }
2689
-
2690
3339
  /**
2691
3340
  * Detach the certificate attached to a reserved domain.
2692
3341
  */
2693
- public deleteCertificate(arg: datatypes.Item): Promise<void> {
3342
+ public deleteCertificate(id): Promise<void> {
2694
3343
  return this.httpClient
2695
- .url(`/reserved_domains/${arg.id}/certificate`)
2696
- .delete()
3344
+ .url(`/reserved_domains/${id}/certificate`)
3345
+ .delete(id)
2697
3346
  .json(payload => util.deserializeResult(payload))
2698
3347
  .then(f => f, util.onRejected);
2699
3348
  }
@@ -2722,39 +3371,40 @@ export class SSHCertificateAuthorities {
2722
3371
  .json(payload => util.deserializeResult(payload))
2723
3372
  .then(f => f, util.onRejected);
2724
3373
  }
2725
-
2726
3374
  /**
2727
3375
  * Delete an SSH Certificate Authority
2728
3376
  */
2729
- public delete(arg: datatypes.Item): Promise<void> {
3377
+ public delete(id): Promise<void> {
2730
3378
  return this.httpClient
2731
- .url(`/ssh_certificate_authorities/${arg.id}`)
2732
- .delete()
3379
+ .url(`/ssh_certificate_authorities/${id}`)
3380
+ .delete(id)
2733
3381
  .json(payload => util.deserializeResult(payload))
2734
3382
  .then(f => f, util.onRejected);
2735
3383
  }
2736
-
2737
3384
  /**
2738
3385
  * Get detailed information about an SSH Certficate Authority
2739
3386
  */
2740
- public get(arg: datatypes.Item): Promise<datatypes.SSHCertificateAuthority> {
3387
+ public get(id): Promise<datatypes.SSHCertificateAuthority> {
2741
3388
  return this.httpClient
2742
- .url(`/ssh_certificate_authorities/${arg.id}`)
2743
- .get()
3389
+ .url(`/ssh_certificate_authorities/${id}`)
3390
+ .get(id)
2744
3391
  .json(payload => util.deserializeResult(payload))
2745
3392
  .then(f => f, util.onRejected);
2746
3393
  }
2747
-
2748
3394
  /**
2749
3395
  * List all SSH Certificate Authorities on this account
2750
3396
  */
2751
- public async list(): Promise<Array<datatypes.SSHCertificateAuthority>> {
3397
+ public async list(
3398
+ beforeId?: string,
3399
+ limit?: string
3400
+ ): Promise<Array<datatypes.SSHCertificateAuthority>> {
2752
3401
  const array: Array<datatypes.SSHCertificateAuthority> = [];
2753
- for await (const item of this._asyncList()) {
3402
+ for await (const item of this._asyncList(beforeId, limit)) {
2754
3403
  array.push(item);
2755
3404
  }
2756
3405
  return array;
2757
3406
  }
3407
+
2758
3408
  private _pagedList(
2759
3409
  arg: datatypes.Paging
2760
3410
  ): Promise<datatypes.SSHCertificateAuthorityList> {
@@ -2765,11 +3415,15 @@ export class SSHCertificateAuthorities {
2765
3415
  .json(payload => util.deserializeResult(payload))
2766
3416
  .then(util.onFulfilled, util.onRejected);
2767
3417
  }
2768
- private async *_asyncList() {
2769
- const limit = '100';
3418
+
3419
+ private async *_asyncList(beforeId: string, limit = '100') {
2770
3420
  let nextPage = 'initial loop';
2771
3421
  let page: datatypes.Paging = { limit: limit };
2772
3422
 
3423
+ if (beforeId) {
3424
+ page.beforeId = beforeId;
3425
+ }
3426
+
2773
3427
  while (nextPage) {
2774
3428
  const pagedList = await this._pagedList(page);
2775
3429
  nextPage = pagedList.nextPageUri;
@@ -2825,39 +3479,40 @@ export class SSHCredentials {
2825
3479
  .json(payload => util.deserializeResult(payload))
2826
3480
  .then(f => f, util.onRejected);
2827
3481
  }
2828
-
2829
3482
  /**
2830
3483
  * Delete an ssh_credential by ID
2831
3484
  */
2832
- public delete(arg: datatypes.Item): Promise<void> {
3485
+ public delete(id): Promise<void> {
2833
3486
  return this.httpClient
2834
- .url(`/ssh_credentials/${arg.id}`)
2835
- .delete()
3487
+ .url(`/ssh_credentials/${id}`)
3488
+ .delete(id)
2836
3489
  .json(payload => util.deserializeResult(payload))
2837
3490
  .then(f => f, util.onRejected);
2838
3491
  }
2839
-
2840
3492
  /**
2841
3493
  * Get detailed information about an ssh_credential
2842
3494
  */
2843
- public get(arg: datatypes.Item): Promise<datatypes.SSHCredential> {
3495
+ public get(id): Promise<datatypes.SSHCredential> {
2844
3496
  return this.httpClient
2845
- .url(`/ssh_credentials/${arg.id}`)
2846
- .get()
3497
+ .url(`/ssh_credentials/${id}`)
3498
+ .get(id)
2847
3499
  .json(payload => util.deserializeResult(payload))
2848
3500
  .then(f => f, util.onRejected);
2849
3501
  }
2850
-
2851
3502
  /**
2852
3503
  * List all ssh credentials on this account
2853
3504
  */
2854
- public async list(): Promise<Array<datatypes.SSHCredential>> {
3505
+ public async list(
3506
+ beforeId?: string,
3507
+ limit?: string
3508
+ ): Promise<Array<datatypes.SSHCredential>> {
2855
3509
  const array: Array<datatypes.SSHCredential> = [];
2856
- for await (const item of this._asyncList()) {
3510
+ for await (const item of this._asyncList(beforeId, limit)) {
2857
3511
  array.push(item);
2858
3512
  }
2859
3513
  return array;
2860
3514
  }
3515
+
2861
3516
  private _pagedList(
2862
3517
  arg: datatypes.Paging
2863
3518
  ): Promise<datatypes.SSHCredentialList> {
@@ -2868,11 +3523,15 @@ export class SSHCredentials {
2868
3523
  .json(payload => util.deserializeResult(payload))
2869
3524
  .then(util.onFulfilled, util.onRejected);
2870
3525
  }
2871
- private async *_asyncList() {
2872
- const limit = '100';
3526
+
3527
+ private async *_asyncList(beforeId: string, limit = '100') {
2873
3528
  let nextPage = 'initial loop';
2874
3529
  let page: datatypes.Paging = { limit: limit };
2875
3530
 
3531
+ if (beforeId) {
3532
+ page.beforeId = beforeId;
3533
+ }
3534
+
2876
3535
  while (nextPage) {
2877
3536
  const pagedList = await this._pagedList(page);
2878
3537
  nextPage = pagedList.nextPageUri;
@@ -2928,39 +3587,40 @@ export class SSHHostCertificates {
2928
3587
  .json(payload => util.deserializeResult(payload))
2929
3588
  .then(f => f, util.onRejected);
2930
3589
  }
2931
-
2932
3590
  /**
2933
3591
  * Delete an SSH Host Certificate
2934
3592
  */
2935
- public delete(arg: datatypes.Item): Promise<void> {
3593
+ public delete(id): Promise<void> {
2936
3594
  return this.httpClient
2937
- .url(`/ssh_host_certificates/${arg.id}`)
2938
- .delete()
3595
+ .url(`/ssh_host_certificates/${id}`)
3596
+ .delete(id)
2939
3597
  .json(payload => util.deserializeResult(payload))
2940
3598
  .then(f => f, util.onRejected);
2941
3599
  }
2942
-
2943
3600
  /**
2944
3601
  * Get detailed information about an SSH Host Certficate
2945
3602
  */
2946
- public get(arg: datatypes.Item): Promise<datatypes.SSHHostCertificate> {
3603
+ public get(id): Promise<datatypes.SSHHostCertificate> {
2947
3604
  return this.httpClient
2948
- .url(`/ssh_host_certificates/${arg.id}`)
2949
- .get()
3605
+ .url(`/ssh_host_certificates/${id}`)
3606
+ .get(id)
2950
3607
  .json(payload => util.deserializeResult(payload))
2951
3608
  .then(f => f, util.onRejected);
2952
3609
  }
2953
-
2954
3610
  /**
2955
3611
  * List all SSH Host Certificates issued on this account
2956
3612
  */
2957
- public async list(): Promise<Array<datatypes.SSHHostCertificate>> {
3613
+ public async list(
3614
+ beforeId?: string,
3615
+ limit?: string
3616
+ ): Promise<Array<datatypes.SSHHostCertificate>> {
2958
3617
  const array: Array<datatypes.SSHHostCertificate> = [];
2959
- for await (const item of this._asyncList()) {
3618
+ for await (const item of this._asyncList(beforeId, limit)) {
2960
3619
  array.push(item);
2961
3620
  }
2962
3621
  return array;
2963
3622
  }
3623
+
2964
3624
  private _pagedList(
2965
3625
  arg: datatypes.Paging
2966
3626
  ): Promise<datatypes.SSHHostCertificateList> {
@@ -2971,11 +3631,15 @@ export class SSHHostCertificates {
2971
3631
  .json(payload => util.deserializeResult(payload))
2972
3632
  .then(util.onFulfilled, util.onRejected);
2973
3633
  }
2974
- private async *_asyncList() {
2975
- const limit = '100';
3634
+
3635
+ private async *_asyncList(beforeId: string, limit = '100') {
2976
3636
  let nextPage = 'initial loop';
2977
3637
  let page: datatypes.Paging = { limit: limit };
2978
3638
 
3639
+ if (beforeId) {
3640
+ page.beforeId = beforeId;
3641
+ }
3642
+
2979
3643
  while (nextPage) {
2980
3644
  const pagedList = await this._pagedList(page);
2981
3645
  nextPage = pagedList.nextPageUri;
@@ -3032,39 +3696,40 @@ export class SSHUserCertificates {
3032
3696
  .json(payload => util.deserializeResult(payload))
3033
3697
  .then(f => f, util.onRejected);
3034
3698
  }
3035
-
3036
3699
  /**
3037
3700
  * Delete an SSH User Certificate
3038
3701
  */
3039
- public delete(arg: datatypes.Item): Promise<void> {
3702
+ public delete(id): Promise<void> {
3040
3703
  return this.httpClient
3041
- .url(`/ssh_user_certificates/${arg.id}`)
3042
- .delete()
3704
+ .url(`/ssh_user_certificates/${id}`)
3705
+ .delete(id)
3043
3706
  .json(payload => util.deserializeResult(payload))
3044
3707
  .then(f => f, util.onRejected);
3045
3708
  }
3046
-
3047
3709
  /**
3048
3710
  * Get detailed information about an SSH User Certficate
3049
3711
  */
3050
- public get(arg: datatypes.Item): Promise<datatypes.SSHUserCertificate> {
3712
+ public get(id): Promise<datatypes.SSHUserCertificate> {
3051
3713
  return this.httpClient
3052
- .url(`/ssh_user_certificates/${arg.id}`)
3053
- .get()
3714
+ .url(`/ssh_user_certificates/${id}`)
3715
+ .get(id)
3054
3716
  .json(payload => util.deserializeResult(payload))
3055
3717
  .then(f => f, util.onRejected);
3056
3718
  }
3057
-
3058
3719
  /**
3059
3720
  * List all SSH User Certificates issued on this account
3060
3721
  */
3061
- public async list(): Promise<Array<datatypes.SSHUserCertificate>> {
3722
+ public async list(
3723
+ beforeId?: string,
3724
+ limit?: string
3725
+ ): Promise<Array<datatypes.SSHUserCertificate>> {
3062
3726
  const array: Array<datatypes.SSHUserCertificate> = [];
3063
- for await (const item of this._asyncList()) {
3727
+ for await (const item of this._asyncList(beforeId, limit)) {
3064
3728
  array.push(item);
3065
3729
  }
3066
3730
  return array;
3067
3731
  }
3732
+
3068
3733
  private _pagedList(
3069
3734
  arg: datatypes.Paging
3070
3735
  ): Promise<datatypes.SSHUserCertificateList> {
@@ -3075,11 +3740,15 @@ export class SSHUserCertificates {
3075
3740
  .json(payload => util.deserializeResult(payload))
3076
3741
  .then(util.onFulfilled, util.onRejected);
3077
3742
  }
3078
- private async *_asyncList() {
3079
- const limit = '100';
3743
+
3744
+ private async *_asyncList(beforeId: string, limit = '100') {
3080
3745
  let nextPage = 'initial loop';
3081
3746
  let page: datatypes.Paging = { limit: limit };
3082
3747
 
3748
+ if (beforeId) {
3749
+ page.beforeId = beforeId;
3750
+ }
3751
+
3083
3752
  while (nextPage) {
3084
3753
  const pagedList = await this._pagedList(page);
3085
3754
  nextPage = pagedList.nextPageUri;
@@ -3138,39 +3807,40 @@ export class TLSCertificates {
3138
3807
  .json(payload => util.deserializeResult(payload))
3139
3808
  .then(f => f, util.onRejected);
3140
3809
  }
3141
-
3142
3810
  /**
3143
3811
  * Delete a TLS certificate
3144
3812
  */
3145
- public delete(arg: datatypes.Item): Promise<void> {
3813
+ public delete(id): Promise<void> {
3146
3814
  return this.httpClient
3147
- .url(`/tls_certificates/${arg.id}`)
3148
- .delete()
3815
+ .url(`/tls_certificates/${id}`)
3816
+ .delete(id)
3149
3817
  .json(payload => util.deserializeResult(payload))
3150
3818
  .then(f => f, util.onRejected);
3151
3819
  }
3152
-
3153
3820
  /**
3154
3821
  * Get detailed information about a TLS certificate
3155
3822
  */
3156
- public get(arg: datatypes.Item): Promise<datatypes.TLSCertificate> {
3823
+ public get(id): Promise<datatypes.TLSCertificate> {
3157
3824
  return this.httpClient
3158
- .url(`/tls_certificates/${arg.id}`)
3159
- .get()
3825
+ .url(`/tls_certificates/${id}`)
3826
+ .get(id)
3160
3827
  .json(payload => util.deserializeResult(payload))
3161
3828
  .then(f => f, util.onRejected);
3162
3829
  }
3163
-
3164
3830
  /**
3165
3831
  * List all TLS certificates on this account
3166
3832
  */
3167
- public async list(): Promise<Array<datatypes.TLSCertificate>> {
3833
+ public async list(
3834
+ beforeId?: string,
3835
+ limit?: string
3836
+ ): Promise<Array<datatypes.TLSCertificate>> {
3168
3837
  const array: Array<datatypes.TLSCertificate> = [];
3169
- for await (const item of this._asyncList()) {
3838
+ for await (const item of this._asyncList(beforeId, limit)) {
3170
3839
  array.push(item);
3171
3840
  }
3172
3841
  return array;
3173
3842
  }
3843
+
3174
3844
  private _pagedList(
3175
3845
  arg: datatypes.Paging
3176
3846
  ): Promise<datatypes.TLSCertificateList> {
@@ -3181,11 +3851,15 @@ export class TLSCertificates {
3181
3851
  .json(payload => util.deserializeResult(payload))
3182
3852
  .then(util.onFulfilled, util.onRejected);
3183
3853
  }
3184
- private async *_asyncList() {
3185
- const limit = '100';
3854
+
3855
+ private async *_asyncList(beforeId: string, limit = '100') {
3186
3856
  let nextPage = 'initial loop';
3187
3857
  let page: datatypes.Paging = { limit: limit };
3188
3858
 
3859
+ if (beforeId) {
3860
+ page.beforeId = beforeId;
3861
+ }
3862
+
3189
3863
  while (nextPage) {
3190
3864
  const pagedList = await this._pagedList(page);
3191
3865
  nextPage = pagedList.nextPageUri;
@@ -3217,105 +3891,6 @@ export class TLSCertificates {
3217
3891
  }
3218
3892
  }
3219
3893
 
3220
- /**
3221
- * Tunnel Sessions represent instances of ngrok agents or SSH reverse tunnel
3222
- sessions that are running and connected to the ngrok service. Each tunnel
3223
- session can include one or more Tunnels.
3224
- */
3225
- export class TunnelSessions {
3226
- private httpClient: Wretcher;
3227
-
3228
- /** Do not construct this object directly, use the <code>tunnelSessions</code> property of an <code>Ngrok</code> client object instead. */
3229
- public constructor(httpClient: Wretcher) {
3230
- this.httpClient = httpClient;
3231
- }
3232
- /**
3233
- * List all online tunnel sessions running on this account.
3234
- */
3235
- public async list(): Promise<Array<datatypes.TunnelSession>> {
3236
- const array: Array<datatypes.TunnelSession> = [];
3237
- for await (const item of this._asyncList()) {
3238
- array.push(item);
3239
- }
3240
- return array;
3241
- }
3242
- private _pagedList(
3243
- arg: datatypes.Paging
3244
- ): Promise<datatypes.TunnelSessionList> {
3245
- return this.httpClient
3246
- .url(`/tunnel_sessions`)
3247
- .query(arg)
3248
- .get()
3249
- .json(payload => util.deserializeResult(payload))
3250
- .then(util.onFulfilled, util.onRejected);
3251
- }
3252
- private async *_asyncList() {
3253
- const limit = '100';
3254
- let nextPage = 'initial loop';
3255
- let page: datatypes.Paging = { limit: limit };
3256
-
3257
- while (nextPage) {
3258
- const pagedList = await this._pagedList(page);
3259
- nextPage = pagedList.nextPageUri;
3260
- const items: datatypes.TunnelSession[] = pagedList.tunnelSessions;
3261
-
3262
- if (nextPage) {
3263
- page = {
3264
- beforeId: items[items.length - 1].id,
3265
- limit: limit,
3266
- };
3267
- }
3268
-
3269
- for (const item of items) {
3270
- yield item;
3271
- }
3272
- }
3273
- }
3274
- /**
3275
- * Get the detailed status of a tunnel session by ID
3276
- */
3277
- public get(arg: datatypes.Item): Promise<datatypes.TunnelSession> {
3278
- return this.httpClient
3279
- .url(`/tunnel_sessions/${arg.id}`)
3280
- .get()
3281
- .json(payload => util.deserializeResult(payload))
3282
- .then(f => f, util.onRejected);
3283
- }
3284
-
3285
- /**
3286
- * Issues a command instructing the ngrok agent to restart. The agent restarts itself by calling exec() on platforms that support it. This operation is notably not supported on Windows. When an agent restarts, it reconnects with a new tunnel session ID.
3287
- */
3288
- public restart(arg: datatypes.Item): Promise<void> {
3289
- return this.httpClient
3290
- .url(`/tunnel_sessions/${arg.id}/restart`)
3291
- .post(util.serializeArgument(arg))
3292
- .json(payload => util.deserializeResult(payload))
3293
- .then(f => f, util.onRejected);
3294
- }
3295
-
3296
- /**
3297
- * Issues a command instructing the ngrok agent that started this tunnel session to exit.
3298
- */
3299
- public stop(arg: datatypes.Item): Promise<void> {
3300
- return this.httpClient
3301
- .url(`/tunnel_sessions/${arg.id}/stop`)
3302
- .post(util.serializeArgument(arg))
3303
- .json(payload => util.deserializeResult(payload))
3304
- .then(f => f, util.onRejected);
3305
- }
3306
-
3307
- /**
3308
- * Issues a command instructing the ngrok agent to update itself to the latest version. After this call completes successfully, the ngrok agent will be in the update process. A caller should wait some amount of time to allow the update to complete (at least 10 seconds) before making a call to the Restart endpoint to request that the agent restart itself to start using the new code. This call will never update an ngrok agent to a new major version which could cause breaking compatibility issues. If you wish to update to a new major version, that must be done manually. Still, please be aware that updating your ngrok agent could break your integration. This call will fail in any of the following circumstances: there is no update available the ngrok agent's configuration disabled update checks the agent is currently in process of updating the agent has already successfully updated but has not yet been restarted
3309
- */
3310
- public update(arg: datatypes.TunnelSessionsUpdate): Promise<void> {
3311
- return this.httpClient
3312
- .url(`/tunnel_sessions/${arg.id}/update`)
3313
- .post(util.serializeArgument(arg))
3314
- .json(payload => util.deserializeResult(payload))
3315
- .then(f => f, util.onRejected);
3316
- }
3317
- }
3318
-
3319
3894
  /**
3320
3895
  * Tunnels provide endpoints to access services exposed by a running ngrok
3321
3896
  agent tunnel session or an SSH reverse tunnel session.
@@ -3330,13 +3905,17 @@ export class Tunnels {
3330
3905
  /**
3331
3906
  * List all online tunnels currently running on the account.
3332
3907
  */
3333
- public async list(): Promise<Array<datatypes.Tunnel>> {
3908
+ public async list(
3909
+ beforeId?: string,
3910
+ limit?: string
3911
+ ): Promise<Array<datatypes.Tunnel>> {
3334
3912
  const array: Array<datatypes.Tunnel> = [];
3335
- for await (const item of this._asyncList()) {
3913
+ for await (const item of this._asyncList(beforeId, limit)) {
3336
3914
  array.push(item);
3337
3915
  }
3338
3916
  return array;
3339
3917
  }
3918
+
3340
3919
  private _pagedList(arg: datatypes.Paging): Promise<datatypes.TunnelList> {
3341
3920
  return this.httpClient
3342
3921
  .url(`/tunnels`)
@@ -3345,11 +3924,15 @@ export class Tunnels {
3345
3924
  .json(payload => util.deserializeResult(payload))
3346
3925
  .then(util.onFulfilled, util.onRejected);
3347
3926
  }
3348
- private async *_asyncList() {
3349
- const limit = '100';
3927
+
3928
+ private async *_asyncList(beforeId: string, limit = '100') {
3350
3929
  let nextPage = 'initial loop';
3351
3930
  let page: datatypes.Paging = { limit: limit };
3352
3931
 
3932
+ if (beforeId) {
3933
+ page.beforeId = beforeId;
3934
+ }
3935
+
3353
3936
  while (nextPage) {
3354
3937
  const pagedList = await this._pagedList(page);
3355
3938
  nextPage = pagedList.nextPageUri;
@@ -3370,10 +3953,10 @@ export class Tunnels {
3370
3953
  /**
3371
3954
  * Get the status of a tunnel by ID
3372
3955
  */
3373
- public get(arg: datatypes.Item): Promise<datatypes.Tunnel> {
3956
+ public get(id): Promise<datatypes.Tunnel> {
3374
3957
  return this.httpClient
3375
- .url(`/tunnels/${arg.id}`)
3376
- .get()
3958
+ .url(`/tunnels/${id}`)
3959
+ .get(id)
3377
3960
  .json(payload => util.deserializeResult(payload))
3378
3961
  .then(f => f, util.onRejected);
3379
3962
  }