@ngrok/ngrok-api 0.3.0 → 0.7.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 (242) hide show
  1. package/README.md +0 -28
  2. package/docs/assets/js/search.js +1 -1
  3. package/docs/classes/client.Ngrok.html +191 -100
  4. package/docs/classes/services.APIKeys.html +6 -105
  5. package/docs/classes/services.AbuseReports.html +3 -102
  6. package/docs/classes/services.AgentIngresses.html +6 -105
  7. package/docs/classes/services.CertificateAuthorities.html +6 -105
  8. package/docs/classes/services.Credentials.html +6 -105
  9. package/docs/classes/services.EdgeRouteBackendModule.html +270 -0
  10. package/docs/classes/services.EdgeRouteCircuitBreakerModule.html +270 -0
  11. package/docs/classes/services.EdgeRouteCompressionModule.html +270 -0
  12. package/docs/classes/{services.EndpointCircuitBreakerModule.html → services.EdgeRouteIPRestrictionModule.html} +28 -127
  13. package/docs/classes/services.EdgeRouteOAuthModule.html +270 -0
  14. package/docs/classes/services.EdgeRouteOIDCModule.html +270 -0
  15. package/docs/classes/{services.EndpointResponseHeadersModule.html → services.EdgeRouteRequestHeadersModule.html} +28 -127
  16. package/docs/classes/services.EdgeRouteResponseHeadersModule.html +270 -0
  17. package/docs/classes/services.EdgeRouteSAMLModule.html +270 -0
  18. package/docs/classes/services.EdgeRouteWebhookVerificationModule.html +270 -0
  19. package/docs/classes/services.EdgeRouteWebsocketTCPConverterModule.html +270 -0
  20. package/docs/classes/services.EdgesHTTPS.html +343 -0
  21. package/docs/classes/services.EdgesHTTPSRoutes.html +317 -0
  22. package/docs/classes/services.EdgesTCP.html +343 -0
  23. package/docs/classes/services.EdgesTLS.html +343 -0
  24. package/docs/classes/services.Endpoints.html +256 -0
  25. package/docs/classes/services.EventDestinations.html +7 -106
  26. package/docs/classes/services.EventSources.html +6 -105
  27. package/docs/classes/services.EventSubscriptions.html +6 -105
  28. package/docs/classes/services.FailoverBackends.html +353 -0
  29. package/docs/classes/services.HTTPResponseBackends.html +318 -0
  30. package/docs/classes/{services.EndpointMutualTLSModule.html → services.HTTPSEdgeMutualTLSModule.html} +22 -121
  31. package/docs/classes/{services.EndpointTLSTerminationModule.html → services.HTTPSEdgeTLSTerminationModule.html} +22 -121
  32. package/docs/classes/services.IPPolicies.html +6 -105
  33. package/docs/classes/services.IPPolicyRules.html +6 -105
  34. package/docs/classes/services.IPRestrictions.html +7 -106
  35. package/docs/classes/services.ReservedAddrs.html +6 -137
  36. package/docs/classes/services.ReservedDomains.html +8 -171
  37. package/docs/classes/services.SSHCertificateAuthorities.html +6 -105
  38. package/docs/classes/services.SSHCredentials.html +6 -105
  39. package/docs/classes/services.SSHHostCertificates.html +6 -105
  40. package/docs/classes/services.SSHUserCertificates.html +6 -105
  41. package/docs/classes/{services.EndpointSAMLModule.html → services.TCPEdgeBackendModule.html} +25 -124
  42. package/docs/classes/{services.EndpointIPPolicyModule.html → services.TCPEdgeIPRestrictionModule.html} +22 -121
  43. package/docs/classes/services.TLSCertificates.html +6 -105
  44. package/docs/classes/{services.EndpointLoggingModule.html → services.TLSEdgeBackendModule.html} +25 -124
  45. package/docs/classes/{services.EndpointOIDCModule.html → services.TLSEdgeIPRestrictionModule.html} +25 -124
  46. package/docs/classes/{services.EndpointOAuthModule.html → services.TLSEdgeMutualTLSModule.html} +25 -124
  47. package/docs/classes/services.TLSEdgeTLSTerminationModule.html +270 -0
  48. package/docs/classes/services.TunnelGroupBackends.html +351 -0
  49. package/docs/classes/services.TunnelSessions.html +6 -105
  50. package/docs/classes/services.Tunnels.html +34 -101
  51. package/docs/classes/{services.EventStreams.html → services.WeightedBackends.html} +51 -140
  52. package/docs/index.html +0 -27
  53. package/docs/interfaces/client.NgrokConfig.html +2 -2
  54. package/docs/interfaces/datatypes.APIKey.html +6 -6
  55. package/docs/interfaces/datatypes.APIKeyCreate.html +2 -2
  56. package/docs/interfaces/datatypes.APIKeyList.html +3 -3
  57. package/docs/interfaces/datatypes.APIKeyUpdate.html +3 -3
  58. package/docs/interfaces/datatypes.AWSAuth.html +2 -2
  59. package/docs/interfaces/datatypes.AWSCredentials.html +2 -2
  60. package/docs/interfaces/datatypes.AWSRole.html +1 -1
  61. package/docs/interfaces/datatypes.AbuseReport.html +7 -7
  62. package/docs/interfaces/datatypes.AbuseReportCreate.html +2 -2
  63. package/docs/interfaces/datatypes.AbuseReportHostname.html +2 -2
  64. package/docs/interfaces/datatypes.AgentIngress.html +8 -8
  65. package/docs/interfaces/datatypes.AgentIngressCreate.html +3 -3
  66. package/docs/interfaces/datatypes.AgentIngressList.html +3 -3
  67. package/docs/interfaces/datatypes.AgentIngressUpdate.html +3 -3
  68. package/docs/interfaces/datatypes.CertificateAuthority.html +11 -11
  69. package/docs/interfaces/datatypes.CertificateAuthorityCreate.html +3 -3
  70. package/docs/interfaces/datatypes.CertificateAuthorityList.html +3 -3
  71. package/docs/interfaces/datatypes.CertificateAuthorityUpdate.html +3 -3
  72. package/docs/interfaces/datatypes.Credential.html +7 -7
  73. package/docs/interfaces/datatypes.CredentialCreate.html +3 -3
  74. package/docs/interfaces/datatypes.CredentialList.html +3 -3
  75. package/docs/interfaces/datatypes.CredentialUpdate.html +4 -4
  76. package/docs/interfaces/{datatypes.EndpointOIDCReplace.html → datatypes.EdgeBackendReplace.html} +12 -12
  77. package/docs/interfaces/{datatypes.EndpointIPPolicyReplace.html → datatypes.EdgeIPRestrictionReplace.html} +11 -11
  78. package/docs/interfaces/{datatypes.EndpointMutualTLSReplace.html → datatypes.EdgeMutualTLSReplace.html} +11 -11
  79. package/docs/interfaces/datatypes.EdgeRouteBackendReplace.html +190 -0
  80. package/docs/interfaces/datatypes.EdgeRouteCircuitBreakerReplace.html +190 -0
  81. package/docs/interfaces/{datatypes.EndpointCompressionReplace.html → datatypes.EdgeRouteCompressionReplace.html} +25 -11
  82. package/docs/interfaces/datatypes.EdgeRouteIPRestrictionReplace.html +190 -0
  83. package/docs/interfaces/{datatypes.EndpointCircuitBreakerReplace.html → datatypes.EdgeRouteItem.html} +27 -17
  84. package/docs/interfaces/{datatypes.EndpointOAuthReplace.html → datatypes.EdgeRouteOAuthReplace.html} +25 -11
  85. package/docs/interfaces/datatypes.EdgeRouteOIDCReplace.html +190 -0
  86. package/docs/interfaces/{datatypes.EndpointRequestHeadersReplace.html → datatypes.EdgeRouteRequestHeadersReplace.html} +25 -11
  87. package/docs/interfaces/datatypes.EdgeRouteResponseHeadersReplace.html +190 -0
  88. package/docs/interfaces/{datatypes.EndpointSAMLReplace.html → datatypes.EdgeRouteSAMLReplace.html} +25 -11
  89. package/docs/interfaces/{datatypes.EndpointWebhookValidationReplace.html → datatypes.EdgeRouteWebhookVerificationReplace.html} +25 -11
  90. package/docs/interfaces/datatypes.EdgeRouteWebsocketTCPConverterReplace.html +190 -0
  91. package/docs/interfaces/{datatypes.EndpointResponseHeadersReplace.html → datatypes.EdgeTLSTerminationAtEdgeReplace.html} +12 -12
  92. package/docs/interfaces/{datatypes.EndpointTLSTerminationReplace.html → datatypes.EdgeTLSTerminationReplace.html} +11 -11
  93. package/docs/interfaces/datatypes.Endpoint.html +395 -0
  94. package/docs/interfaces/{datatypes.EndpointLogging.html → datatypes.EndpointBackend.html} +19 -19
  95. package/docs/interfaces/{datatypes.EndpointLoggingMutate.html → datatypes.EndpointBackendMutate.html} +19 -19
  96. package/docs/interfaces/datatypes.EndpointCircuitBreaker.html +6 -6
  97. package/docs/interfaces/datatypes.EndpointCompression.html +1 -1
  98. package/docs/interfaces/datatypes.EndpointIPPolicy.html +2 -2
  99. package/docs/interfaces/datatypes.EndpointIPPolicyMutate.html +2 -2
  100. package/docs/interfaces/datatypes.EndpointList.html +205 -0
  101. package/docs/interfaces/datatypes.EndpointMutualTLS.html +2 -2
  102. package/docs/interfaces/datatypes.EndpointMutualTLSMutate.html +2 -2
  103. package/docs/interfaces/datatypes.EndpointOAuth.html +7 -7
  104. package/docs/interfaces/datatypes.EndpointOAuthFacebook.html +5 -5
  105. package/docs/interfaces/datatypes.EndpointOAuthGitHub.html +7 -7
  106. package/docs/interfaces/datatypes.EndpointOAuthGoogle.html +5 -5
  107. package/docs/interfaces/datatypes.EndpointOAuthMicrosoft.html +5 -5
  108. package/docs/interfaces/datatypes.EndpointOAuthProvider.html +4 -4
  109. package/docs/interfaces/datatypes.EndpointOIDC.html +9 -9
  110. package/docs/interfaces/datatypes.EndpointRequestHeaders.html +3 -3
  111. package/docs/interfaces/datatypes.EndpointResponseHeaders.html +3 -3
  112. package/docs/interfaces/datatypes.EndpointSAML.html +15 -15
  113. package/docs/interfaces/datatypes.EndpointSAMLMutate.html +10 -10
  114. package/docs/interfaces/datatypes.EndpointTLSTermination.html +3 -3
  115. package/docs/interfaces/datatypes.EndpointTLSTerminationAtEdge.html +186 -0
  116. package/docs/interfaces/datatypes.EndpointWebhookValidation.html +4 -4
  117. package/docs/interfaces/datatypes.EndpointWebsocketTCPConverter.html +167 -0
  118. package/docs/interfaces/datatypes.Error.html +4 -4
  119. package/docs/interfaces/datatypes.EventDestination.html +7 -7
  120. package/docs/interfaces/datatypes.EventDestinationCreate.html +4 -4
  121. package/docs/interfaces/datatypes.EventDestinationList.html +3 -3
  122. package/docs/interfaces/datatypes.EventDestinationUpdate.html +5 -5
  123. package/docs/interfaces/datatypes.EventSource.html +2 -2
  124. package/docs/interfaces/datatypes.EventSourceCreate.html +2 -2
  125. package/docs/interfaces/datatypes.EventSourceItem.html +2 -2
  126. package/docs/interfaces/datatypes.EventSourceList.html +2 -2
  127. package/docs/interfaces/datatypes.EventSourcePaging.html +1 -1
  128. package/docs/interfaces/datatypes.EventSourceReplace.html +1 -1
  129. package/docs/interfaces/datatypes.EventSourceUpdate.html +2 -2
  130. package/docs/interfaces/datatypes.EventSubscription.html +7 -7
  131. package/docs/interfaces/datatypes.EventSubscriptionCreate.html +5 -5
  132. package/docs/interfaces/datatypes.EventSubscriptionList.html +3 -3
  133. package/docs/interfaces/datatypes.EventSubscriptionUpdate.html +6 -6
  134. package/docs/interfaces/datatypes.EventTarget.html +3 -3
  135. package/docs/interfaces/datatypes.EventTargetCloudwatchLogs.html +2 -2
  136. package/docs/interfaces/datatypes.EventTargetFirehose.html +2 -2
  137. package/docs/interfaces/datatypes.EventTargetKinesis.html +2 -2
  138. package/docs/interfaces/{datatypes.EventStreamCreate.html → datatypes.FailoverBackend.html} +44 -44
  139. package/docs/interfaces/datatypes.FailoverBackendCreate.html +205 -0
  140. package/docs/interfaces/datatypes.FailoverBackendList.html +205 -0
  141. package/docs/interfaces/datatypes.FailoverBackendUpdate.html +219 -0
  142. package/docs/interfaces/datatypes.HTTPResponseBackend.html +295 -0
  143. package/docs/interfaces/datatypes.HTTPResponseBackendCreate.html +243 -0
  144. package/docs/interfaces/datatypes.HTTPResponseBackendList.html +190 -0
  145. package/docs/interfaces/{datatypes.EventStreamUpdate.html → datatypes.HTTPResponseBackendUpdate.html} +40 -45
  146. package/docs/interfaces/{datatypes.EventStream.html → datatypes.HTTPSEdge.html} +58 -63
  147. package/docs/interfaces/datatypes.HTTPSEdgeCreate.html +238 -0
  148. package/docs/interfaces/{datatypes.EventStreamList.html → datatypes.HTTPSEdgeList.html} +20 -20
  149. package/docs/interfaces/{datatypes.EndpointConfiguration.html → datatypes.HTTPSEdgeRoute.html} +123 -104
  150. package/docs/interfaces/{datatypes.EndpointConfigurationCreate.html → datatypes.HTTPSEdgeRouteCreate.html} +108 -89
  151. package/docs/interfaces/{datatypes.EndpointConfigurationUpdate.html → datatypes.HTTPSEdgeRouteUpdate.html} +115 -77
  152. package/docs/interfaces/datatypes.HTTPSEdgeUpdate.html +257 -0
  153. package/docs/interfaces/datatypes.IPPolicy.html +5 -24
  154. package/docs/interfaces/datatypes.IPPolicyCreate.html +2 -21
  155. package/docs/interfaces/datatypes.IPPolicyList.html +3 -3
  156. package/docs/interfaces/datatypes.IPPolicyRule.html +26 -7
  157. package/docs/interfaces/datatypes.IPPolicyRuleCreate.html +23 -4
  158. package/docs/interfaces/datatypes.IPPolicyRuleList.html +3 -3
  159. package/docs/interfaces/datatypes.IPPolicyRuleUpdate.html +4 -4
  160. package/docs/interfaces/datatypes.IPPolicyUpdate.html +3 -3
  161. package/docs/interfaces/datatypes.IPRestriction.html +8 -8
  162. package/docs/interfaces/datatypes.IPRestrictionCreate.html +5 -5
  163. package/docs/interfaces/datatypes.IPRestrictionList.html +3 -3
  164. package/docs/interfaces/datatypes.IPRestrictionUpdate.html +5 -5
  165. package/docs/interfaces/datatypes.Item.html +1 -1
  166. package/docs/interfaces/datatypes.Paging.html +2 -2
  167. package/docs/interfaces/datatypes.Ref.html +2 -2
  168. package/docs/interfaces/datatypes.ReservedAddr.html +7 -26
  169. package/docs/interfaces/datatypes.ReservedAddrCreate.html +3 -22
  170. package/docs/interfaces/datatypes.ReservedAddrList.html +3 -3
  171. package/docs/interfaces/datatypes.ReservedAddrUpdate.html +3 -22
  172. package/docs/interfaces/datatypes.ReservedDomain.html +12 -50
  173. package/docs/interfaces/datatypes.ReservedDomainCertJob.html +4 -4
  174. package/docs/interfaces/datatypes.ReservedDomainCertPolicy.html +2 -2
  175. package/docs/interfaces/datatypes.ReservedDomainCertStatus.html +2 -2
  176. package/docs/interfaces/datatypes.ReservedDomainCreate.html +6 -44
  177. package/docs/interfaces/datatypes.ReservedDomainList.html +3 -3
  178. package/docs/interfaces/datatypes.ReservedDomainUpdate.html +5 -43
  179. package/docs/interfaces/datatypes.SSHCertificateAuthority.html +7 -7
  180. package/docs/interfaces/datatypes.SSHCertificateAuthorityCreate.html +5 -5
  181. package/docs/interfaces/datatypes.SSHCertificateAuthorityList.html +3 -3
  182. package/docs/interfaces/datatypes.SSHCertificateAuthorityUpdate.html +3 -3
  183. package/docs/interfaces/datatypes.SSHCredential.html +7 -7
  184. package/docs/interfaces/datatypes.SSHCredentialCreate.html +4 -4
  185. package/docs/interfaces/datatypes.SSHCredentialList.html +3 -3
  186. package/docs/interfaces/datatypes.SSHCredentialUpdate.html +4 -4
  187. package/docs/interfaces/datatypes.SSHHostCertificate.html +12 -12
  188. package/docs/interfaces/datatypes.SSHHostCertificateCreate.html +7 -7
  189. package/docs/interfaces/datatypes.SSHHostCertificateList.html +3 -3
  190. package/docs/interfaces/datatypes.SSHHostCertificateUpdate.html +3 -3
  191. package/docs/interfaces/datatypes.SSHUserCertificate.html +14 -14
  192. package/docs/interfaces/datatypes.SSHUserCertificateCreate.html +9 -9
  193. package/docs/interfaces/datatypes.SSHUserCertificateList.html +3 -3
  194. package/docs/interfaces/datatypes.SSHUserCertificateUpdate.html +3 -3
  195. package/docs/interfaces/datatypes.TCPEdge.html +295 -0
  196. package/docs/interfaces/datatypes.TCPEdgeCreate.html +238 -0
  197. package/docs/interfaces/datatypes.TCPEdgeList.html +205 -0
  198. package/docs/interfaces/datatypes.TCPEdgeUpdate.html +257 -0
  199. package/docs/interfaces/datatypes.TLSCertificate.html +21 -21
  200. package/docs/interfaces/datatypes.TLSCertificateCreate.html +4 -4
  201. package/docs/interfaces/datatypes.TLSCertificateList.html +3 -3
  202. package/docs/interfaces/datatypes.TLSCertificateSANs.html +2 -2
  203. package/docs/interfaces/datatypes.TLSCertificateUpdate.html +3 -3
  204. package/docs/interfaces/datatypes.TLSEdge.html +323 -0
  205. package/docs/interfaces/datatypes.TLSEdgeCreate.html +266 -0
  206. package/docs/interfaces/datatypes.TLSEdgeList.html +205 -0
  207. package/docs/interfaces/datatypes.TLSEdgeUpdate.html +285 -0
  208. package/docs/interfaces/datatypes.Tunnel.html +85 -9
  209. package/docs/interfaces/datatypes.TunnelGroupBackend.html +281 -0
  210. package/docs/interfaces/datatypes.TunnelGroupBackendCreate.html +205 -0
  211. package/docs/interfaces/datatypes.TunnelGroupBackendList.html +205 -0
  212. package/docs/interfaces/datatypes.TunnelGroupBackendUpdate.html +219 -0
  213. package/docs/interfaces/datatypes.TunnelList.html +3 -3
  214. package/docs/interfaces/datatypes.TunnelSession.html +10 -10
  215. package/docs/interfaces/datatypes.TunnelSessionList.html +3 -3
  216. package/docs/interfaces/datatypes.TunnelSessionsUpdate.html +1 -1
  217. package/docs/interfaces/datatypes.WeightedBackend.html +262 -0
  218. package/docs/interfaces/datatypes.WeightedBackendCreate.html +205 -0
  219. package/docs/interfaces/{datatypes.EndpointConfigurationList.html → datatypes.WeightedBackendList.html} +19 -19
  220. package/docs/interfaces/datatypes.WeightedBackendUpdate.html +219 -0
  221. package/docs/modules/datatypes.html +197 -69
  222. package/docs/modules/services.html +85 -29
  223. package/lib/client.d.ts +53 -19
  224. package/lib/client.d.ts.map +1 -1
  225. package/lib/client.js +42 -18
  226. package/lib/client.js.map +1 -1
  227. package/lib/datatypes.d.ts +570 -236
  228. package/lib/datatypes.d.ts.map +1 -1
  229. package/lib/services.d.ts +358 -138
  230. package/lib/services.d.ts.map +1 -1
  231. package/lib/services.js +1367 -528
  232. package/lib/services.js.map +1 -1
  233. package/package.json +2 -2
  234. package/src/client.ts +95 -38
  235. package/src/datatypes.ts +618 -252
  236. package/src/services.ts +1363 -543
  237. package/docs/classes/services.EndpointCompressionModule.html +0 -369
  238. package/docs/classes/services.EndpointConfigurations.html +0 -451
  239. package/docs/classes/services.EndpointRequestHeadersModule.html +0 -369
  240. package/docs/classes/services.EndpointWebhookValidationModule.html +0 -369
  241. package/docs/interfaces/datatypes.EndpointLoggingReplace.html +0 -176
  242. package/test/endpointConfigurations.test.js +0 -67
package/src/services.ts CHANGED
@@ -237,59 +237,58 @@ export class APIKeys {
237
237
  }
238
238
 
239
239
  /**
240
- * Certificate Authorities are x509 certificates that are used to sign other
241
- x509 certificates. Attach a Certificate Authority to the Mutual TLS module
242
- to verify that the TLS certificate presented by a client has been signed by
243
- this CA. Certificate Authorities are used only for mTLS validation only and
244
- thus a private key is not included in the resource.
240
+ * A Failover backend defines failover behavior within a list of referenced
241
+ backends. Traffic is sent to the first backend in the list. If that backend
242
+ is offline or no connection can be established, ngrok attempts to connect to
243
+ the next backend in the list until one is successful.
245
244
  */
246
- export class CertificateAuthorities {
245
+ export class FailoverBackends {
247
246
  private httpClient: Wretcher;
248
247
 
249
- /** Do not construct this object directly, use the <code>certificateAuthorities</code> property of an <code>Ngrok</code> client object instead. */
248
+ /** Do not construct this object directly, use the <code>failoverBackends</code> property of an <code>Ngrok</code> client object instead. */
250
249
  public constructor(httpClient: Wretcher) {
251
250
  this.httpClient = httpClient;
252
251
  }
253
252
  /**
254
- * Upload a new Certificate Authority
253
+ * Create a new Failover backend
255
254
  */
256
255
  public create(
257
- arg: datatypes.CertificateAuthorityCreate
258
- ): Promise<datatypes.CertificateAuthority> {
256
+ arg: datatypes.FailoverBackendCreate
257
+ ): Promise<datatypes.FailoverBackend> {
259
258
  return this.httpClient
260
- .url(`/certificate_authorities`)
259
+ .url(`/backends/failover`)
261
260
  .post(util.serializeArgument(arg))
262
261
  .json(payload => util.deserializeResult(payload))
263
262
  .then(f => f, util.onRejected);
264
263
  }
265
264
 
266
265
  /**
267
- * Delete a Certificate Authority
266
+ * Delete a Failover backend by ID. TODO what if used?
268
267
  */
269
268
  public delete(arg: datatypes.Item): Promise<void> {
270
269
  return this.httpClient
271
- .url(`/certificate_authorities/${arg.id}`)
270
+ .url(`/backends/failover/${arg.id}`)
272
271
  .delete()
273
272
  .json(payload => util.deserializeResult(payload))
274
273
  .then(f => f, util.onRejected);
275
274
  }
276
275
 
277
276
  /**
278
- * Get detailed information about a certficate authority
277
+ * Get detailed information about a Failover backend by ID
279
278
  */
280
- public get(arg: datatypes.Item): Promise<datatypes.CertificateAuthority> {
279
+ public get(arg: datatypes.Item): Promise<datatypes.FailoverBackend> {
281
280
  return this.httpClient
282
- .url(`/certificate_authorities/${arg.id}`)
281
+ .url(`/backends/failover/${arg.id}`)
283
282
  .get()
284
283
  .json(payload => util.deserializeResult(payload))
285
284
  .then(f => f, util.onRejected);
286
285
  }
287
286
 
288
287
  /**
289
- * List all Certificate Authority on this account
288
+ * List all Failover backends on this account
290
289
  */
291
- public async list(): Promise<Array<datatypes.CertificateAuthority>> {
292
- const array: Array<datatypes.CertificateAuthority> = [];
290
+ public async list(): Promise<Array<datatypes.FailoverBackend>> {
291
+ const array: Array<datatypes.FailoverBackend> = [];
293
292
  for await (const item of this._asyncList()) {
294
293
  array.push(item);
295
294
  }
@@ -297,9 +296,9 @@ export class CertificateAuthorities {
297
296
  }
298
297
  private _pagedList(
299
298
  arg: datatypes.Paging
300
- ): Promise<datatypes.CertificateAuthorityList> {
299
+ ): Promise<datatypes.FailoverBackendList> {
301
300
  return this.httpClient
302
- .url(`/certificate_authorities`)
301
+ .url(`/backends/failover`)
303
302
  .query(arg)
304
303
  .get()
305
304
  .json(payload => util.deserializeResult(payload))
@@ -313,8 +312,7 @@ export class CertificateAuthorities {
313
312
  while (nextPage) {
314
313
  const pagedList = await this._pagedList(page);
315
314
  nextPage = pagedList.nextPageUri;
316
- const items: datatypes.CertificateAuthority[] =
317
- pagedList.certificateAuthorities;
315
+ const items: datatypes.FailoverBackend[] = pagedList.backends;
318
316
 
319
317
  if (nextPage) {
320
318
  page = {
@@ -329,80 +327,64 @@ export class CertificateAuthorities {
329
327
  }
330
328
  }
331
329
  /**
332
- * Update attributes of a Certificate Authority by ID
330
+ * Update Failover backend by ID
333
331
  */
334
332
  public update(
335
- arg: datatypes.CertificateAuthorityUpdate
336
- ): Promise<datatypes.CertificateAuthority> {
333
+ arg: datatypes.FailoverBackendUpdate
334
+ ): Promise<datatypes.FailoverBackend> {
337
335
  return this.httpClient
338
- .url(`/certificate_authorities/${arg.id}`)
336
+ .url(`/backends/failover/${arg.id}`)
339
337
  .patch(util.serializeArgument(arg))
340
338
  .json(payload => util.deserializeResult(payload))
341
339
  .then(f => f, util.onRejected);
342
340
  }
343
341
  }
344
342
 
345
- /**
346
- * Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
347
- agent to connect the ngrok service as your account. They are installed with
348
- the `ngrok authtoken` command or by specifying it in the `ngrok.yml`
349
- configuration file with the `authtoken` property.
350
- */
351
- export class Credentials {
343
+ export class HTTPResponseBackends {
352
344
  private httpClient: Wretcher;
353
345
 
354
- /** Do not construct this object directly, use the <code>credentials</code> property of an <code>Ngrok</code> client object instead. */
346
+ /** Do not construct this object directly, use the <code>httpResponseBackends</code> property of an <code>Ngrok</code> client object instead. */
355
347
  public constructor(httpClient: Wretcher) {
356
348
  this.httpClient = httpClient;
357
349
  }
358
- /**
359
- * Create a new tunnel authtoken credential. This authtoken credential can be used to start a new tunnel session. The response to this API call is the only time the generated token is available. If you need it for future use, you must save it securely yourself.
360
- */
361
350
  public create(
362
- arg: datatypes.CredentialCreate
363
- ): Promise<datatypes.Credential> {
351
+ arg: datatypes.HTTPResponseBackendCreate
352
+ ): Promise<datatypes.HTTPResponseBackend> {
364
353
  return this.httpClient
365
- .url(`/credentials`)
354
+ .url(`/backends/http_response`)
366
355
  .post(util.serializeArgument(arg))
367
356
  .json(payload => util.deserializeResult(payload))
368
357
  .then(f => f, util.onRejected);
369
358
  }
370
359
 
371
- /**
372
- * Delete a tunnel authtoken credential by ID
373
- */
374
360
  public delete(arg: datatypes.Item): Promise<void> {
375
361
  return this.httpClient
376
- .url(`/credentials/${arg.id}`)
362
+ .url(`/backends/http_response/${arg.id}`)
377
363
  .delete()
378
364
  .json(payload => util.deserializeResult(payload))
379
365
  .then(f => f, util.onRejected);
380
366
  }
381
367
 
382
- /**
383
- * Get detailed information about a tunnel authtoken credential
384
- */
385
- public get(arg: datatypes.Item): Promise<datatypes.Credential> {
368
+ public get(arg: datatypes.Item): Promise<datatypes.HTTPResponseBackend> {
386
369
  return this.httpClient
387
- .url(`/credentials/${arg.id}`)
370
+ .url(`/backends/http_response/${arg.id}`)
388
371
  .get()
389
372
  .json(payload => util.deserializeResult(payload))
390
373
  .then(f => f, util.onRejected);
391
374
  }
392
375
 
393
- /**
394
- * List all tunnel authtoken credentials on this account
395
- */
396
- public async list(): Promise<Array<datatypes.Credential>> {
397
- const array: Array<datatypes.Credential> = [];
376
+ public async list(): Promise<Array<datatypes.HTTPResponseBackend>> {
377
+ const array: Array<datatypes.HTTPResponseBackend> = [];
398
378
  for await (const item of this._asyncList()) {
399
379
  array.push(item);
400
380
  }
401
381
  return array;
402
382
  }
403
- private _pagedList(arg: datatypes.Paging): Promise<datatypes.CredentialList> {
383
+ private _pagedList(
384
+ arg: datatypes.Paging
385
+ ): Promise<datatypes.HTTPResponseBackendList> {
404
386
  return this.httpClient
405
- .url(`/credentials`)
387
+ .url(`/backends/http_response`)
406
388
  .query(arg)
407
389
  .get()
408
390
  .json(payload => util.deserializeResult(payload))
@@ -416,7 +398,7 @@ export class Credentials {
416
398
  while (nextPage) {
417
399
  const pagedList = await this._pagedList(page);
418
400
  nextPage = pagedList.nextPageUri;
419
- const items: datatypes.Credential[] = pagedList.credentials;
401
+ const items: datatypes.HTTPResponseBackend[] = pagedList.backends;
420
402
 
421
403
  if (nextPage) {
422
404
  page = {
@@ -430,14 +412,11 @@ export class Credentials {
430
412
  }
431
413
  }
432
414
  }
433
- /**
434
- * Update attributes of an tunnel authtoken credential by ID
435
- */
436
415
  public update(
437
- arg: datatypes.CredentialUpdate
438
- ): Promise<datatypes.Credential> {
416
+ arg: datatypes.HTTPResponseBackendUpdate
417
+ ): Promise<datatypes.HTTPResponseBackend> {
439
418
  return this.httpClient
440
- .url(`/credentials/${arg.id}`)
419
+ .url(`/backends/http_response/${arg.id}`)
441
420
  .patch(util.serializeArgument(arg))
442
421
  .json(payload => util.deserializeResult(payload))
443
422
  .then(f => f, util.onRejected);
@@ -445,57 +424,56 @@ export class Credentials {
445
424
  }
446
425
 
447
426
  /**
448
- * Endpoint Configurations are a reusable group of modules that encapsulate how
449
- traffic to a domain or address is handled. Endpoint configurations are only
450
- applied to Domains and TCP Addresses they have been attached to.
427
+ * A Tunnel Group Backend balances traffic among all online tunnels that match
428
+ a label selector.
451
429
  */
452
- export class EndpointConfigurations {
430
+ export class TunnelGroupBackends {
453
431
  private httpClient: Wretcher;
454
432
 
455
- /** Do not construct this object directly, use the <code>endpointConfigurations</code> property of an <code>Ngrok</code> client object instead. */
433
+ /** Do not construct this object directly, use the <code>tunnelGroupBackends</code> property of an <code>Ngrok</code> client object instead. */
456
434
  public constructor(httpClient: Wretcher) {
457
435
  this.httpClient = httpClient;
458
436
  }
459
437
  /**
460
- * Create a new endpoint configuration
438
+ * Create a new TunnelGroup backend
461
439
  */
462
440
  public create(
463
- arg: datatypes.EndpointConfigurationCreate
464
- ): Promise<datatypes.EndpointConfiguration> {
441
+ arg: datatypes.TunnelGroupBackendCreate
442
+ ): Promise<datatypes.TunnelGroupBackend> {
465
443
  return this.httpClient
466
- .url(`/endpoint_configurations`)
444
+ .url(`/backends/tunnel_group`)
467
445
  .post(util.serializeArgument(arg))
468
446
  .json(payload => util.deserializeResult(payload))
469
447
  .then(f => f, util.onRejected);
470
448
  }
471
449
 
472
450
  /**
473
- * Delete an endpoint configuration. This operation will fail if the endpoint configuration is still referenced by any reserved domain or reserved address.
451
+ * Delete a TunnelGroup backend by ID. TODO what if used?
474
452
  */
475
453
  public delete(arg: datatypes.Item): Promise<void> {
476
454
  return this.httpClient
477
- .url(`/endpoint_configurations/${arg.id}`)
455
+ .url(`/backends/tunnel_group/${arg.id}`)
478
456
  .delete()
479
457
  .json(payload => util.deserializeResult(payload))
480
458
  .then(f => f, util.onRejected);
481
459
  }
482
460
 
483
461
  /**
484
- * Returns detailed information about an endpoint configuration
462
+ * Get detailed information about a TunnelGroup backend by ID
485
463
  */
486
- public get(arg: datatypes.Item): Promise<datatypes.EndpointConfiguration> {
464
+ public get(arg: datatypes.Item): Promise<datatypes.TunnelGroupBackend> {
487
465
  return this.httpClient
488
- .url(`/endpoint_configurations/${arg.id}`)
466
+ .url(`/backends/tunnel_group/${arg.id}`)
489
467
  .get()
490
468
  .json(payload => util.deserializeResult(payload))
491
469
  .then(f => f, util.onRejected);
492
470
  }
493
471
 
494
472
  /**
495
- * Returns a list of all endpoint configurations on this account
473
+ * List all TunnelGroup backends on this account
496
474
  */
497
- public async list(): Promise<Array<datatypes.EndpointConfiguration>> {
498
- const array: Array<datatypes.EndpointConfiguration> = [];
475
+ public async list(): Promise<Array<datatypes.TunnelGroupBackend>> {
476
+ const array: Array<datatypes.TunnelGroupBackend> = [];
499
477
  for await (const item of this._asyncList()) {
500
478
  array.push(item);
501
479
  }
@@ -503,9 +481,9 @@ export class EndpointConfigurations {
503
481
  }
504
482
  private _pagedList(
505
483
  arg: datatypes.Paging
506
- ): Promise<datatypes.EndpointConfigurationList> {
484
+ ): Promise<datatypes.TunnelGroupBackendList> {
507
485
  return this.httpClient
508
- .url(`/endpoint_configurations`)
486
+ .url(`/backends/tunnel_group`)
509
487
  .query(arg)
510
488
  .get()
511
489
  .json(payload => util.deserializeResult(payload))
@@ -519,8 +497,7 @@ export class EndpointConfigurations {
519
497
  while (nextPage) {
520
498
  const pagedList = await this._pagedList(page);
521
499
  nextPage = pagedList.nextPageUri;
522
- const items: datatypes.EndpointConfiguration[] =
523
- pagedList.endpointConfigurations;
500
+ const items: datatypes.TunnelGroupBackend[] = pagedList.backends;
524
501
 
525
502
  if (nextPage) {
526
503
  page = {
@@ -535,66 +512,72 @@ export class EndpointConfigurations {
535
512
  }
536
513
  }
537
514
  /**
538
- * Updates an endpoint configuration. 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.
515
+ * Update TunnelGroup backend by ID
539
516
  */
540
517
  public update(
541
- arg: datatypes.EndpointConfigurationUpdate
542
- ): Promise<datatypes.EndpointConfiguration> {
518
+ arg: datatypes.TunnelGroupBackendUpdate
519
+ ): Promise<datatypes.TunnelGroupBackend> {
543
520
  return this.httpClient
544
- .url(`/endpoint_configurations/${arg.id}`)
521
+ .url(`/backends/tunnel_group/${arg.id}`)
545
522
  .patch(util.serializeArgument(arg))
546
523
  .json(payload => util.deserializeResult(payload))
547
524
  .then(f => f, util.onRejected);
548
525
  }
549
526
  }
550
527
 
551
- export class EventStreams {
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 {
552
535
  private httpClient: Wretcher;
553
536
 
554
- /** Do not construct this object directly, use the <code>eventStreams</code> property of an <code>Ngrok</code> client object instead. */
537
+ /** Do not construct this object directly, use the <code>weightedBackends</code> property of an <code>Ngrok</code> client object instead. */
555
538
  public constructor(httpClient: Wretcher) {
556
539
  this.httpClient = httpClient;
557
540
  }
558
541
  /**
559
- * Create a new Event Stream. It will not apply to anything until you associate it with one or more Endpoint Configs.
542
+ * Create a new Weighted backend
560
543
  */
561
544
  public create(
562
- arg: datatypes.EventStreamCreate
563
- ): Promise<datatypes.EventStream> {
545
+ arg: datatypes.WeightedBackendCreate
546
+ ): Promise<datatypes.WeightedBackend> {
564
547
  return this.httpClient
565
- .url(`/event_streams`)
548
+ .url(`/backends/weighted`)
566
549
  .post(util.serializeArgument(arg))
567
550
  .json(payload => util.deserializeResult(payload))
568
551
  .then(f => f, util.onRejected);
569
552
  }
570
553
 
571
554
  /**
572
- * Delete an Event Stream. Associated Event Destinations will be preserved.
555
+ * Delete a Weighted backend by ID. TODO what if used?
573
556
  */
574
557
  public delete(arg: datatypes.Item): Promise<void> {
575
558
  return this.httpClient
576
- .url(`/event_streams/${arg.id}`)
559
+ .url(`/backends/weighted/${arg.id}`)
577
560
  .delete()
578
561
  .json(payload => util.deserializeResult(payload))
579
562
  .then(f => f, util.onRejected);
580
563
  }
581
564
 
582
565
  /**
583
- * Get detailed information about an Event Stream by ID.
566
+ * Get detailed information about a Weighted backend by ID
584
567
  */
585
- public get(arg: datatypes.Item): Promise<datatypes.EventStream> {
568
+ public get(arg: datatypes.Item): Promise<datatypes.WeightedBackend> {
586
569
  return this.httpClient
587
- .url(`/event_streams/${arg.id}`)
570
+ .url(`/backends/weighted/${arg.id}`)
588
571
  .get()
589
572
  .json(payload => util.deserializeResult(payload))
590
573
  .then(f => f, util.onRejected);
591
574
  }
592
575
 
593
576
  /**
594
- * List all Event Streams available on this account.
577
+ * List all Weighted backends on this account
595
578
  */
596
- public async list(): Promise<Array<datatypes.EventStream>> {
597
- const array: Array<datatypes.EventStream> = [];
579
+ public async list(): Promise<Array<datatypes.WeightedBackend>> {
580
+ const array: Array<datatypes.WeightedBackend> = [];
598
581
  for await (const item of this._asyncList()) {
599
582
  array.push(item);
600
583
  }
@@ -602,9 +585,9 @@ export class EventStreams {
602
585
  }
603
586
  private _pagedList(
604
587
  arg: datatypes.Paging
605
- ): Promise<datatypes.EventStreamList> {
588
+ ): Promise<datatypes.WeightedBackendList> {
606
589
  return this.httpClient
607
- .url(`/event_streams`)
590
+ .url(`/backends/weighted`)
608
591
  .query(arg)
609
592
  .get()
610
593
  .json(payload => util.deserializeResult(payload))
@@ -618,7 +601,7 @@ export class EventStreams {
618
601
  while (nextPage) {
619
602
  const pagedList = await this._pagedList(page);
620
603
  nextPage = pagedList.nextPageUri;
621
- const items: datatypes.EventStream[] = pagedList.eventStreams;
604
+ const items: datatypes.WeightedBackend[] = pagedList.backends;
622
605
 
623
606
  if (nextPage) {
624
607
  page = {
@@ -633,66 +616,73 @@ export class EventStreams {
633
616
  }
634
617
  }
635
618
  /**
636
- * Update attributes of an Event Stream by ID.
619
+ * Update Weighted backend by ID
637
620
  */
638
621
  public update(
639
- arg: datatypes.EventStreamUpdate
640
- ): Promise<datatypes.EventStream> {
622
+ arg: datatypes.WeightedBackendUpdate
623
+ ): Promise<datatypes.WeightedBackend> {
641
624
  return this.httpClient
642
- .url(`/event_streams/${arg.id}`)
625
+ .url(`/backends/weighted/${arg.id}`)
643
626
  .patch(util.serializeArgument(arg))
644
627
  .json(payload => util.deserializeResult(payload))
645
628
  .then(f => f, util.onRejected);
646
629
  }
647
630
  }
648
631
 
649
- export class EventDestinations {
632
+ /**
633
+ * Certificate Authorities are x509 certificates that are used to sign other
634
+ x509 certificates. Attach a Certificate Authority to the Mutual TLS module
635
+ to verify that the TLS certificate presented by a client has been signed by
636
+ this CA. Certificate Authorities are used only for mTLS validation only and
637
+ thus a private key is not included in the resource.
638
+ */
639
+ export class CertificateAuthorities {
650
640
  private httpClient: Wretcher;
651
641
 
652
- /** Do not construct this object directly, use the <code>eventDestinations</code> property of an <code>Ngrok</code> client object instead. */
642
+ /** Do not construct this object directly, use the <code>certificateAuthorities</code> property of an <code>Ngrok</code> client object instead. */
653
643
  public constructor(httpClient: Wretcher) {
654
644
  this.httpClient = httpClient;
655
645
  }
656
646
  /**
657
- * 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.
647
+ * Upload a new Certificate Authority
658
648
  */
659
649
  public create(
660
- arg: datatypes.EventDestinationCreate
661
- ): Promise<datatypes.EventDestination> {
650
+ arg: datatypes.CertificateAuthorityCreate
651
+ ): Promise<datatypes.CertificateAuthority> {
662
652
  return this.httpClient
663
- .url(`/event_destinations`)
653
+ .url(`/certificate_authorities`)
664
654
  .post(util.serializeArgument(arg))
665
655
  .json(payload => util.deserializeResult(payload))
666
656
  .then(f => f, util.onRejected);
667
657
  }
668
658
 
669
659
  /**
670
- * Delete an Event Destination. If the Event Destination is still referenced by an Event Stream, this will throw an error until that Event Stream has removed that reference.
660
+ * Delete a Certificate Authority
671
661
  */
672
662
  public delete(arg: datatypes.Item): Promise<void> {
673
663
  return this.httpClient
674
- .url(`/event_destinations/${arg.id}`)
664
+ .url(`/certificate_authorities/${arg.id}`)
675
665
  .delete()
676
666
  .json(payload => util.deserializeResult(payload))
677
667
  .then(f => f, util.onRejected);
678
668
  }
679
669
 
680
670
  /**
681
- * Get detailed information about an Event Destination by ID.
671
+ * Get detailed information about a certficate authority
682
672
  */
683
- public get(arg: datatypes.Item): Promise<datatypes.EventDestination> {
673
+ public get(arg: datatypes.Item): Promise<datatypes.CertificateAuthority> {
684
674
  return this.httpClient
685
- .url(`/event_destinations/${arg.id}`)
675
+ .url(`/certificate_authorities/${arg.id}`)
686
676
  .get()
687
677
  .json(payload => util.deserializeResult(payload))
688
678
  .then(f => f, util.onRejected);
689
679
  }
690
680
 
691
681
  /**
692
- * List all Event Destinations on this account.
682
+ * List all Certificate Authority on this account
693
683
  */
694
- public async list(): Promise<Array<datatypes.EventDestination>> {
695
- const array: Array<datatypes.EventDestination> = [];
684
+ public async list(): Promise<Array<datatypes.CertificateAuthority>> {
685
+ const array: Array<datatypes.CertificateAuthority> = [];
696
686
  for await (const item of this._asyncList()) {
697
687
  array.push(item);
698
688
  }
@@ -700,9 +690,9 @@ export class EventDestinations {
700
690
  }
701
691
  private _pagedList(
702
692
  arg: datatypes.Paging
703
- ): Promise<datatypes.EventDestinationList> {
693
+ ): Promise<datatypes.CertificateAuthorityList> {
704
694
  return this.httpClient
705
- .url(`/event_destinations`)
695
+ .url(`/certificate_authorities`)
706
696
  .query(arg)
707
697
  .get()
708
698
  .json(payload => util.deserializeResult(payload))
@@ -716,7 +706,8 @@ export class EventDestinations {
716
706
  while (nextPage) {
717
707
  const pagedList = await this._pagedList(page);
718
708
  nextPage = pagedList.nextPageUri;
719
- const items: datatypes.EventDestination[] = pagedList.eventDestinations;
709
+ const items: datatypes.CertificateAuthority[] =
710
+ pagedList.certificateAuthorities;
720
711
 
721
712
  if (nextPage) {
722
713
  page = {
@@ -731,76 +722,80 @@ export class EventDestinations {
731
722
  }
732
723
  }
733
724
  /**
734
- * Update attributes of an Event Destination.
725
+ * Update attributes of a Certificate Authority by ID
735
726
  */
736
727
  public update(
737
- arg: datatypes.EventDestinationUpdate
738
- ): Promise<datatypes.EventDestination> {
728
+ arg: datatypes.CertificateAuthorityUpdate
729
+ ): Promise<datatypes.CertificateAuthority> {
739
730
  return this.httpClient
740
- .url(`/event_destinations/${arg.id}`)
731
+ .url(`/certificate_authorities/${arg.id}`)
741
732
  .patch(util.serializeArgument(arg))
742
733
  .json(payload => util.deserializeResult(payload))
743
734
  .then(f => f, util.onRejected);
744
735
  }
745
736
  }
746
737
 
747
- export class EventSubscriptions {
738
+ /**
739
+ * Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
740
+ 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`
742
+ configuration file with the `authtoken` property.
743
+ */
744
+ export class Credentials {
748
745
  private httpClient: Wretcher;
749
746
 
750
- /** Do not construct this object directly, use the <code>eventSubscriptions</code> property of an <code>Ngrok</code> client object instead. */
747
+ /** Do not construct this object directly, use the <code>credentials</code> property of an <code>Ngrok</code> client object instead. */
751
748
  public constructor(httpClient: Wretcher) {
752
749
  this.httpClient = httpClient;
753
750
  }
754
751
  /**
755
- * Create an Event Subscription.
752
+ * Create a new tunnel authtoken credential. This authtoken credential can be used to start a new tunnel session. The response to this API call is the only time the generated token is available. If you need it for future use, you must save it securely yourself.
756
753
  */
757
754
  public create(
758
- arg: datatypes.EventSubscriptionCreate
759
- ): Promise<datatypes.EventSubscription> {
755
+ arg: datatypes.CredentialCreate
756
+ ): Promise<datatypes.Credential> {
760
757
  return this.httpClient
761
- .url(`/event_subscriptions`)
758
+ .url(`/credentials`)
762
759
  .post(util.serializeArgument(arg))
763
760
  .json(payload => util.deserializeResult(payload))
764
761
  .then(f => f, util.onRejected);
765
762
  }
766
763
 
767
764
  /**
768
- * Delete an Event Subscription.
765
+ * Delete a tunnel authtoken credential by ID
769
766
  */
770
767
  public delete(arg: datatypes.Item): Promise<void> {
771
768
  return this.httpClient
772
- .url(`/event_subscriptions/${arg.id}`)
769
+ .url(`/credentials/${arg.id}`)
773
770
  .delete()
774
771
  .json(payload => util.deserializeResult(payload))
775
772
  .then(f => f, util.onRejected);
776
773
  }
777
774
 
778
775
  /**
779
- * Get an Event Subscription by ID.
776
+ * Get detailed information about a tunnel authtoken credential
780
777
  */
781
- public get(arg: datatypes.Item): Promise<datatypes.EventSubscription> {
778
+ public get(arg: datatypes.Item): Promise<datatypes.Credential> {
782
779
  return this.httpClient
783
- .url(`/event_subscriptions/${arg.id}`)
780
+ .url(`/credentials/${arg.id}`)
784
781
  .get()
785
782
  .json(payload => util.deserializeResult(payload))
786
783
  .then(f => f, util.onRejected);
787
784
  }
788
785
 
789
786
  /**
790
- * List this Account's Event Subscriptions.
787
+ * List all tunnel authtoken credentials on this account
791
788
  */
792
- public async list(): Promise<Array<datatypes.EventSubscription>> {
793
- const array: Array<datatypes.EventSubscription> = [];
789
+ public async list(): Promise<Array<datatypes.Credential>> {
790
+ const array: Array<datatypes.Credential> = [];
794
791
  for await (const item of this._asyncList()) {
795
792
  array.push(item);
796
793
  }
797
794
  return array;
798
795
  }
799
- private _pagedList(
800
- arg: datatypes.Paging
801
- ): Promise<datatypes.EventSubscriptionList> {
796
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.CredentialList> {
802
797
  return this.httpClient
803
- .url(`/event_subscriptions`)
798
+ .url(`/credentials`)
804
799
  .query(arg)
805
800
  .get()
806
801
  .json(payload => util.deserializeResult(payload))
@@ -814,7 +809,7 @@ export class EventSubscriptions {
814
809
  while (nextPage) {
815
810
  const pagedList = await this._pagedList(page);
816
811
  nextPage = pagedList.nextPageUri;
817
- const items: datatypes.EventSubscription[] = pagedList.eventSubscriptions;
812
+ const items: datatypes.Credential[] = pagedList.credentials;
818
813
 
819
814
  if (nextPage) {
820
815
  page = {
@@ -829,147 +824,117 @@ export class EventSubscriptions {
829
824
  }
830
825
  }
831
826
  /**
832
- * Update an Event Subscription.
827
+ * Update attributes of an tunnel authtoken credential by ID
833
828
  */
834
829
  public update(
835
- arg: datatypes.EventSubscriptionUpdate
836
- ): Promise<datatypes.EventSubscription> {
830
+ arg: datatypes.CredentialUpdate
831
+ ): Promise<datatypes.Credential> {
837
832
  return this.httpClient
838
- .url(`/event_subscriptions/${arg.id}`)
833
+ .url(`/credentials/${arg.id}`)
839
834
  .patch(util.serializeArgument(arg))
840
835
  .json(payload => util.deserializeResult(payload))
841
836
  .then(f => f, util.onRejected);
842
837
  }
843
838
  }
844
839
 
845
- export class EventSources {
840
+ export class EdgesHTTPSRoutes {
846
841
  private httpClient: Wretcher;
847
842
 
848
- /** Do not construct this object directly, use the <code>eventSources</code> property of an <code>Ngrok</code> client object instead. */
843
+ /** Do not construct this object directly, use the <code>edgesHttpsRoutes</code> property of an <code>Ngrok</code> client object instead. */
849
844
  public constructor(httpClient: Wretcher) {
850
845
  this.httpClient = httpClient;
851
846
  }
852
847
  /**
853
- * Add an additional type for which this event subscription will trigger
848
+ * Create an HTTPS Edge Route
854
849
  */
855
850
  public create(
856
- arg: datatypes.EventSourceCreate
857
- ): Promise<datatypes.EventSource> {
851
+ arg: datatypes.HTTPSEdgeRouteCreate
852
+ ): Promise<datatypes.HTTPSEdgeRoute> {
858
853
  return this.httpClient
859
- .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
854
+ .url(`/edges/https/${arg.edgeId}/routes`)
860
855
  .post(util.serializeArgument(arg))
861
856
  .json(payload => util.deserializeResult(payload))
862
857
  .then(f => f, util.onRejected);
863
858
  }
864
859
 
865
860
  /**
866
- * Remove a type for which this event subscription will trigger
867
- */
868
- public delete(arg: datatypes.EventSourceItem): Promise<void> {
869
- return this.httpClient
870
- .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
871
- .delete()
872
- .json(payload => util.deserializeResult(payload))
873
- .then(f => f, util.onRejected);
874
- }
875
-
876
- /**
877
- * Get the details for a given type that triggers for the given event subscription
861
+ * Get an HTTPS Edge Route by ID
878
862
  */
879
- public get(arg: datatypes.EventSourceItem): Promise<datatypes.EventSource> {
863
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.HTTPSEdgeRoute> {
880
864
  return this.httpClient
881
- .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
865
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
882
866
  .get()
883
867
  .json(payload => util.deserializeResult(payload))
884
868
  .then(f => f, util.onRejected);
885
869
  }
886
870
 
887
871
  /**
888
- * List the types for which this event subscription will trigger
872
+ * 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.
889
873
  */
890
- public list(
891
- arg: datatypes.EventSourcePaging
892
- ): Promise<datatypes.EventSourceList> {
874
+ public update(
875
+ arg: datatypes.HTTPSEdgeRouteUpdate
876
+ ): Promise<datatypes.HTTPSEdgeRoute> {
893
877
  return this.httpClient
894
- .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
895
- .get()
878
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
879
+ .patch(util.serializeArgument(arg))
896
880
  .json(payload => util.deserializeResult(payload))
897
881
  .then(f => f, util.onRejected);
898
882
  }
899
883
 
900
884
  /**
901
- * Update the type for which this event subscription will trigger
885
+ * Delete an HTTPS Edge Route by ID
902
886
  */
903
- public update(
904
- arg: datatypes.EventSourceUpdate
905
- ): Promise<datatypes.EventSource> {
887
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
906
888
  return this.httpClient
907
- .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
908
- .patch(util.serializeArgument(arg))
889
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
890
+ .delete()
909
891
  .json(payload => util.deserializeResult(payload))
910
892
  .then(f => f, util.onRejected);
911
893
  }
912
894
  }
913
895
 
914
- /**
915
- * IP Policies are reusable groups of CIDR ranges with an `allow` or `deny`
916
- action. They can be attached to endpoints via the Endpoint Configuration IP
917
- Policy module. They can also be used with IP Restrictions to control source
918
- IP ranges that can start tunnel sessions and connect to the API and dashboard.
919
- */
920
- export class IPPolicies {
896
+ export class EdgesHTTPS {
921
897
  private httpClient: Wretcher;
922
898
 
923
- /** Do not construct this object directly, use the <code>ipPolicies</code> property of an <code>Ngrok</code> client object instead. */
899
+ /** Do not construct this object directly, use the <code>edgesHttps</code> property of an <code>Ngrok</code> client object instead. */
924
900
  public constructor(httpClient: Wretcher) {
925
901
  this.httpClient = httpClient;
926
902
  }
927
903
  /**
928
- * Create a new IP policy. It will not apply to any traffic until you associate to a traffic source via an endpoint configuration or IP restriction.
904
+ * Create an HTTPS Edge
929
905
  */
930
- public create(arg: datatypes.IPPolicyCreate): Promise<datatypes.IPPolicy> {
906
+ public create(arg: datatypes.HTTPSEdgeCreate): Promise<datatypes.HTTPSEdge> {
931
907
  return this.httpClient
932
- .url(`/ip_policies`)
908
+ .url(`/edges/https`)
933
909
  .post(util.serializeArgument(arg))
934
910
  .json(payload => util.deserializeResult(payload))
935
911
  .then(f => f, util.onRejected);
936
912
  }
937
913
 
938
914
  /**
939
- * 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.
940
- */
941
- public delete(arg: datatypes.Item): Promise<void> {
942
- return this.httpClient
943
- .url(`/ip_policies/${arg.id}`)
944
- .delete()
945
- .json(payload => util.deserializeResult(payload))
946
- .then(f => f, util.onRejected);
947
- }
948
-
949
- /**
950
- * Get detailed information about an IP policy by ID.
915
+ * Get an HTTPS Edge by ID
951
916
  */
952
- public get(arg: datatypes.Item): Promise<datatypes.IPPolicy> {
917
+ public get(arg: datatypes.Item): Promise<datatypes.HTTPSEdge> {
953
918
  return this.httpClient
954
- .url(`/ip_policies/${arg.id}`)
919
+ .url(`/edges/https/${arg.id}`)
955
920
  .get()
956
921
  .json(payload => util.deserializeResult(payload))
957
922
  .then(f => f, util.onRejected);
958
923
  }
959
924
 
960
925
  /**
961
- * List all IP policies on this account
926
+ * Returns a list of all HTTPS Edges on this account
962
927
  */
963
- public async list(): Promise<Array<datatypes.IPPolicy>> {
964
- const array: Array<datatypes.IPPolicy> = [];
928
+ public async list(): Promise<Array<datatypes.HTTPSEdge>> {
929
+ const array: Array<datatypes.HTTPSEdge> = [];
965
930
  for await (const item of this._asyncList()) {
966
931
  array.push(item);
967
932
  }
968
933
  return array;
969
934
  }
970
- private _pagedList(arg: datatypes.Paging): Promise<datatypes.IPPolicyList> {
935
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.HTTPSEdgeList> {
971
936
  return this.httpClient
972
- .url(`/ip_policies`)
937
+ .url(`/edges/https`)
973
938
  .query(arg)
974
939
  .get()
975
940
  .json(payload => util.deserializeResult(payload))
@@ -983,7 +948,7 @@ export class IPPolicies {
983
948
  while (nextPage) {
984
949
  const pagedList = await this._pagedList(page);
985
950
  nextPage = pagedList.nextPageUri;
986
- const items: datatypes.IPPolicy[] = pagedList.ipPolicies;
951
+ const items: datatypes.HTTPSEdge[] = pagedList.httpsEdges;
987
952
 
988
953
  if (nextPage) {
989
954
  page = {
@@ -998,630 +963,1508 @@ export class IPPolicies {
998
963
  }
999
964
  }
1000
965
  /**
1001
- * Update attributes of an IP policy by ID
966
+ * Updates an HTTPS Edge 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.
1002
967
  */
1003
- public update(arg: datatypes.IPPolicyUpdate): Promise<datatypes.IPPolicy> {
968
+ public update(arg: datatypes.HTTPSEdgeUpdate): Promise<datatypes.HTTPSEdge> {
1004
969
  return this.httpClient
1005
- .url(`/ip_policies/${arg.id}`)
970
+ .url(`/edges/https/${arg.id}`)
1006
971
  .patch(util.serializeArgument(arg))
1007
972
  .json(payload => util.deserializeResult(payload))
1008
973
  .then(f => f, util.onRejected);
1009
974
  }
1010
- }
1011
-
1012
- /**
1013
- * IP Policy Rules are the IPv4 or IPv6 CIDRs entries that
1014
- make up an IP Policy.
1015
- */
1016
- export class IPPolicyRules {
1017
- private httpClient: Wretcher;
1018
975
 
1019
- /** Do not construct this object directly, use the <code>ipPolicyRules</code> property of an <code>Ngrok</code> client object instead. */
1020
- public constructor(httpClient: Wretcher) {
1021
- this.httpClient = httpClient;
1022
- }
1023
976
  /**
1024
- * Create a new IP policy rule attached to an IP Policy.
977
+ * Delete an HTTPS Edge by ID
1025
978
  */
1026
- public create(
1027
- arg: datatypes.IPPolicyRuleCreate
1028
- ): Promise<datatypes.IPPolicyRule> {
979
+ public delete(arg: datatypes.Item): Promise<void> {
1029
980
  return this.httpClient
1030
- .url(`/ip_policy_rules`)
1031
- .post(util.serializeArgument(arg))
981
+ .url(`/edges/https/${arg.id}`)
982
+ .delete()
1032
983
  .json(payload => util.deserializeResult(payload))
1033
984
  .then(f => f, util.onRejected);
1034
985
  }
986
+ }
1035
987
 
1036
- /**
1037
- * Delete an IP policy rule.
1038
- */
1039
- public delete(arg: datatypes.Item): Promise<void> {
988
+ export class HTTPSEdgeMutualTLSModule {
989
+ private httpClient: Wretcher;
990
+
991
+ /** Do not construct this object directly, use the <code>httpsEdgeMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
992
+ public constructor(httpClient: Wretcher) {
993
+ this.httpClient = httpClient;
994
+ }
995
+ public replace(
996
+ arg: datatypes.EdgeMutualTLSReplace
997
+ ): Promise<datatypes.EndpointMutualTLS> {
1040
998
  return this.httpClient
1041
- .url(`/ip_policy_rules/${arg.id}`)
1042
- .delete()
999
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1000
+ .put(util.serializeArgument(arg))
1043
1001
  .json(payload => util.deserializeResult(payload))
1044
1002
  .then(f => f, util.onRejected);
1045
1003
  }
1046
1004
 
1047
- /**
1048
- * Get detailed information about an IP policy rule by ID.
1049
- */
1050
- public get(arg: datatypes.Item): Promise<datatypes.IPPolicyRule> {
1005
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
1051
1006
  return this.httpClient
1052
- .url(`/ip_policy_rules/${arg.id}`)
1007
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1053
1008
  .get()
1054
1009
  .json(payload => util.deserializeResult(payload))
1055
1010
  .then(f => f, util.onRejected);
1056
1011
  }
1057
1012
 
1058
- /**
1059
- * List all IP policy rules on this account
1060
- */
1061
- public async list(): Promise<Array<datatypes.IPPolicyRule>> {
1062
- const array: Array<datatypes.IPPolicyRule> = [];
1063
- for await (const item of this._asyncList()) {
1064
- array.push(item);
1065
- }
1066
- return array;
1067
- }
1068
- private _pagedList(
1069
- arg: datatypes.Paging
1070
- ): Promise<datatypes.IPPolicyRuleList> {
1013
+ public delete(arg: datatypes.Item): Promise<void> {
1071
1014
  return this.httpClient
1072
- .url(`/ip_policy_rules`)
1073
- .query(arg)
1074
- .get()
1015
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1016
+ .delete()
1075
1017
  .json(payload => util.deserializeResult(payload))
1076
- .then(util.onFulfilled, util.onRejected);
1018
+ .then(f => f, util.onRejected);
1077
1019
  }
1078
- private async *_asyncList() {
1079
- const limit = '100';
1080
- let nextPage = 'initial loop';
1081
- let page: datatypes.Paging = { limit: limit };
1020
+ }
1082
1021
 
1083
- while (nextPage) {
1084
- const pagedList = await this._pagedList(page);
1085
- nextPage = pagedList.nextPageUri;
1086
- const items: datatypes.IPPolicyRule[] = pagedList.ipPolicyRules;
1022
+ export class HTTPSEdgeTLSTerminationModule {
1023
+ private httpClient: Wretcher;
1087
1024
 
1088
- if (nextPage) {
1089
- page = {
1090
- beforeId: items[items.length - 1].id,
1091
- limit: limit,
1092
- };
1093
- }
1025
+ /** Do not construct this object directly, use the <code>httpsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1026
+ public constructor(httpClient: Wretcher) {
1027
+ this.httpClient = httpClient;
1028
+ }
1029
+ public replace(
1030
+ arg: datatypes.EdgeTLSTerminationAtEdgeReplace
1031
+ ): Promise<datatypes.EndpointTLSTermination> {
1032
+ return this.httpClient
1033
+ .url(`/edges/https/${arg.id}/tls_termination`)
1034
+ .put(util.serializeArgument(arg))
1035
+ .json(payload => util.deserializeResult(payload))
1036
+ .then(f => f, util.onRejected);
1037
+ }
1094
1038
 
1095
- for (const item of items) {
1096
- yield item;
1097
- }
1098
- }
1039
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
1040
+ return this.httpClient
1041
+ .url(`/edges/https/${arg.id}/tls_termination`)
1042
+ .get()
1043
+ .json(payload => util.deserializeResult(payload))
1044
+ .then(f => f, util.onRejected);
1099
1045
  }
1100
- /**
1101
- * Update attributes of an IP policy rule by ID
1102
- */
1103
- public update(
1104
- arg: datatypes.IPPolicyRuleUpdate
1105
- ): Promise<datatypes.IPPolicyRule> {
1046
+
1047
+ public delete(arg: datatypes.Item): Promise<void> {
1106
1048
  return this.httpClient
1107
- .url(`/ip_policy_rules/${arg.id}`)
1108
- .patch(util.serializeArgument(arg))
1049
+ .url(`/edges/https/${arg.id}/tls_termination`)
1050
+ .delete()
1109
1051
  .json(payload => util.deserializeResult(payload))
1110
1052
  .then(f => f, util.onRejected);
1111
1053
  }
1112
1054
  }
1113
1055
 
1114
- /**
1115
- * An IP restriction is a restriction placed on the CIDRs that are allowed to
1116
- initate traffic to a specific aspect of your ngrok account. An IP
1117
- restriction has a type which defines the ingress it applies to. IP
1118
- restrictions can be used to enforce the source IPs that can make API
1119
- requests, log in to the dashboard, start ngrok agents, and connect to your
1120
- public-facing endpoints.
1121
- */
1122
- export class IPRestrictions {
1056
+ export class EdgeRouteBackendModule {
1123
1057
  private httpClient: Wretcher;
1124
1058
 
1125
- /** Do not construct this object directly, use the <code>ipRestrictions</code> property of an <code>Ngrok</code> client object instead. */
1059
+ /** Do not construct this object directly, use the <code>edgeRouteBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1126
1060
  public constructor(httpClient: Wretcher) {
1127
1061
  this.httpClient = httpClient;
1128
1062
  }
1129
- /**
1130
- * Create a new IP restriction
1131
- */
1132
- public create(
1133
- arg: datatypes.IPRestrictionCreate
1134
- ): Promise<datatypes.IPRestriction> {
1063
+ public replace(
1064
+ arg: datatypes.EdgeRouteBackendReplace
1065
+ ): Promise<datatypes.EndpointBackend> {
1135
1066
  return this.httpClient
1136
- .url(`/ip_restrictions`)
1137
- .post(util.serializeArgument(arg))
1067
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1068
+ .put(util.serializeArgument(arg))
1138
1069
  .json(payload => util.deserializeResult(payload))
1139
1070
  .then(f => f, util.onRejected);
1140
1071
  }
1141
1072
 
1142
- /**
1143
- * Delete an IP restriction
1144
- */
1145
- public delete(arg: datatypes.Item): Promise<void> {
1073
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointBackend> {
1146
1074
  return this.httpClient
1147
- .url(`/ip_restrictions/${arg.id}`)
1148
- .delete()
1075
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1076
+ .get()
1149
1077
  .json(payload => util.deserializeResult(payload))
1150
1078
  .then(f => f, util.onRejected);
1151
1079
  }
1152
1080
 
1153
- /**
1154
- * Get detailed information about an IP restriction
1155
- */
1156
- public get(arg: datatypes.Item): Promise<datatypes.IPRestriction> {
1081
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1157
1082
  return this.httpClient
1158
- .url(`/ip_restrictions/${arg.id}`)
1159
- .get()
1083
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1084
+ .delete()
1160
1085
  .json(payload => util.deserializeResult(payload))
1161
1086
  .then(f => f, util.onRejected);
1162
1087
  }
1088
+ }
1163
1089
 
1164
- /**
1165
- * List all IP restrictions on this account
1166
- */
1167
- public async list(): Promise<Array<datatypes.IPRestriction>> {
1168
- const array: Array<datatypes.IPRestriction> = [];
1169
- for await (const item of this._asyncList()) {
1170
- array.push(item);
1171
- }
1172
- return array;
1090
+ export class EdgeRouteIPRestrictionModule {
1091
+ private httpClient: Wretcher;
1092
+
1093
+ /** Do not construct this object directly, use the <code>edgeRouteIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1094
+ public constructor(httpClient: Wretcher) {
1095
+ this.httpClient = httpClient;
1173
1096
  }
1174
- private _pagedList(
1175
- arg: datatypes.Paging
1176
- ): Promise<datatypes.IPRestrictionList> {
1097
+ public replace(
1098
+ arg: datatypes.EdgeRouteIPRestrictionReplace
1099
+ ): Promise<datatypes.EndpointIPPolicy> {
1177
1100
  return this.httpClient
1178
- .url(`/ip_restrictions`)
1179
- .query(arg)
1101
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1102
+ .put(util.serializeArgument(arg))
1103
+ .json(payload => util.deserializeResult(payload))
1104
+ .then(f => f, util.onRejected);
1105
+ }
1106
+
1107
+ public get(
1108
+ arg: datatypes.EdgeRouteItem
1109
+ ): Promise<datatypes.EndpointIPPolicy> {
1110
+ return this.httpClient
1111
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1180
1112
  .get()
1181
1113
  .json(payload => util.deserializeResult(payload))
1182
- .then(util.onFulfilled, util.onRejected);
1114
+ .then(f => f, util.onRejected);
1183
1115
  }
1184
- private async *_asyncList() {
1185
- const limit = '100';
1186
- let nextPage = 'initial loop';
1187
- let page: datatypes.Paging = { limit: limit };
1188
1116
 
1189
- while (nextPage) {
1190
- const pagedList = await this._pagedList(page);
1191
- nextPage = pagedList.nextPageUri;
1192
- const items: datatypes.IPRestriction[] = pagedList.ipRestrictions;
1117
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1118
+ return this.httpClient
1119
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1120
+ .delete()
1121
+ .json(payload => util.deserializeResult(payload))
1122
+ .then(f => f, util.onRejected);
1123
+ }
1124
+ }
1193
1125
 
1194
- if (nextPage) {
1195
- page = {
1196
- beforeId: items[items.length - 1].id,
1197
- limit: limit,
1198
- };
1199
- }
1126
+ export class EdgeRouteRequestHeadersModule {
1127
+ private httpClient: Wretcher;
1200
1128
 
1201
- for (const item of items) {
1202
- yield item;
1203
- }
1204
- }
1129
+ /** Do not construct this object directly, use the <code>edgeRouteRequestHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1130
+ public constructor(httpClient: Wretcher) {
1131
+ this.httpClient = httpClient;
1205
1132
  }
1206
- /**
1207
- * Update attributes of an IP restriction by ID
1208
- */
1209
- public update(
1210
- arg: datatypes.IPRestrictionUpdate
1211
- ): Promise<datatypes.IPRestriction> {
1133
+ public replace(
1134
+ arg: datatypes.EdgeRouteRequestHeadersReplace
1135
+ ): Promise<datatypes.EndpointRequestHeaders> {
1212
1136
  return this.httpClient
1213
- .url(`/ip_restrictions/${arg.id}`)
1214
- .patch(util.serializeArgument(arg))
1137
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1138
+ .put(util.serializeArgument(arg))
1139
+ .json(payload => util.deserializeResult(payload))
1140
+ .then(f => f, util.onRejected);
1141
+ }
1142
+
1143
+ public get(
1144
+ arg: datatypes.EdgeRouteItem
1145
+ ): Promise<datatypes.EndpointRequestHeaders> {
1146
+ return this.httpClient
1147
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1148
+ .get()
1149
+ .json(payload => util.deserializeResult(payload))
1150
+ .then(f => f, util.onRejected);
1151
+ }
1152
+
1153
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1154
+ return this.httpClient
1155
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1156
+ .delete()
1215
1157
  .json(payload => util.deserializeResult(payload))
1216
1158
  .then(f => f, util.onRejected);
1217
1159
  }
1218
1160
  }
1219
1161
 
1220
- export class EndpointLoggingModule {
1162
+ export class EdgeRouteResponseHeadersModule {
1221
1163
  private httpClient: Wretcher;
1222
1164
 
1223
- /** Do not construct this object directly, use the <code>endpointLoggingModule</code> property of an <code>Ngrok</code> client object instead. */
1165
+ /** Do not construct this object directly, use the <code>edgeRouteResponseHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1224
1166
  public constructor(httpClient: Wretcher) {
1225
1167
  this.httpClient = httpClient;
1226
1168
  }
1227
1169
  public replace(
1228
- arg: datatypes.EndpointLoggingReplace
1229
- ): Promise<datatypes.EndpointLogging> {
1170
+ arg: datatypes.EdgeRouteResponseHeadersReplace
1171
+ ): Promise<datatypes.EndpointResponseHeaders> {
1230
1172
  return this.httpClient
1231
- .url(`/endpoint_configurations/${arg.id}/logging`)
1173
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1232
1174
  .put(util.serializeArgument(arg))
1233
1175
  .json(payload => util.deserializeResult(payload))
1234
1176
  .then(f => f, util.onRejected);
1235
1177
  }
1236
1178
 
1237
- public get(arg: datatypes.Item): Promise<datatypes.EndpointLogging> {
1179
+ public get(
1180
+ arg: datatypes.EdgeRouteItem
1181
+ ): Promise<datatypes.EndpointResponseHeaders> {
1238
1182
  return this.httpClient
1239
- .url(`/endpoint_configurations/${arg.id}/logging`)
1183
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1240
1184
  .get()
1241
1185
  .json(payload => util.deserializeResult(payload))
1242
1186
  .then(f => f, util.onRejected);
1243
1187
  }
1244
1188
 
1245
- public delete(arg: datatypes.Item): Promise<void> {
1189
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1246
1190
  return this.httpClient
1247
- .url(`/endpoint_configurations/${arg.id}/logging`)
1191
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1248
1192
  .delete()
1249
1193
  .json(payload => util.deserializeResult(payload))
1250
1194
  .then(f => f, util.onRejected);
1251
1195
  }
1252
1196
  }
1253
1197
 
1254
- export class EndpointCircuitBreakerModule {
1198
+ export class EdgeRouteCompressionModule {
1255
1199
  private httpClient: Wretcher;
1256
1200
 
1257
- /** Do not construct this object directly, use the <code>endpointCircuitBreakerModule</code> property of an <code>Ngrok</code> client object instead. */
1201
+ /** Do not construct this object directly, use the <code>edgeRouteCompressionModule</code> property of an <code>Ngrok</code> client object instead. */
1258
1202
  public constructor(httpClient: Wretcher) {
1259
1203
  this.httpClient = httpClient;
1260
1204
  }
1261
1205
  public replace(
1262
- arg: datatypes.EndpointCircuitBreakerReplace
1263
- ): Promise<datatypes.EndpointCircuitBreaker> {
1206
+ arg: datatypes.EdgeRouteCompressionReplace
1207
+ ): Promise<datatypes.EndpointCompression> {
1264
1208
  return this.httpClient
1265
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1209
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1266
1210
  .put(util.serializeArgument(arg))
1267
1211
  .json(payload => util.deserializeResult(payload))
1268
1212
  .then(f => f, util.onRejected);
1269
1213
  }
1270
1214
 
1271
- public get(arg: datatypes.Item): Promise<datatypes.EndpointCircuitBreaker> {
1215
+ public get(
1216
+ arg: datatypes.EdgeRouteItem
1217
+ ): Promise<datatypes.EndpointCompression> {
1272
1218
  return this.httpClient
1273
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1219
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1274
1220
  .get()
1275
1221
  .json(payload => util.deserializeResult(payload))
1276
1222
  .then(f => f, util.onRejected);
1277
1223
  }
1278
1224
 
1279
- public delete(arg: datatypes.Item): Promise<void> {
1225
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1280
1226
  return this.httpClient
1281
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1227
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1282
1228
  .delete()
1283
1229
  .json(payload => util.deserializeResult(payload))
1284
1230
  .then(f => f, util.onRejected);
1285
1231
  }
1286
1232
  }
1287
1233
 
1288
- export class EndpointCompressionModule {
1234
+ export class EdgeRouteCircuitBreakerModule {
1289
1235
  private httpClient: Wretcher;
1290
1236
 
1291
- /** Do not construct this object directly, use the <code>endpointCompressionModule</code> property of an <code>Ngrok</code> client object instead. */
1237
+ /** Do not construct this object directly, use the <code>edgeRouteCircuitBreakerModule</code> property of an <code>Ngrok</code> client object instead. */
1292
1238
  public constructor(httpClient: Wretcher) {
1293
1239
  this.httpClient = httpClient;
1294
1240
  }
1295
1241
  public replace(
1296
- arg: datatypes.EndpointCompressionReplace
1297
- ): Promise<datatypes.EndpointCompression> {
1242
+ arg: datatypes.EdgeRouteCircuitBreakerReplace
1243
+ ): Promise<datatypes.EndpointCircuitBreaker> {
1298
1244
  return this.httpClient
1299
- .url(`/endpoint_configurations/${arg.id}/compression`)
1245
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1300
1246
  .put(util.serializeArgument(arg))
1301
1247
  .json(payload => util.deserializeResult(payload))
1302
1248
  .then(f => f, util.onRejected);
1303
1249
  }
1304
1250
 
1305
- public get(arg: datatypes.Item): Promise<datatypes.EndpointCompression> {
1251
+ public get(
1252
+ arg: datatypes.EdgeRouteItem
1253
+ ): Promise<datatypes.EndpointCircuitBreaker> {
1306
1254
  return this.httpClient
1307
- .url(`/endpoint_configurations/${arg.id}/compression`)
1255
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1308
1256
  .get()
1309
1257
  .json(payload => util.deserializeResult(payload))
1310
1258
  .then(f => f, util.onRejected);
1311
1259
  }
1312
1260
 
1313
- public delete(arg: datatypes.Item): Promise<void> {
1261
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1314
1262
  return this.httpClient
1315
- .url(`/endpoint_configurations/${arg.id}/compression`)
1263
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1316
1264
  .delete()
1317
1265
  .json(payload => util.deserializeResult(payload))
1318
1266
  .then(f => f, util.onRejected);
1319
1267
  }
1320
1268
  }
1321
1269
 
1322
- export class EndpointTLSTerminationModule {
1270
+ export class EdgeRouteWebhookVerificationModule {
1323
1271
  private httpClient: Wretcher;
1324
1272
 
1325
- /** Do not construct this object directly, use the <code>endpointTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1273
+ /** Do not construct this object directly, use the <code>edgeRouteWebhookVerificationModule</code> property of an <code>Ngrok</code> client object instead. */
1326
1274
  public constructor(httpClient: Wretcher) {
1327
1275
  this.httpClient = httpClient;
1328
1276
  }
1329
1277
  public replace(
1330
- arg: datatypes.EndpointTLSTerminationReplace
1331
- ): Promise<datatypes.EndpointTLSTermination> {
1278
+ arg: datatypes.EdgeRouteWebhookVerificationReplace
1279
+ ): Promise<datatypes.EndpointWebhookValidation> {
1332
1280
  return this.httpClient
1333
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1281
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1334
1282
  .put(util.serializeArgument(arg))
1335
1283
  .json(payload => util.deserializeResult(payload))
1336
1284
  .then(f => f, util.onRejected);
1337
1285
  }
1338
1286
 
1339
- public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
1287
+ public get(
1288
+ arg: datatypes.EdgeRouteItem
1289
+ ): Promise<datatypes.EndpointWebhookValidation> {
1340
1290
  return this.httpClient
1341
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1291
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1342
1292
  .get()
1343
1293
  .json(payload => util.deserializeResult(payload))
1344
1294
  .then(f => f, util.onRejected);
1345
1295
  }
1346
1296
 
1347
- public delete(arg: datatypes.Item): Promise<void> {
1297
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1348
1298
  return this.httpClient
1349
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1299
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1350
1300
  .delete()
1351
1301
  .json(payload => util.deserializeResult(payload))
1352
1302
  .then(f => f, util.onRejected);
1353
1303
  }
1354
1304
  }
1355
1305
 
1356
- export class EndpointIPPolicyModule {
1306
+ export class EdgeRouteOAuthModule {
1357
1307
  private httpClient: Wretcher;
1358
1308
 
1359
- /** Do not construct this object directly, use the <code>endpointIpPolicyModule</code> property of an <code>Ngrok</code> client object instead. */
1309
+ /** Do not construct this object directly, use the <code>edgeRouteOAuthModule</code> property of an <code>Ngrok</code> client object instead. */
1360
1310
  public constructor(httpClient: Wretcher) {
1361
1311
  this.httpClient = httpClient;
1362
1312
  }
1363
1313
  public replace(
1364
- arg: datatypes.EndpointIPPolicyReplace
1365
- ): Promise<datatypes.EndpointIPPolicy> {
1314
+ arg: datatypes.EdgeRouteOAuthReplace
1315
+ ): Promise<datatypes.EndpointOAuth> {
1366
1316
  return this.httpClient
1367
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1317
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1368
1318
  .put(util.serializeArgument(arg))
1369
1319
  .json(payload => util.deserializeResult(payload))
1370
1320
  .then(f => f, util.onRejected);
1371
1321
  }
1372
1322
 
1373
- public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
1323
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointOAuth> {
1374
1324
  return this.httpClient
1375
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1325
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1376
1326
  .get()
1377
1327
  .json(payload => util.deserializeResult(payload))
1378
1328
  .then(f => f, util.onRejected);
1379
1329
  }
1380
1330
 
1381
- public delete(arg: datatypes.Item): Promise<void> {
1331
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1382
1332
  return this.httpClient
1383
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1333
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1384
1334
  .delete()
1385
1335
  .json(payload => util.deserializeResult(payload))
1386
1336
  .then(f => f, util.onRejected);
1387
1337
  }
1388
1338
  }
1389
1339
 
1390
- export class EndpointMutualTLSModule {
1340
+ export class EdgeRouteSAMLModule {
1391
1341
  private httpClient: Wretcher;
1392
1342
 
1393
- /** Do not construct this object directly, use the <code>endpointMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
1343
+ /** Do not construct this object directly, use the <code>edgeRouteSamlModule</code> property of an <code>Ngrok</code> client object instead. */
1394
1344
  public constructor(httpClient: Wretcher) {
1395
1345
  this.httpClient = httpClient;
1396
1346
  }
1397
1347
  public replace(
1398
- arg: datatypes.EndpointMutualTLSReplace
1399
- ): Promise<datatypes.EndpointMutualTLS> {
1348
+ arg: datatypes.EdgeRouteSAMLReplace
1349
+ ): Promise<datatypes.EndpointSAML> {
1400
1350
  return this.httpClient
1401
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1351
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1402
1352
  .put(util.serializeArgument(arg))
1403
1353
  .json(payload => util.deserializeResult(payload))
1404
1354
  .then(f => f, util.onRejected);
1405
1355
  }
1406
1356
 
1407
- public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
1357
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointSAML> {
1408
1358
  return this.httpClient
1409
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1359
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1410
1360
  .get()
1411
1361
  .json(payload => util.deserializeResult(payload))
1412
1362
  .then(f => f, util.onRejected);
1413
1363
  }
1414
1364
 
1415
- public delete(arg: datatypes.Item): Promise<void> {
1365
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1416
1366
  return this.httpClient
1417
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1367
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1418
1368
  .delete()
1419
1369
  .json(payload => util.deserializeResult(payload))
1420
1370
  .then(f => f, util.onRejected);
1421
1371
  }
1422
1372
  }
1423
1373
 
1424
- export class EndpointRequestHeadersModule {
1374
+ export class EdgeRouteOIDCModule {
1425
1375
  private httpClient: Wretcher;
1426
1376
 
1427
- /** Do not construct this object directly, use the <code>endpointRequestHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1377
+ /** Do not construct this object directly, use the <code>edgeRouteOidcModule</code> property of an <code>Ngrok</code> client object instead. */
1428
1378
  public constructor(httpClient: Wretcher) {
1429
1379
  this.httpClient = httpClient;
1430
1380
  }
1431
1381
  public replace(
1432
- arg: datatypes.EndpointRequestHeadersReplace
1433
- ): Promise<datatypes.EndpointRequestHeaders> {
1382
+ arg: datatypes.EdgeRouteOIDCReplace
1383
+ ): Promise<datatypes.EndpointOIDC> {
1434
1384
  return this.httpClient
1435
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1385
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1436
1386
  .put(util.serializeArgument(arg))
1437
1387
  .json(payload => util.deserializeResult(payload))
1438
1388
  .then(f => f, util.onRejected);
1439
1389
  }
1440
1390
 
1441
- public get(arg: datatypes.Item): Promise<datatypes.EndpointRequestHeaders> {
1391
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointOIDC> {
1442
1392
  return this.httpClient
1443
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1393
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1444
1394
  .get()
1445
1395
  .json(payload => util.deserializeResult(payload))
1446
1396
  .then(f => f, util.onRejected);
1447
1397
  }
1448
1398
 
1449
- public delete(arg: datatypes.Item): Promise<void> {
1399
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1450
1400
  return this.httpClient
1451
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1401
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1452
1402
  .delete()
1453
1403
  .json(payload => util.deserializeResult(payload))
1454
1404
  .then(f => f, util.onRejected);
1455
1405
  }
1456
1406
  }
1457
1407
 
1458
- export class EndpointResponseHeadersModule {
1408
+ export class EdgeRouteWebsocketTCPConverterModule {
1459
1409
  private httpClient: Wretcher;
1460
1410
 
1461
- /** Do not construct this object directly, use the <code>endpointResponseHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1411
+ /** Do not construct this object directly, use the <code>edgeRouteWebsocketTcpConverterModule</code> property of an <code>Ngrok</code> client object instead. */
1462
1412
  public constructor(httpClient: Wretcher) {
1463
1413
  this.httpClient = httpClient;
1464
1414
  }
1465
1415
  public replace(
1466
- arg: datatypes.EndpointResponseHeadersReplace
1467
- ): Promise<datatypes.EndpointResponseHeaders> {
1416
+ arg: datatypes.EdgeRouteWebsocketTCPConverterReplace
1417
+ ): Promise<datatypes.EndpointWebsocketTCPConverter> {
1468
1418
  return this.httpClient
1469
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
1419
+ .url(
1420
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1421
+ )
1470
1422
  .put(util.serializeArgument(arg))
1471
1423
  .json(payload => util.deserializeResult(payload))
1472
1424
  .then(f => f, util.onRejected);
1473
1425
  }
1474
-
1475
- public get(arg: datatypes.Item): Promise<datatypes.EndpointResponseHeaders> {
1426
+
1427
+ public get(
1428
+ arg: datatypes.EdgeRouteItem
1429
+ ): Promise<datatypes.EndpointWebsocketTCPConverter> {
1430
+ return this.httpClient
1431
+ .url(
1432
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1433
+ )
1434
+ .get()
1435
+ .json(payload => util.deserializeResult(payload))
1436
+ .then(f => f, util.onRejected);
1437
+ }
1438
+
1439
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1440
+ return this.httpClient
1441
+ .url(
1442
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1443
+ )
1444
+ .delete()
1445
+ .json(payload => util.deserializeResult(payload))
1446
+ .then(f => f, util.onRejected);
1447
+ }
1448
+ }
1449
+
1450
+ export class EdgesTCP {
1451
+ private httpClient: Wretcher;
1452
+
1453
+ /** Do not construct this object directly, use the <code>edgesTcp</code> property of an <code>Ngrok</code> client object instead. */
1454
+ public constructor(httpClient: Wretcher) {
1455
+ this.httpClient = httpClient;
1456
+ }
1457
+ /**
1458
+ * Create a TCP Edge
1459
+ */
1460
+ public create(arg: datatypes.TCPEdgeCreate): Promise<datatypes.TCPEdge> {
1461
+ return this.httpClient
1462
+ .url(`/edges/tcp`)
1463
+ .post(util.serializeArgument(arg))
1464
+ .json(payload => util.deserializeResult(payload))
1465
+ .then(f => f, util.onRejected);
1466
+ }
1467
+
1468
+ /**
1469
+ * Get a TCP Edge by ID
1470
+ */
1471
+ public get(arg: datatypes.Item): Promise<datatypes.TCPEdge> {
1472
+ return this.httpClient
1473
+ .url(`/edges/tcp/${arg.id}`)
1474
+ .get()
1475
+ .json(payload => util.deserializeResult(payload))
1476
+ .then(f => f, util.onRejected);
1477
+ }
1478
+
1479
+ /**
1480
+ * Returns a list of all TCP Edges on this account
1481
+ */
1482
+ public async list(): Promise<Array<datatypes.TCPEdge>> {
1483
+ const array: Array<datatypes.TCPEdge> = [];
1484
+ for await (const item of this._asyncList()) {
1485
+ array.push(item);
1486
+ }
1487
+ return array;
1488
+ }
1489
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.TCPEdgeList> {
1490
+ return this.httpClient
1491
+ .url(`/edges/tcp`)
1492
+ .query(arg)
1493
+ .get()
1494
+ .json(payload => util.deserializeResult(payload))
1495
+ .then(util.onFulfilled, util.onRejected);
1496
+ }
1497
+ private async *_asyncList() {
1498
+ const limit = '100';
1499
+ let nextPage = 'initial loop';
1500
+ let page: datatypes.Paging = { limit: limit };
1501
+
1502
+ while (nextPage) {
1503
+ const pagedList = await this._pagedList(page);
1504
+ nextPage = pagedList.nextPageUri;
1505
+ const items: datatypes.TCPEdge[] = pagedList.tcpEdges;
1506
+
1507
+ if (nextPage) {
1508
+ page = {
1509
+ beforeId: items[items.length - 1].id,
1510
+ limit: limit,
1511
+ };
1512
+ }
1513
+
1514
+ for (const item of items) {
1515
+ yield item;
1516
+ }
1517
+ }
1518
+ }
1519
+ /**
1520
+ * Updates a TCP Edge 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.
1521
+ */
1522
+ public update(arg: datatypes.TCPEdgeUpdate): Promise<datatypes.TCPEdge> {
1523
+ return this.httpClient
1524
+ .url(`/edges/tcp/${arg.id}`)
1525
+ .patch(util.serializeArgument(arg))
1526
+ .json(payload => util.deserializeResult(payload))
1527
+ .then(f => f, util.onRejected);
1528
+ }
1529
+
1530
+ /**
1531
+ * Delete a TCP Edge by ID
1532
+ */
1533
+ public delete(arg: datatypes.Item): Promise<void> {
1534
+ return this.httpClient
1535
+ .url(`/edges/tcp/${arg.id}`)
1536
+ .delete()
1537
+ .json(payload => util.deserializeResult(payload))
1538
+ .then(f => f, util.onRejected);
1539
+ }
1540
+ }
1541
+
1542
+ export class TCPEdgeBackendModule {
1543
+ private httpClient: Wretcher;
1544
+
1545
+ /** Do not construct this object directly, use the <code>tcpEdgeBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1546
+ public constructor(httpClient: Wretcher) {
1547
+ this.httpClient = httpClient;
1548
+ }
1549
+ public replace(
1550
+ arg: datatypes.EdgeBackendReplace
1551
+ ): Promise<datatypes.EndpointBackend> {
1552
+ return this.httpClient
1553
+ .url(`/edges/tcp/${arg.id}/backend`)
1554
+ .put(util.serializeArgument(arg))
1555
+ .json(payload => util.deserializeResult(payload))
1556
+ .then(f => f, util.onRejected);
1557
+ }
1558
+
1559
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointBackend> {
1560
+ return this.httpClient
1561
+ .url(`/edges/tcp/${arg.id}/backend`)
1562
+ .get()
1563
+ .json(payload => util.deserializeResult(payload))
1564
+ .then(f => f, util.onRejected);
1565
+ }
1566
+
1567
+ public delete(arg: datatypes.Item): Promise<void> {
1568
+ return this.httpClient
1569
+ .url(`/edges/tcp/${arg.id}/backend`)
1570
+ .delete()
1571
+ .json(payload => util.deserializeResult(payload))
1572
+ .then(f => f, util.onRejected);
1573
+ }
1574
+ }
1575
+
1576
+ export class TCPEdgeIPRestrictionModule {
1577
+ private httpClient: Wretcher;
1578
+
1579
+ /** Do not construct this object directly, use the <code>tcpEdgeIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1580
+ public constructor(httpClient: Wretcher) {
1581
+ this.httpClient = httpClient;
1582
+ }
1583
+ public replace(
1584
+ arg: datatypes.EdgeIPRestrictionReplace
1585
+ ): Promise<datatypes.EndpointIPPolicy> {
1586
+ return this.httpClient
1587
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1588
+ .put(util.serializeArgument(arg))
1589
+ .json(payload => util.deserializeResult(payload))
1590
+ .then(f => f, util.onRejected);
1591
+ }
1592
+
1593
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
1594
+ return this.httpClient
1595
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1596
+ .get()
1597
+ .json(payload => util.deserializeResult(payload))
1598
+ .then(f => f, util.onRejected);
1599
+ }
1600
+
1601
+ public delete(arg: datatypes.Item): Promise<void> {
1602
+ return this.httpClient
1603
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1604
+ .delete()
1605
+ .json(payload => util.deserializeResult(payload))
1606
+ .then(f => f, util.onRejected);
1607
+ }
1608
+ }
1609
+
1610
+ export class EdgesTLS {
1611
+ private httpClient: Wretcher;
1612
+
1613
+ /** Do not construct this object directly, use the <code>edgesTls</code> property of an <code>Ngrok</code> client object instead. */
1614
+ public constructor(httpClient: Wretcher) {
1615
+ this.httpClient = httpClient;
1616
+ }
1617
+ /**
1618
+ * Create a TLS Edge
1619
+ */
1620
+ public create(arg: datatypes.TLSEdgeCreate): Promise<datatypes.TLSEdge> {
1621
+ return this.httpClient
1622
+ .url(`/edges/tls`)
1623
+ .post(util.serializeArgument(arg))
1624
+ .json(payload => util.deserializeResult(payload))
1625
+ .then(f => f, util.onRejected);
1626
+ }
1627
+
1628
+ /**
1629
+ * Get a TLS Edge by ID
1630
+ */
1631
+ public get(arg: datatypes.Item): Promise<datatypes.TLSEdge> {
1632
+ return this.httpClient
1633
+ .url(`/edges/tls/${arg.id}`)
1634
+ .get()
1635
+ .json(payload => util.deserializeResult(payload))
1636
+ .then(f => f, util.onRejected);
1637
+ }
1638
+
1639
+ /**
1640
+ * Returns a list of all TLS Edges on this account
1641
+ */
1642
+ public async list(): Promise<Array<datatypes.TLSEdge>> {
1643
+ const array: Array<datatypes.TLSEdge> = [];
1644
+ for await (const item of this._asyncList()) {
1645
+ array.push(item);
1646
+ }
1647
+ return array;
1648
+ }
1649
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.TLSEdgeList> {
1650
+ return this.httpClient
1651
+ .url(`/edges/tls`)
1652
+ .query(arg)
1653
+ .get()
1654
+ .json(payload => util.deserializeResult(payload))
1655
+ .then(util.onFulfilled, util.onRejected);
1656
+ }
1657
+ private async *_asyncList() {
1658
+ const limit = '100';
1659
+ let nextPage = 'initial loop';
1660
+ let page: datatypes.Paging = { limit: limit };
1661
+
1662
+ while (nextPage) {
1663
+ const pagedList = await this._pagedList(page);
1664
+ nextPage = pagedList.nextPageUri;
1665
+ const items: datatypes.TLSEdge[] = pagedList.tlsEdges;
1666
+
1667
+ if (nextPage) {
1668
+ page = {
1669
+ beforeId: items[items.length - 1].id,
1670
+ limit: limit,
1671
+ };
1672
+ }
1673
+
1674
+ for (const item of items) {
1675
+ yield item;
1676
+ }
1677
+ }
1678
+ }
1679
+ /**
1680
+ * Updates a TLS Edge 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.
1681
+ */
1682
+ public update(arg: datatypes.TLSEdgeUpdate): Promise<datatypes.TLSEdge> {
1683
+ return this.httpClient
1684
+ .url(`/edges/tls/${arg.id}`)
1685
+ .patch(util.serializeArgument(arg))
1686
+ .json(payload => util.deserializeResult(payload))
1687
+ .then(f => f, util.onRejected);
1688
+ }
1689
+
1690
+ /**
1691
+ * Delete a TLS Edge by ID
1692
+ */
1693
+ public delete(arg: datatypes.Item): Promise<void> {
1694
+ return this.httpClient
1695
+ .url(`/edges/tls/${arg.id}`)
1696
+ .delete()
1697
+ .json(payload => util.deserializeResult(payload))
1698
+ .then(f => f, util.onRejected);
1699
+ }
1700
+ }
1701
+
1702
+ export class TLSEdgeBackendModule {
1703
+ private httpClient: Wretcher;
1704
+
1705
+ /** Do not construct this object directly, use the <code>tlsEdgeBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1706
+ public constructor(httpClient: Wretcher) {
1707
+ this.httpClient = httpClient;
1708
+ }
1709
+ public replace(
1710
+ arg: datatypes.EdgeBackendReplace
1711
+ ): Promise<datatypes.EndpointBackend> {
1712
+ return this.httpClient
1713
+ .url(`/edges/tls/${arg.id}/backend`)
1714
+ .put(util.serializeArgument(arg))
1715
+ .json(payload => util.deserializeResult(payload))
1716
+ .then(f => f, util.onRejected);
1717
+ }
1718
+
1719
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointBackend> {
1720
+ return this.httpClient
1721
+ .url(`/edges/tls/${arg.id}/backend`)
1722
+ .get()
1723
+ .json(payload => util.deserializeResult(payload))
1724
+ .then(f => f, util.onRejected);
1725
+ }
1726
+
1727
+ public delete(arg: datatypes.Item): Promise<void> {
1728
+ return this.httpClient
1729
+ .url(`/edges/tls/${arg.id}/backend`)
1730
+ .delete()
1731
+ .json(payload => util.deserializeResult(payload))
1732
+ .then(f => f, util.onRejected);
1733
+ }
1734
+ }
1735
+
1736
+ export class TLSEdgeIPRestrictionModule {
1737
+ private httpClient: Wretcher;
1738
+
1739
+ /** Do not construct this object directly, use the <code>tlsEdgeIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1740
+ public constructor(httpClient: Wretcher) {
1741
+ this.httpClient = httpClient;
1742
+ }
1743
+ public replace(
1744
+ arg: datatypes.EdgeIPRestrictionReplace
1745
+ ): Promise<datatypes.EndpointIPPolicy> {
1746
+ return this.httpClient
1747
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1748
+ .put(util.serializeArgument(arg))
1749
+ .json(payload => util.deserializeResult(payload))
1750
+ .then(f => f, util.onRejected);
1751
+ }
1752
+
1753
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
1754
+ return this.httpClient
1755
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1756
+ .get()
1757
+ .json(payload => util.deserializeResult(payload))
1758
+ .then(f => f, util.onRejected);
1759
+ }
1760
+
1761
+ public delete(arg: datatypes.Item): Promise<void> {
1762
+ return this.httpClient
1763
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1764
+ .delete()
1765
+ .json(payload => util.deserializeResult(payload))
1766
+ .then(f => f, util.onRejected);
1767
+ }
1768
+ }
1769
+
1770
+ export class TLSEdgeMutualTLSModule {
1771
+ private httpClient: Wretcher;
1772
+
1773
+ /** Do not construct this object directly, use the <code>tlsEdgeMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
1774
+ public constructor(httpClient: Wretcher) {
1775
+ this.httpClient = httpClient;
1776
+ }
1777
+ public replace(
1778
+ arg: datatypes.EdgeMutualTLSReplace
1779
+ ): Promise<datatypes.EndpointMutualTLS> {
1780
+ return this.httpClient
1781
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1782
+ .put(util.serializeArgument(arg))
1783
+ .json(payload => util.deserializeResult(payload))
1784
+ .then(f => f, util.onRejected);
1785
+ }
1786
+
1787
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
1788
+ return this.httpClient
1789
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1790
+ .get()
1791
+ .json(payload => util.deserializeResult(payload))
1792
+ .then(f => f, util.onRejected);
1793
+ }
1794
+
1795
+ public delete(arg: datatypes.Item): Promise<void> {
1796
+ return this.httpClient
1797
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1798
+ .delete()
1799
+ .json(payload => util.deserializeResult(payload))
1800
+ .then(f => f, util.onRejected);
1801
+ }
1802
+ }
1803
+
1804
+ export class TLSEdgeTLSTerminationModule {
1805
+ private httpClient: Wretcher;
1806
+
1807
+ /** Do not construct this object directly, use the <code>tlsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1808
+ public constructor(httpClient: Wretcher) {
1809
+ this.httpClient = httpClient;
1810
+ }
1811
+ public replace(
1812
+ arg: datatypes.EdgeTLSTerminationReplace
1813
+ ): Promise<datatypes.EndpointTLSTermination> {
1814
+ return this.httpClient
1815
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1816
+ .put(util.serializeArgument(arg))
1817
+ .json(payload => util.deserializeResult(payload))
1818
+ .then(f => f, util.onRejected);
1819
+ }
1820
+
1821
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
1822
+ return this.httpClient
1823
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1824
+ .get()
1825
+ .json(payload => util.deserializeResult(payload))
1826
+ .then(f => f, util.onRejected);
1827
+ }
1828
+
1829
+ public delete(arg: datatypes.Item): Promise<void> {
1830
+ return this.httpClient
1831
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1832
+ .delete()
1833
+ .json(payload => util.deserializeResult(payload))
1834
+ .then(f => f, util.onRejected);
1835
+ }
1836
+ }
1837
+
1838
+ /**
1839
+ * Endpoints provides an API for querying the endpoint objects
1840
+ which define what tunnel or edge is used to serve a hostport.
1841
+ Only active endpoints associated with a tunnel or backend are returned.
1842
+ */
1843
+ export class Endpoints {
1844
+ private httpClient: Wretcher;
1845
+
1846
+ /** Do not construct this object directly, use the <code>endpoints</code> property of an <code>Ngrok</code> client object instead. */
1847
+ public constructor(httpClient: Wretcher) {
1848
+ this.httpClient = httpClient;
1849
+ }
1850
+ /**
1851
+ * List all active endpoints on the account
1852
+ */
1853
+ public async list(): Promise<Array<datatypes.Endpoint>> {
1854
+ const array: Array<datatypes.Endpoint> = [];
1855
+ for await (const item of this._asyncList()) {
1856
+ array.push(item);
1857
+ }
1858
+ return array;
1859
+ }
1860
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.EndpointList> {
1861
+ return this.httpClient
1862
+ .url(`/endpoints`)
1863
+ .query(arg)
1864
+ .get()
1865
+ .json(payload => util.deserializeResult(payload))
1866
+ .then(util.onFulfilled, util.onRejected);
1867
+ }
1868
+ private async *_asyncList() {
1869
+ const limit = '100';
1870
+ let nextPage = 'initial loop';
1871
+ let page: datatypes.Paging = { limit: limit };
1872
+
1873
+ while (nextPage) {
1874
+ const pagedList = await this._pagedList(page);
1875
+ nextPage = pagedList.nextPageUri;
1876
+ const items: datatypes.Endpoint[] = pagedList.endpoints;
1877
+
1878
+ if (nextPage) {
1879
+ page = {
1880
+ beforeId: items[items.length - 1].id,
1881
+ limit: limit,
1882
+ };
1883
+ }
1884
+
1885
+ for (const item of items) {
1886
+ yield item;
1887
+ }
1888
+ }
1889
+ }
1890
+ /**
1891
+ * Get the status of an endpoint by ID
1892
+ */
1893
+ public get(arg: datatypes.Item): Promise<datatypes.Endpoint> {
1894
+ return this.httpClient
1895
+ .url(`/endpoints/${arg.id}`)
1896
+ .get()
1897
+ .json(payload => util.deserializeResult(payload))
1898
+ .then(f => f, util.onRejected);
1899
+ }
1900
+ }
1901
+
1902
+ export class EventDestinations {
1903
+ private httpClient: Wretcher;
1904
+
1905
+ /** Do not construct this object directly, use the <code>eventDestinations</code> property of an <code>Ngrok</code> client object instead. */
1906
+ public constructor(httpClient: Wretcher) {
1907
+ this.httpClient = httpClient;
1908
+ }
1909
+ /**
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.
1911
+ */
1912
+ public create(
1913
+ arg: datatypes.EventDestinationCreate
1914
+ ): Promise<datatypes.EventDestination> {
1915
+ return this.httpClient
1916
+ .url(`/event_destinations`)
1917
+ .post(util.serializeArgument(arg))
1918
+ .json(payload => util.deserializeResult(payload))
1919
+ .then(f => f, util.onRejected);
1920
+ }
1921
+
1922
+ /**
1923
+ * Delete an Event Destination. If the Event Destination is still referenced by an Event Subscription.
1924
+ */
1925
+ public delete(arg: datatypes.Item): Promise<void> {
1926
+ return this.httpClient
1927
+ .url(`/event_destinations/${arg.id}`)
1928
+ .delete()
1929
+ .json(payload => util.deserializeResult(payload))
1930
+ .then(f => f, util.onRejected);
1931
+ }
1932
+
1933
+ /**
1934
+ * Get detailed information about an Event Destination by ID.
1935
+ */
1936
+ public get(arg: datatypes.Item): Promise<datatypes.EventDestination> {
1937
+ return this.httpClient
1938
+ .url(`/event_destinations/${arg.id}`)
1939
+ .get()
1940
+ .json(payload => util.deserializeResult(payload))
1941
+ .then(f => f, util.onRejected);
1942
+ }
1943
+
1944
+ /**
1945
+ * List all Event Destinations on this account.
1946
+ */
1947
+ public async list(): Promise<Array<datatypes.EventDestination>> {
1948
+ const array: Array<datatypes.EventDestination> = [];
1949
+ for await (const item of this._asyncList()) {
1950
+ array.push(item);
1951
+ }
1952
+ return array;
1953
+ }
1954
+ private _pagedList(
1955
+ arg: datatypes.Paging
1956
+ ): Promise<datatypes.EventDestinationList> {
1957
+ return this.httpClient
1958
+ .url(`/event_destinations`)
1959
+ .query(arg)
1960
+ .get()
1961
+ .json(payload => util.deserializeResult(payload))
1962
+ .then(util.onFulfilled, util.onRejected);
1963
+ }
1964
+ private async *_asyncList() {
1965
+ const limit = '100';
1966
+ let nextPage = 'initial loop';
1967
+ let page: datatypes.Paging = { limit: limit };
1968
+
1969
+ while (nextPage) {
1970
+ const pagedList = await this._pagedList(page);
1971
+ nextPage = pagedList.nextPageUri;
1972
+ const items: datatypes.EventDestination[] = pagedList.eventDestinations;
1973
+
1974
+ if (nextPage) {
1975
+ page = {
1976
+ beforeId: items[items.length - 1].id,
1977
+ limit: limit,
1978
+ };
1979
+ }
1980
+
1981
+ for (const item of items) {
1982
+ yield item;
1983
+ }
1984
+ }
1985
+ }
1986
+ /**
1987
+ * Update attributes of an Event Destination.
1988
+ */
1989
+ public update(
1990
+ arg: datatypes.EventDestinationUpdate
1991
+ ): Promise<datatypes.EventDestination> {
1992
+ return this.httpClient
1993
+ .url(`/event_destinations/${arg.id}`)
1994
+ .patch(util.serializeArgument(arg))
1995
+ .json(payload => util.deserializeResult(payload))
1996
+ .then(f => f, util.onRejected);
1997
+ }
1998
+ }
1999
+
2000
+ export class EventSubscriptions {
2001
+ private httpClient: Wretcher;
2002
+
2003
+ /** Do not construct this object directly, use the <code>eventSubscriptions</code> property of an <code>Ngrok</code> client object instead. */
2004
+ public constructor(httpClient: Wretcher) {
2005
+ this.httpClient = httpClient;
2006
+ }
2007
+ /**
2008
+ * Create an Event Subscription.
2009
+ */
2010
+ public create(
2011
+ arg: datatypes.EventSubscriptionCreate
2012
+ ): Promise<datatypes.EventSubscription> {
2013
+ return this.httpClient
2014
+ .url(`/event_subscriptions`)
2015
+ .post(util.serializeArgument(arg))
2016
+ .json(payload => util.deserializeResult(payload))
2017
+ .then(f => f, util.onRejected);
2018
+ }
2019
+
2020
+ /**
2021
+ * Delete an Event Subscription.
2022
+ */
2023
+ public delete(arg: datatypes.Item): Promise<void> {
2024
+ return this.httpClient
2025
+ .url(`/event_subscriptions/${arg.id}`)
2026
+ .delete()
2027
+ .json(payload => util.deserializeResult(payload))
2028
+ .then(f => f, util.onRejected);
2029
+ }
2030
+
2031
+ /**
2032
+ * Get an Event Subscription by ID.
2033
+ */
2034
+ public get(arg: datatypes.Item): Promise<datatypes.EventSubscription> {
2035
+ return this.httpClient
2036
+ .url(`/event_subscriptions/${arg.id}`)
2037
+ .get()
2038
+ .json(payload => util.deserializeResult(payload))
2039
+ .then(f => f, util.onRejected);
2040
+ }
2041
+
2042
+ /**
2043
+ * List this Account's Event Subscriptions.
2044
+ */
2045
+ public async list(): Promise<Array<datatypes.EventSubscription>> {
2046
+ const array: Array<datatypes.EventSubscription> = [];
2047
+ for await (const item of this._asyncList()) {
2048
+ array.push(item);
2049
+ }
2050
+ return array;
2051
+ }
2052
+ private _pagedList(
2053
+ arg: datatypes.Paging
2054
+ ): Promise<datatypes.EventSubscriptionList> {
2055
+ return this.httpClient
2056
+ .url(`/event_subscriptions`)
2057
+ .query(arg)
2058
+ .get()
2059
+ .json(payload => util.deserializeResult(payload))
2060
+ .then(util.onFulfilled, util.onRejected);
2061
+ }
2062
+ private async *_asyncList() {
2063
+ const limit = '100';
2064
+ let nextPage = 'initial loop';
2065
+ let page: datatypes.Paging = { limit: limit };
2066
+
2067
+ while (nextPage) {
2068
+ const pagedList = await this._pagedList(page);
2069
+ nextPage = pagedList.nextPageUri;
2070
+ const items: datatypes.EventSubscription[] = pagedList.eventSubscriptions;
2071
+
2072
+ if (nextPage) {
2073
+ page = {
2074
+ beforeId: items[items.length - 1].id,
2075
+ limit: limit,
2076
+ };
2077
+ }
2078
+
2079
+ for (const item of items) {
2080
+ yield item;
2081
+ }
2082
+ }
2083
+ }
2084
+ /**
2085
+ * Update an Event Subscription.
2086
+ */
2087
+ public update(
2088
+ arg: datatypes.EventSubscriptionUpdate
2089
+ ): Promise<datatypes.EventSubscription> {
2090
+ return this.httpClient
2091
+ .url(`/event_subscriptions/${arg.id}`)
2092
+ .patch(util.serializeArgument(arg))
2093
+ .json(payload => util.deserializeResult(payload))
2094
+ .then(f => f, util.onRejected);
2095
+ }
2096
+ }
2097
+
2098
+ export class EventSources {
2099
+ private httpClient: Wretcher;
2100
+
2101
+ /** Do not construct this object directly, use the <code>eventSources</code> property of an <code>Ngrok</code> client object instead. */
2102
+ public constructor(httpClient: Wretcher) {
2103
+ this.httpClient = httpClient;
2104
+ }
2105
+ /**
2106
+ * Add an additional type for which this event subscription will trigger
2107
+ */
2108
+ public create(
2109
+ arg: datatypes.EventSourceCreate
2110
+ ): Promise<datatypes.EventSource> {
2111
+ return this.httpClient
2112
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
2113
+ .post(util.serializeArgument(arg))
2114
+ .json(payload => util.deserializeResult(payload))
2115
+ .then(f => f, util.onRejected);
2116
+ }
2117
+
2118
+ /**
2119
+ * Remove a type for which this event subscription will trigger
2120
+ */
2121
+ public delete(arg: datatypes.EventSourceItem): Promise<void> {
2122
+ return this.httpClient
2123
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
2124
+ .delete()
2125
+ .json(payload => util.deserializeResult(payload))
2126
+ .then(f => f, util.onRejected);
2127
+ }
2128
+
2129
+ /**
2130
+ * Get the details for a given type that triggers for the given event subscription
2131
+ */
2132
+ public get(arg: datatypes.EventSourceItem): Promise<datatypes.EventSource> {
2133
+ return this.httpClient
2134
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
2135
+ .get()
2136
+ .json(payload => util.deserializeResult(payload))
2137
+ .then(f => f, util.onRejected);
2138
+ }
2139
+
2140
+ /**
2141
+ * List the types for which this event subscription will trigger
2142
+ */
2143
+ public list(
2144
+ arg: datatypes.EventSourcePaging
2145
+ ): Promise<datatypes.EventSourceList> {
2146
+ return this.httpClient
2147
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
2148
+ .get()
2149
+ .json(payload => util.deserializeResult(payload))
2150
+ .then(f => f, util.onRejected);
2151
+ }
2152
+
2153
+ /**
2154
+ * Update the type for which this event subscription will trigger
2155
+ */
2156
+ public update(
2157
+ arg: datatypes.EventSourceUpdate
2158
+ ): Promise<datatypes.EventSource> {
2159
+ return this.httpClient
2160
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
2161
+ .patch(util.serializeArgument(arg))
2162
+ .json(payload => util.deserializeResult(payload))
2163
+ .then(f => f, util.onRejected);
2164
+ }
2165
+ }
2166
+
2167
+ /**
2168
+ * IP Policies are reusable groups of CIDR ranges with an `allow` or `deny`
2169
+ action. They can be attached to endpoints via the Endpoint Configuration IP
2170
+ Policy module. They can also be used with IP Restrictions to control source
2171
+ IP ranges that can start tunnel sessions and connect to the API and dashboard.
2172
+ */
2173
+ export class IPPolicies {
2174
+ private httpClient: Wretcher;
2175
+
2176
+ /** Do not construct this object directly, use the <code>ipPolicies</code> property of an <code>Ngrok</code> client object instead. */
2177
+ public constructor(httpClient: Wretcher) {
2178
+ this.httpClient = httpClient;
2179
+ }
2180
+ /**
2181
+ * Create a new IP policy. It will not apply to any traffic until you associate to a traffic source via an endpoint configuration or IP restriction.
2182
+ */
2183
+ public create(arg: datatypes.IPPolicyCreate): Promise<datatypes.IPPolicy> {
2184
+ return this.httpClient
2185
+ .url(`/ip_policies`)
2186
+ .post(util.serializeArgument(arg))
2187
+ .json(payload => util.deserializeResult(payload))
2188
+ .then(f => f, util.onRejected);
2189
+ }
2190
+
2191
+ /**
2192
+ * 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
+ */
2194
+ public delete(arg: datatypes.Item): Promise<void> {
2195
+ return this.httpClient
2196
+ .url(`/ip_policies/${arg.id}`)
2197
+ .delete()
2198
+ .json(payload => util.deserializeResult(payload))
2199
+ .then(f => f, util.onRejected);
2200
+ }
2201
+
2202
+ /**
2203
+ * Get detailed information about an IP policy by ID.
2204
+ */
2205
+ public get(arg: datatypes.Item): Promise<datatypes.IPPolicy> {
2206
+ return this.httpClient
2207
+ .url(`/ip_policies/${arg.id}`)
2208
+ .get()
2209
+ .json(payload => util.deserializeResult(payload))
2210
+ .then(f => f, util.onRejected);
2211
+ }
2212
+
2213
+ /**
2214
+ * List all IP policies on this account
2215
+ */
2216
+ public async list(): Promise<Array<datatypes.IPPolicy>> {
2217
+ const array: Array<datatypes.IPPolicy> = [];
2218
+ for await (const item of this._asyncList()) {
2219
+ array.push(item);
2220
+ }
2221
+ return array;
2222
+ }
2223
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.IPPolicyList> {
1476
2224
  return this.httpClient
1477
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
2225
+ .url(`/ip_policies`)
2226
+ .query(arg)
1478
2227
  .get()
1479
2228
  .json(payload => util.deserializeResult(payload))
1480
- .then(f => f, util.onRejected);
2229
+ .then(util.onFulfilled, util.onRejected);
1481
2230
  }
2231
+ private async *_asyncList() {
2232
+ const limit = '100';
2233
+ let nextPage = 'initial loop';
2234
+ let page: datatypes.Paging = { limit: limit };
1482
2235
 
1483
- public delete(arg: datatypes.Item): Promise<void> {
2236
+ while (nextPage) {
2237
+ const pagedList = await this._pagedList(page);
2238
+ nextPage = pagedList.nextPageUri;
2239
+ const items: datatypes.IPPolicy[] = pagedList.ipPolicies;
2240
+
2241
+ if (nextPage) {
2242
+ page = {
2243
+ beforeId: items[items.length - 1].id,
2244
+ limit: limit,
2245
+ };
2246
+ }
2247
+
2248
+ for (const item of items) {
2249
+ yield item;
2250
+ }
2251
+ }
2252
+ }
2253
+ /**
2254
+ * Update attributes of an IP policy by ID
2255
+ */
2256
+ public update(arg: datatypes.IPPolicyUpdate): Promise<datatypes.IPPolicy> {
1484
2257
  return this.httpClient
1485
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
1486
- .delete()
2258
+ .url(`/ip_policies/${arg.id}`)
2259
+ .patch(util.serializeArgument(arg))
1487
2260
  .json(payload => util.deserializeResult(payload))
1488
2261
  .then(f => f, util.onRejected);
1489
2262
  }
1490
2263
  }
1491
2264
 
1492
- export class EndpointOAuthModule {
2265
+ /**
2266
+ * IP Policy Rules are the IPv4 or IPv6 CIDRs entries that
2267
+ make up an IP Policy.
2268
+ */
2269
+ export class IPPolicyRules {
1493
2270
  private httpClient: Wretcher;
1494
2271
 
1495
- /** Do not construct this object directly, use the <code>endpointOAuthModule</code> property of an <code>Ngrok</code> client object instead. */
2272
+ /** Do not construct this object directly, use the <code>ipPolicyRules</code> property of an <code>Ngrok</code> client object instead. */
1496
2273
  public constructor(httpClient: Wretcher) {
1497
2274
  this.httpClient = httpClient;
1498
2275
  }
1499
- public replace(
1500
- arg: datatypes.EndpointOAuthReplace
1501
- ): Promise<datatypes.EndpointOAuth> {
1502
- return this.httpClient
1503
- .url(`/endpoint_configurations/${arg.id}/oauth`)
1504
- .put(util.serializeArgument(arg))
1505
- .json(payload => util.deserializeResult(payload))
1506
- .then(f => f, util.onRejected);
1507
- }
1508
-
1509
- public get(arg: datatypes.Item): Promise<datatypes.EndpointOAuth> {
2276
+ /**
2277
+ * Create a new IP policy rule attached to an IP Policy.
2278
+ */
2279
+ public create(
2280
+ arg: datatypes.IPPolicyRuleCreate
2281
+ ): Promise<datatypes.IPPolicyRule> {
1510
2282
  return this.httpClient
1511
- .url(`/endpoint_configurations/${arg.id}/oauth`)
1512
- .get()
2283
+ .url(`/ip_policy_rules`)
2284
+ .post(util.serializeArgument(arg))
1513
2285
  .json(payload => util.deserializeResult(payload))
1514
2286
  .then(f => f, util.onRejected);
1515
2287
  }
1516
2288
 
2289
+ /**
2290
+ * Delete an IP policy rule.
2291
+ */
1517
2292
  public delete(arg: datatypes.Item): Promise<void> {
1518
2293
  return this.httpClient
1519
- .url(`/endpoint_configurations/${arg.id}/oauth`)
2294
+ .url(`/ip_policy_rules/${arg.id}`)
1520
2295
  .delete()
1521
2296
  .json(payload => util.deserializeResult(payload))
1522
2297
  .then(f => f, util.onRejected);
1523
2298
  }
1524
- }
1525
2299
 
1526
- export class EndpointWebhookValidationModule {
1527
- private httpClient: Wretcher;
1528
-
1529
- /** Do not construct this object directly, use the <code>endpointWebhookValidationModule</code> property of an <code>Ngrok</code> client object instead. */
1530
- public constructor(httpClient: Wretcher) {
1531
- this.httpClient = httpClient;
1532
- }
1533
- public replace(
1534
- arg: datatypes.EndpointWebhookValidationReplace
1535
- ): Promise<datatypes.EndpointWebhookValidation> {
2300
+ /**
2301
+ * Get detailed information about an IP policy rule by ID.
2302
+ */
2303
+ public get(arg: datatypes.Item): Promise<datatypes.IPPolicyRule> {
1536
2304
  return this.httpClient
1537
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
1538
- .put(util.serializeArgument(arg))
2305
+ .url(`/ip_policy_rules/${arg.id}`)
2306
+ .get()
1539
2307
  .json(payload => util.deserializeResult(payload))
1540
2308
  .then(f => f, util.onRejected);
1541
2309
  }
1542
2310
 
1543
- public get(
1544
- arg: datatypes.Item
1545
- ): Promise<datatypes.EndpointWebhookValidation> {
2311
+ /**
2312
+ * List all IP policy rules on this account
2313
+ */
2314
+ public async list(): Promise<Array<datatypes.IPPolicyRule>> {
2315
+ const array: Array<datatypes.IPPolicyRule> = [];
2316
+ for await (const item of this._asyncList()) {
2317
+ array.push(item);
2318
+ }
2319
+ return array;
2320
+ }
2321
+ private _pagedList(
2322
+ arg: datatypes.Paging
2323
+ ): Promise<datatypes.IPPolicyRuleList> {
1546
2324
  return this.httpClient
1547
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
2325
+ .url(`/ip_policy_rules`)
2326
+ .query(arg)
1548
2327
  .get()
1549
2328
  .json(payload => util.deserializeResult(payload))
1550
- .then(f => f, util.onRejected);
2329
+ .then(util.onFulfilled, util.onRejected);
1551
2330
  }
2331
+ private async *_asyncList() {
2332
+ const limit = '100';
2333
+ let nextPage = 'initial loop';
2334
+ let page: datatypes.Paging = { limit: limit };
1552
2335
 
1553
- public delete(arg: datatypes.Item): Promise<void> {
2336
+ while (nextPage) {
2337
+ const pagedList = await this._pagedList(page);
2338
+ nextPage = pagedList.nextPageUri;
2339
+ const items: datatypes.IPPolicyRule[] = pagedList.ipPolicyRules;
2340
+
2341
+ if (nextPage) {
2342
+ page = {
2343
+ beforeId: items[items.length - 1].id,
2344
+ limit: limit,
2345
+ };
2346
+ }
2347
+
2348
+ for (const item of items) {
2349
+ yield item;
2350
+ }
2351
+ }
2352
+ }
2353
+ /**
2354
+ * Update attributes of an IP policy rule by ID
2355
+ */
2356
+ public update(
2357
+ arg: datatypes.IPPolicyRuleUpdate
2358
+ ): Promise<datatypes.IPPolicyRule> {
1554
2359
  return this.httpClient
1555
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
1556
- .delete()
2360
+ .url(`/ip_policy_rules/${arg.id}`)
2361
+ .patch(util.serializeArgument(arg))
1557
2362
  .json(payload => util.deserializeResult(payload))
1558
2363
  .then(f => f, util.onRejected);
1559
2364
  }
1560
2365
  }
1561
2366
 
1562
- export class EndpointSAMLModule {
2367
+ /**
2368
+ * An IP restriction is a restriction placed on the CIDRs that are allowed to
2369
+ initiate traffic to a specific aspect of your ngrok account. An IP
2370
+ restriction has a type which defines the ingress it applies to. IP
2371
+ restrictions can be used to enforce the source IPs that can make API
2372
+ requests, log in to the dashboard, start ngrok agents, and connect to your
2373
+ public-facing endpoints.
2374
+ */
2375
+ export class IPRestrictions {
1563
2376
  private httpClient: Wretcher;
1564
2377
 
1565
- /** Do not construct this object directly, use the <code>endpointSamlModule</code> property of an <code>Ngrok</code> client object instead. */
2378
+ /** Do not construct this object directly, use the <code>ipRestrictions</code> property of an <code>Ngrok</code> client object instead. */
1566
2379
  public constructor(httpClient: Wretcher) {
1567
2380
  this.httpClient = httpClient;
1568
2381
  }
1569
- public replace(
1570
- arg: datatypes.EndpointSAMLReplace
1571
- ): Promise<datatypes.EndpointSAML> {
1572
- return this.httpClient
1573
- .url(`/endpoint_configurations/${arg.id}/saml`)
1574
- .put(util.serializeArgument(arg))
1575
- .json(payload => util.deserializeResult(payload))
1576
- .then(f => f, util.onRejected);
1577
- }
1578
-
1579
- public get(arg: datatypes.Item): Promise<datatypes.EndpointSAML> {
2382
+ /**
2383
+ * Create a new IP restriction
2384
+ */
2385
+ public create(
2386
+ arg: datatypes.IPRestrictionCreate
2387
+ ): Promise<datatypes.IPRestriction> {
1580
2388
  return this.httpClient
1581
- .url(`/endpoint_configurations/${arg.id}/saml`)
1582
- .get()
2389
+ .url(`/ip_restrictions`)
2390
+ .post(util.serializeArgument(arg))
1583
2391
  .json(payload => util.deserializeResult(payload))
1584
2392
  .then(f => f, util.onRejected);
1585
2393
  }
1586
2394
 
2395
+ /**
2396
+ * Delete an IP restriction
2397
+ */
1587
2398
  public delete(arg: datatypes.Item): Promise<void> {
1588
2399
  return this.httpClient
1589
- .url(`/endpoint_configurations/${arg.id}/saml`)
2400
+ .url(`/ip_restrictions/${arg.id}`)
1590
2401
  .delete()
1591
2402
  .json(payload => util.deserializeResult(payload))
1592
2403
  .then(f => f, util.onRejected);
1593
2404
  }
1594
- }
1595
-
1596
- export class EndpointOIDCModule {
1597
- private httpClient: Wretcher;
1598
2405
 
1599
- /** Do not construct this object directly, use the <code>endpointOidcModule</code> property of an <code>Ngrok</code> client object instead. */
1600
- public constructor(httpClient: Wretcher) {
1601
- this.httpClient = httpClient;
1602
- }
1603
- public replace(
1604
- arg: datatypes.EndpointOIDCReplace
1605
- ): Promise<datatypes.EndpointOIDC> {
2406
+ /**
2407
+ * Get detailed information about an IP restriction
2408
+ */
2409
+ public get(arg: datatypes.Item): Promise<datatypes.IPRestriction> {
1606
2410
  return this.httpClient
1607
- .url(`/endpoint_configurations/${arg.id}/oidc`)
1608
- .put(util.serializeArgument(arg))
2411
+ .url(`/ip_restrictions/${arg.id}`)
2412
+ .get()
1609
2413
  .json(payload => util.deserializeResult(payload))
1610
2414
  .then(f => f, util.onRejected);
1611
2415
  }
1612
2416
 
1613
- public get(arg: datatypes.Item): Promise<datatypes.EndpointOIDC> {
2417
+ /**
2418
+ * List all IP restrictions on this account
2419
+ */
2420
+ public async list(): Promise<Array<datatypes.IPRestriction>> {
2421
+ const array: Array<datatypes.IPRestriction> = [];
2422
+ for await (const item of this._asyncList()) {
2423
+ array.push(item);
2424
+ }
2425
+ return array;
2426
+ }
2427
+ private _pagedList(
2428
+ arg: datatypes.Paging
2429
+ ): Promise<datatypes.IPRestrictionList> {
1614
2430
  return this.httpClient
1615
- .url(`/endpoint_configurations/${arg.id}/oidc`)
2431
+ .url(`/ip_restrictions`)
2432
+ .query(arg)
1616
2433
  .get()
1617
2434
  .json(payload => util.deserializeResult(payload))
1618
- .then(f => f, util.onRejected);
2435
+ .then(util.onFulfilled, util.onRejected);
1619
2436
  }
2437
+ private async *_asyncList() {
2438
+ const limit = '100';
2439
+ let nextPage = 'initial loop';
2440
+ let page: datatypes.Paging = { limit: limit };
1620
2441
 
1621
- public delete(arg: datatypes.Item): Promise<void> {
2442
+ while (nextPage) {
2443
+ const pagedList = await this._pagedList(page);
2444
+ nextPage = pagedList.nextPageUri;
2445
+ const items: datatypes.IPRestriction[] = pagedList.ipRestrictions;
2446
+
2447
+ if (nextPage) {
2448
+ page = {
2449
+ beforeId: items[items.length - 1].id,
2450
+ limit: limit,
2451
+ };
2452
+ }
2453
+
2454
+ for (const item of items) {
2455
+ yield item;
2456
+ }
2457
+ }
2458
+ }
2459
+ /**
2460
+ * Update attributes of an IP restriction by ID
2461
+ */
2462
+ public update(
2463
+ arg: datatypes.IPRestrictionUpdate
2464
+ ): Promise<datatypes.IPRestriction> {
1622
2465
  return this.httpClient
1623
- .url(`/endpoint_configurations/${arg.id}/oidc`)
1624
- .delete()
2466
+ .url(`/ip_restrictions/${arg.id}`)
2467
+ .patch(util.serializeArgument(arg))
1625
2468
  .json(payload => util.deserializeResult(payload))
1626
2469
  .then(f => f, util.onRejected);
1627
2470
  }
@@ -1728,17 +2571,6 @@ export class ReservedAddrs {
1728
2571
  .json(payload => util.deserializeResult(payload))
1729
2572
  .then(f => f, util.onRejected);
1730
2573
  }
1731
-
1732
- /**
1733
- * Detach the endpoint configuration attached to a reserved address.
1734
- */
1735
- public deleteEndpointConfig(arg: datatypes.Item): Promise<void> {
1736
- return this.httpClient
1737
- .url(`/reserved_addrs/${arg.id}/endpoint_configuration`)
1738
- .delete()
1739
- .json(payload => util.deserializeResult(payload))
1740
- .then(f => f, util.onRejected);
1741
- }
1742
2574
  }
1743
2575
 
1744
2576
  /**
@@ -1865,28 +2697,6 @@ export class ReservedDomains {
1865
2697
  .json(payload => util.deserializeResult(payload))
1866
2698
  .then(f => f, util.onRejected);
1867
2699
  }
1868
-
1869
- /**
1870
- * Detach the http endpoint configuration attached to a reserved domain.
1871
- */
1872
- public deleteHttpEndpointConfig(arg: datatypes.Item): Promise<void> {
1873
- return this.httpClient
1874
- .url(`/reserved_domains/${arg.id}/http_endpoint_configuration`)
1875
- .delete()
1876
- .json(payload => util.deserializeResult(payload))
1877
- .then(f => f, util.onRejected);
1878
- }
1879
-
1880
- /**
1881
- * Detach the https endpoint configuration attached to a reserved domain.
1882
- */
1883
- public deleteHttpsEndpointConfig(arg: datatypes.Item): Promise<void> {
1884
- return this.httpClient
1885
- .url(`/reserved_domains/${arg.id}/https_endpoint_configuration`)
1886
- .delete()
1887
- .json(payload => util.deserializeResult(payload))
1888
- .then(f => f, util.onRejected);
1889
- }
1890
2700
  }
1891
2701
 
1892
2702
  /**
@@ -2557,4 +3367,14 @@ export class Tunnels {
2557
3367
  }
2558
3368
  }
2559
3369
  }
3370
+ /**
3371
+ * Get the status of a tunnel by ID
3372
+ */
3373
+ public get(arg: datatypes.Item): Promise<datatypes.Tunnel> {
3374
+ return this.httpClient
3375
+ .url(`/tunnels/${arg.id}`)
3376
+ .get()
3377
+ .json(payload => util.deserializeResult(payload))
3378
+ .then(f => f, util.onRejected);
3379
+ }
2560
3380
  }