@ngrok/ngrok-api 0.1.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 (283) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +102 -31
  3. package/docs/CNAME +1 -0
  4. package/docs/assets/js/search.js +1 -1
  5. package/docs/classes/client.Ngrok.html +772 -0
  6. package/docs/classes/services.APIKeys.html +354 -0
  7. package/docs/classes/services.AbuseReports.html +261 -0
  8. package/docs/classes/services.AgentIngresses.html +343 -0
  9. package/docs/classes/services.CertificateAuthorities.html +354 -0
  10. package/docs/classes/services.Credentials.html +353 -0
  11. package/docs/classes/services.EdgeRouteBackendModule.html +270 -0
  12. package/docs/classes/services.EdgeRouteCircuitBreakerModule.html +270 -0
  13. package/docs/classes/services.EdgeRouteCompressionModule.html +270 -0
  14. package/docs/classes/services.EdgeRouteIPRestrictionModule.html +270 -0
  15. package/docs/classes/services.EdgeRouteOAuthModule.html +270 -0
  16. package/docs/classes/services.EdgeRouteOIDCModule.html +270 -0
  17. package/docs/classes/services.EdgeRouteRequestHeadersModule.html +270 -0
  18. package/docs/classes/services.EdgeRouteResponseHeadersModule.html +270 -0
  19. package/docs/classes/services.EdgeRouteSAMLModule.html +270 -0
  20. package/docs/classes/services.EdgeRouteWebhookVerificationModule.html +270 -0
  21. package/docs/classes/services.EdgeRouteWebsocketTCPConverterModule.html +270 -0
  22. package/docs/classes/services.EdgesHTTPS.html +343 -0
  23. package/docs/classes/services.EdgesHTTPSRoutes.html +317 -0
  24. package/docs/classes/services.EdgesTCP.html +343 -0
  25. package/docs/classes/services.EdgesTLS.html +343 -0
  26. package/docs/classes/services.Endpoints.html +256 -0
  27. package/docs/classes/services.EventDestinations.html +343 -0
  28. package/docs/classes/services.EventSources.html +349 -0
  29. package/docs/classes/services.EventSubscriptions.html +343 -0
  30. package/docs/classes/services.FailoverBackends.html +353 -0
  31. package/docs/classes/services.HTTPResponseBackends.html +318 -0
  32. package/docs/classes/services.HTTPSEdgeMutualTLSModule.html +270 -0
  33. package/docs/classes/services.HTTPSEdgeTLSTerminationModule.html +270 -0
  34. package/docs/classes/services.IPPolicies.html +353 -0
  35. package/docs/classes/services.IPPolicyRules.html +351 -0
  36. package/docs/classes/services.IPRestrictions.html +355 -0
  37. package/docs/classes/services.ReservedAddrs.html +352 -0
  38. package/docs/classes/services.ReservedDomains.html +417 -0
  39. package/docs/classes/services.SSHCertificateAuthorities.html +351 -0
  40. package/docs/classes/services.SSHCredentials.html +351 -0
  41. package/docs/classes/services.SSHHostCertificates.html +352 -0
  42. package/docs/classes/services.SSHUserCertificates.html +352 -0
  43. package/docs/classes/services.TCPEdgeBackendModule.html +270 -0
  44. package/docs/classes/services.TCPEdgeIPRestrictionModule.html +270 -0
  45. package/docs/classes/services.TLSCertificates.html +354 -0
  46. package/docs/classes/services.TLSEdgeBackendModule.html +270 -0
  47. package/docs/classes/services.TLSEdgeIPRestrictionModule.html +270 -0
  48. package/docs/classes/services.TLSEdgeMutualTLSModule.html +270 -0
  49. package/docs/classes/services.TLSEdgeTLSTerminationModule.html +270 -0
  50. package/docs/classes/services.TunnelGroupBackends.html +351 -0
  51. package/docs/classes/services.TunnelSessions.html +352 -0
  52. package/docs/classes/services.Tunnels.html +255 -0
  53. package/docs/classes/services.WeightedBackends.html +353 -0
  54. package/docs/index.html +103 -546
  55. package/docs/interfaces/client.NgrokConfig.html +179 -0
  56. package/docs/interfaces/{apikey.html → datatypes.APIKey.html} +41 -29
  57. package/docs/interfaces/{apikeycreate.html → datatypes.APIKeyCreate.html} +25 -13
  58. package/docs/interfaces/{apikeylist.html → datatypes.APIKeyList.html} +32 -20
  59. package/docs/interfaces/{apikeyupdate.html → datatypes.APIKeyUpdate.html} +28 -16
  60. package/docs/interfaces/{awsauth.html → datatypes.AWSAuth.html} +27 -15
  61. package/docs/interfaces/{awscredentials.html → datatypes.AWSCredentials.html} +31 -19
  62. package/docs/interfaces/{awsrole.html → datatypes.AWSRole.html} +25 -13
  63. package/docs/interfaces/{abusereport.html → datatypes.AbuseReport.html} +45 -33
  64. package/docs/interfaces/{abusereportcreate.html → datatypes.AbuseReportCreate.html} +25 -13
  65. package/docs/interfaces/{abusereporthostname.html → datatypes.AbuseReportHostname.html} +26 -14
  66. package/docs/interfaces/datatypes.AgentIngress.html +300 -0
  67. package/docs/interfaces/{ipwhitelistentrycreate.html → datatypes.AgentIngressCreate.html} +37 -25
  68. package/docs/interfaces/datatypes.AgentIngressList.html +205 -0
  69. package/docs/interfaces/{ipwhitelistentryupdate.html → datatypes.AgentIngressUpdate.html} +33 -21
  70. package/docs/interfaces/{certificateauthority.html → datatypes.CertificateAuthority.html} +73 -61
  71. package/docs/interfaces/{certificateauthoritycreate.html → datatypes.CertificateAuthorityCreate.html} +31 -19
  72. package/docs/interfaces/{certificateauthoritylist.html → datatypes.CertificateAuthorityList.html} +34 -22
  73. package/docs/interfaces/{certificateauthorityupdate.html → datatypes.CertificateAuthorityUpdate.html} +28 -16
  74. package/docs/interfaces/{credential.html → datatypes.Credential.html} +45 -33
  75. package/docs/interfaces/{credentialcreate.html → datatypes.CredentialCreate.html} +29 -17
  76. package/docs/interfaces/{credentiallist.html → datatypes.CredentialList.html} +32 -20
  77. package/docs/interfaces/{credentialupdate.html → datatypes.CredentialUpdate.html} +32 -20
  78. package/docs/interfaces/{endpointippolicyreplace.html → datatypes.EdgeBackendReplace.html} +29 -17
  79. package/docs/interfaces/{endpointbackendreplace.html → datatypes.EdgeIPRestrictionReplace.html} +29 -17
  80. package/docs/interfaces/{endpointresponseheadersreplace.html → datatypes.EdgeMutualTLSReplace.html} +29 -17
  81. package/docs/interfaces/datatypes.EdgeRouteBackendReplace.html +190 -0
  82. package/docs/interfaces/datatypes.EdgeRouteCircuitBreakerReplace.html +190 -0
  83. package/docs/interfaces/datatypes.EdgeRouteCompressionReplace.html +190 -0
  84. package/docs/interfaces/datatypes.EdgeRouteIPRestrictionReplace.html +190 -0
  85. package/docs/interfaces/{reserveddomaincertnstarget.html → datatypes.EdgeRouteItem.html} +36 -24
  86. package/docs/interfaces/datatypes.EdgeRouteOAuthReplace.html +190 -0
  87. package/docs/interfaces/datatypes.EdgeRouteOIDCReplace.html +190 -0
  88. package/docs/interfaces/datatypes.EdgeRouteRequestHeadersReplace.html +190 -0
  89. package/docs/interfaces/datatypes.EdgeRouteResponseHeadersReplace.html +190 -0
  90. package/docs/interfaces/datatypes.EdgeRouteSAMLReplace.html +190 -0
  91. package/docs/interfaces/datatypes.EdgeRouteWebhookVerificationReplace.html +190 -0
  92. package/docs/interfaces/datatypes.EdgeRouteWebsocketTCPConverterReplace.html +190 -0
  93. package/docs/interfaces/{endpointoauthreplace.html → datatypes.EdgeTLSTerminationAtEdgeReplace.html} +29 -17
  94. package/docs/interfaces/{endpointbasicauthreplace.html → datatypes.EdgeTLSTerminationReplace.html} +29 -17
  95. package/docs/interfaces/{empty.html → datatypes.Empty.html} +18 -7
  96. package/docs/interfaces/datatypes.Endpoint.html +395 -0
  97. package/docs/interfaces/{endpointbackend.html → datatypes.EndpointBackend.html} +27 -15
  98. package/docs/interfaces/{endpointlogging.html → datatypes.EndpointBackendMutate.html} +36 -24
  99. package/docs/interfaces/{endpointcircuitbreaker.html → datatypes.EndpointCircuitBreaker.html} +53 -41
  100. package/docs/interfaces/{endpointcompression.html → datatypes.EndpointCompression.html} +23 -11
  101. package/docs/interfaces/{endpointippolicy.html → datatypes.EndpointIPPolicy.html} +29 -17
  102. package/docs/interfaces/{endpointippolicymutate.html → datatypes.EndpointIPPolicyMutate.html} +29 -17
  103. package/docs/interfaces/datatypes.EndpointList.html +205 -0
  104. package/docs/interfaces/{endpointmutualtls.html → datatypes.EndpointMutualTLS.html} +29 -17
  105. package/docs/interfaces/{endpointmutualtlsmutate.html → datatypes.EndpointMutualTLSMutate.html} +29 -17
  106. package/docs/interfaces/{endpointoauth.html → datatypes.EndpointOAuth.html} +57 -45
  107. package/docs/interfaces/{endpointoauthfacebook.html → datatypes.EndpointOAuthFacebook.html} +48 -36
  108. package/docs/interfaces/{endpointoauthgithub.html → datatypes.EndpointOAuthGitHub.html} +55 -43
  109. package/docs/interfaces/{endpointoauthgoogle.html → datatypes.EndpointOAuthGoogle.html} +48 -36
  110. package/docs/interfaces/{endpointoauthmicrosoft.html → datatypes.EndpointOAuthMicrosoft.html} +48 -36
  111. package/docs/interfaces/{endpointoauthprovider.html → datatypes.EndpointOAuthProvider.html} +35 -23
  112. package/docs/interfaces/{endpointoidc.html → datatypes.EndpointOIDC.html} +65 -53
  113. package/docs/interfaces/{endpointrequestheaders.html → datatypes.EndpointRequestHeaders.html} +29 -17
  114. package/docs/interfaces/{endpointresponseheaders.html → datatypes.EndpointResponseHeaders.html} +29 -17
  115. package/docs/interfaces/{endpointsaml.html → datatypes.EndpointSAML.html} +121 -90
  116. package/docs/interfaces/{endpointsamlmutate.html → datatypes.EndpointSAMLMutate.html} +91 -60
  117. package/docs/interfaces/{endpointtlstermination.html → datatypes.EndpointTLSTermination.html} +37 -25
  118. package/docs/interfaces/{endpointloggingmutate.html → datatypes.EndpointTLSTerminationAtEdge.html} +33 -21
  119. package/docs/interfaces/{endpointwebhookvalidation.html → datatypes.EndpointWebhookValidation.html} +30 -18
  120. package/docs/interfaces/{staticbackendtls.html → datatypes.EndpointWebsocketTCPConverter.html} +27 -15
  121. package/docs/interfaces/{error.html → datatypes.Error.html} +37 -25
  122. package/docs/interfaces/{eventdestination.html → datatypes.EventDestination.html} +46 -34
  123. package/docs/interfaces/{eventdestinationcreate.html → datatypes.EventDestinationCreate.html} +34 -22
  124. package/docs/interfaces/{eventdestinationlist.html → datatypes.EventDestinationList.html} +34 -22
  125. package/docs/interfaces/{eventdestinationupdate.html → datatypes.EventDestinationUpdate.html} +37 -25
  126. package/docs/interfaces/{eventsource.html → datatypes.EventSource.html} +25 -13
  127. package/docs/interfaces/{eventsourcecreate.html → datatypes.EventSourceCreate.html} +28 -16
  128. package/docs/interfaces/{eventsourceitem.html → datatypes.EventSourceItem.html} +28 -16
  129. package/docs/interfaces/{eventsourcelist.html → datatypes.EventSourceList.html} +26 -14
  130. package/docs/interfaces/{eventsourcepaging.html → datatypes.EventSourcePaging.html} +25 -13
  131. package/docs/interfaces/{eventsourcereplace.html → datatypes.EventSourceReplace.html} +22 -10
  132. package/docs/interfaces/{eventsourceupdate.html → datatypes.EventSourceUpdate.html} +28 -16
  133. package/docs/interfaces/{eventsubscription.html → datatypes.EventSubscription.html} +45 -33
  134. package/docs/interfaces/{eventsubscriptioncreate.html → datatypes.EventSubscriptionCreate.html} +36 -24
  135. package/docs/interfaces/{eventsubscriptionlist.html → datatypes.EventSubscriptionList.html} +34 -22
  136. package/docs/interfaces/{eventsubscriptionupdate.html → datatypes.EventSubscriptionUpdate.html} +39 -27
  137. package/docs/interfaces/{eventtarget.html → datatypes.EventTarget.html} +33 -21
  138. package/docs/interfaces/{eventtargetcloudwatchlogs.html → datatypes.EventTargetCloudwatchLogs.html} +30 -18
  139. package/docs/interfaces/{eventtargetfirehose.html → datatypes.EventTargetFirehose.html} +30 -18
  140. package/docs/interfaces/{eventtargetkinesis.html → datatypes.EventTargetKinesis.html} +30 -18
  141. package/docs/interfaces/{staticbackend.html → datatypes.FailoverBackend.html} +52 -40
  142. package/docs/interfaces/{prioritybackendcreate.html → datatypes.FailoverBackendCreate.html} +31 -19
  143. package/docs/interfaces/{prioritybackendlist.html → datatypes.FailoverBackendList.html} +37 -25
  144. package/docs/interfaces/{prioritybackendupdate.html → datatypes.FailoverBackendUpdate.html} +34 -22
  145. package/docs/interfaces/datatypes.HTTPResponseBackend.html +295 -0
  146. package/docs/interfaces/{tunnelgroupbackend.html → datatypes.HTTPResponseBackendCreate.html} +53 -41
  147. package/docs/interfaces/{staticbackendlist.html → datatypes.HTTPResponseBackendList.html} +35 -38
  148. package/docs/interfaces/{tcpedge.html → datatypes.HTTPResponseBackendUpdate.html} +58 -65
  149. package/docs/interfaces/{eventstream.html → datatypes.HTTPSEdge.html} +78 -71
  150. package/docs/interfaces/{staticbackendupdate.html → datatypes.HTTPSEdgeCreate.html} +60 -48
  151. package/docs/interfaces/datatypes.HTTPSEdgeList.html +205 -0
  152. package/docs/interfaces/datatypes.HTTPSEdgeRoute.html +509 -0
  153. package/docs/interfaces/{endpointconfigurationcreate.html → datatypes.HTTPSEdgeRouteCreate.html} +141 -110
  154. package/docs/interfaces/{endpointconfiguration.html → datatypes.HTTPSEdgeRouteUpdate.html} +138 -145
  155. package/docs/interfaces/{tlsedgeupdate.html → datatypes.HTTPSEdgeUpdate.html} +65 -43
  156. package/docs/interfaces/{ippolicy.html → datatypes.IPPolicy.html} +37 -44
  157. package/docs/interfaces/{ippolicycreate.html → datatypes.IPPolicyCreate.html} +25 -32
  158. package/docs/interfaces/{ippolicylist.html → datatypes.IPPolicyList.html} +34 -22
  159. package/docs/interfaces/{ippolicyrule.html → datatypes.IPPolicyRule.html} +65 -34
  160. package/docs/interfaces/{ippolicyrulecreate.html → datatypes.IPPolicyRuleCreate.html} +53 -22
  161. package/docs/interfaces/{ippolicyrulelist.html → datatypes.IPPolicyRuleList.html} +34 -22
  162. package/docs/interfaces/{ippolicyruleupdate.html → datatypes.IPPolicyRuleUpdate.html} +31 -19
  163. package/docs/interfaces/{ippolicyupdate.html → datatypes.IPPolicyUpdate.html} +28 -16
  164. package/docs/interfaces/{iprestriction.html → datatypes.IPRestriction.html} +50 -38
  165. package/docs/interfaces/{iprestrictioncreate.html → datatypes.IPRestrictionCreate.html} +38 -26
  166. package/docs/interfaces/{iprestrictionlist.html → datatypes.IPRestrictionList.html} +34 -22
  167. package/docs/interfaces/{iprestrictionupdate.html → datatypes.IPRestrictionUpdate.html} +37 -25
  168. package/docs/interfaces/{item.html → datatypes.Item.html} +22 -10
  169. package/docs/interfaces/{paging.html → datatypes.Paging.html} +28 -16
  170. package/docs/interfaces/{ref.html → datatypes.Ref.html} +25 -13
  171. package/docs/interfaces/{reservedaddr.html → datatypes.ReservedAddr.html} +43 -50
  172. package/docs/interfaces/{reservedaddrcreate.html → datatypes.ReservedAddrCreate.html} +28 -35
  173. package/docs/interfaces/{reservedaddrlist.html → datatypes.ReservedAddrList.html} +34 -22
  174. package/docs/interfaces/datatypes.ReservedAddrUpdate.html +200 -0
  175. package/docs/interfaces/{reserveddomain.html → datatypes.ReservedDomain.html} +82 -89
  176. package/docs/interfaces/{reserveddomaincertjob.html → datatypes.ReservedDomainCertJob.html} +40 -47
  177. package/docs/interfaces/{reserveddomaincertpolicy.html → datatypes.ReservedDomainCertPolicy.html} +28 -16
  178. package/docs/interfaces/{reserveddomaincertstatus.html → datatypes.ReservedDomainCertStatus.html} +31 -19
  179. package/docs/interfaces/{reserveddomaincreate.html → datatypes.ReservedDomainCreate.html} +45 -71
  180. package/docs/interfaces/{reserveddomainlist.html → datatypes.ReservedDomainList.html} +34 -22
  181. package/docs/interfaces/datatypes.ReservedDomainUpdate.html +238 -0
  182. package/docs/interfaces/{sshcertificateauthority.html → datatypes.SSHCertificateAuthority.html} +49 -37
  183. package/docs/interfaces/{sshcertificateauthoritycreate.html → datatypes.SSHCertificateAuthorityCreate.html} +45 -33
  184. package/docs/interfaces/{sshcertificateauthoritylist.html → datatypes.SSHCertificateAuthorityList.html} +34 -22
  185. package/docs/interfaces/{sshcertificateauthorityupdate.html → datatypes.SSHCertificateAuthorityUpdate.html} +28 -16
  186. package/docs/interfaces/{sshcredential.html → datatypes.SSHCredential.html} +47 -35
  187. package/docs/interfaces/{sshcredentialcreate.html → datatypes.SSHCredentialCreate.html} +35 -23
  188. package/docs/interfaces/{sshcredentiallist.html → datatypes.SSHCredentialList.html} +34 -22
  189. package/docs/interfaces/{sshcredentialupdate.html → datatypes.SSHCredentialUpdate.html} +32 -20
  190. package/docs/interfaces/{sshhostcertificate.html → datatypes.SSHHostCertificate.html} +76 -64
  191. package/docs/interfaces/{sshhostcertificatecreate.html → datatypes.SSHHostCertificateCreate.html} +53 -41
  192. package/docs/interfaces/{sshhostcertificatelist.html → datatypes.SSHHostCertificateList.html} +34 -22
  193. package/docs/interfaces/{sshhostcertificateupdate.html → datatypes.SSHHostCertificateUpdate.html} +28 -16
  194. package/docs/interfaces/{sshusercertificate.html → datatypes.SSHUserCertificate.html} +87 -75
  195. package/docs/interfaces/{sshusercertificatecreate.html → datatypes.SSHUserCertificateCreate.html} +64 -52
  196. package/docs/interfaces/{sshusercertificatelist.html → datatypes.SSHUserCertificateList.html} +34 -22
  197. package/docs/interfaces/{sshusercertificateupdate.html → datatypes.SSHUserCertificateUpdate.html} +28 -16
  198. package/docs/interfaces/{tlsedge.html → datatypes.TCPEdge.html} +69 -66
  199. package/docs/interfaces/{tlsedgecreate.html → datatypes.TCPEdgeCreate.html} +64 -42
  200. package/docs/interfaces/{endpointconfigurationlist.html → datatypes.TCPEdgeList.html} +40 -28
  201. package/docs/interfaces/{eventstreamupdate.html → datatypes.TCPEdgeUpdate.html} +60 -53
  202. package/docs/interfaces/{tlscertificate.html → datatypes.TLSCertificate.html} +134 -122
  203. package/docs/interfaces/{tlscertificatecreate.html → datatypes.TLSCertificateCreate.html} +39 -27
  204. package/docs/interfaces/{tlscertificatelist.html → datatypes.TLSCertificateList.html} +34 -22
  205. package/docs/interfaces/{tlscertificatesans.html → datatypes.TLSCertificateSANs.html} +28 -16
  206. package/docs/interfaces/{tlscertificateupdate.html → datatypes.TLSCertificateUpdate.html} +28 -16
  207. package/docs/interfaces/datatypes.TLSEdge.html +323 -0
  208. package/docs/interfaces/datatypes.TLSEdgeCreate.html +266 -0
  209. package/docs/interfaces/datatypes.TLSEdgeList.html +205 -0
  210. package/docs/interfaces/{reserveddomainupdate.html → datatypes.TLSEdgeUpdate.html} +83 -62
  211. package/docs/interfaces/datatypes.Tunnel.html +357 -0
  212. package/docs/interfaces/datatypes.TunnelGroupBackend.html +281 -0
  213. package/docs/interfaces/{tunnelgroupbackendcreate.html → datatypes.TunnelGroupBackendCreate.html} +28 -16
  214. package/docs/interfaces/{tunnelgroupbackendlist.html → datatypes.TunnelGroupBackendList.html} +32 -20
  215. package/docs/interfaces/{tunnelgroupbackendupdate.html → datatypes.TunnelGroupBackendUpdate.html} +31 -19
  216. package/docs/interfaces/{tunnellist.html → datatypes.TunnelList.html} +32 -20
  217. package/docs/interfaces/{tunnelsession.html → datatypes.TunnelSession.html} +57 -45
  218. package/docs/interfaces/{tunnelsessionlist.html → datatypes.TunnelSessionList.html} +34 -22
  219. package/docs/interfaces/{tunnelsessionsupdate.html → datatypes.TunnelSessionsUpdate.html} +22 -10
  220. package/docs/interfaces/{weightedbackend.html → datatypes.WeightedBackend.html} +56 -25
  221. package/docs/interfaces/{weightedbackendcreate.html → datatypes.WeightedBackendCreate.html} +28 -16
  222. package/docs/interfaces/{weightedbackendlist.html → datatypes.WeightedBackendList.html} +32 -20
  223. package/docs/interfaces/{weightedbackendupdate.html → datatypes.WeightedBackendUpdate.html} +31 -19
  224. package/docs/{interfaces/endpointbasicauth.html → modules/client.html} +38 -20
  225. package/docs/modules/datatypes.html +796 -0
  226. package/docs/modules/services.html +316 -0
  227. package/docs/modules.html +16 -690
  228. package/lib/client.d.ts +179 -0
  229. package/lib/client.d.ts.map +1 -0
  230. package/lib/client.js +126 -0
  231. package/lib/client.js.map +1 -0
  232. package/lib/{types.d.ts → datatypes.d.ts} +729 -660
  233. package/lib/datatypes.d.ts.map +1 -0
  234. package/lib/{types.js → datatypes.js} +1 -1
  235. package/lib/datatypes.js.map +1 -0
  236. package/lib/index.d.ts +2 -378
  237. package/lib/index.d.ts.map +1 -1
  238. package/lib/index.js +2 -2148
  239. package/lib/index.js.map +1 -1
  240. package/lib/services.d.ts +993 -0
  241. package/lib/services.d.ts.map +1 -0
  242. package/lib/services.js +3600 -0
  243. package/lib/services.js.map +1 -0
  244. package/lib/util.d.ts +5 -0
  245. package/lib/util.d.ts.map +1 -0
  246. package/lib/util.js +53 -0
  247. package/lib/util.js.map +1 -0
  248. package/package.json +2 -2
  249. package/src/client.ts +322 -0
  250. package/src/{types.ts → datatypes.ts} +760 -689
  251. package/src/index.ts +2 -1775
  252. package/src/services.ts +3380 -0
  253. package/src/util.ts +48 -0
  254. package/test/apikey.test.js +41 -30
  255. package/docs/classes/ngrok.html +0 -5028
  256. package/docs/interfaces/endpointbackendmutate.html +0 -119
  257. package/docs/interfaces/endpointcircuitbreakerreplace.html +0 -164
  258. package/docs/interfaces/endpointcompressionreplace.html +0 -164
  259. package/docs/interfaces/endpointconfigurationupdate.html +0 -421
  260. package/docs/interfaces/endpointloggingreplace.html +0 -164
  261. package/docs/interfaces/endpointmutualtlsreplace.html +0 -164
  262. package/docs/interfaces/endpointoidcreplace.html +0 -164
  263. package/docs/interfaces/endpointrequestheadersreplace.html +0 -164
  264. package/docs/interfaces/endpointsamlreplace.html +0 -164
  265. package/docs/interfaces/endpointtlsterminationreplace.html +0 -164
  266. package/docs/interfaces/endpointwebhookvalidationreplace.html +0 -164
  267. package/docs/interfaces/eventstreamcreate.html +0 -250
  268. package/docs/interfaces/eventstreamlist.html +0 -193
  269. package/docs/interfaces/eventtargetdebug.html +0 -119
  270. package/docs/interfaces/eventtargets3.html +0 -250
  271. package/docs/interfaces/ipwhitelistentry.html +0 -250
  272. package/docs/interfaces/ipwhitelistentrylist.html +0 -193
  273. package/docs/interfaces/prioritybackend.html +0 -231
  274. package/docs/interfaces/reservedaddrupdate.html +0 -207
  275. package/docs/interfaces/rootresponse.html +0 -164
  276. package/docs/interfaces/sentevent.html +0 -150
  277. package/docs/interfaces/staticbackendcreate.html +0 -212
  278. package/docs/interfaces/tcpedgecreate.html +0 -188
  279. package/docs/interfaces/tcpedgeupdate.html +0 -207
  280. package/docs/interfaces/tunnel.html +0 -269
  281. package/lib/types.d.ts.map +0 -1
  282. package/lib/types.js.map +0 -1
  283. package/test/endpointConfigurations.test.js +0 -63
@@ -0,0 +1,3600 @@
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done
29
+ ? resolve(result.value)
30
+ : adopt(result.value).then(fulfilled, rejected);
31
+ }
32
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
33
+ });
34
+ };
35
+ var __asyncValues =
36
+ (this && this.__asyncValues) ||
37
+ function (o) {
38
+ if (!Symbol.asyncIterator)
39
+ throw new TypeError('Symbol.asyncIterator is not defined.');
40
+ var m = o[Symbol.asyncIterator],
41
+ i;
42
+ return m
43
+ ? m.call(o)
44
+ : ((o =
45
+ typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()),
46
+ (i = {}),
47
+ verb('next'),
48
+ verb('throw'),
49
+ verb('return'),
50
+ (i[Symbol.asyncIterator] = function () {
51
+ return this;
52
+ }),
53
+ i);
54
+ function verb(n) {
55
+ i[n] =
56
+ o[n] &&
57
+ function (v) {
58
+ return new Promise(function (resolve, reject) {
59
+ (v = o[n](v)), settle(resolve, reject, v.done, v.value);
60
+ });
61
+ };
62
+ }
63
+ function settle(resolve, reject, d, v) {
64
+ Promise.resolve(v).then(function (v) {
65
+ resolve({ value: v, done: d });
66
+ }, reject);
67
+ }
68
+ };
69
+ var __await =
70
+ (this && this.__await) ||
71
+ function (v) {
72
+ return this instanceof __await ? ((this.v = v), this) : new __await(v);
73
+ };
74
+ var __asyncGenerator =
75
+ (this && this.__asyncGenerator) ||
76
+ function (thisArg, _arguments, generator) {
77
+ if (!Symbol.asyncIterator)
78
+ throw new TypeError('Symbol.asyncIterator is not defined.');
79
+ var g = generator.apply(thisArg, _arguments || []),
80
+ i,
81
+ q = [];
82
+ return (
83
+ (i = {}),
84
+ verb('next'),
85
+ verb('throw'),
86
+ verb('return'),
87
+ (i[Symbol.asyncIterator] = function () {
88
+ return this;
89
+ }),
90
+ i
91
+ );
92
+ function verb(n) {
93
+ if (g[n])
94
+ i[n] = function (v) {
95
+ return new Promise(function (a, b) {
96
+ q.push([n, v, a, b]) > 1 || resume(n, v);
97
+ });
98
+ };
99
+ }
100
+ function resume(n, v) {
101
+ try {
102
+ step(g[n](v));
103
+ } catch (e) {
104
+ settle(q[0][3], e);
105
+ }
106
+ }
107
+ function step(r) {
108
+ r.value instanceof __await
109
+ ? Promise.resolve(r.value.v).then(fulfill, reject)
110
+ : settle(q[0][2], r);
111
+ }
112
+ function fulfill(value) {
113
+ resume('next', value);
114
+ }
115
+ function reject(value) {
116
+ resume('throw', value);
117
+ }
118
+ function settle(f, v) {
119
+ if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]);
120
+ }
121
+ };
122
+ Object.defineProperty(exports, '__esModule', { value: true });
123
+ exports.Tunnels =
124
+ exports.TunnelSessions =
125
+ exports.TLSCertificates =
126
+ exports.SSHUserCertificates =
127
+ exports.SSHHostCertificates =
128
+ exports.SSHCredentials =
129
+ exports.SSHCertificateAuthorities =
130
+ exports.ReservedDomains =
131
+ exports.ReservedAddrs =
132
+ exports.IPRestrictions =
133
+ exports.IPPolicyRules =
134
+ exports.IPPolicies =
135
+ exports.EventSources =
136
+ exports.EventSubscriptions =
137
+ exports.EventDestinations =
138
+ exports.Endpoints =
139
+ exports.TLSEdgeTLSTerminationModule =
140
+ exports.TLSEdgeMutualTLSModule =
141
+ exports.TLSEdgeIPRestrictionModule =
142
+ exports.TLSEdgeBackendModule =
143
+ exports.EdgesTLS =
144
+ exports.TCPEdgeIPRestrictionModule =
145
+ exports.TCPEdgeBackendModule =
146
+ exports.EdgesTCP =
147
+ exports.EdgeRouteWebsocketTCPConverterModule =
148
+ exports.EdgeRouteOIDCModule =
149
+ exports.EdgeRouteSAMLModule =
150
+ exports.EdgeRouteOAuthModule =
151
+ exports.EdgeRouteWebhookVerificationModule =
152
+ exports.EdgeRouteCircuitBreakerModule =
153
+ exports.EdgeRouteCompressionModule =
154
+ exports.EdgeRouteResponseHeadersModule =
155
+ exports.EdgeRouteRequestHeadersModule =
156
+ exports.EdgeRouteIPRestrictionModule =
157
+ exports.EdgeRouteBackendModule =
158
+ exports.HTTPSEdgeTLSTerminationModule =
159
+ exports.HTTPSEdgeMutualTLSModule =
160
+ exports.EdgesHTTPS =
161
+ exports.EdgesHTTPSRoutes =
162
+ exports.Credentials =
163
+ exports.CertificateAuthorities =
164
+ exports.WeightedBackends =
165
+ exports.TunnelGroupBackends =
166
+ exports.HTTPResponseBackends =
167
+ exports.FailoverBackends =
168
+ exports.APIKeys =
169
+ exports.AgentIngresses =
170
+ exports.AbuseReports =
171
+ void 0;
172
+ const util = require('./util');
173
+ /**
174
+ * Abuse Reports allow you to submit take-down requests for URLs hosted by
175
+ ngrok that violate ngrok's terms of service.
176
+ */
177
+ class AbuseReports {
178
+ /** Do not construct this object directly, use the <code>abuseReports</code> property of an <code>Ngrok</code> client object instead. */
179
+ constructor(httpClient) {
180
+ this.httpClient = httpClient;
181
+ }
182
+ /**
183
+ * Creates a new abuse report which will be reviewed by our system and abuse response team. This API is only available to authorized accounts. Contact abuse@ngrok.com to request access
184
+ */
185
+ create(arg) {
186
+ return this.httpClient
187
+ .url(`/abuse_reports`)
188
+ .post(util.serializeArgument(arg))
189
+ .json(payload => util.deserializeResult(payload))
190
+ .then(f => f, util.onRejected);
191
+ }
192
+ /**
193
+ * Get the detailed status of abuse report by ID.
194
+ */
195
+ get(arg) {
196
+ return this.httpClient
197
+ .url(`/abuse_reports/${arg.id}`)
198
+ .get()
199
+ .json(payload => util.deserializeResult(payload))
200
+ .then(f => f, util.onRejected);
201
+ }
202
+ }
203
+ exports.AbuseReports = AbuseReports;
204
+ class AgentIngresses {
205
+ /** Do not construct this object directly, use the <code>agentIngresses</code> property of an <code>Ngrok</code> client object instead. */
206
+ constructor(httpClient) {
207
+ this.httpClient = httpClient;
208
+ }
209
+ /**
210
+ * Create a new Agent Ingress. The ngrok agent can be configured to connect to ngrok via the new set of addresses on the returned Agent Ingress.
211
+ */
212
+ create(arg) {
213
+ return this.httpClient
214
+ .url(`/agent_ingresses`)
215
+ .post(util.serializeArgument(arg))
216
+ .json(payload => util.deserializeResult(payload))
217
+ .then(f => f, util.onRejected);
218
+ }
219
+ /**
220
+ * Delete an Agent Ingress by ID
221
+ */
222
+ delete(arg) {
223
+ return this.httpClient
224
+ .url(`/agent_ingresses/${arg.id}`)
225
+ .delete()
226
+ .json(payload => util.deserializeResult(payload))
227
+ .then(f => f, util.onRejected);
228
+ }
229
+ /**
230
+ * Get the details of an Agent Ingress by ID.
231
+ */
232
+ get(arg) {
233
+ return this.httpClient
234
+ .url(`/agent_ingresses/${arg.id}`)
235
+ .get()
236
+ .json(payload => util.deserializeResult(payload))
237
+ .then(f => f, util.onRejected);
238
+ }
239
+ /**
240
+ * List all Agent Ingresses owned by this account
241
+ */
242
+ list() {
243
+ var e_1, _a;
244
+ return __awaiter(this, void 0, void 0, function* () {
245
+ const array = [];
246
+ try {
247
+ for (
248
+ var _b = __asyncValues(this._asyncList()), _c;
249
+ (_c = yield _b.next()), !_c.done;
250
+
251
+ ) {
252
+ let item = _c.value;
253
+ array.push(item);
254
+ }
255
+ } catch (e_1_1) {
256
+ e_1 = { error: e_1_1 };
257
+ } finally {
258
+ try {
259
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
260
+ } finally {
261
+ if (e_1) throw e_1.error;
262
+ }
263
+ }
264
+ return array;
265
+ });
266
+ }
267
+ _pagedList(arg) {
268
+ return this.httpClient
269
+ .url(`/agent_ingresses`)
270
+ .query(arg)
271
+ .get()
272
+ .json(payload => util.deserializeResult(payload))
273
+ .then(util.onFulfilled, util.onRejected);
274
+ }
275
+ _asyncList() {
276
+ return __asyncGenerator(this, arguments, function* _asyncList_1() {
277
+ const limit = '100';
278
+ let nextPage = 'initial loop';
279
+ let page = { limit: limit };
280
+ while (nextPage) {
281
+ const pagedList = yield __await(this._pagedList(page));
282
+ nextPage = pagedList.nextPageUri;
283
+ const items = pagedList.ingresses;
284
+ if (nextPage) {
285
+ page = {
286
+ beforeId: items[items.length - 1].id,
287
+ limit: limit,
288
+ };
289
+ }
290
+ for (let item of items) {
291
+ yield yield __await(item);
292
+ }
293
+ }
294
+ });
295
+ }
296
+ /**
297
+ * Update attributes of an Agent Ingress by ID.
298
+ */
299
+ update(arg) {
300
+ return this.httpClient
301
+ .url(`/agent_ingresses/${arg.id}`)
302
+ .patch(util.serializeArgument(arg))
303
+ .json(payload => util.deserializeResult(payload))
304
+ .then(f => f, util.onRejected);
305
+ }
306
+ }
307
+ exports.AgentIngresses = AgentIngresses;
308
+ /**
309
+ * API Keys are used to authenticate to the [ngrok
310
+ API](https://ngrok.com/docs/api#authentication). You may use the API itself
311
+ to provision and manage API Keys but you'll need to provision your first API
312
+ key from the [API Keys page](https://dashboard.ngrok.com/api/keys) on your
313
+ ngrok.com dashboard.
314
+ */
315
+ class APIKeys {
316
+ /** Do not construct this object directly, use the <code>apiKeys</code> property of an <code>Ngrok</code> client object instead. */
317
+ constructor(httpClient) {
318
+ this.httpClient = httpClient;
319
+ }
320
+ /**
321
+ * Create a new API key. The generated API key can be used to authenticate to the ngrok API.
322
+ */
323
+ create(arg) {
324
+ return this.httpClient
325
+ .url(`/api_keys`)
326
+ .post(util.serializeArgument(arg))
327
+ .json(payload => util.deserializeResult(payload))
328
+ .then(f => f, util.onRejected);
329
+ }
330
+ /**
331
+ * Delete an API key by ID
332
+ */
333
+ delete(arg) {
334
+ return this.httpClient
335
+ .url(`/api_keys/${arg.id}`)
336
+ .delete()
337
+ .json(payload => util.deserializeResult(payload))
338
+ .then(f => f, util.onRejected);
339
+ }
340
+ /**
341
+ * Get the details of an API key by ID.
342
+ */
343
+ get(arg) {
344
+ return this.httpClient
345
+ .url(`/api_keys/${arg.id}`)
346
+ .get()
347
+ .json(payload => util.deserializeResult(payload))
348
+ .then(f => f, util.onRejected);
349
+ }
350
+ /**
351
+ * List all API keys owned by this account
352
+ */
353
+ list() {
354
+ var e_2, _a;
355
+ return __awaiter(this, void 0, void 0, function* () {
356
+ const array = [];
357
+ try {
358
+ for (
359
+ var _b = __asyncValues(this._asyncList()), _c;
360
+ (_c = yield _b.next()), !_c.done;
361
+
362
+ ) {
363
+ let item = _c.value;
364
+ array.push(item);
365
+ }
366
+ } catch (e_2_1) {
367
+ e_2 = { error: e_2_1 };
368
+ } finally {
369
+ try {
370
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
371
+ } finally {
372
+ if (e_2) throw e_2.error;
373
+ }
374
+ }
375
+ return array;
376
+ });
377
+ }
378
+ _pagedList(arg) {
379
+ return this.httpClient
380
+ .url(`/api_keys`)
381
+ .query(arg)
382
+ .get()
383
+ .json(payload => util.deserializeResult(payload))
384
+ .then(util.onFulfilled, util.onRejected);
385
+ }
386
+ _asyncList() {
387
+ return __asyncGenerator(this, arguments, function* _asyncList_2() {
388
+ const limit = '100';
389
+ let nextPage = 'initial loop';
390
+ let page = { limit: limit };
391
+ while (nextPage) {
392
+ const pagedList = yield __await(this._pagedList(page));
393
+ nextPage = pagedList.nextPageUri;
394
+ const items = pagedList.keys;
395
+ if (nextPage) {
396
+ page = {
397
+ beforeId: items[items.length - 1].id,
398
+ limit: limit,
399
+ };
400
+ }
401
+ for (let item of items) {
402
+ yield yield __await(item);
403
+ }
404
+ }
405
+ });
406
+ }
407
+ /**
408
+ * Update attributes of an API key by ID.
409
+ */
410
+ update(arg) {
411
+ return this.httpClient
412
+ .url(`/api_keys/${arg.id}`)
413
+ .patch(util.serializeArgument(arg))
414
+ .json(payload => util.deserializeResult(payload))
415
+ .then(f => f, util.onRejected);
416
+ }
417
+ }
418
+ exports.APIKeys = APIKeys;
419
+ /**
420
+ * A Failover backend defines failover behavior within a list of referenced
421
+ backends. Traffic is sent to the first backend in the list. If that backend
422
+ is offline or no connection can be established, ngrok attempts to connect to
423
+ the next backend in the list until one is successful.
424
+ */
425
+ class FailoverBackends {
426
+ /** Do not construct this object directly, use the <code>failoverBackends</code> property of an <code>Ngrok</code> client object instead. */
427
+ constructor(httpClient) {
428
+ this.httpClient = httpClient;
429
+ }
430
+ /**
431
+ * Create a new Failover backend
432
+ */
433
+ create(arg) {
434
+ return this.httpClient
435
+ .url(`/backends/failover`)
436
+ .post(util.serializeArgument(arg))
437
+ .json(payload => util.deserializeResult(payload))
438
+ .then(f => f, util.onRejected);
439
+ }
440
+ /**
441
+ * Delete a Failover backend by ID. TODO what if used?
442
+ */
443
+ delete(arg) {
444
+ return this.httpClient
445
+ .url(`/backends/failover/${arg.id}`)
446
+ .delete()
447
+ .json(payload => util.deserializeResult(payload))
448
+ .then(f => f, util.onRejected);
449
+ }
450
+ /**
451
+ * Get detailed information about a Failover backend by ID
452
+ */
453
+ get(arg) {
454
+ return this.httpClient
455
+ .url(`/backends/failover/${arg.id}`)
456
+ .get()
457
+ .json(payload => util.deserializeResult(payload))
458
+ .then(f => f, util.onRejected);
459
+ }
460
+ /**
461
+ * List all Failover backends on this account
462
+ */
463
+ list() {
464
+ var e_3, _a;
465
+ return __awaiter(this, void 0, void 0, function* () {
466
+ const array = [];
467
+ try {
468
+ for (
469
+ var _b = __asyncValues(this._asyncList()), _c;
470
+ (_c = yield _b.next()), !_c.done;
471
+
472
+ ) {
473
+ let item = _c.value;
474
+ array.push(item);
475
+ }
476
+ } catch (e_3_1) {
477
+ e_3 = { error: e_3_1 };
478
+ } finally {
479
+ try {
480
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
481
+ } finally {
482
+ if (e_3) throw e_3.error;
483
+ }
484
+ }
485
+ return array;
486
+ });
487
+ }
488
+ _pagedList(arg) {
489
+ return this.httpClient
490
+ .url(`/backends/failover`)
491
+ .query(arg)
492
+ .get()
493
+ .json(payload => util.deserializeResult(payload))
494
+ .then(util.onFulfilled, util.onRejected);
495
+ }
496
+ _asyncList() {
497
+ return __asyncGenerator(this, arguments, function* _asyncList_3() {
498
+ const limit = '100';
499
+ let nextPage = 'initial loop';
500
+ let page = { limit: limit };
501
+ while (nextPage) {
502
+ const pagedList = yield __await(this._pagedList(page));
503
+ nextPage = pagedList.nextPageUri;
504
+ const items = pagedList.backends;
505
+ if (nextPage) {
506
+ page = {
507
+ beforeId: items[items.length - 1].id,
508
+ limit: limit,
509
+ };
510
+ }
511
+ for (let item of items) {
512
+ yield yield __await(item);
513
+ }
514
+ }
515
+ });
516
+ }
517
+ /**
518
+ * Update Failover backend by ID
519
+ */
520
+ update(arg) {
521
+ return this.httpClient
522
+ .url(`/backends/failover/${arg.id}`)
523
+ .patch(util.serializeArgument(arg))
524
+ .json(payload => util.deserializeResult(payload))
525
+ .then(f => f, util.onRejected);
526
+ }
527
+ }
528
+ exports.FailoverBackends = FailoverBackends;
529
+ class HTTPResponseBackends {
530
+ /** Do not construct this object directly, use the <code>httpResponseBackends</code> property of an <code>Ngrok</code> client object instead. */
531
+ constructor(httpClient) {
532
+ this.httpClient = httpClient;
533
+ }
534
+ create(arg) {
535
+ return this.httpClient
536
+ .url(`/backends/http_response`)
537
+ .post(util.serializeArgument(arg))
538
+ .json(payload => util.deserializeResult(payload))
539
+ .then(f => f, util.onRejected);
540
+ }
541
+ delete(arg) {
542
+ return this.httpClient
543
+ .url(`/backends/http_response/${arg.id}`)
544
+ .delete()
545
+ .json(payload => util.deserializeResult(payload))
546
+ .then(f => f, util.onRejected);
547
+ }
548
+ get(arg) {
549
+ return this.httpClient
550
+ .url(`/backends/http_response/${arg.id}`)
551
+ .get()
552
+ .json(payload => util.deserializeResult(payload))
553
+ .then(f => f, util.onRejected);
554
+ }
555
+ list() {
556
+ var e_4, _a;
557
+ return __awaiter(this, void 0, void 0, function* () {
558
+ const array = [];
559
+ try {
560
+ for (
561
+ var _b = __asyncValues(this._asyncList()), _c;
562
+ (_c = yield _b.next()), !_c.done;
563
+
564
+ ) {
565
+ let item = _c.value;
566
+ array.push(item);
567
+ }
568
+ } catch (e_4_1) {
569
+ e_4 = { error: e_4_1 };
570
+ } finally {
571
+ try {
572
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
573
+ } finally {
574
+ if (e_4) throw e_4.error;
575
+ }
576
+ }
577
+ return array;
578
+ });
579
+ }
580
+ _pagedList(arg) {
581
+ return this.httpClient
582
+ .url(`/backends/http_response`)
583
+ .query(arg)
584
+ .get()
585
+ .json(payload => util.deserializeResult(payload))
586
+ .then(util.onFulfilled, util.onRejected);
587
+ }
588
+ _asyncList() {
589
+ return __asyncGenerator(this, arguments, function* _asyncList_4() {
590
+ const limit = '100';
591
+ let nextPage = 'initial loop';
592
+ let page = { limit: limit };
593
+ while (nextPage) {
594
+ const pagedList = yield __await(this._pagedList(page));
595
+ nextPage = pagedList.nextPageUri;
596
+ const items = pagedList.backends;
597
+ if (nextPage) {
598
+ page = {
599
+ beforeId: items[items.length - 1].id,
600
+ limit: limit,
601
+ };
602
+ }
603
+ for (let item of items) {
604
+ yield yield __await(item);
605
+ }
606
+ }
607
+ });
608
+ }
609
+ update(arg) {
610
+ return this.httpClient
611
+ .url(`/backends/http_response/${arg.id}`)
612
+ .patch(util.serializeArgument(arg))
613
+ .json(payload => util.deserializeResult(payload))
614
+ .then(f => f, util.onRejected);
615
+ }
616
+ }
617
+ exports.HTTPResponseBackends = HTTPResponseBackends;
618
+ /**
619
+ * A Tunnel Group Backend balances traffic among all online tunnels that match
620
+ a label selector.
621
+ */
622
+ class TunnelGroupBackends {
623
+ /** Do not construct this object directly, use the <code>tunnelGroupBackends</code> property of an <code>Ngrok</code> client object instead. */
624
+ constructor(httpClient) {
625
+ this.httpClient = httpClient;
626
+ }
627
+ /**
628
+ * Create a new TunnelGroup backend
629
+ */
630
+ create(arg) {
631
+ return this.httpClient
632
+ .url(`/backends/tunnel_group`)
633
+ .post(util.serializeArgument(arg))
634
+ .json(payload => util.deserializeResult(payload))
635
+ .then(f => f, util.onRejected);
636
+ }
637
+ /**
638
+ * Delete a TunnelGroup backend by ID. TODO what if used?
639
+ */
640
+ delete(arg) {
641
+ return this.httpClient
642
+ .url(`/backends/tunnel_group/${arg.id}`)
643
+ .delete()
644
+ .json(payload => util.deserializeResult(payload))
645
+ .then(f => f, util.onRejected);
646
+ }
647
+ /**
648
+ * Get detailed information about a TunnelGroup backend by ID
649
+ */
650
+ get(arg) {
651
+ return this.httpClient
652
+ .url(`/backends/tunnel_group/${arg.id}`)
653
+ .get()
654
+ .json(payload => util.deserializeResult(payload))
655
+ .then(f => f, util.onRejected);
656
+ }
657
+ /**
658
+ * List all TunnelGroup backends on this account
659
+ */
660
+ list() {
661
+ var e_5, _a;
662
+ return __awaiter(this, void 0, void 0, function* () {
663
+ const array = [];
664
+ try {
665
+ for (
666
+ var _b = __asyncValues(this._asyncList()), _c;
667
+ (_c = yield _b.next()), !_c.done;
668
+
669
+ ) {
670
+ let item = _c.value;
671
+ array.push(item);
672
+ }
673
+ } catch (e_5_1) {
674
+ e_5 = { error: e_5_1 };
675
+ } finally {
676
+ try {
677
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
678
+ } finally {
679
+ if (e_5) throw e_5.error;
680
+ }
681
+ }
682
+ return array;
683
+ });
684
+ }
685
+ _pagedList(arg) {
686
+ return this.httpClient
687
+ .url(`/backends/tunnel_group`)
688
+ .query(arg)
689
+ .get()
690
+ .json(payload => util.deserializeResult(payload))
691
+ .then(util.onFulfilled, util.onRejected);
692
+ }
693
+ _asyncList() {
694
+ return __asyncGenerator(this, arguments, function* _asyncList_5() {
695
+ const limit = '100';
696
+ let nextPage = 'initial loop';
697
+ let page = { limit: limit };
698
+ while (nextPage) {
699
+ const pagedList = yield __await(this._pagedList(page));
700
+ nextPage = pagedList.nextPageUri;
701
+ const items = pagedList.backends;
702
+ if (nextPage) {
703
+ page = {
704
+ beforeId: items[items.length - 1].id,
705
+ limit: limit,
706
+ };
707
+ }
708
+ for (let item of items) {
709
+ yield yield __await(item);
710
+ }
711
+ }
712
+ });
713
+ }
714
+ /**
715
+ * Update TunnelGroup backend by ID
716
+ */
717
+ update(arg) {
718
+ return this.httpClient
719
+ .url(`/backends/tunnel_group/${arg.id}`)
720
+ .patch(util.serializeArgument(arg))
721
+ .json(payload => util.deserializeResult(payload))
722
+ .then(f => f, util.onRejected);
723
+ }
724
+ }
725
+ exports.TunnelGroupBackends = TunnelGroupBackends;
726
+ /**
727
+ * A Weighted Backend balances traffic among the referenced backends. Traffic
728
+ is assigned proportionally to each based on its weight. The percentage of
729
+ traffic is calculated by dividing a backend's weight by the sum of all
730
+ weights.
731
+ */
732
+ class WeightedBackends {
733
+ /** Do not construct this object directly, use the <code>weightedBackends</code> property of an <code>Ngrok</code> client object instead. */
734
+ constructor(httpClient) {
735
+ this.httpClient = httpClient;
736
+ }
737
+ /**
738
+ * Create a new Weighted backend
739
+ */
740
+ create(arg) {
741
+ return this.httpClient
742
+ .url(`/backends/weighted`)
743
+ .post(util.serializeArgument(arg))
744
+ .json(payload => util.deserializeResult(payload))
745
+ .then(f => f, util.onRejected);
746
+ }
747
+ /**
748
+ * Delete a Weighted backend by ID. TODO what if used?
749
+ */
750
+ delete(arg) {
751
+ return this.httpClient
752
+ .url(`/backends/weighted/${arg.id}`)
753
+ .delete()
754
+ .json(payload => util.deserializeResult(payload))
755
+ .then(f => f, util.onRejected);
756
+ }
757
+ /**
758
+ * Get detailed information about a Weighted backend by ID
759
+ */
760
+ get(arg) {
761
+ return this.httpClient
762
+ .url(`/backends/weighted/${arg.id}`)
763
+ .get()
764
+ .json(payload => util.deserializeResult(payload))
765
+ .then(f => f, util.onRejected);
766
+ }
767
+ /**
768
+ * List all Weighted backends on this account
769
+ */
770
+ list() {
771
+ var e_6, _a;
772
+ return __awaiter(this, void 0, void 0, function* () {
773
+ const array = [];
774
+ try {
775
+ for (
776
+ var _b = __asyncValues(this._asyncList()), _c;
777
+ (_c = yield _b.next()), !_c.done;
778
+
779
+ ) {
780
+ let item = _c.value;
781
+ array.push(item);
782
+ }
783
+ } catch (e_6_1) {
784
+ e_6 = { error: e_6_1 };
785
+ } finally {
786
+ try {
787
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
788
+ } finally {
789
+ if (e_6) throw e_6.error;
790
+ }
791
+ }
792
+ return array;
793
+ });
794
+ }
795
+ _pagedList(arg) {
796
+ return this.httpClient
797
+ .url(`/backends/weighted`)
798
+ .query(arg)
799
+ .get()
800
+ .json(payload => util.deserializeResult(payload))
801
+ .then(util.onFulfilled, util.onRejected);
802
+ }
803
+ _asyncList() {
804
+ return __asyncGenerator(this, arguments, function* _asyncList_6() {
805
+ const limit = '100';
806
+ let nextPage = 'initial loop';
807
+ let page = { limit: limit };
808
+ while (nextPage) {
809
+ const pagedList = yield __await(this._pagedList(page));
810
+ nextPage = pagedList.nextPageUri;
811
+ const items = pagedList.backends;
812
+ if (nextPage) {
813
+ page = {
814
+ beforeId: items[items.length - 1].id,
815
+ limit: limit,
816
+ };
817
+ }
818
+ for (let item of items) {
819
+ yield yield __await(item);
820
+ }
821
+ }
822
+ });
823
+ }
824
+ /**
825
+ * Update Weighted backend by ID
826
+ */
827
+ update(arg) {
828
+ return this.httpClient
829
+ .url(`/backends/weighted/${arg.id}`)
830
+ .patch(util.serializeArgument(arg))
831
+ .json(payload => util.deserializeResult(payload))
832
+ .then(f => f, util.onRejected);
833
+ }
834
+ }
835
+ exports.WeightedBackends = WeightedBackends;
836
+ /**
837
+ * Certificate Authorities are x509 certificates that are used to sign other
838
+ x509 certificates. Attach a Certificate Authority to the Mutual TLS module
839
+ to verify that the TLS certificate presented by a client has been signed by
840
+ this CA. Certificate Authorities are used only for mTLS validation only and
841
+ thus a private key is not included in the resource.
842
+ */
843
+ class CertificateAuthorities {
844
+ /** Do not construct this object directly, use the <code>certificateAuthorities</code> property of an <code>Ngrok</code> client object instead. */
845
+ constructor(httpClient) {
846
+ this.httpClient = httpClient;
847
+ }
848
+ /**
849
+ * Upload a new Certificate Authority
850
+ */
851
+ create(arg) {
852
+ return this.httpClient
853
+ .url(`/certificate_authorities`)
854
+ .post(util.serializeArgument(arg))
855
+ .json(payload => util.deserializeResult(payload))
856
+ .then(f => f, util.onRejected);
857
+ }
858
+ /**
859
+ * Delete a Certificate Authority
860
+ */
861
+ delete(arg) {
862
+ return this.httpClient
863
+ .url(`/certificate_authorities/${arg.id}`)
864
+ .delete()
865
+ .json(payload => util.deserializeResult(payload))
866
+ .then(f => f, util.onRejected);
867
+ }
868
+ /**
869
+ * Get detailed information about a certficate authority
870
+ */
871
+ get(arg) {
872
+ return this.httpClient
873
+ .url(`/certificate_authorities/${arg.id}`)
874
+ .get()
875
+ .json(payload => util.deserializeResult(payload))
876
+ .then(f => f, util.onRejected);
877
+ }
878
+ /**
879
+ * List all Certificate Authority on this account
880
+ */
881
+ list() {
882
+ var e_7, _a;
883
+ return __awaiter(this, void 0, void 0, function* () {
884
+ const array = [];
885
+ try {
886
+ for (
887
+ var _b = __asyncValues(this._asyncList()), _c;
888
+ (_c = yield _b.next()), !_c.done;
889
+
890
+ ) {
891
+ let item = _c.value;
892
+ array.push(item);
893
+ }
894
+ } catch (e_7_1) {
895
+ e_7 = { error: e_7_1 };
896
+ } finally {
897
+ try {
898
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
899
+ } finally {
900
+ if (e_7) throw e_7.error;
901
+ }
902
+ }
903
+ return array;
904
+ });
905
+ }
906
+ _pagedList(arg) {
907
+ return this.httpClient
908
+ .url(`/certificate_authorities`)
909
+ .query(arg)
910
+ .get()
911
+ .json(payload => util.deserializeResult(payload))
912
+ .then(util.onFulfilled, util.onRejected);
913
+ }
914
+ _asyncList() {
915
+ return __asyncGenerator(this, arguments, function* _asyncList_7() {
916
+ const limit = '100';
917
+ let nextPage = 'initial loop';
918
+ let page = { limit: limit };
919
+ while (nextPage) {
920
+ const pagedList = yield __await(this._pagedList(page));
921
+ nextPage = pagedList.nextPageUri;
922
+ const items = pagedList.certificateAuthorities;
923
+ if (nextPage) {
924
+ page = {
925
+ beforeId: items[items.length - 1].id,
926
+ limit: limit,
927
+ };
928
+ }
929
+ for (let item of items) {
930
+ yield yield __await(item);
931
+ }
932
+ }
933
+ });
934
+ }
935
+ /**
936
+ * Update attributes of a Certificate Authority by ID
937
+ */
938
+ update(arg) {
939
+ return this.httpClient
940
+ .url(`/certificate_authorities/${arg.id}`)
941
+ .patch(util.serializeArgument(arg))
942
+ .json(payload => util.deserializeResult(payload))
943
+ .then(f => f, util.onRejected);
944
+ }
945
+ }
946
+ exports.CertificateAuthorities = CertificateAuthorities;
947
+ /**
948
+ * Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
949
+ agent to connect the ngrok service as your account. They are installed with
950
+ the `ngrok authtoken` command or by specifying it in the `ngrok.yml`
951
+ configuration file with the `authtoken` property.
952
+ */
953
+ class Credentials {
954
+ /** Do not construct this object directly, use the <code>credentials</code> property of an <code>Ngrok</code> client object instead. */
955
+ constructor(httpClient) {
956
+ this.httpClient = httpClient;
957
+ }
958
+ /**
959
+ * 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.
960
+ */
961
+ create(arg) {
962
+ return this.httpClient
963
+ .url(`/credentials`)
964
+ .post(util.serializeArgument(arg))
965
+ .json(payload => util.deserializeResult(payload))
966
+ .then(f => f, util.onRejected);
967
+ }
968
+ /**
969
+ * Delete a tunnel authtoken credential by ID
970
+ */
971
+ delete(arg) {
972
+ return this.httpClient
973
+ .url(`/credentials/${arg.id}`)
974
+ .delete()
975
+ .json(payload => util.deserializeResult(payload))
976
+ .then(f => f, util.onRejected);
977
+ }
978
+ /**
979
+ * Get detailed information about a tunnel authtoken credential
980
+ */
981
+ get(arg) {
982
+ return this.httpClient
983
+ .url(`/credentials/${arg.id}`)
984
+ .get()
985
+ .json(payload => util.deserializeResult(payload))
986
+ .then(f => f, util.onRejected);
987
+ }
988
+ /**
989
+ * List all tunnel authtoken credentials on this account
990
+ */
991
+ list() {
992
+ var e_8, _a;
993
+ return __awaiter(this, void 0, void 0, function* () {
994
+ const array = [];
995
+ try {
996
+ for (
997
+ var _b = __asyncValues(this._asyncList()), _c;
998
+ (_c = yield _b.next()), !_c.done;
999
+
1000
+ ) {
1001
+ let item = _c.value;
1002
+ array.push(item);
1003
+ }
1004
+ } catch (e_8_1) {
1005
+ e_8 = { error: e_8_1 };
1006
+ } finally {
1007
+ try {
1008
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
1009
+ } finally {
1010
+ if (e_8) throw e_8.error;
1011
+ }
1012
+ }
1013
+ return array;
1014
+ });
1015
+ }
1016
+ _pagedList(arg) {
1017
+ return this.httpClient
1018
+ .url(`/credentials`)
1019
+ .query(arg)
1020
+ .get()
1021
+ .json(payload => util.deserializeResult(payload))
1022
+ .then(util.onFulfilled, util.onRejected);
1023
+ }
1024
+ _asyncList() {
1025
+ return __asyncGenerator(this, arguments, function* _asyncList_8() {
1026
+ const limit = '100';
1027
+ let nextPage = 'initial loop';
1028
+ let page = { limit: limit };
1029
+ while (nextPage) {
1030
+ const pagedList = yield __await(this._pagedList(page));
1031
+ nextPage = pagedList.nextPageUri;
1032
+ const items = pagedList.credentials;
1033
+ if (nextPage) {
1034
+ page = {
1035
+ beforeId: items[items.length - 1].id,
1036
+ limit: limit,
1037
+ };
1038
+ }
1039
+ for (let item of items) {
1040
+ yield yield __await(item);
1041
+ }
1042
+ }
1043
+ });
1044
+ }
1045
+ /**
1046
+ * Update attributes of an tunnel authtoken credential by ID
1047
+ */
1048
+ update(arg) {
1049
+ return this.httpClient
1050
+ .url(`/credentials/${arg.id}`)
1051
+ .patch(util.serializeArgument(arg))
1052
+ .json(payload => util.deserializeResult(payload))
1053
+ .then(f => f, util.onRejected);
1054
+ }
1055
+ }
1056
+ exports.Credentials = Credentials;
1057
+ class EdgesHTTPSRoutes {
1058
+ /** Do not construct this object directly, use the <code>edgesHttpsRoutes</code> property of an <code>Ngrok</code> client object instead. */
1059
+ constructor(httpClient) {
1060
+ this.httpClient = httpClient;
1061
+ }
1062
+ /**
1063
+ * Create an HTTPS Edge Route
1064
+ */
1065
+ create(arg) {
1066
+ return this.httpClient
1067
+ .url(`/edges/https/${arg.edgeId}/routes`)
1068
+ .post(util.serializeArgument(arg))
1069
+ .json(payload => util.deserializeResult(payload))
1070
+ .then(f => f, util.onRejected);
1071
+ }
1072
+ /**
1073
+ * Get an HTTPS Edge Route by ID
1074
+ */
1075
+ get(arg) {
1076
+ return this.httpClient
1077
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
1078
+ .get()
1079
+ .json(payload => util.deserializeResult(payload))
1080
+ .then(f => f, util.onRejected);
1081
+ }
1082
+ /**
1083
+ * 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.
1084
+ */
1085
+ update(arg) {
1086
+ return this.httpClient
1087
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
1088
+ .patch(util.serializeArgument(arg))
1089
+ .json(payload => util.deserializeResult(payload))
1090
+ .then(f => f, util.onRejected);
1091
+ }
1092
+ /**
1093
+ * Delete an HTTPS Edge Route by ID
1094
+ */
1095
+ delete(arg) {
1096
+ return this.httpClient
1097
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
1098
+ .delete()
1099
+ .json(payload => util.deserializeResult(payload))
1100
+ .then(f => f, util.onRejected);
1101
+ }
1102
+ }
1103
+ exports.EdgesHTTPSRoutes = EdgesHTTPSRoutes;
1104
+ class EdgesHTTPS {
1105
+ /** Do not construct this object directly, use the <code>edgesHttps</code> property of an <code>Ngrok</code> client object instead. */
1106
+ constructor(httpClient) {
1107
+ this.httpClient = httpClient;
1108
+ }
1109
+ /**
1110
+ * Create an HTTPS Edge
1111
+ */
1112
+ create(arg) {
1113
+ return this.httpClient
1114
+ .url(`/edges/https`)
1115
+ .post(util.serializeArgument(arg))
1116
+ .json(payload => util.deserializeResult(payload))
1117
+ .then(f => f, util.onRejected);
1118
+ }
1119
+ /**
1120
+ * Get an HTTPS Edge by ID
1121
+ */
1122
+ get(arg) {
1123
+ return this.httpClient
1124
+ .url(`/edges/https/${arg.id}`)
1125
+ .get()
1126
+ .json(payload => util.deserializeResult(payload))
1127
+ .then(f => f, util.onRejected);
1128
+ }
1129
+ /**
1130
+ * Returns a list of all HTTPS Edges on this account
1131
+ */
1132
+ list() {
1133
+ var e_9, _a;
1134
+ return __awaiter(this, void 0, void 0, function* () {
1135
+ const array = [];
1136
+ try {
1137
+ for (
1138
+ var _b = __asyncValues(this._asyncList()), _c;
1139
+ (_c = yield _b.next()), !_c.done;
1140
+
1141
+ ) {
1142
+ let item = _c.value;
1143
+ array.push(item);
1144
+ }
1145
+ } catch (e_9_1) {
1146
+ e_9 = { error: e_9_1 };
1147
+ } finally {
1148
+ try {
1149
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
1150
+ } finally {
1151
+ if (e_9) throw e_9.error;
1152
+ }
1153
+ }
1154
+ return array;
1155
+ });
1156
+ }
1157
+ _pagedList(arg) {
1158
+ return this.httpClient
1159
+ .url(`/edges/https`)
1160
+ .query(arg)
1161
+ .get()
1162
+ .json(payload => util.deserializeResult(payload))
1163
+ .then(util.onFulfilled, util.onRejected);
1164
+ }
1165
+ _asyncList() {
1166
+ return __asyncGenerator(this, arguments, function* _asyncList_9() {
1167
+ const limit = '100';
1168
+ let nextPage = 'initial loop';
1169
+ let page = { limit: limit };
1170
+ while (nextPage) {
1171
+ const pagedList = yield __await(this._pagedList(page));
1172
+ nextPage = pagedList.nextPageUri;
1173
+ const items = pagedList.httpsEdges;
1174
+ if (nextPage) {
1175
+ page = {
1176
+ beforeId: items[items.length - 1].id,
1177
+ limit: limit,
1178
+ };
1179
+ }
1180
+ for (let item of items) {
1181
+ yield yield __await(item);
1182
+ }
1183
+ }
1184
+ });
1185
+ }
1186
+ /**
1187
+ * 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.
1188
+ */
1189
+ update(arg) {
1190
+ return this.httpClient
1191
+ .url(`/edges/https/${arg.id}`)
1192
+ .patch(util.serializeArgument(arg))
1193
+ .json(payload => util.deserializeResult(payload))
1194
+ .then(f => f, util.onRejected);
1195
+ }
1196
+ /**
1197
+ * Delete an HTTPS Edge by ID
1198
+ */
1199
+ delete(arg) {
1200
+ return this.httpClient
1201
+ .url(`/edges/https/${arg.id}`)
1202
+ .delete()
1203
+ .json(payload => util.deserializeResult(payload))
1204
+ .then(f => f, util.onRejected);
1205
+ }
1206
+ }
1207
+ exports.EdgesHTTPS = EdgesHTTPS;
1208
+ class HTTPSEdgeMutualTLSModule {
1209
+ /** Do not construct this object directly, use the <code>httpsEdgeMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
1210
+ constructor(httpClient) {
1211
+ this.httpClient = httpClient;
1212
+ }
1213
+ replace(arg) {
1214
+ return this.httpClient
1215
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1216
+ .put(util.serializeArgument(arg))
1217
+ .json(payload => util.deserializeResult(payload))
1218
+ .then(f => f, util.onRejected);
1219
+ }
1220
+ get(arg) {
1221
+ return this.httpClient
1222
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1223
+ .get()
1224
+ .json(payload => util.deserializeResult(payload))
1225
+ .then(f => f, util.onRejected);
1226
+ }
1227
+ delete(arg) {
1228
+ return this.httpClient
1229
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1230
+ .delete()
1231
+ .json(payload => util.deserializeResult(payload))
1232
+ .then(f => f, util.onRejected);
1233
+ }
1234
+ }
1235
+ exports.HTTPSEdgeMutualTLSModule = HTTPSEdgeMutualTLSModule;
1236
+ class HTTPSEdgeTLSTerminationModule {
1237
+ /** Do not construct this object directly, use the <code>httpsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1238
+ constructor(httpClient) {
1239
+ this.httpClient = httpClient;
1240
+ }
1241
+ replace(arg) {
1242
+ return this.httpClient
1243
+ .url(`/edges/https/${arg.id}/tls_termination`)
1244
+ .put(util.serializeArgument(arg))
1245
+ .json(payload => util.deserializeResult(payload))
1246
+ .then(f => f, util.onRejected);
1247
+ }
1248
+ get(arg) {
1249
+ return this.httpClient
1250
+ .url(`/edges/https/${arg.id}/tls_termination`)
1251
+ .get()
1252
+ .json(payload => util.deserializeResult(payload))
1253
+ .then(f => f, util.onRejected);
1254
+ }
1255
+ delete(arg) {
1256
+ return this.httpClient
1257
+ .url(`/edges/https/${arg.id}/tls_termination`)
1258
+ .delete()
1259
+ .json(payload => util.deserializeResult(payload))
1260
+ .then(f => f, util.onRejected);
1261
+ }
1262
+ }
1263
+ exports.HTTPSEdgeTLSTerminationModule = HTTPSEdgeTLSTerminationModule;
1264
+ class EdgeRouteBackendModule {
1265
+ /** Do not construct this object directly, use the <code>edgeRouteBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1266
+ constructor(httpClient) {
1267
+ this.httpClient = httpClient;
1268
+ }
1269
+ replace(arg) {
1270
+ return this.httpClient
1271
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1272
+ .put(util.serializeArgument(arg))
1273
+ .json(payload => util.deserializeResult(payload))
1274
+ .then(f => f, util.onRejected);
1275
+ }
1276
+ get(arg) {
1277
+ return this.httpClient
1278
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1279
+ .get()
1280
+ .json(payload => util.deserializeResult(payload))
1281
+ .then(f => f, util.onRejected);
1282
+ }
1283
+ delete(arg) {
1284
+ return this.httpClient
1285
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1286
+ .delete()
1287
+ .json(payload => util.deserializeResult(payload))
1288
+ .then(f => f, util.onRejected);
1289
+ }
1290
+ }
1291
+ exports.EdgeRouteBackendModule = EdgeRouteBackendModule;
1292
+ class EdgeRouteIPRestrictionModule {
1293
+ /** Do not construct this object directly, use the <code>edgeRouteIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1294
+ constructor(httpClient) {
1295
+ this.httpClient = httpClient;
1296
+ }
1297
+ replace(arg) {
1298
+ return this.httpClient
1299
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1300
+ .put(util.serializeArgument(arg))
1301
+ .json(payload => util.deserializeResult(payload))
1302
+ .then(f => f, util.onRejected);
1303
+ }
1304
+ get(arg) {
1305
+ return this.httpClient
1306
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1307
+ .get()
1308
+ .json(payload => util.deserializeResult(payload))
1309
+ .then(f => f, util.onRejected);
1310
+ }
1311
+ delete(arg) {
1312
+ return this.httpClient
1313
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1314
+ .delete()
1315
+ .json(payload => util.deserializeResult(payload))
1316
+ .then(f => f, util.onRejected);
1317
+ }
1318
+ }
1319
+ exports.EdgeRouteIPRestrictionModule = EdgeRouteIPRestrictionModule;
1320
+ class EdgeRouteRequestHeadersModule {
1321
+ /** Do not construct this object directly, use the <code>edgeRouteRequestHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1322
+ constructor(httpClient) {
1323
+ this.httpClient = httpClient;
1324
+ }
1325
+ replace(arg) {
1326
+ return this.httpClient
1327
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1328
+ .put(util.serializeArgument(arg))
1329
+ .json(payload => util.deserializeResult(payload))
1330
+ .then(f => f, util.onRejected);
1331
+ }
1332
+ get(arg) {
1333
+ return this.httpClient
1334
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1335
+ .get()
1336
+ .json(payload => util.deserializeResult(payload))
1337
+ .then(f => f, util.onRejected);
1338
+ }
1339
+ delete(arg) {
1340
+ return this.httpClient
1341
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1342
+ .delete()
1343
+ .json(payload => util.deserializeResult(payload))
1344
+ .then(f => f, util.onRejected);
1345
+ }
1346
+ }
1347
+ exports.EdgeRouteRequestHeadersModule = EdgeRouteRequestHeadersModule;
1348
+ class EdgeRouteResponseHeadersModule {
1349
+ /** Do not construct this object directly, use the <code>edgeRouteResponseHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1350
+ constructor(httpClient) {
1351
+ this.httpClient = httpClient;
1352
+ }
1353
+ replace(arg) {
1354
+ return this.httpClient
1355
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1356
+ .put(util.serializeArgument(arg))
1357
+ .json(payload => util.deserializeResult(payload))
1358
+ .then(f => f, util.onRejected);
1359
+ }
1360
+ get(arg) {
1361
+ return this.httpClient
1362
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1363
+ .get()
1364
+ .json(payload => util.deserializeResult(payload))
1365
+ .then(f => f, util.onRejected);
1366
+ }
1367
+ delete(arg) {
1368
+ return this.httpClient
1369
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1370
+ .delete()
1371
+ .json(payload => util.deserializeResult(payload))
1372
+ .then(f => f, util.onRejected);
1373
+ }
1374
+ }
1375
+ exports.EdgeRouteResponseHeadersModule = EdgeRouteResponseHeadersModule;
1376
+ class EdgeRouteCompressionModule {
1377
+ /** Do not construct this object directly, use the <code>edgeRouteCompressionModule</code> property of an <code>Ngrok</code> client object instead. */
1378
+ constructor(httpClient) {
1379
+ this.httpClient = httpClient;
1380
+ }
1381
+ replace(arg) {
1382
+ return this.httpClient
1383
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1384
+ .put(util.serializeArgument(arg))
1385
+ .json(payload => util.deserializeResult(payload))
1386
+ .then(f => f, util.onRejected);
1387
+ }
1388
+ get(arg) {
1389
+ return this.httpClient
1390
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1391
+ .get()
1392
+ .json(payload => util.deserializeResult(payload))
1393
+ .then(f => f, util.onRejected);
1394
+ }
1395
+ delete(arg) {
1396
+ return this.httpClient
1397
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1398
+ .delete()
1399
+ .json(payload => util.deserializeResult(payload))
1400
+ .then(f => f, util.onRejected);
1401
+ }
1402
+ }
1403
+ exports.EdgeRouteCompressionModule = EdgeRouteCompressionModule;
1404
+ class EdgeRouteCircuitBreakerModule {
1405
+ /** Do not construct this object directly, use the <code>edgeRouteCircuitBreakerModule</code> property of an <code>Ngrok</code> client object instead. */
1406
+ constructor(httpClient) {
1407
+ this.httpClient = httpClient;
1408
+ }
1409
+ replace(arg) {
1410
+ return this.httpClient
1411
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1412
+ .put(util.serializeArgument(arg))
1413
+ .json(payload => util.deserializeResult(payload))
1414
+ .then(f => f, util.onRejected);
1415
+ }
1416
+ get(arg) {
1417
+ return this.httpClient
1418
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1419
+ .get()
1420
+ .json(payload => util.deserializeResult(payload))
1421
+ .then(f => f, util.onRejected);
1422
+ }
1423
+ delete(arg) {
1424
+ return this.httpClient
1425
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1426
+ .delete()
1427
+ .json(payload => util.deserializeResult(payload))
1428
+ .then(f => f, util.onRejected);
1429
+ }
1430
+ }
1431
+ exports.EdgeRouteCircuitBreakerModule = EdgeRouteCircuitBreakerModule;
1432
+ class EdgeRouteWebhookVerificationModule {
1433
+ /** Do not construct this object directly, use the <code>edgeRouteWebhookVerificationModule</code> property of an <code>Ngrok</code> client object instead. */
1434
+ constructor(httpClient) {
1435
+ this.httpClient = httpClient;
1436
+ }
1437
+ replace(arg) {
1438
+ return this.httpClient
1439
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1440
+ .put(util.serializeArgument(arg))
1441
+ .json(payload => util.deserializeResult(payload))
1442
+ .then(f => f, util.onRejected);
1443
+ }
1444
+ get(arg) {
1445
+ return this.httpClient
1446
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1447
+ .get()
1448
+ .json(payload => util.deserializeResult(payload))
1449
+ .then(f => f, util.onRejected);
1450
+ }
1451
+ delete(arg) {
1452
+ return this.httpClient
1453
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1454
+ .delete()
1455
+ .json(payload => util.deserializeResult(payload))
1456
+ .then(f => f, util.onRejected);
1457
+ }
1458
+ }
1459
+ exports.EdgeRouteWebhookVerificationModule = EdgeRouteWebhookVerificationModule;
1460
+ class EdgeRouteOAuthModule {
1461
+ /** Do not construct this object directly, use the <code>edgeRouteOAuthModule</code> property of an <code>Ngrok</code> client object instead. */
1462
+ constructor(httpClient) {
1463
+ this.httpClient = httpClient;
1464
+ }
1465
+ replace(arg) {
1466
+ return this.httpClient
1467
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1468
+ .put(util.serializeArgument(arg))
1469
+ .json(payload => util.deserializeResult(payload))
1470
+ .then(f => f, util.onRejected);
1471
+ }
1472
+ get(arg) {
1473
+ return this.httpClient
1474
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1475
+ .get()
1476
+ .json(payload => util.deserializeResult(payload))
1477
+ .then(f => f, util.onRejected);
1478
+ }
1479
+ delete(arg) {
1480
+ return this.httpClient
1481
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1482
+ .delete()
1483
+ .json(payload => util.deserializeResult(payload))
1484
+ .then(f => f, util.onRejected);
1485
+ }
1486
+ }
1487
+ exports.EdgeRouteOAuthModule = EdgeRouteOAuthModule;
1488
+ class EdgeRouteSAMLModule {
1489
+ /** Do not construct this object directly, use the <code>edgeRouteSamlModule</code> property of an <code>Ngrok</code> client object instead. */
1490
+ constructor(httpClient) {
1491
+ this.httpClient = httpClient;
1492
+ }
1493
+ replace(arg) {
1494
+ return this.httpClient
1495
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1496
+ .put(util.serializeArgument(arg))
1497
+ .json(payload => util.deserializeResult(payload))
1498
+ .then(f => f, util.onRejected);
1499
+ }
1500
+ get(arg) {
1501
+ return this.httpClient
1502
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1503
+ .get()
1504
+ .json(payload => util.deserializeResult(payload))
1505
+ .then(f => f, util.onRejected);
1506
+ }
1507
+ delete(arg) {
1508
+ return this.httpClient
1509
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1510
+ .delete()
1511
+ .json(payload => util.deserializeResult(payload))
1512
+ .then(f => f, util.onRejected);
1513
+ }
1514
+ }
1515
+ exports.EdgeRouteSAMLModule = EdgeRouteSAMLModule;
1516
+ class EdgeRouteOIDCModule {
1517
+ /** Do not construct this object directly, use the <code>edgeRouteOidcModule</code> property of an <code>Ngrok</code> client object instead. */
1518
+ constructor(httpClient) {
1519
+ this.httpClient = httpClient;
1520
+ }
1521
+ replace(arg) {
1522
+ return this.httpClient
1523
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1524
+ .put(util.serializeArgument(arg))
1525
+ .json(payload => util.deserializeResult(payload))
1526
+ .then(f => f, util.onRejected);
1527
+ }
1528
+ get(arg) {
1529
+ return this.httpClient
1530
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1531
+ .get()
1532
+ .json(payload => util.deserializeResult(payload))
1533
+ .then(f => f, util.onRejected);
1534
+ }
1535
+ delete(arg) {
1536
+ return this.httpClient
1537
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1538
+ .delete()
1539
+ .json(payload => util.deserializeResult(payload))
1540
+ .then(f => f, util.onRejected);
1541
+ }
1542
+ }
1543
+ exports.EdgeRouteOIDCModule = EdgeRouteOIDCModule;
1544
+ class EdgeRouteWebsocketTCPConverterModule {
1545
+ /** Do not construct this object directly, use the <code>edgeRouteWebsocketTcpConverterModule</code> property of an <code>Ngrok</code> client object instead. */
1546
+ constructor(httpClient) {
1547
+ this.httpClient = httpClient;
1548
+ }
1549
+ replace(arg) {
1550
+ return this.httpClient
1551
+ .url(
1552
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1553
+ )
1554
+ .put(util.serializeArgument(arg))
1555
+ .json(payload => util.deserializeResult(payload))
1556
+ .then(f => f, util.onRejected);
1557
+ }
1558
+ get(arg) {
1559
+ return this.httpClient
1560
+ .url(
1561
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1562
+ )
1563
+ .get()
1564
+ .json(payload => util.deserializeResult(payload))
1565
+ .then(f => f, util.onRejected);
1566
+ }
1567
+ delete(arg) {
1568
+ return this.httpClient
1569
+ .url(
1570
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1571
+ )
1572
+ .delete()
1573
+ .json(payload => util.deserializeResult(payload))
1574
+ .then(f => f, util.onRejected);
1575
+ }
1576
+ }
1577
+ exports.EdgeRouteWebsocketTCPConverterModule =
1578
+ EdgeRouteWebsocketTCPConverterModule;
1579
+ class EdgesTCP {
1580
+ /** Do not construct this object directly, use the <code>edgesTcp</code> property of an <code>Ngrok</code> client object instead. */
1581
+ constructor(httpClient) {
1582
+ this.httpClient = httpClient;
1583
+ }
1584
+ /**
1585
+ * Create a TCP Edge
1586
+ */
1587
+ create(arg) {
1588
+ return this.httpClient
1589
+ .url(`/edges/tcp`)
1590
+ .post(util.serializeArgument(arg))
1591
+ .json(payload => util.deserializeResult(payload))
1592
+ .then(f => f, util.onRejected);
1593
+ }
1594
+ /**
1595
+ * Get a TCP Edge by ID
1596
+ */
1597
+ get(arg) {
1598
+ return this.httpClient
1599
+ .url(`/edges/tcp/${arg.id}`)
1600
+ .get()
1601
+ .json(payload => util.deserializeResult(payload))
1602
+ .then(f => f, util.onRejected);
1603
+ }
1604
+ /**
1605
+ * Returns a list of all TCP Edges on this account
1606
+ */
1607
+ list() {
1608
+ var e_10, _a;
1609
+ return __awaiter(this, void 0, void 0, function* () {
1610
+ const array = [];
1611
+ try {
1612
+ for (
1613
+ var _b = __asyncValues(this._asyncList()), _c;
1614
+ (_c = yield _b.next()), !_c.done;
1615
+
1616
+ ) {
1617
+ let item = _c.value;
1618
+ array.push(item);
1619
+ }
1620
+ } catch (e_10_1) {
1621
+ e_10 = { error: e_10_1 };
1622
+ } finally {
1623
+ try {
1624
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
1625
+ } finally {
1626
+ if (e_10) throw e_10.error;
1627
+ }
1628
+ }
1629
+ return array;
1630
+ });
1631
+ }
1632
+ _pagedList(arg) {
1633
+ return this.httpClient
1634
+ .url(`/edges/tcp`)
1635
+ .query(arg)
1636
+ .get()
1637
+ .json(payload => util.deserializeResult(payload))
1638
+ .then(util.onFulfilled, util.onRejected);
1639
+ }
1640
+ _asyncList() {
1641
+ return __asyncGenerator(this, arguments, function* _asyncList_10() {
1642
+ const limit = '100';
1643
+ let nextPage = 'initial loop';
1644
+ let page = { limit: limit };
1645
+ while (nextPage) {
1646
+ const pagedList = yield __await(this._pagedList(page));
1647
+ nextPage = pagedList.nextPageUri;
1648
+ const items = pagedList.tcpEdges;
1649
+ if (nextPage) {
1650
+ page = {
1651
+ beforeId: items[items.length - 1].id,
1652
+ limit: limit,
1653
+ };
1654
+ }
1655
+ for (let item of items) {
1656
+ yield yield __await(item);
1657
+ }
1658
+ }
1659
+ });
1660
+ }
1661
+ /**
1662
+ * 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.
1663
+ */
1664
+ update(arg) {
1665
+ return this.httpClient
1666
+ .url(`/edges/tcp/${arg.id}`)
1667
+ .patch(util.serializeArgument(arg))
1668
+ .json(payload => util.deserializeResult(payload))
1669
+ .then(f => f, util.onRejected);
1670
+ }
1671
+ /**
1672
+ * Delete a TCP Edge by ID
1673
+ */
1674
+ delete(arg) {
1675
+ return this.httpClient
1676
+ .url(`/edges/tcp/${arg.id}`)
1677
+ .delete()
1678
+ .json(payload => util.deserializeResult(payload))
1679
+ .then(f => f, util.onRejected);
1680
+ }
1681
+ }
1682
+ exports.EdgesTCP = EdgesTCP;
1683
+ class TCPEdgeBackendModule {
1684
+ /** Do not construct this object directly, use the <code>tcpEdgeBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1685
+ constructor(httpClient) {
1686
+ this.httpClient = httpClient;
1687
+ }
1688
+ replace(arg) {
1689
+ return this.httpClient
1690
+ .url(`/edges/tcp/${arg.id}/backend`)
1691
+ .put(util.serializeArgument(arg))
1692
+ .json(payload => util.deserializeResult(payload))
1693
+ .then(f => f, util.onRejected);
1694
+ }
1695
+ get(arg) {
1696
+ return this.httpClient
1697
+ .url(`/edges/tcp/${arg.id}/backend`)
1698
+ .get()
1699
+ .json(payload => util.deserializeResult(payload))
1700
+ .then(f => f, util.onRejected);
1701
+ }
1702
+ delete(arg) {
1703
+ return this.httpClient
1704
+ .url(`/edges/tcp/${arg.id}/backend`)
1705
+ .delete()
1706
+ .json(payload => util.deserializeResult(payload))
1707
+ .then(f => f, util.onRejected);
1708
+ }
1709
+ }
1710
+ exports.TCPEdgeBackendModule = TCPEdgeBackendModule;
1711
+ class TCPEdgeIPRestrictionModule {
1712
+ /** Do not construct this object directly, use the <code>tcpEdgeIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1713
+ constructor(httpClient) {
1714
+ this.httpClient = httpClient;
1715
+ }
1716
+ replace(arg) {
1717
+ return this.httpClient
1718
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1719
+ .put(util.serializeArgument(arg))
1720
+ .json(payload => util.deserializeResult(payload))
1721
+ .then(f => f, util.onRejected);
1722
+ }
1723
+ get(arg) {
1724
+ return this.httpClient
1725
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1726
+ .get()
1727
+ .json(payload => util.deserializeResult(payload))
1728
+ .then(f => f, util.onRejected);
1729
+ }
1730
+ delete(arg) {
1731
+ return this.httpClient
1732
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1733
+ .delete()
1734
+ .json(payload => util.deserializeResult(payload))
1735
+ .then(f => f, util.onRejected);
1736
+ }
1737
+ }
1738
+ exports.TCPEdgeIPRestrictionModule = TCPEdgeIPRestrictionModule;
1739
+ class EdgesTLS {
1740
+ /** Do not construct this object directly, use the <code>edgesTls</code> property of an <code>Ngrok</code> client object instead. */
1741
+ constructor(httpClient) {
1742
+ this.httpClient = httpClient;
1743
+ }
1744
+ /**
1745
+ * Create a TLS Edge
1746
+ */
1747
+ create(arg) {
1748
+ return this.httpClient
1749
+ .url(`/edges/tls`)
1750
+ .post(util.serializeArgument(arg))
1751
+ .json(payload => util.deserializeResult(payload))
1752
+ .then(f => f, util.onRejected);
1753
+ }
1754
+ /**
1755
+ * Get a TLS Edge by ID
1756
+ */
1757
+ get(arg) {
1758
+ return this.httpClient
1759
+ .url(`/edges/tls/${arg.id}`)
1760
+ .get()
1761
+ .json(payload => util.deserializeResult(payload))
1762
+ .then(f => f, util.onRejected);
1763
+ }
1764
+ /**
1765
+ * Returns a list of all TLS Edges on this account
1766
+ */
1767
+ list() {
1768
+ var e_11, _a;
1769
+ return __awaiter(this, void 0, void 0, function* () {
1770
+ const array = [];
1771
+ try {
1772
+ for (
1773
+ var _b = __asyncValues(this._asyncList()), _c;
1774
+ (_c = yield _b.next()), !_c.done;
1775
+
1776
+ ) {
1777
+ let item = _c.value;
1778
+ array.push(item);
1779
+ }
1780
+ } catch (e_11_1) {
1781
+ e_11 = { error: e_11_1 };
1782
+ } finally {
1783
+ try {
1784
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
1785
+ } finally {
1786
+ if (e_11) throw e_11.error;
1787
+ }
1788
+ }
1789
+ return array;
1790
+ });
1791
+ }
1792
+ _pagedList(arg) {
1793
+ return this.httpClient
1794
+ .url(`/edges/tls`)
1795
+ .query(arg)
1796
+ .get()
1797
+ .json(payload => util.deserializeResult(payload))
1798
+ .then(util.onFulfilled, util.onRejected);
1799
+ }
1800
+ _asyncList() {
1801
+ return __asyncGenerator(this, arguments, function* _asyncList_11() {
1802
+ const limit = '100';
1803
+ let nextPage = 'initial loop';
1804
+ let page = { limit: limit };
1805
+ while (nextPage) {
1806
+ const pagedList = yield __await(this._pagedList(page));
1807
+ nextPage = pagedList.nextPageUri;
1808
+ const items = pagedList.tlsEdges;
1809
+ if (nextPage) {
1810
+ page = {
1811
+ beforeId: items[items.length - 1].id,
1812
+ limit: limit,
1813
+ };
1814
+ }
1815
+ for (let item of items) {
1816
+ yield yield __await(item);
1817
+ }
1818
+ }
1819
+ });
1820
+ }
1821
+ /**
1822
+ * 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.
1823
+ */
1824
+ update(arg) {
1825
+ return this.httpClient
1826
+ .url(`/edges/tls/${arg.id}`)
1827
+ .patch(util.serializeArgument(arg))
1828
+ .json(payload => util.deserializeResult(payload))
1829
+ .then(f => f, util.onRejected);
1830
+ }
1831
+ /**
1832
+ * Delete a TLS Edge by ID
1833
+ */
1834
+ delete(arg) {
1835
+ return this.httpClient
1836
+ .url(`/edges/tls/${arg.id}`)
1837
+ .delete()
1838
+ .json(payload => util.deserializeResult(payload))
1839
+ .then(f => f, util.onRejected);
1840
+ }
1841
+ }
1842
+ exports.EdgesTLS = EdgesTLS;
1843
+ class TLSEdgeBackendModule {
1844
+ /** Do not construct this object directly, use the <code>tlsEdgeBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1845
+ constructor(httpClient) {
1846
+ this.httpClient = httpClient;
1847
+ }
1848
+ replace(arg) {
1849
+ return this.httpClient
1850
+ .url(`/edges/tls/${arg.id}/backend`)
1851
+ .put(util.serializeArgument(arg))
1852
+ .json(payload => util.deserializeResult(payload))
1853
+ .then(f => f, util.onRejected);
1854
+ }
1855
+ get(arg) {
1856
+ return this.httpClient
1857
+ .url(`/edges/tls/${arg.id}/backend`)
1858
+ .get()
1859
+ .json(payload => util.deserializeResult(payload))
1860
+ .then(f => f, util.onRejected);
1861
+ }
1862
+ delete(arg) {
1863
+ return this.httpClient
1864
+ .url(`/edges/tls/${arg.id}/backend`)
1865
+ .delete()
1866
+ .json(payload => util.deserializeResult(payload))
1867
+ .then(f => f, util.onRejected);
1868
+ }
1869
+ }
1870
+ exports.TLSEdgeBackendModule = TLSEdgeBackendModule;
1871
+ class TLSEdgeIPRestrictionModule {
1872
+ /** Do not construct this object directly, use the <code>tlsEdgeIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1873
+ constructor(httpClient) {
1874
+ this.httpClient = httpClient;
1875
+ }
1876
+ replace(arg) {
1877
+ return this.httpClient
1878
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1879
+ .put(util.serializeArgument(arg))
1880
+ .json(payload => util.deserializeResult(payload))
1881
+ .then(f => f, util.onRejected);
1882
+ }
1883
+ get(arg) {
1884
+ return this.httpClient
1885
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1886
+ .get()
1887
+ .json(payload => util.deserializeResult(payload))
1888
+ .then(f => f, util.onRejected);
1889
+ }
1890
+ delete(arg) {
1891
+ return this.httpClient
1892
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1893
+ .delete()
1894
+ .json(payload => util.deserializeResult(payload))
1895
+ .then(f => f, util.onRejected);
1896
+ }
1897
+ }
1898
+ exports.TLSEdgeIPRestrictionModule = TLSEdgeIPRestrictionModule;
1899
+ class TLSEdgeMutualTLSModule {
1900
+ /** Do not construct this object directly, use the <code>tlsEdgeMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
1901
+ constructor(httpClient) {
1902
+ this.httpClient = httpClient;
1903
+ }
1904
+ replace(arg) {
1905
+ return this.httpClient
1906
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1907
+ .put(util.serializeArgument(arg))
1908
+ .json(payload => util.deserializeResult(payload))
1909
+ .then(f => f, util.onRejected);
1910
+ }
1911
+ get(arg) {
1912
+ return this.httpClient
1913
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1914
+ .get()
1915
+ .json(payload => util.deserializeResult(payload))
1916
+ .then(f => f, util.onRejected);
1917
+ }
1918
+ delete(arg) {
1919
+ return this.httpClient
1920
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1921
+ .delete()
1922
+ .json(payload => util.deserializeResult(payload))
1923
+ .then(f => f, util.onRejected);
1924
+ }
1925
+ }
1926
+ exports.TLSEdgeMutualTLSModule = TLSEdgeMutualTLSModule;
1927
+ class TLSEdgeTLSTerminationModule {
1928
+ /** Do not construct this object directly, use the <code>tlsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1929
+ constructor(httpClient) {
1930
+ this.httpClient = httpClient;
1931
+ }
1932
+ replace(arg) {
1933
+ return this.httpClient
1934
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1935
+ .put(util.serializeArgument(arg))
1936
+ .json(payload => util.deserializeResult(payload))
1937
+ .then(f => f, util.onRejected);
1938
+ }
1939
+ get(arg) {
1940
+ return this.httpClient
1941
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1942
+ .get()
1943
+ .json(payload => util.deserializeResult(payload))
1944
+ .then(f => f, util.onRejected);
1945
+ }
1946
+ delete(arg) {
1947
+ return this.httpClient
1948
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1949
+ .delete()
1950
+ .json(payload => util.deserializeResult(payload))
1951
+ .then(f => f, util.onRejected);
1952
+ }
1953
+ }
1954
+ exports.TLSEdgeTLSTerminationModule = TLSEdgeTLSTerminationModule;
1955
+ /**
1956
+ * Endpoints provides an API for querying the endpoint objects
1957
+ which define what tunnel or edge is used to serve a hostport.
1958
+ Only active endpoints associated with a tunnel or backend are returned.
1959
+ */
1960
+ class Endpoints {
1961
+ /** Do not construct this object directly, use the <code>endpoints</code> property of an <code>Ngrok</code> client object instead. */
1962
+ constructor(httpClient) {
1963
+ this.httpClient = httpClient;
1964
+ }
1965
+ /**
1966
+ * List all active endpoints on the account
1967
+ */
1968
+ list() {
1969
+ var e_12, _a;
1970
+ return __awaiter(this, void 0, void 0, function* () {
1971
+ const array = [];
1972
+ try {
1973
+ for (
1974
+ var _b = __asyncValues(this._asyncList()), _c;
1975
+ (_c = yield _b.next()), !_c.done;
1976
+
1977
+ ) {
1978
+ let item = _c.value;
1979
+ array.push(item);
1980
+ }
1981
+ } catch (e_12_1) {
1982
+ e_12 = { error: e_12_1 };
1983
+ } finally {
1984
+ try {
1985
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
1986
+ } finally {
1987
+ if (e_12) throw e_12.error;
1988
+ }
1989
+ }
1990
+ return array;
1991
+ });
1992
+ }
1993
+ _pagedList(arg) {
1994
+ return this.httpClient
1995
+ .url(`/endpoints`)
1996
+ .query(arg)
1997
+ .get()
1998
+ .json(payload => util.deserializeResult(payload))
1999
+ .then(util.onFulfilled, util.onRejected);
2000
+ }
2001
+ _asyncList() {
2002
+ return __asyncGenerator(this, arguments, function* _asyncList_12() {
2003
+ const limit = '100';
2004
+ let nextPage = 'initial loop';
2005
+ let page = { limit: limit };
2006
+ while (nextPage) {
2007
+ const pagedList = yield __await(this._pagedList(page));
2008
+ nextPage = pagedList.nextPageUri;
2009
+ const items = pagedList.endpoints;
2010
+ if (nextPage) {
2011
+ page = {
2012
+ beforeId: items[items.length - 1].id,
2013
+ limit: limit,
2014
+ };
2015
+ }
2016
+ for (let item of items) {
2017
+ yield yield __await(item);
2018
+ }
2019
+ }
2020
+ });
2021
+ }
2022
+ /**
2023
+ * Get the status of an endpoint by ID
2024
+ */
2025
+ get(arg) {
2026
+ return this.httpClient
2027
+ .url(`/endpoints/${arg.id}`)
2028
+ .get()
2029
+ .json(payload => util.deserializeResult(payload))
2030
+ .then(f => f, util.onRejected);
2031
+ }
2032
+ }
2033
+ exports.Endpoints = Endpoints;
2034
+ class EventDestinations {
2035
+ /** Do not construct this object directly, use the <code>eventDestinations</code> property of an <code>Ngrok</code> client object instead. */
2036
+ constructor(httpClient) {
2037
+ this.httpClient = httpClient;
2038
+ }
2039
+ /**
2040
+ * 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.
2041
+ */
2042
+ create(arg) {
2043
+ return this.httpClient
2044
+ .url(`/event_destinations`)
2045
+ .post(util.serializeArgument(arg))
2046
+ .json(payload => util.deserializeResult(payload))
2047
+ .then(f => f, util.onRejected);
2048
+ }
2049
+ /**
2050
+ * Delete an Event Destination. If the Event Destination is still referenced by an Event Subscription.
2051
+ */
2052
+ delete(arg) {
2053
+ return this.httpClient
2054
+ .url(`/event_destinations/${arg.id}`)
2055
+ .delete()
2056
+ .json(payload => util.deserializeResult(payload))
2057
+ .then(f => f, util.onRejected);
2058
+ }
2059
+ /**
2060
+ * Get detailed information about an Event Destination by ID.
2061
+ */
2062
+ get(arg) {
2063
+ return this.httpClient
2064
+ .url(`/event_destinations/${arg.id}`)
2065
+ .get()
2066
+ .json(payload => util.deserializeResult(payload))
2067
+ .then(f => f, util.onRejected);
2068
+ }
2069
+ /**
2070
+ * List all Event Destinations on this account.
2071
+ */
2072
+ list() {
2073
+ var e_13, _a;
2074
+ return __awaiter(this, void 0, void 0, function* () {
2075
+ const array = [];
2076
+ try {
2077
+ for (
2078
+ var _b = __asyncValues(this._asyncList()), _c;
2079
+ (_c = yield _b.next()), !_c.done;
2080
+
2081
+ ) {
2082
+ let item = _c.value;
2083
+ array.push(item);
2084
+ }
2085
+ } catch (e_13_1) {
2086
+ e_13 = { error: e_13_1 };
2087
+ } finally {
2088
+ try {
2089
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2090
+ } finally {
2091
+ if (e_13) throw e_13.error;
2092
+ }
2093
+ }
2094
+ return array;
2095
+ });
2096
+ }
2097
+ _pagedList(arg) {
2098
+ return this.httpClient
2099
+ .url(`/event_destinations`)
2100
+ .query(arg)
2101
+ .get()
2102
+ .json(payload => util.deserializeResult(payload))
2103
+ .then(util.onFulfilled, util.onRejected);
2104
+ }
2105
+ _asyncList() {
2106
+ return __asyncGenerator(this, arguments, function* _asyncList_13() {
2107
+ const limit = '100';
2108
+ let nextPage = 'initial loop';
2109
+ let page = { limit: limit };
2110
+ while (nextPage) {
2111
+ const pagedList = yield __await(this._pagedList(page));
2112
+ nextPage = pagedList.nextPageUri;
2113
+ const items = pagedList.eventDestinations;
2114
+ if (nextPage) {
2115
+ page = {
2116
+ beforeId: items[items.length - 1].id,
2117
+ limit: limit,
2118
+ };
2119
+ }
2120
+ for (let item of items) {
2121
+ yield yield __await(item);
2122
+ }
2123
+ }
2124
+ });
2125
+ }
2126
+ /**
2127
+ * Update attributes of an Event Destination.
2128
+ */
2129
+ update(arg) {
2130
+ return this.httpClient
2131
+ .url(`/event_destinations/${arg.id}`)
2132
+ .patch(util.serializeArgument(arg))
2133
+ .json(payload => util.deserializeResult(payload))
2134
+ .then(f => f, util.onRejected);
2135
+ }
2136
+ }
2137
+ exports.EventDestinations = EventDestinations;
2138
+ class EventSubscriptions {
2139
+ /** Do not construct this object directly, use the <code>eventSubscriptions</code> property of an <code>Ngrok</code> client object instead. */
2140
+ constructor(httpClient) {
2141
+ this.httpClient = httpClient;
2142
+ }
2143
+ /**
2144
+ * Create an Event Subscription.
2145
+ */
2146
+ create(arg) {
2147
+ return this.httpClient
2148
+ .url(`/event_subscriptions`)
2149
+ .post(util.serializeArgument(arg))
2150
+ .json(payload => util.deserializeResult(payload))
2151
+ .then(f => f, util.onRejected);
2152
+ }
2153
+ /**
2154
+ * Delete an Event Subscription.
2155
+ */
2156
+ delete(arg) {
2157
+ return this.httpClient
2158
+ .url(`/event_subscriptions/${arg.id}`)
2159
+ .delete()
2160
+ .json(payload => util.deserializeResult(payload))
2161
+ .then(f => f, util.onRejected);
2162
+ }
2163
+ /**
2164
+ * Get an Event Subscription by ID.
2165
+ */
2166
+ get(arg) {
2167
+ return this.httpClient
2168
+ .url(`/event_subscriptions/${arg.id}`)
2169
+ .get()
2170
+ .json(payload => util.deserializeResult(payload))
2171
+ .then(f => f, util.onRejected);
2172
+ }
2173
+ /**
2174
+ * List this Account's Event Subscriptions.
2175
+ */
2176
+ list() {
2177
+ var e_14, _a;
2178
+ return __awaiter(this, void 0, void 0, function* () {
2179
+ const array = [];
2180
+ try {
2181
+ for (
2182
+ var _b = __asyncValues(this._asyncList()), _c;
2183
+ (_c = yield _b.next()), !_c.done;
2184
+
2185
+ ) {
2186
+ let item = _c.value;
2187
+ array.push(item);
2188
+ }
2189
+ } catch (e_14_1) {
2190
+ e_14 = { error: e_14_1 };
2191
+ } finally {
2192
+ try {
2193
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2194
+ } finally {
2195
+ if (e_14) throw e_14.error;
2196
+ }
2197
+ }
2198
+ return array;
2199
+ });
2200
+ }
2201
+ _pagedList(arg) {
2202
+ return this.httpClient
2203
+ .url(`/event_subscriptions`)
2204
+ .query(arg)
2205
+ .get()
2206
+ .json(payload => util.deserializeResult(payload))
2207
+ .then(util.onFulfilled, util.onRejected);
2208
+ }
2209
+ _asyncList() {
2210
+ return __asyncGenerator(this, arguments, function* _asyncList_14() {
2211
+ const limit = '100';
2212
+ let nextPage = 'initial loop';
2213
+ let page = { limit: limit };
2214
+ while (nextPage) {
2215
+ const pagedList = yield __await(this._pagedList(page));
2216
+ nextPage = pagedList.nextPageUri;
2217
+ const items = pagedList.eventSubscriptions;
2218
+ if (nextPage) {
2219
+ page = {
2220
+ beforeId: items[items.length - 1].id,
2221
+ limit: limit,
2222
+ };
2223
+ }
2224
+ for (let item of items) {
2225
+ yield yield __await(item);
2226
+ }
2227
+ }
2228
+ });
2229
+ }
2230
+ /**
2231
+ * Update an Event Subscription.
2232
+ */
2233
+ update(arg) {
2234
+ return this.httpClient
2235
+ .url(`/event_subscriptions/${arg.id}`)
2236
+ .patch(util.serializeArgument(arg))
2237
+ .json(payload => util.deserializeResult(payload))
2238
+ .then(f => f, util.onRejected);
2239
+ }
2240
+ }
2241
+ exports.EventSubscriptions = EventSubscriptions;
2242
+ class EventSources {
2243
+ /** Do not construct this object directly, use the <code>eventSources</code> property of an <code>Ngrok</code> client object instead. */
2244
+ constructor(httpClient) {
2245
+ this.httpClient = httpClient;
2246
+ }
2247
+ /**
2248
+ * Add an additional type for which this event subscription will trigger
2249
+ */
2250
+ create(arg) {
2251
+ return this.httpClient
2252
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
2253
+ .post(util.serializeArgument(arg))
2254
+ .json(payload => util.deserializeResult(payload))
2255
+ .then(f => f, util.onRejected);
2256
+ }
2257
+ /**
2258
+ * Remove a type for which this event subscription will trigger
2259
+ */
2260
+ delete(arg) {
2261
+ return this.httpClient
2262
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
2263
+ .delete()
2264
+ .json(payload => util.deserializeResult(payload))
2265
+ .then(f => f, util.onRejected);
2266
+ }
2267
+ /**
2268
+ * Get the details for a given type that triggers for the given event subscription
2269
+ */
2270
+ get(arg) {
2271
+ return this.httpClient
2272
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
2273
+ .get()
2274
+ .json(payload => util.deserializeResult(payload))
2275
+ .then(f => f, util.onRejected);
2276
+ }
2277
+ /**
2278
+ * List the types for which this event subscription will trigger
2279
+ */
2280
+ list(arg) {
2281
+ return this.httpClient
2282
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
2283
+ .get()
2284
+ .json(payload => util.deserializeResult(payload))
2285
+ .then(f => f, util.onRejected);
2286
+ }
2287
+ /**
2288
+ * Update the type for which this event subscription will trigger
2289
+ */
2290
+ update(arg) {
2291
+ return this.httpClient
2292
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
2293
+ .patch(util.serializeArgument(arg))
2294
+ .json(payload => util.deserializeResult(payload))
2295
+ .then(f => f, util.onRejected);
2296
+ }
2297
+ }
2298
+ exports.EventSources = EventSources;
2299
+ /**
2300
+ * IP Policies are reusable groups of CIDR ranges with an `allow` or `deny`
2301
+ action. They can be attached to endpoints via the Endpoint Configuration IP
2302
+ Policy module. They can also be used with IP Restrictions to control source
2303
+ IP ranges that can start tunnel sessions and connect to the API and dashboard.
2304
+ */
2305
+ class IPPolicies {
2306
+ /** Do not construct this object directly, use the <code>ipPolicies</code> property of an <code>Ngrok</code> client object instead. */
2307
+ constructor(httpClient) {
2308
+ this.httpClient = httpClient;
2309
+ }
2310
+ /**
2311
+ * 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.
2312
+ */
2313
+ create(arg) {
2314
+ return this.httpClient
2315
+ .url(`/ip_policies`)
2316
+ .post(util.serializeArgument(arg))
2317
+ .json(payload => util.deserializeResult(payload))
2318
+ .then(f => f, util.onRejected);
2319
+ }
2320
+ /**
2321
+ * 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.
2322
+ */
2323
+ delete(arg) {
2324
+ return this.httpClient
2325
+ .url(`/ip_policies/${arg.id}`)
2326
+ .delete()
2327
+ .json(payload => util.deserializeResult(payload))
2328
+ .then(f => f, util.onRejected);
2329
+ }
2330
+ /**
2331
+ * Get detailed information about an IP policy by ID.
2332
+ */
2333
+ get(arg) {
2334
+ return this.httpClient
2335
+ .url(`/ip_policies/${arg.id}`)
2336
+ .get()
2337
+ .json(payload => util.deserializeResult(payload))
2338
+ .then(f => f, util.onRejected);
2339
+ }
2340
+ /**
2341
+ * List all IP policies on this account
2342
+ */
2343
+ list() {
2344
+ var e_15, _a;
2345
+ return __awaiter(this, void 0, void 0, function* () {
2346
+ const array = [];
2347
+ try {
2348
+ for (
2349
+ var _b = __asyncValues(this._asyncList()), _c;
2350
+ (_c = yield _b.next()), !_c.done;
2351
+
2352
+ ) {
2353
+ let item = _c.value;
2354
+ array.push(item);
2355
+ }
2356
+ } catch (e_15_1) {
2357
+ e_15 = { error: e_15_1 };
2358
+ } finally {
2359
+ try {
2360
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2361
+ } finally {
2362
+ if (e_15) throw e_15.error;
2363
+ }
2364
+ }
2365
+ return array;
2366
+ });
2367
+ }
2368
+ _pagedList(arg) {
2369
+ return this.httpClient
2370
+ .url(`/ip_policies`)
2371
+ .query(arg)
2372
+ .get()
2373
+ .json(payload => util.deserializeResult(payload))
2374
+ .then(util.onFulfilled, util.onRejected);
2375
+ }
2376
+ _asyncList() {
2377
+ return __asyncGenerator(this, arguments, function* _asyncList_15() {
2378
+ const limit = '100';
2379
+ let nextPage = 'initial loop';
2380
+ let page = { limit: limit };
2381
+ while (nextPage) {
2382
+ const pagedList = yield __await(this._pagedList(page));
2383
+ nextPage = pagedList.nextPageUri;
2384
+ const items = pagedList.ipPolicies;
2385
+ if (nextPage) {
2386
+ page = {
2387
+ beforeId: items[items.length - 1].id,
2388
+ limit: limit,
2389
+ };
2390
+ }
2391
+ for (let item of items) {
2392
+ yield yield __await(item);
2393
+ }
2394
+ }
2395
+ });
2396
+ }
2397
+ /**
2398
+ * Update attributes of an IP policy by ID
2399
+ */
2400
+ update(arg) {
2401
+ return this.httpClient
2402
+ .url(`/ip_policies/${arg.id}`)
2403
+ .patch(util.serializeArgument(arg))
2404
+ .json(payload => util.deserializeResult(payload))
2405
+ .then(f => f, util.onRejected);
2406
+ }
2407
+ }
2408
+ exports.IPPolicies = IPPolicies;
2409
+ /**
2410
+ * IP Policy Rules are the IPv4 or IPv6 CIDRs entries that
2411
+ make up an IP Policy.
2412
+ */
2413
+ class IPPolicyRules {
2414
+ /** Do not construct this object directly, use the <code>ipPolicyRules</code> property of an <code>Ngrok</code> client object instead. */
2415
+ constructor(httpClient) {
2416
+ this.httpClient = httpClient;
2417
+ }
2418
+ /**
2419
+ * Create a new IP policy rule attached to an IP Policy.
2420
+ */
2421
+ create(arg) {
2422
+ return this.httpClient
2423
+ .url(`/ip_policy_rules`)
2424
+ .post(util.serializeArgument(arg))
2425
+ .json(payload => util.deserializeResult(payload))
2426
+ .then(f => f, util.onRejected);
2427
+ }
2428
+ /**
2429
+ * Delete an IP policy rule.
2430
+ */
2431
+ delete(arg) {
2432
+ return this.httpClient
2433
+ .url(`/ip_policy_rules/${arg.id}`)
2434
+ .delete()
2435
+ .json(payload => util.deserializeResult(payload))
2436
+ .then(f => f, util.onRejected);
2437
+ }
2438
+ /**
2439
+ * Get detailed information about an IP policy rule by ID.
2440
+ */
2441
+ get(arg) {
2442
+ return this.httpClient
2443
+ .url(`/ip_policy_rules/${arg.id}`)
2444
+ .get()
2445
+ .json(payload => util.deserializeResult(payload))
2446
+ .then(f => f, util.onRejected);
2447
+ }
2448
+ /**
2449
+ * List all IP policy rules on this account
2450
+ */
2451
+ list() {
2452
+ var e_16, _a;
2453
+ return __awaiter(this, void 0, void 0, function* () {
2454
+ const array = [];
2455
+ try {
2456
+ for (
2457
+ var _b = __asyncValues(this._asyncList()), _c;
2458
+ (_c = yield _b.next()), !_c.done;
2459
+
2460
+ ) {
2461
+ let item = _c.value;
2462
+ array.push(item);
2463
+ }
2464
+ } catch (e_16_1) {
2465
+ e_16 = { error: e_16_1 };
2466
+ } finally {
2467
+ try {
2468
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2469
+ } finally {
2470
+ if (e_16) throw e_16.error;
2471
+ }
2472
+ }
2473
+ return array;
2474
+ });
2475
+ }
2476
+ _pagedList(arg) {
2477
+ return this.httpClient
2478
+ .url(`/ip_policy_rules`)
2479
+ .query(arg)
2480
+ .get()
2481
+ .json(payload => util.deserializeResult(payload))
2482
+ .then(util.onFulfilled, util.onRejected);
2483
+ }
2484
+ _asyncList() {
2485
+ return __asyncGenerator(this, arguments, function* _asyncList_16() {
2486
+ const limit = '100';
2487
+ let nextPage = 'initial loop';
2488
+ let page = { limit: limit };
2489
+ while (nextPage) {
2490
+ const pagedList = yield __await(this._pagedList(page));
2491
+ nextPage = pagedList.nextPageUri;
2492
+ const items = pagedList.ipPolicyRules;
2493
+ if (nextPage) {
2494
+ page = {
2495
+ beforeId: items[items.length - 1].id,
2496
+ limit: limit,
2497
+ };
2498
+ }
2499
+ for (let item of items) {
2500
+ yield yield __await(item);
2501
+ }
2502
+ }
2503
+ });
2504
+ }
2505
+ /**
2506
+ * Update attributes of an IP policy rule by ID
2507
+ */
2508
+ update(arg) {
2509
+ return this.httpClient
2510
+ .url(`/ip_policy_rules/${arg.id}`)
2511
+ .patch(util.serializeArgument(arg))
2512
+ .json(payload => util.deserializeResult(payload))
2513
+ .then(f => f, util.onRejected);
2514
+ }
2515
+ }
2516
+ exports.IPPolicyRules = IPPolicyRules;
2517
+ /**
2518
+ * An IP restriction is a restriction placed on the CIDRs that are allowed to
2519
+ initiate traffic to a specific aspect of your ngrok account. An IP
2520
+ restriction has a type which defines the ingress it applies to. IP
2521
+ restrictions can be used to enforce the source IPs that can make API
2522
+ requests, log in to the dashboard, start ngrok agents, and connect to your
2523
+ public-facing endpoints.
2524
+ */
2525
+ class IPRestrictions {
2526
+ /** Do not construct this object directly, use the <code>ipRestrictions</code> property of an <code>Ngrok</code> client object instead. */
2527
+ constructor(httpClient) {
2528
+ this.httpClient = httpClient;
2529
+ }
2530
+ /**
2531
+ * Create a new IP restriction
2532
+ */
2533
+ create(arg) {
2534
+ return this.httpClient
2535
+ .url(`/ip_restrictions`)
2536
+ .post(util.serializeArgument(arg))
2537
+ .json(payload => util.deserializeResult(payload))
2538
+ .then(f => f, util.onRejected);
2539
+ }
2540
+ /**
2541
+ * Delete an IP restriction
2542
+ */
2543
+ delete(arg) {
2544
+ return this.httpClient
2545
+ .url(`/ip_restrictions/${arg.id}`)
2546
+ .delete()
2547
+ .json(payload => util.deserializeResult(payload))
2548
+ .then(f => f, util.onRejected);
2549
+ }
2550
+ /**
2551
+ * Get detailed information about an IP restriction
2552
+ */
2553
+ get(arg) {
2554
+ return this.httpClient
2555
+ .url(`/ip_restrictions/${arg.id}`)
2556
+ .get()
2557
+ .json(payload => util.deserializeResult(payload))
2558
+ .then(f => f, util.onRejected);
2559
+ }
2560
+ /**
2561
+ * List all IP restrictions on this account
2562
+ */
2563
+ list() {
2564
+ var e_17, _a;
2565
+ return __awaiter(this, void 0, void 0, function* () {
2566
+ const array = [];
2567
+ try {
2568
+ for (
2569
+ var _b = __asyncValues(this._asyncList()), _c;
2570
+ (_c = yield _b.next()), !_c.done;
2571
+
2572
+ ) {
2573
+ let item = _c.value;
2574
+ array.push(item);
2575
+ }
2576
+ } catch (e_17_1) {
2577
+ e_17 = { error: e_17_1 };
2578
+ } finally {
2579
+ try {
2580
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2581
+ } finally {
2582
+ if (e_17) throw e_17.error;
2583
+ }
2584
+ }
2585
+ return array;
2586
+ });
2587
+ }
2588
+ _pagedList(arg) {
2589
+ return this.httpClient
2590
+ .url(`/ip_restrictions`)
2591
+ .query(arg)
2592
+ .get()
2593
+ .json(payload => util.deserializeResult(payload))
2594
+ .then(util.onFulfilled, util.onRejected);
2595
+ }
2596
+ _asyncList() {
2597
+ return __asyncGenerator(this, arguments, function* _asyncList_17() {
2598
+ const limit = '100';
2599
+ let nextPage = 'initial loop';
2600
+ let page = { limit: limit };
2601
+ while (nextPage) {
2602
+ const pagedList = yield __await(this._pagedList(page));
2603
+ nextPage = pagedList.nextPageUri;
2604
+ const items = pagedList.ipRestrictions;
2605
+ if (nextPage) {
2606
+ page = {
2607
+ beforeId: items[items.length - 1].id,
2608
+ limit: limit,
2609
+ };
2610
+ }
2611
+ for (let item of items) {
2612
+ yield yield __await(item);
2613
+ }
2614
+ }
2615
+ });
2616
+ }
2617
+ /**
2618
+ * Update attributes of an IP restriction by ID
2619
+ */
2620
+ update(arg) {
2621
+ return this.httpClient
2622
+ .url(`/ip_restrictions/${arg.id}`)
2623
+ .patch(util.serializeArgument(arg))
2624
+ .json(payload => util.deserializeResult(payload))
2625
+ .then(f => f, util.onRejected);
2626
+ }
2627
+ }
2628
+ exports.IPRestrictions = IPRestrictions;
2629
+ /**
2630
+ * Reserved Addresses are TCP addresses that can be used to listen for traffic.
2631
+ TCP address hostnames and ports are assigned by ngrok, they cannot be
2632
+ chosen.
2633
+ */
2634
+ class ReservedAddrs {
2635
+ /** Do not construct this object directly, use the <code>reservedAddrs</code> property of an <code>Ngrok</code> client object instead. */
2636
+ constructor(httpClient) {
2637
+ this.httpClient = httpClient;
2638
+ }
2639
+ /**
2640
+ * Create a new reserved address.
2641
+ */
2642
+ create(arg) {
2643
+ return this.httpClient
2644
+ .url(`/reserved_addrs`)
2645
+ .post(util.serializeArgument(arg))
2646
+ .json(payload => util.deserializeResult(payload))
2647
+ .then(f => f, util.onRejected);
2648
+ }
2649
+ /**
2650
+ * Delete a reserved address.
2651
+ */
2652
+ delete(arg) {
2653
+ return this.httpClient
2654
+ .url(`/reserved_addrs/${arg.id}`)
2655
+ .delete()
2656
+ .json(payload => util.deserializeResult(payload))
2657
+ .then(f => f, util.onRejected);
2658
+ }
2659
+ /**
2660
+ * Get the details of a reserved address.
2661
+ */
2662
+ get(arg) {
2663
+ return this.httpClient
2664
+ .url(`/reserved_addrs/${arg.id}`)
2665
+ .get()
2666
+ .json(payload => util.deserializeResult(payload))
2667
+ .then(f => f, util.onRejected);
2668
+ }
2669
+ /**
2670
+ * List all reserved addresses on this account.
2671
+ */
2672
+ list() {
2673
+ var e_18, _a;
2674
+ return __awaiter(this, void 0, void 0, function* () {
2675
+ const array = [];
2676
+ try {
2677
+ for (
2678
+ var _b = __asyncValues(this._asyncList()), _c;
2679
+ (_c = yield _b.next()), !_c.done;
2680
+
2681
+ ) {
2682
+ let item = _c.value;
2683
+ array.push(item);
2684
+ }
2685
+ } catch (e_18_1) {
2686
+ e_18 = { error: e_18_1 };
2687
+ } finally {
2688
+ try {
2689
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2690
+ } finally {
2691
+ if (e_18) throw e_18.error;
2692
+ }
2693
+ }
2694
+ return array;
2695
+ });
2696
+ }
2697
+ _pagedList(arg) {
2698
+ return this.httpClient
2699
+ .url(`/reserved_addrs`)
2700
+ .query(arg)
2701
+ .get()
2702
+ .json(payload => util.deserializeResult(payload))
2703
+ .then(util.onFulfilled, util.onRejected);
2704
+ }
2705
+ _asyncList() {
2706
+ return __asyncGenerator(this, arguments, function* _asyncList_18() {
2707
+ const limit = '100';
2708
+ let nextPage = 'initial loop';
2709
+ let page = { limit: limit };
2710
+ while (nextPage) {
2711
+ const pagedList = yield __await(this._pagedList(page));
2712
+ nextPage = pagedList.nextPageUri;
2713
+ const items = pagedList.reservedAddrs;
2714
+ if (nextPage) {
2715
+ page = {
2716
+ beforeId: items[items.length - 1].id,
2717
+ limit: limit,
2718
+ };
2719
+ }
2720
+ for (let item of items) {
2721
+ yield yield __await(item);
2722
+ }
2723
+ }
2724
+ });
2725
+ }
2726
+ /**
2727
+ * Update the attributes of a reserved address.
2728
+ */
2729
+ update(arg) {
2730
+ return this.httpClient
2731
+ .url(`/reserved_addrs/${arg.id}`)
2732
+ .patch(util.serializeArgument(arg))
2733
+ .json(payload => util.deserializeResult(payload))
2734
+ .then(f => f, util.onRejected);
2735
+ }
2736
+ }
2737
+ exports.ReservedAddrs = ReservedAddrs;
2738
+ /**
2739
+ * Reserved Domains are hostnames that you can listen for traffic on. Domains
2740
+ can be used to listen for http, https or tls traffic. You may use a domain
2741
+ that you own by creating a CNAME record specified in the returned resource.
2742
+ This CNAME record points traffic for that domain to ngrok's edge servers.
2743
+ */
2744
+ class ReservedDomains {
2745
+ /** Do not construct this object directly, use the <code>reservedDomains</code> property of an <code>Ngrok</code> client object instead. */
2746
+ constructor(httpClient) {
2747
+ this.httpClient = httpClient;
2748
+ }
2749
+ /**
2750
+ * Create a new reserved domain.
2751
+ */
2752
+ create(arg) {
2753
+ return this.httpClient
2754
+ .url(`/reserved_domains`)
2755
+ .post(util.serializeArgument(arg))
2756
+ .json(payload => util.deserializeResult(payload))
2757
+ .then(f => f, util.onRejected);
2758
+ }
2759
+ /**
2760
+ * Delete a reserved domain.
2761
+ */
2762
+ delete(arg) {
2763
+ return this.httpClient
2764
+ .url(`/reserved_domains/${arg.id}`)
2765
+ .delete()
2766
+ .json(payload => util.deserializeResult(payload))
2767
+ .then(f => f, util.onRejected);
2768
+ }
2769
+ /**
2770
+ * Get the details of a reserved domain.
2771
+ */
2772
+ get(arg) {
2773
+ return this.httpClient
2774
+ .url(`/reserved_domains/${arg.id}`)
2775
+ .get()
2776
+ .json(payload => util.deserializeResult(payload))
2777
+ .then(f => f, util.onRejected);
2778
+ }
2779
+ /**
2780
+ * List all reserved domains on this account.
2781
+ */
2782
+ list() {
2783
+ var e_19, _a;
2784
+ return __awaiter(this, void 0, void 0, function* () {
2785
+ const array = [];
2786
+ try {
2787
+ for (
2788
+ var _b = __asyncValues(this._asyncList()), _c;
2789
+ (_c = yield _b.next()), !_c.done;
2790
+
2791
+ ) {
2792
+ let item = _c.value;
2793
+ array.push(item);
2794
+ }
2795
+ } catch (e_19_1) {
2796
+ e_19 = { error: e_19_1 };
2797
+ } finally {
2798
+ try {
2799
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2800
+ } finally {
2801
+ if (e_19) throw e_19.error;
2802
+ }
2803
+ }
2804
+ return array;
2805
+ });
2806
+ }
2807
+ _pagedList(arg) {
2808
+ return this.httpClient
2809
+ .url(`/reserved_domains`)
2810
+ .query(arg)
2811
+ .get()
2812
+ .json(payload => util.deserializeResult(payload))
2813
+ .then(util.onFulfilled, util.onRejected);
2814
+ }
2815
+ _asyncList() {
2816
+ return __asyncGenerator(this, arguments, function* _asyncList_19() {
2817
+ const limit = '100';
2818
+ let nextPage = 'initial loop';
2819
+ let page = { limit: limit };
2820
+ while (nextPage) {
2821
+ const pagedList = yield __await(this._pagedList(page));
2822
+ nextPage = pagedList.nextPageUri;
2823
+ const items = pagedList.reservedDomains;
2824
+ if (nextPage) {
2825
+ page = {
2826
+ beforeId: items[items.length - 1].id,
2827
+ limit: limit,
2828
+ };
2829
+ }
2830
+ for (let item of items) {
2831
+ yield yield __await(item);
2832
+ }
2833
+ }
2834
+ });
2835
+ }
2836
+ /**
2837
+ * Update the attributes of a reserved domain.
2838
+ */
2839
+ update(arg) {
2840
+ return this.httpClient
2841
+ .url(`/reserved_domains/${arg.id}`)
2842
+ .patch(util.serializeArgument(arg))
2843
+ .json(payload => util.deserializeResult(payload))
2844
+ .then(f => f, util.onRejected);
2845
+ }
2846
+ /**
2847
+ * Detach the certificate management policy attached to a reserved domain.
2848
+ */
2849
+ deleteCertificateManagementPolicy(arg) {
2850
+ return this.httpClient
2851
+ .url(`/reserved_domains/${arg.id}/certificate_management_policy`)
2852
+ .delete()
2853
+ .json(payload => util.deserializeResult(payload))
2854
+ .then(f => f, util.onRejected);
2855
+ }
2856
+ /**
2857
+ * Detach the certificate attached to a reserved domain.
2858
+ */
2859
+ deleteCertificate(arg) {
2860
+ return this.httpClient
2861
+ .url(`/reserved_domains/${arg.id}/certificate`)
2862
+ .delete()
2863
+ .json(payload => util.deserializeResult(payload))
2864
+ .then(f => f, util.onRejected);
2865
+ }
2866
+ }
2867
+ exports.ReservedDomains = ReservedDomains;
2868
+ /**
2869
+ * An SSH Certificate Authority is a pair of an SSH Certificate and its private
2870
+ key that can be used to sign other SSH host and user certificates.
2871
+ */
2872
+ class SSHCertificateAuthorities {
2873
+ /** Do not construct this object directly, use the <code>sshCertificateAuthorities</code> property of an <code>Ngrok</code> client object instead. */
2874
+ constructor(httpClient) {
2875
+ this.httpClient = httpClient;
2876
+ }
2877
+ /**
2878
+ * Create a new SSH Certificate Authority
2879
+ */
2880
+ create(arg) {
2881
+ return this.httpClient
2882
+ .url(`/ssh_certificate_authorities`)
2883
+ .post(util.serializeArgument(arg))
2884
+ .json(payload => util.deserializeResult(payload))
2885
+ .then(f => f, util.onRejected);
2886
+ }
2887
+ /**
2888
+ * Delete an SSH Certificate Authority
2889
+ */
2890
+ delete(arg) {
2891
+ return this.httpClient
2892
+ .url(`/ssh_certificate_authorities/${arg.id}`)
2893
+ .delete()
2894
+ .json(payload => util.deserializeResult(payload))
2895
+ .then(f => f, util.onRejected);
2896
+ }
2897
+ /**
2898
+ * Get detailed information about an SSH Certficate Authority
2899
+ */
2900
+ get(arg) {
2901
+ return this.httpClient
2902
+ .url(`/ssh_certificate_authorities/${arg.id}`)
2903
+ .get()
2904
+ .json(payload => util.deserializeResult(payload))
2905
+ .then(f => f, util.onRejected);
2906
+ }
2907
+ /**
2908
+ * List all SSH Certificate Authorities on this account
2909
+ */
2910
+ list() {
2911
+ var e_20, _a;
2912
+ return __awaiter(this, void 0, void 0, function* () {
2913
+ const array = [];
2914
+ try {
2915
+ for (
2916
+ var _b = __asyncValues(this._asyncList()), _c;
2917
+ (_c = yield _b.next()), !_c.done;
2918
+
2919
+ ) {
2920
+ let item = _c.value;
2921
+ array.push(item);
2922
+ }
2923
+ } catch (e_20_1) {
2924
+ e_20 = { error: e_20_1 };
2925
+ } finally {
2926
+ try {
2927
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
2928
+ } finally {
2929
+ if (e_20) throw e_20.error;
2930
+ }
2931
+ }
2932
+ return array;
2933
+ });
2934
+ }
2935
+ _pagedList(arg) {
2936
+ return this.httpClient
2937
+ .url(`/ssh_certificate_authorities`)
2938
+ .query(arg)
2939
+ .get()
2940
+ .json(payload => util.deserializeResult(payload))
2941
+ .then(util.onFulfilled, util.onRejected);
2942
+ }
2943
+ _asyncList() {
2944
+ return __asyncGenerator(this, arguments, function* _asyncList_20() {
2945
+ const limit = '100';
2946
+ let nextPage = 'initial loop';
2947
+ let page = { limit: limit };
2948
+ while (nextPage) {
2949
+ const pagedList = yield __await(this._pagedList(page));
2950
+ nextPage = pagedList.nextPageUri;
2951
+ const items = pagedList.sshCertificateAuthorities;
2952
+ if (nextPage) {
2953
+ page = {
2954
+ beforeId: items[items.length - 1].id,
2955
+ limit: limit,
2956
+ };
2957
+ }
2958
+ for (let item of items) {
2959
+ yield yield __await(item);
2960
+ }
2961
+ }
2962
+ });
2963
+ }
2964
+ /**
2965
+ * Update an SSH Certificate Authority
2966
+ */
2967
+ update(arg) {
2968
+ return this.httpClient
2969
+ .url(`/ssh_certificate_authorities/${arg.id}`)
2970
+ .patch(util.serializeArgument(arg))
2971
+ .json(payload => util.deserializeResult(payload))
2972
+ .then(f => f, util.onRejected);
2973
+ }
2974
+ }
2975
+ exports.SSHCertificateAuthorities = SSHCertificateAuthorities;
2976
+ /**
2977
+ * SSH Credentials are SSH public keys that can be used to start SSH tunnels
2978
+ via the ngrok SSH tunnel gateway.
2979
+ */
2980
+ class SSHCredentials {
2981
+ /** Do not construct this object directly, use the <code>sshCredentials</code> property of an <code>Ngrok</code> client object instead. */
2982
+ constructor(httpClient) {
2983
+ this.httpClient = httpClient;
2984
+ }
2985
+ /**
2986
+ * Create a new ssh_credential from an uploaded public SSH key. This ssh credential can be used to start new tunnels via ngrok's SSH gateway.
2987
+ */
2988
+ create(arg) {
2989
+ return this.httpClient
2990
+ .url(`/ssh_credentials`)
2991
+ .post(util.serializeArgument(arg))
2992
+ .json(payload => util.deserializeResult(payload))
2993
+ .then(f => f, util.onRejected);
2994
+ }
2995
+ /**
2996
+ * Delete an ssh_credential by ID
2997
+ */
2998
+ delete(arg) {
2999
+ return this.httpClient
3000
+ .url(`/ssh_credentials/${arg.id}`)
3001
+ .delete()
3002
+ .json(payload => util.deserializeResult(payload))
3003
+ .then(f => f, util.onRejected);
3004
+ }
3005
+ /**
3006
+ * Get detailed information about an ssh_credential
3007
+ */
3008
+ get(arg) {
3009
+ return this.httpClient
3010
+ .url(`/ssh_credentials/${arg.id}`)
3011
+ .get()
3012
+ .json(payload => util.deserializeResult(payload))
3013
+ .then(f => f, util.onRejected);
3014
+ }
3015
+ /**
3016
+ * List all ssh credentials on this account
3017
+ */
3018
+ list() {
3019
+ var e_21, _a;
3020
+ return __awaiter(this, void 0, void 0, function* () {
3021
+ const array = [];
3022
+ try {
3023
+ for (
3024
+ var _b = __asyncValues(this._asyncList()), _c;
3025
+ (_c = yield _b.next()), !_c.done;
3026
+
3027
+ ) {
3028
+ let item = _c.value;
3029
+ array.push(item);
3030
+ }
3031
+ } catch (e_21_1) {
3032
+ e_21 = { error: e_21_1 };
3033
+ } finally {
3034
+ try {
3035
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
3036
+ } finally {
3037
+ if (e_21) throw e_21.error;
3038
+ }
3039
+ }
3040
+ return array;
3041
+ });
3042
+ }
3043
+ _pagedList(arg) {
3044
+ return this.httpClient
3045
+ .url(`/ssh_credentials`)
3046
+ .query(arg)
3047
+ .get()
3048
+ .json(payload => util.deserializeResult(payload))
3049
+ .then(util.onFulfilled, util.onRejected);
3050
+ }
3051
+ _asyncList() {
3052
+ return __asyncGenerator(this, arguments, function* _asyncList_21() {
3053
+ const limit = '100';
3054
+ let nextPage = 'initial loop';
3055
+ let page = { limit: limit };
3056
+ while (nextPage) {
3057
+ const pagedList = yield __await(this._pagedList(page));
3058
+ nextPage = pagedList.nextPageUri;
3059
+ const items = pagedList.sshCredentials;
3060
+ if (nextPage) {
3061
+ page = {
3062
+ beforeId: items[items.length - 1].id,
3063
+ limit: limit,
3064
+ };
3065
+ }
3066
+ for (let item of items) {
3067
+ yield yield __await(item);
3068
+ }
3069
+ }
3070
+ });
3071
+ }
3072
+ /**
3073
+ * Update attributes of an ssh_credential by ID
3074
+ */
3075
+ update(arg) {
3076
+ return this.httpClient
3077
+ .url(`/ssh_credentials/${arg.id}`)
3078
+ .patch(util.serializeArgument(arg))
3079
+ .json(payload => util.deserializeResult(payload))
3080
+ .then(f => f, util.onRejected);
3081
+ }
3082
+ }
3083
+ exports.SSHCredentials = SSHCredentials;
3084
+ /**
3085
+ * SSH Host Certificates along with the corresponding private key allows an SSH
3086
+ server to assert its authenticity to connecting SSH clients who trust the
3087
+ SSH Certificate Authority that was used to sign the certificate.
3088
+ */
3089
+ class SSHHostCertificates {
3090
+ /** Do not construct this object directly, use the <code>sshHostCertificates</code> property of an <code>Ngrok</code> client object instead. */
3091
+ constructor(httpClient) {
3092
+ this.httpClient = httpClient;
3093
+ }
3094
+ /**
3095
+ * Create a new SSH Host Certificate
3096
+ */
3097
+ create(arg) {
3098
+ return this.httpClient
3099
+ .url(`/ssh_host_certificates`)
3100
+ .post(util.serializeArgument(arg))
3101
+ .json(payload => util.deserializeResult(payload))
3102
+ .then(f => f, util.onRejected);
3103
+ }
3104
+ /**
3105
+ * Delete an SSH Host Certificate
3106
+ */
3107
+ delete(arg) {
3108
+ return this.httpClient
3109
+ .url(`/ssh_host_certificates/${arg.id}`)
3110
+ .delete()
3111
+ .json(payload => util.deserializeResult(payload))
3112
+ .then(f => f, util.onRejected);
3113
+ }
3114
+ /**
3115
+ * Get detailed information about an SSH Host Certficate
3116
+ */
3117
+ get(arg) {
3118
+ return this.httpClient
3119
+ .url(`/ssh_host_certificates/${arg.id}`)
3120
+ .get()
3121
+ .json(payload => util.deserializeResult(payload))
3122
+ .then(f => f, util.onRejected);
3123
+ }
3124
+ /**
3125
+ * List all SSH Host Certificates issued on this account
3126
+ */
3127
+ list() {
3128
+ var e_22, _a;
3129
+ return __awaiter(this, void 0, void 0, function* () {
3130
+ const array = [];
3131
+ try {
3132
+ for (
3133
+ var _b = __asyncValues(this._asyncList()), _c;
3134
+ (_c = yield _b.next()), !_c.done;
3135
+
3136
+ ) {
3137
+ let item = _c.value;
3138
+ array.push(item);
3139
+ }
3140
+ } catch (e_22_1) {
3141
+ e_22 = { error: e_22_1 };
3142
+ } finally {
3143
+ try {
3144
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
3145
+ } finally {
3146
+ if (e_22) throw e_22.error;
3147
+ }
3148
+ }
3149
+ return array;
3150
+ });
3151
+ }
3152
+ _pagedList(arg) {
3153
+ return this.httpClient
3154
+ .url(`/ssh_host_certificates`)
3155
+ .query(arg)
3156
+ .get()
3157
+ .json(payload => util.deserializeResult(payload))
3158
+ .then(util.onFulfilled, util.onRejected);
3159
+ }
3160
+ _asyncList() {
3161
+ return __asyncGenerator(this, arguments, function* _asyncList_22() {
3162
+ const limit = '100';
3163
+ let nextPage = 'initial loop';
3164
+ let page = { limit: limit };
3165
+ while (nextPage) {
3166
+ const pagedList = yield __await(this._pagedList(page));
3167
+ nextPage = pagedList.nextPageUri;
3168
+ const items = pagedList.sshHostCertificates;
3169
+ if (nextPage) {
3170
+ page = {
3171
+ beforeId: items[items.length - 1].id,
3172
+ limit: limit,
3173
+ };
3174
+ }
3175
+ for (let item of items) {
3176
+ yield yield __await(item);
3177
+ }
3178
+ }
3179
+ });
3180
+ }
3181
+ /**
3182
+ * Update an SSH Host Certificate
3183
+ */
3184
+ update(arg) {
3185
+ return this.httpClient
3186
+ .url(`/ssh_host_certificates/${arg.id}`)
3187
+ .patch(util.serializeArgument(arg))
3188
+ .json(payload => util.deserializeResult(payload))
3189
+ .then(f => f, util.onRejected);
3190
+ }
3191
+ }
3192
+ exports.SSHHostCertificates = SSHHostCertificates;
3193
+ /**
3194
+ * SSH User Certificates are presented by SSH clients when connecting to an SSH
3195
+ server to authenticate their connection. The SSH server must trust the SSH
3196
+ Certificate Authority used to sign the certificate.
3197
+ */
3198
+ class SSHUserCertificates {
3199
+ /** Do not construct this object directly, use the <code>sshUserCertificates</code> property of an <code>Ngrok</code> client object instead. */
3200
+ constructor(httpClient) {
3201
+ this.httpClient = httpClient;
3202
+ }
3203
+ /**
3204
+ * Create a new SSH User Certificate
3205
+ */
3206
+ create(arg) {
3207
+ return this.httpClient
3208
+ .url(`/ssh_user_certificates`)
3209
+ .post(util.serializeArgument(arg))
3210
+ .json(payload => util.deserializeResult(payload))
3211
+ .then(f => f, util.onRejected);
3212
+ }
3213
+ /**
3214
+ * Delete an SSH User Certificate
3215
+ */
3216
+ delete(arg) {
3217
+ return this.httpClient
3218
+ .url(`/ssh_user_certificates/${arg.id}`)
3219
+ .delete()
3220
+ .json(payload => util.deserializeResult(payload))
3221
+ .then(f => f, util.onRejected);
3222
+ }
3223
+ /**
3224
+ * Get detailed information about an SSH User Certficate
3225
+ */
3226
+ get(arg) {
3227
+ return this.httpClient
3228
+ .url(`/ssh_user_certificates/${arg.id}`)
3229
+ .get()
3230
+ .json(payload => util.deserializeResult(payload))
3231
+ .then(f => f, util.onRejected);
3232
+ }
3233
+ /**
3234
+ * List all SSH User Certificates issued on this account
3235
+ */
3236
+ list() {
3237
+ var e_23, _a;
3238
+ return __awaiter(this, void 0, void 0, function* () {
3239
+ const array = [];
3240
+ try {
3241
+ for (
3242
+ var _b = __asyncValues(this._asyncList()), _c;
3243
+ (_c = yield _b.next()), !_c.done;
3244
+
3245
+ ) {
3246
+ let item = _c.value;
3247
+ array.push(item);
3248
+ }
3249
+ } catch (e_23_1) {
3250
+ e_23 = { error: e_23_1 };
3251
+ } finally {
3252
+ try {
3253
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
3254
+ } finally {
3255
+ if (e_23) throw e_23.error;
3256
+ }
3257
+ }
3258
+ return array;
3259
+ });
3260
+ }
3261
+ _pagedList(arg) {
3262
+ return this.httpClient
3263
+ .url(`/ssh_user_certificates`)
3264
+ .query(arg)
3265
+ .get()
3266
+ .json(payload => util.deserializeResult(payload))
3267
+ .then(util.onFulfilled, util.onRejected);
3268
+ }
3269
+ _asyncList() {
3270
+ return __asyncGenerator(this, arguments, function* _asyncList_23() {
3271
+ const limit = '100';
3272
+ let nextPage = 'initial loop';
3273
+ let page = { limit: limit };
3274
+ while (nextPage) {
3275
+ const pagedList = yield __await(this._pagedList(page));
3276
+ nextPage = pagedList.nextPageUri;
3277
+ const items = pagedList.sshUserCertificates;
3278
+ if (nextPage) {
3279
+ page = {
3280
+ beforeId: items[items.length - 1].id,
3281
+ limit: limit,
3282
+ };
3283
+ }
3284
+ for (let item of items) {
3285
+ yield yield __await(item);
3286
+ }
3287
+ }
3288
+ });
3289
+ }
3290
+ /**
3291
+ * Update an SSH User Certificate
3292
+ */
3293
+ update(arg) {
3294
+ return this.httpClient
3295
+ .url(`/ssh_user_certificates/${arg.id}`)
3296
+ .patch(util.serializeArgument(arg))
3297
+ .json(payload => util.deserializeResult(payload))
3298
+ .then(f => f, util.onRejected);
3299
+ }
3300
+ }
3301
+ exports.SSHUserCertificates = SSHUserCertificates;
3302
+ /**
3303
+ * TLS Certificates are pairs of x509 certificates and their matching private
3304
+ key that can be used to terminate TLS traffic. TLS certificates are unused
3305
+ until they are attached to a Domain. TLS Certificates may also be
3306
+ provisioned by ngrok automatically for domains on which you have enabled
3307
+ automated certificate provisioning.
3308
+ */
3309
+ class TLSCertificates {
3310
+ /** Do not construct this object directly, use the <code>tlsCertificates</code> property of an <code>Ngrok</code> client object instead. */
3311
+ constructor(httpClient) {
3312
+ this.httpClient = httpClient;
3313
+ }
3314
+ /**
3315
+ * Upload a new TLS certificate
3316
+ */
3317
+ create(arg) {
3318
+ return this.httpClient
3319
+ .url(`/tls_certificates`)
3320
+ .post(util.serializeArgument(arg))
3321
+ .json(payload => util.deserializeResult(payload))
3322
+ .then(f => f, util.onRejected);
3323
+ }
3324
+ /**
3325
+ * Delete a TLS certificate
3326
+ */
3327
+ delete(arg) {
3328
+ return this.httpClient
3329
+ .url(`/tls_certificates/${arg.id}`)
3330
+ .delete()
3331
+ .json(payload => util.deserializeResult(payload))
3332
+ .then(f => f, util.onRejected);
3333
+ }
3334
+ /**
3335
+ * Get detailed information about a TLS certificate
3336
+ */
3337
+ get(arg) {
3338
+ return this.httpClient
3339
+ .url(`/tls_certificates/${arg.id}`)
3340
+ .get()
3341
+ .json(payload => util.deserializeResult(payload))
3342
+ .then(f => f, util.onRejected);
3343
+ }
3344
+ /**
3345
+ * List all TLS certificates on this account
3346
+ */
3347
+ list() {
3348
+ var e_24, _a;
3349
+ return __awaiter(this, void 0, void 0, function* () {
3350
+ const array = [];
3351
+ try {
3352
+ for (
3353
+ var _b = __asyncValues(this._asyncList()), _c;
3354
+ (_c = yield _b.next()), !_c.done;
3355
+
3356
+ ) {
3357
+ let item = _c.value;
3358
+ array.push(item);
3359
+ }
3360
+ } catch (e_24_1) {
3361
+ e_24 = { error: e_24_1 };
3362
+ } finally {
3363
+ try {
3364
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
3365
+ } finally {
3366
+ if (e_24) throw e_24.error;
3367
+ }
3368
+ }
3369
+ return array;
3370
+ });
3371
+ }
3372
+ _pagedList(arg) {
3373
+ return this.httpClient
3374
+ .url(`/tls_certificates`)
3375
+ .query(arg)
3376
+ .get()
3377
+ .json(payload => util.deserializeResult(payload))
3378
+ .then(util.onFulfilled, util.onRejected);
3379
+ }
3380
+ _asyncList() {
3381
+ return __asyncGenerator(this, arguments, function* _asyncList_24() {
3382
+ const limit = '100';
3383
+ let nextPage = 'initial loop';
3384
+ let page = { limit: limit };
3385
+ while (nextPage) {
3386
+ const pagedList = yield __await(this._pagedList(page));
3387
+ nextPage = pagedList.nextPageUri;
3388
+ const items = pagedList.tlsCertificates;
3389
+ if (nextPage) {
3390
+ page = {
3391
+ beforeId: items[items.length - 1].id,
3392
+ limit: limit,
3393
+ };
3394
+ }
3395
+ for (let item of items) {
3396
+ yield yield __await(item);
3397
+ }
3398
+ }
3399
+ });
3400
+ }
3401
+ /**
3402
+ * Update attributes of a TLS Certificate by ID
3403
+ */
3404
+ update(arg) {
3405
+ return this.httpClient
3406
+ .url(`/tls_certificates/${arg.id}`)
3407
+ .patch(util.serializeArgument(arg))
3408
+ .json(payload => util.deserializeResult(payload))
3409
+ .then(f => f, util.onRejected);
3410
+ }
3411
+ }
3412
+ exports.TLSCertificates = TLSCertificates;
3413
+ /**
3414
+ * Tunnel Sessions represent instances of ngrok agents or SSH reverse tunnel
3415
+ sessions that are running and connected to the ngrok service. Each tunnel
3416
+ session can include one or more Tunnels.
3417
+ */
3418
+ class TunnelSessions {
3419
+ /** Do not construct this object directly, use the <code>tunnelSessions</code> property of an <code>Ngrok</code> client object instead. */
3420
+ constructor(httpClient) {
3421
+ this.httpClient = httpClient;
3422
+ }
3423
+ /**
3424
+ * List all online tunnel sessions running on this account.
3425
+ */
3426
+ list() {
3427
+ var e_25, _a;
3428
+ return __awaiter(this, void 0, void 0, function* () {
3429
+ const array = [];
3430
+ try {
3431
+ for (
3432
+ var _b = __asyncValues(this._asyncList()), _c;
3433
+ (_c = yield _b.next()), !_c.done;
3434
+
3435
+ ) {
3436
+ let item = _c.value;
3437
+ array.push(item);
3438
+ }
3439
+ } catch (e_25_1) {
3440
+ e_25 = { error: e_25_1 };
3441
+ } finally {
3442
+ try {
3443
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
3444
+ } finally {
3445
+ if (e_25) throw e_25.error;
3446
+ }
3447
+ }
3448
+ return array;
3449
+ });
3450
+ }
3451
+ _pagedList(arg) {
3452
+ return this.httpClient
3453
+ .url(`/tunnel_sessions`)
3454
+ .query(arg)
3455
+ .get()
3456
+ .json(payload => util.deserializeResult(payload))
3457
+ .then(util.onFulfilled, util.onRejected);
3458
+ }
3459
+ _asyncList() {
3460
+ return __asyncGenerator(this, arguments, function* _asyncList_25() {
3461
+ const limit = '100';
3462
+ let nextPage = 'initial loop';
3463
+ let page = { limit: limit };
3464
+ while (nextPage) {
3465
+ const pagedList = yield __await(this._pagedList(page));
3466
+ nextPage = pagedList.nextPageUri;
3467
+ const items = pagedList.tunnelSessions;
3468
+ if (nextPage) {
3469
+ page = {
3470
+ beforeId: items[items.length - 1].id,
3471
+ limit: limit,
3472
+ };
3473
+ }
3474
+ for (let item of items) {
3475
+ yield yield __await(item);
3476
+ }
3477
+ }
3478
+ });
3479
+ }
3480
+ /**
3481
+ * Get the detailed status of a tunnel session by ID
3482
+ */
3483
+ get(arg) {
3484
+ return this.httpClient
3485
+ .url(`/tunnel_sessions/${arg.id}`)
3486
+ .get()
3487
+ .json(payload => util.deserializeResult(payload))
3488
+ .then(f => f, util.onRejected);
3489
+ }
3490
+ /**
3491
+ * Issues a command instructing the ngrok agent to restart. The agent restarts itself by calling exec() on platforms that support it. This operation is notably not supported on Windows. When an agent restarts, it reconnects with a new tunnel session ID.
3492
+ */
3493
+ restart(arg) {
3494
+ return this.httpClient
3495
+ .url(`/tunnel_sessions/${arg.id}/restart`)
3496
+ .post(util.serializeArgument(arg))
3497
+ .json(payload => util.deserializeResult(payload))
3498
+ .then(f => f, util.onRejected);
3499
+ }
3500
+ /**
3501
+ * Issues a command instructing the ngrok agent that started this tunnel session to exit.
3502
+ */
3503
+ stop(arg) {
3504
+ return this.httpClient
3505
+ .url(`/tunnel_sessions/${arg.id}/stop`)
3506
+ .post(util.serializeArgument(arg))
3507
+ .json(payload => util.deserializeResult(payload))
3508
+ .then(f => f, util.onRejected);
3509
+ }
3510
+ /**
3511
+ * Issues a command instructing the ngrok agent to update itself to the latest version. After this call completes successfully, the ngrok agent will be in the update process. A caller should wait some amount of time to allow the update to complete (at least 10 seconds) before making a call to the Restart endpoint to request that the agent restart itself to start using the new code. This call will never update an ngrok agent to a new major version which could cause breaking compatibility issues. If you wish to update to a new major version, that must be done manually. Still, please be aware that updating your ngrok agent could break your integration. This call will fail in any of the following circumstances: there is no update available the ngrok agent's configuration disabled update checks the agent is currently in process of updating the agent has already successfully updated but has not yet been restarted
3512
+ */
3513
+ update(arg) {
3514
+ return this.httpClient
3515
+ .url(`/tunnel_sessions/${arg.id}/update`)
3516
+ .post(util.serializeArgument(arg))
3517
+ .json(payload => util.deserializeResult(payload))
3518
+ .then(f => f, util.onRejected);
3519
+ }
3520
+ }
3521
+ exports.TunnelSessions = TunnelSessions;
3522
+ /**
3523
+ * Tunnels provide endpoints to access services exposed by a running ngrok
3524
+ agent tunnel session or an SSH reverse tunnel session.
3525
+ */
3526
+ class Tunnels {
3527
+ /** Do not construct this object directly, use the <code>tunnels</code> property of an <code>Ngrok</code> client object instead. */
3528
+ constructor(httpClient) {
3529
+ this.httpClient = httpClient;
3530
+ }
3531
+ /**
3532
+ * List all online tunnels currently running on the account.
3533
+ */
3534
+ list() {
3535
+ var e_26, _a;
3536
+ return __awaiter(this, void 0, void 0, function* () {
3537
+ const array = [];
3538
+ try {
3539
+ for (
3540
+ var _b = __asyncValues(this._asyncList()), _c;
3541
+ (_c = yield _b.next()), !_c.done;
3542
+
3543
+ ) {
3544
+ let item = _c.value;
3545
+ array.push(item);
3546
+ }
3547
+ } catch (e_26_1) {
3548
+ e_26 = { error: e_26_1 };
3549
+ } finally {
3550
+ try {
3551
+ if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
3552
+ } finally {
3553
+ if (e_26) throw e_26.error;
3554
+ }
3555
+ }
3556
+ return array;
3557
+ });
3558
+ }
3559
+ _pagedList(arg) {
3560
+ return this.httpClient
3561
+ .url(`/tunnels`)
3562
+ .query(arg)
3563
+ .get()
3564
+ .json(payload => util.deserializeResult(payload))
3565
+ .then(util.onFulfilled, util.onRejected);
3566
+ }
3567
+ _asyncList() {
3568
+ return __asyncGenerator(this, arguments, function* _asyncList_26() {
3569
+ const limit = '100';
3570
+ let nextPage = 'initial loop';
3571
+ let page = { limit: limit };
3572
+ while (nextPage) {
3573
+ const pagedList = yield __await(this._pagedList(page));
3574
+ nextPage = pagedList.nextPageUri;
3575
+ const items = pagedList.tunnels;
3576
+ if (nextPage) {
3577
+ page = {
3578
+ beforeId: items[items.length - 1].id,
3579
+ limit: limit,
3580
+ };
3581
+ }
3582
+ for (let item of items) {
3583
+ yield yield __await(item);
3584
+ }
3585
+ }
3586
+ });
3587
+ }
3588
+ /**
3589
+ * Get the status of a tunnel by ID
3590
+ */
3591
+ get(arg) {
3592
+ return this.httpClient
3593
+ .url(`/tunnels/${arg.id}`)
3594
+ .get()
3595
+ .json(payload => util.deserializeResult(payload))
3596
+ .then(f => f, util.onRejected);
3597
+ }
3598
+ }
3599
+ exports.Tunnels = Tunnels;
3600
+ //# sourceMappingURL=services.js.map