@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
package/lib/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  'use strict';
2
- // Code generated by apic. DO NOT EDIT.
3
2
  var __createBinding =
4
3
  (this && this.__createBinding) ||
5
4
  (Object.create
@@ -23,2152 +22,7 @@ var __exportStar =
23
22
  if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p))
24
23
  __createBinding(exports, m, p);
25
24
  };
26
- var __awaiter =
27
- (this && this.__awaiter) ||
28
- function (thisArg, _arguments, P, generator) {
29
- function adopt(value) {
30
- return value instanceof P
31
- ? value
32
- : new P(function (resolve) {
33
- resolve(value);
34
- });
35
- }
36
- return new (P || (P = Promise))(function (resolve, reject) {
37
- function fulfilled(value) {
38
- try {
39
- step(generator.next(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- }
44
- function rejected(value) {
45
- try {
46
- step(generator['throw'](value));
47
- } catch (e) {
48
- reject(e);
49
- }
50
- }
51
- function step(result) {
52
- result.done
53
- ? resolve(result.value)
54
- : adopt(result.value).then(fulfilled, rejected);
55
- }
56
- step((generator = generator.apply(thisArg, _arguments || [])).next());
57
- });
58
- };
59
- var __asyncValues =
60
- (this && this.__asyncValues) ||
61
- function (o) {
62
- if (!Symbol.asyncIterator)
63
- throw new TypeError('Symbol.asyncIterator is not defined.');
64
- var m = o[Symbol.asyncIterator],
65
- i;
66
- return m
67
- ? m.call(o)
68
- : ((o =
69
- typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()),
70
- (i = {}),
71
- verb('next'),
72
- verb('throw'),
73
- verb('return'),
74
- (i[Symbol.asyncIterator] = function () {
75
- return this;
76
- }),
77
- i);
78
- function verb(n) {
79
- i[n] =
80
- o[n] &&
81
- function (v) {
82
- return new Promise(function (resolve, reject) {
83
- (v = o[n](v)), settle(resolve, reject, v.done, v.value);
84
- });
85
- };
86
- }
87
- function settle(resolve, reject, d, v) {
88
- Promise.resolve(v).then(function (v) {
89
- resolve({ value: v, done: d });
90
- }, reject);
91
- }
92
- };
93
- var __await =
94
- (this && this.__await) ||
95
- function (v) {
96
- return this instanceof __await ? ((this.v = v), this) : new __await(v);
97
- };
98
- var __asyncGenerator =
99
- (this && this.__asyncGenerator) ||
100
- function (thisArg, _arguments, generator) {
101
- if (!Symbol.asyncIterator)
102
- throw new TypeError('Symbol.asyncIterator is not defined.');
103
- var g = generator.apply(thisArg, _arguments || []),
104
- i,
105
- q = [];
106
- return (
107
- (i = {}),
108
- verb('next'),
109
- verb('throw'),
110
- verb('return'),
111
- (i[Symbol.asyncIterator] = function () {
112
- return this;
113
- }),
114
- i
115
- );
116
- function verb(n) {
117
- if (g[n])
118
- i[n] = function (v) {
119
- return new Promise(function (a, b) {
120
- q.push([n, v, a, b]) > 1 || resume(n, v);
121
- });
122
- };
123
- }
124
- function resume(n, v) {
125
- try {
126
- step(g[n](v));
127
- } catch (e) {
128
- settle(q[0][3], e);
129
- }
130
- }
131
- function step(r) {
132
- r.value instanceof __await
133
- ? Promise.resolve(r.value.v).then(fulfill, reject)
134
- : settle(q[0][2], r);
135
- }
136
- function fulfill(value) {
137
- resume('next', value);
138
- }
139
- function reject(value) {
140
- resume('throw', value);
141
- }
142
- function settle(f, v) {
143
- if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]);
144
- }
145
- };
146
25
  Object.defineProperty(exports, '__esModule', { value: true });
147
- exports.Ngrok = void 0;
148
- const wretch_1 = require('wretch');
149
- const formData = require('form-data');
150
- const url_1 = require('url');
151
- const node_fetch_1 = require('node-fetch');
152
- __exportStar(require('./types'), exports);
153
- wretch_1.default().polyfills({
154
- fetch: node_fetch_1.default,
155
- FormData: formData,
156
- URLSearchParams: url_1.URLSearchParams,
157
- });
158
- class Ngrok {
159
- /**
160
- * Creates an instance of the Ngrok REST client
161
- * @constructor
162
- * @param {Object} config - config.apiToken and config.baseUrl
163
- */
164
- constructor({ baseUrl = 'https://api.ngrok.com', apiToken }) {
165
- this.AbuseReports = {
166
- /** 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 */
167
- create: arg =>
168
- this.rest
169
- .url(`/abuse_reports`)
170
- .post(serializeMap(arg))
171
- .json()
172
- .then(onFulfilled, onRejected),
173
- /** Get the detailed status of abuse report by ID. */
174
- get: arg =>
175
- this.rest
176
- .url(`/abuse_reports/${arg.id}`)
177
- .get()
178
- .json()
179
- .then(onFulfilled, onRejected),
180
- };
181
- this.APIKeys = {
182
- /** Create a new API key. The generated API key can be used to authenticate to the ngrok API. */
183
- create: arg =>
184
- this.rest
185
- .url(`/api_keys`)
186
- .post(serializeMap(arg))
187
- .json()
188
- .then(onFulfilled, onRejected),
189
- /** Delete an API key by ID */
190
- delete: arg =>
191
- this.rest
192
- .url(`/api_keys/${arg.id}`)
193
- .delete()
194
- .json()
195
- .then(onFulfilled, onRejected),
196
- /** Get the details of an API key by ID. */
197
- get: arg =>
198
- this.rest
199
- .url(`/api_keys/${arg.id}`)
200
- .get()
201
- .json()
202
- .then(onFulfilled, onRejected),
203
- /** List all API keys owned by this account */
204
- list: () =>
205
- __awaiter(this, void 0, void 0, function* () {
206
- var e_1, _a;
207
- const array = [];
208
- try {
209
- for (
210
- var _b = __asyncValues(this.APIKeys._asyncList()), _c;
211
- (_c = yield _b.next()), !_c.done;
212
-
213
- ) {
214
- let item = _c.value;
215
- array.push(item);
216
- }
217
- } catch (e_1_1) {
218
- e_1 = { error: e_1_1 };
219
- } finally {
220
- try {
221
- if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
222
- } finally {
223
- if (e_1) throw e_1.error;
224
- }
225
- }
226
- return array;
227
- }),
228
- _pagedList: arg =>
229
- this.rest
230
- .url(`/api_keys`)
231
- .query(arg)
232
- .get()
233
- .json()
234
- .then(onFulfilled, onRejected),
235
- _asyncList: function () {
236
- return __asyncGenerator(this, arguments, function* () {
237
- const limit = '100';
238
- let nextPage = 'initial loop';
239
- let page = { limit: limit };
240
- while (nextPage) {
241
- const pagedList = yield __await(this._pagedList(page));
242
- nextPage = pagedList.next_page_uri;
243
- const items = pagedList.keys;
244
- if (nextPage) {
245
- page = {
246
- before_id: items[items.length - 1].id,
247
- limit: limit,
248
- };
249
- }
250
- for (let item of items) {
251
- yield yield __await(item);
252
- }
253
- }
254
- });
255
- },
256
- /** Update attributes of an API key by ID. */
257
- update: arg =>
258
- this.rest
259
- .url(`/api_keys/${arg.id}`)
260
- .patch(serializeMap(arg))
261
- .json()
262
- .then(onFulfilled, onRejected),
263
- };
264
- this.CertificateAuthorities = {
265
- /** Upload a new Certificate Authority */
266
- create: arg =>
267
- this.rest
268
- .url(`/certificate_authorities`)
269
- .post(serializeMap(arg))
270
- .json()
271
- .then(onFulfilled, onRejected),
272
- /** Delete a Certificate Authority */
273
- delete: arg =>
274
- this.rest
275
- .url(`/certificate_authorities/${arg.id}`)
276
- .delete()
277
- .json()
278
- .then(onFulfilled, onRejected),
279
- /** Get detailed information about a certficate authority */
280
- get: arg =>
281
- this.rest
282
- .url(`/certificate_authorities/${arg.id}`)
283
- .get()
284
- .json()
285
- .then(onFulfilled, onRejected),
286
- /** List all Certificate Authority on this account */
287
- list: () =>
288
- __awaiter(this, void 0, void 0, function* () {
289
- var e_2, _d;
290
- const array = [];
291
- try {
292
- for (
293
- var _e = __asyncValues(this.CertificateAuthorities._asyncList()),
294
- _f;
295
- (_f = yield _e.next()), !_f.done;
296
-
297
- ) {
298
- let item = _f.value;
299
- array.push(item);
300
- }
301
- } catch (e_2_1) {
302
- e_2 = { error: e_2_1 };
303
- } finally {
304
- try {
305
- if (_f && !_f.done && (_d = _e.return)) yield _d.call(_e);
306
- } finally {
307
- if (e_2) throw e_2.error;
308
- }
309
- }
310
- return array;
311
- }),
312
- _pagedList: arg =>
313
- this.rest
314
- .url(`/certificate_authorities`)
315
- .query(arg)
316
- .get()
317
- .json()
318
- .then(onFulfilled, onRejected),
319
- _asyncList: function () {
320
- return __asyncGenerator(this, arguments, function* () {
321
- const limit = '100';
322
- let nextPage = 'initial loop';
323
- let page = { limit: limit };
324
- while (nextPage) {
325
- const pagedList = yield __await(this._pagedList(page));
326
- nextPage = pagedList.next_page_uri;
327
- const items = pagedList.certificate_authorities;
328
- if (nextPage) {
329
- page = {
330
- before_id: items[items.length - 1].id,
331
- limit: limit,
332
- };
333
- }
334
- for (let item of items) {
335
- yield yield __await(item);
336
- }
337
- }
338
- });
339
- },
340
- /** Update attributes of a Certificate Authority by ID */
341
- update: arg =>
342
- this.rest
343
- .url(`/certificate_authorities/${arg.id}`)
344
- .patch(serializeMap(arg))
345
- .json()
346
- .then(onFulfilled, onRejected),
347
- };
348
- this.Credentials = {
349
- /** 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. */
350
- create: arg =>
351
- this.rest
352
- .url(`/credentials`)
353
- .post(serializeMap(arg))
354
- .json()
355
- .then(onFulfilled, onRejected),
356
- /** Delete a tunnel authtoken credential by ID */
357
- delete: arg =>
358
- this.rest
359
- .url(`/credentials/${arg.id}`)
360
- .delete()
361
- .json()
362
- .then(onFulfilled, onRejected),
363
- /** Get detailed information about a tunnel authtoken credential */
364
- get: arg =>
365
- this.rest
366
- .url(`/credentials/${arg.id}`)
367
- .get()
368
- .json()
369
- .then(onFulfilled, onRejected),
370
- /** List all tunnel authtoken credentials on this account */
371
- list: () =>
372
- __awaiter(this, void 0, void 0, function* () {
373
- var e_3, _g;
374
- const array = [];
375
- try {
376
- for (
377
- var _h = __asyncValues(this.Credentials._asyncList()), _j;
378
- (_j = yield _h.next()), !_j.done;
379
-
380
- ) {
381
- let item = _j.value;
382
- array.push(item);
383
- }
384
- } catch (e_3_1) {
385
- e_3 = { error: e_3_1 };
386
- } finally {
387
- try {
388
- if (_j && !_j.done && (_g = _h.return)) yield _g.call(_h);
389
- } finally {
390
- if (e_3) throw e_3.error;
391
- }
392
- }
393
- return array;
394
- }),
395
- _pagedList: arg =>
396
- this.rest
397
- .url(`/credentials`)
398
- .query(arg)
399
- .get()
400
- .json()
401
- .then(onFulfilled, onRejected),
402
- _asyncList: function () {
403
- return __asyncGenerator(this, arguments, function* () {
404
- const limit = '100';
405
- let nextPage = 'initial loop';
406
- let page = { limit: limit };
407
- while (nextPage) {
408
- const pagedList = yield __await(this._pagedList(page));
409
- nextPage = pagedList.next_page_uri;
410
- const items = pagedList.credentials;
411
- if (nextPage) {
412
- page = {
413
- before_id: items[items.length - 1].id,
414
- limit: limit,
415
- };
416
- }
417
- for (let item of items) {
418
- yield yield __await(item);
419
- }
420
- }
421
- });
422
- },
423
- /** Update attributes of an tunnel authtoken credential by ID */
424
- update: arg =>
425
- this.rest
426
- .url(`/credentials/${arg.id}`)
427
- .patch(serializeMap(arg))
428
- .json()
429
- .then(onFulfilled, onRejected),
430
- };
431
- this.EndpointConfigurations = {
432
- /** Create a new endpoint configuration */
433
- create: arg =>
434
- this.rest
435
- .url(`/endpoint_configurations`)
436
- .post(serializeMap(arg))
437
- .json()
438
- .then(onFulfilled, onRejected),
439
- /** Delete an endpoint configuration. This operation will fail if the endpoint configuration is still referenced by any reserved domain or reserved address. */
440
- delete: arg =>
441
- this.rest
442
- .url(`/endpoint_configurations/${arg.id}`)
443
- .delete()
444
- .json()
445
- .then(onFulfilled, onRejected),
446
- /** Returns detailed information about an endpoint configuration */
447
- get: arg =>
448
- this.rest
449
- .url(`/endpoint_configurations/${arg.id}`)
450
- .get()
451
- .json()
452
- .then(onFulfilled, onRejected),
453
- /** Returns a list of all endpoint configurations on this account */
454
- list: () =>
455
- __awaiter(this, void 0, void 0, function* () {
456
- var e_4, _k;
457
- const array = [];
458
- try {
459
- for (
460
- var _l = __asyncValues(this.EndpointConfigurations._asyncList()),
461
- _m;
462
- (_m = yield _l.next()), !_m.done;
463
-
464
- ) {
465
- let item = _m.value;
466
- array.push(item);
467
- }
468
- } catch (e_4_1) {
469
- e_4 = { error: e_4_1 };
470
- } finally {
471
- try {
472
- if (_m && !_m.done && (_k = _l.return)) yield _k.call(_l);
473
- } finally {
474
- if (e_4) throw e_4.error;
475
- }
476
- }
477
- return array;
478
- }),
479
- _pagedList: arg =>
480
- this.rest
481
- .url(`/endpoint_configurations`)
482
- .query(arg)
483
- .get()
484
- .json()
485
- .then(onFulfilled, onRejected),
486
- _asyncList: function () {
487
- return __asyncGenerator(this, arguments, function* () {
488
- const limit = '100';
489
- let nextPage = 'initial loop';
490
- let page = { limit: limit };
491
- while (nextPage) {
492
- const pagedList = yield __await(this._pagedList(page));
493
- nextPage = pagedList.next_page_uri;
494
- const items = pagedList.endpoint_configurations;
495
- if (nextPage) {
496
- page = {
497
- before_id: items[items.length - 1].id,
498
- limit: limit,
499
- };
500
- }
501
- for (let item of items) {
502
- yield yield __await(item);
503
- }
504
- }
505
- });
506
- },
507
- /** Updates an endpoint configuration. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API. */
508
- update: arg =>
509
- this.rest
510
- .url(`/endpoint_configurations/${arg.id}`)
511
- .patch(serializeMap(arg))
512
- .json()
513
- .then(onFulfilled, onRejected),
514
- };
515
- this.EventStreams = {
516
- /** Create a new Event Stream. It will not apply to anything until you associate it with one or more Endpoint Configs. */
517
- create: arg =>
518
- this.rest
519
- .url(`/event_streams`)
520
- .post(serializeMap(arg))
521
- .json()
522
- .then(onFulfilled, onRejected),
523
- /** Delete an Event Stream. Associated Event Destinations will be preserved. */
524
- delete: arg =>
525
- this.rest
526
- .url(`/event_streams/${arg.id}`)
527
- .delete()
528
- .json()
529
- .then(onFulfilled, onRejected),
530
- /** Get detailed information about an Event Stream by ID. */
531
- get: arg =>
532
- this.rest
533
- .url(`/event_streams/${arg.id}`)
534
- .get()
535
- .json()
536
- .then(onFulfilled, onRejected),
537
- /** List all Event Streams available on this account. */
538
- list: () =>
539
- __awaiter(this, void 0, void 0, function* () {
540
- var e_5, _o;
541
- const array = [];
542
- try {
543
- for (
544
- var _p = __asyncValues(this.EventStreams._asyncList()), _q;
545
- (_q = yield _p.next()), !_q.done;
546
-
547
- ) {
548
- let item = _q.value;
549
- array.push(item);
550
- }
551
- } catch (e_5_1) {
552
- e_5 = { error: e_5_1 };
553
- } finally {
554
- try {
555
- if (_q && !_q.done && (_o = _p.return)) yield _o.call(_p);
556
- } finally {
557
- if (e_5) throw e_5.error;
558
- }
559
- }
560
- return array;
561
- }),
562
- _pagedList: arg =>
563
- this.rest
564
- .url(`/event_streams`)
565
- .query(arg)
566
- .get()
567
- .json()
568
- .then(onFulfilled, onRejected),
569
- _asyncList: function () {
570
- return __asyncGenerator(this, arguments, function* () {
571
- const limit = '100';
572
- let nextPage = 'initial loop';
573
- let page = { limit: limit };
574
- while (nextPage) {
575
- const pagedList = yield __await(this._pagedList(page));
576
- nextPage = pagedList.next_page_uri;
577
- const items = pagedList.event_streams;
578
- if (nextPage) {
579
- page = {
580
- before_id: items[items.length - 1].id,
581
- limit: limit,
582
- };
583
- }
584
- for (let item of items) {
585
- yield yield __await(item);
586
- }
587
- }
588
- });
589
- },
590
- /** Update attributes of an Event Stream by ID. */
591
- update: arg =>
592
- this.rest
593
- .url(`/event_streams/${arg.id}`)
594
- .patch(serializeMap(arg))
595
- .json()
596
- .then(onFulfilled, onRejected),
597
- };
598
- this.EventDestinations = {
599
- /** 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. */
600
- create: arg =>
601
- this.rest
602
- .url(`/event_destinations`)
603
- .post(serializeMap(arg))
604
- .json()
605
- .then(onFulfilled, onRejected),
606
- /** Delete an Event Destination. If the Event Destination is still referenced by an Event Stream, this will throw an error until that Event Stream has removed that reference. */
607
- delete: arg =>
608
- this.rest
609
- .url(`/event_destinations/${arg.id}`)
610
- .delete()
611
- .json()
612
- .then(onFulfilled, onRejected),
613
- /** Get detailed information about an Event Destination by ID. */
614
- get: arg =>
615
- this.rest
616
- .url(`/event_destinations/${arg.id}`)
617
- .get()
618
- .json()
619
- .then(onFulfilled, onRejected),
620
- /** List all Event Destinations on this account. */
621
- list: () =>
622
- __awaiter(this, void 0, void 0, function* () {
623
- var e_6, _r;
624
- const array = [];
625
- try {
626
- for (
627
- var _s = __asyncValues(this.EventDestinations._asyncList()), _t;
628
- (_t = yield _s.next()), !_t.done;
629
-
630
- ) {
631
- let item = _t.value;
632
- array.push(item);
633
- }
634
- } catch (e_6_1) {
635
- e_6 = { error: e_6_1 };
636
- } finally {
637
- try {
638
- if (_t && !_t.done && (_r = _s.return)) yield _r.call(_s);
639
- } finally {
640
- if (e_6) throw e_6.error;
641
- }
642
- }
643
- return array;
644
- }),
645
- _pagedList: arg =>
646
- this.rest
647
- .url(`/event_destinations`)
648
- .query(arg)
649
- .get()
650
- .json()
651
- .then(onFulfilled, onRejected),
652
- _asyncList: function () {
653
- return __asyncGenerator(this, arguments, function* () {
654
- const limit = '100';
655
- let nextPage = 'initial loop';
656
- let page = { limit: limit };
657
- while (nextPage) {
658
- const pagedList = yield __await(this._pagedList(page));
659
- nextPage = pagedList.next_page_uri;
660
- const items = pagedList.event_destinations;
661
- if (nextPage) {
662
- page = {
663
- before_id: items[items.length - 1].id,
664
- limit: limit,
665
- };
666
- }
667
- for (let item of items) {
668
- yield yield __await(item);
669
- }
670
- }
671
- });
672
- },
673
- /** Update attributes of an Event Destination. */
674
- update: arg =>
675
- this.rest
676
- .url(`/event_destinations/${arg.id}`)
677
- .patch(serializeMap(arg))
678
- .json()
679
- .then(onFulfilled, onRejected),
680
- };
681
- this.EventSubscriptions = {
682
- /** Create an Event Subscription. */
683
- create: arg =>
684
- this.rest
685
- .url(`/event_subscriptions`)
686
- .post(serializeMap(arg))
687
- .json()
688
- .then(onFulfilled, onRejected),
689
- /** Delete an Event Subscription. */
690
- delete: arg =>
691
- this.rest
692
- .url(`/event_subscriptions/${arg.id}`)
693
- .delete()
694
- .json()
695
- .then(onFulfilled, onRejected),
696
- /** Get an Event Subscription by ID. */
697
- get: arg =>
698
- this.rest
699
- .url(`/event_subscriptions/${arg.id}`)
700
- .get()
701
- .json()
702
- .then(onFulfilled, onRejected),
703
- /** List this Account's Event Subscriptions. */
704
- list: () =>
705
- __awaiter(this, void 0, void 0, function* () {
706
- var e_7, _u;
707
- const array = [];
708
- try {
709
- for (
710
- var _v = __asyncValues(this.EventSubscriptions._asyncList()), _w;
711
- (_w = yield _v.next()), !_w.done;
712
-
713
- ) {
714
- let item = _w.value;
715
- array.push(item);
716
- }
717
- } catch (e_7_1) {
718
- e_7 = { error: e_7_1 };
719
- } finally {
720
- try {
721
- if (_w && !_w.done && (_u = _v.return)) yield _u.call(_v);
722
- } finally {
723
- if (e_7) throw e_7.error;
724
- }
725
- }
726
- return array;
727
- }),
728
- _pagedList: arg =>
729
- this.rest
730
- .url(`/event_subscriptions`)
731
- .query(arg)
732
- .get()
733
- .json()
734
- .then(onFulfilled, onRejected),
735
- _asyncList: function () {
736
- return __asyncGenerator(this, arguments, function* () {
737
- const limit = '100';
738
- let nextPage = 'initial loop';
739
- let page = { limit: limit };
740
- while (nextPage) {
741
- const pagedList = yield __await(this._pagedList(page));
742
- nextPage = pagedList.next_page_uri;
743
- const items = pagedList.event_subscriptions;
744
- if (nextPage) {
745
- page = {
746
- before_id: items[items.length - 1].id,
747
- limit: limit,
748
- };
749
- }
750
- for (let item of items) {
751
- yield yield __await(item);
752
- }
753
- }
754
- });
755
- },
756
- /** Update an Event Subscription. */
757
- update: arg =>
758
- this.rest
759
- .url(`/event_subscriptions/${arg.id}`)
760
- .patch(serializeMap(arg))
761
- .json()
762
- .then(onFulfilled, onRejected),
763
- };
764
- this.EventSources = {
765
- /** Add an additional type for which this event subscription will trigger */
766
- create: arg =>
767
- this.rest
768
- .url(`/event_subscriptions/${arg.subscription_id}/sources`)
769
- .post(serializeMap(arg))
770
- .json()
771
- .then(onFulfilled, onRejected),
772
- /** Remove a type for which this event subscription will trigger */
773
- delete: arg =>
774
- this.rest
775
- .url(
776
- `/event_subscriptions/${arg.subscription_id}/sources/${arg.type}`
777
- )
778
- .delete()
779
- .json()
780
- .then(onFulfilled, onRejected),
781
- /** Get the details for a given type that triggers for the given event subscription */
782
- get: arg =>
783
- this.rest
784
- .url(
785
- `/event_subscriptions/${arg.subscription_id}/sources/${arg.type}`
786
- )
787
- .get()
788
- .json()
789
- .then(onFulfilled, onRejected),
790
- /** List the types for which this event subscription will trigger */
791
- list: arg =>
792
- this.rest
793
- .url(`/event_subscriptions/${arg.subscription_id}/sources`)
794
- .get()
795
- .json()
796
- .then(onFulfilled, onRejected),
797
- /** Update the type for which this event subscription will trigger */
798
- update: arg =>
799
- this.rest
800
- .url(
801
- `/event_subscriptions/${arg.subscription_id}/sources/${arg.type}`
802
- )
803
- .patch(serializeMap(arg))
804
- .json()
805
- .then(onFulfilled, onRejected),
806
- };
807
- this.IPPolicies = {
808
- /** 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. */
809
- create: arg =>
810
- this.rest
811
- .url(`/ip_policies`)
812
- .post(serializeMap(arg))
813
- .json()
814
- .then(onFulfilled, onRejected),
815
- /** 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. */
816
- delete: arg =>
817
- this.rest
818
- .url(`/ip_policies/${arg.id}`)
819
- .delete()
820
- .json()
821
- .then(onFulfilled, onRejected),
822
- /** Get detailed information about an IP policy by ID. */
823
- get: arg =>
824
- this.rest
825
- .url(`/ip_policies/${arg.id}`)
826
- .get()
827
- .json()
828
- .then(onFulfilled, onRejected),
829
- /** List all IP policies on this account */
830
- list: () =>
831
- __awaiter(this, void 0, void 0, function* () {
832
- var e_8, _x;
833
- const array = [];
834
- try {
835
- for (
836
- var _y = __asyncValues(this.IPPolicies._asyncList()), _z;
837
- (_z = yield _y.next()), !_z.done;
838
-
839
- ) {
840
- let item = _z.value;
841
- array.push(item);
842
- }
843
- } catch (e_8_1) {
844
- e_8 = { error: e_8_1 };
845
- } finally {
846
- try {
847
- if (_z && !_z.done && (_x = _y.return)) yield _x.call(_y);
848
- } finally {
849
- if (e_8) throw e_8.error;
850
- }
851
- }
852
- return array;
853
- }),
854
- _pagedList: arg =>
855
- this.rest
856
- .url(`/ip_policies`)
857
- .query(arg)
858
- .get()
859
- .json()
860
- .then(onFulfilled, onRejected),
861
- _asyncList: function () {
862
- return __asyncGenerator(this, arguments, function* () {
863
- const limit = '100';
864
- let nextPage = 'initial loop';
865
- let page = { limit: limit };
866
- while (nextPage) {
867
- const pagedList = yield __await(this._pagedList(page));
868
- nextPage = pagedList.next_page_uri;
869
- const items = pagedList.ip_policies;
870
- if (nextPage) {
871
- page = {
872
- before_id: items[items.length - 1].id,
873
- limit: limit,
874
- };
875
- }
876
- for (let item of items) {
877
- yield yield __await(item);
878
- }
879
- }
880
- });
881
- },
882
- /** Update attributes of an IP policy by ID */
883
- update: arg =>
884
- this.rest
885
- .url(`/ip_policies/${arg.id}`)
886
- .patch(serializeMap(arg))
887
- .json()
888
- .then(onFulfilled, onRejected),
889
- };
890
- this.IPPolicyRules = {
891
- /** Create a new IP policy rule attached to an IP Policy. */
892
- create: arg =>
893
- this.rest
894
- .url(`/ip_policy_rules`)
895
- .post(serializeMap(arg))
896
- .json()
897
- .then(onFulfilled, onRejected),
898
- /** Delete an IP policy rule. */
899
- delete: arg =>
900
- this.rest
901
- .url(`/ip_policy_rules/${arg.id}`)
902
- .delete()
903
- .json()
904
- .then(onFulfilled, onRejected),
905
- /** Get detailed information about an IP policy rule by ID. */
906
- get: arg =>
907
- this.rest
908
- .url(`/ip_policy_rules/${arg.id}`)
909
- .get()
910
- .json()
911
- .then(onFulfilled, onRejected),
912
- /** List all IP policy rules on this account */
913
- list: () =>
914
- __awaiter(this, void 0, void 0, function* () {
915
- var e_9, _0;
916
- const array = [];
917
- try {
918
- for (
919
- var _1 = __asyncValues(this.IPPolicyRules._asyncList()), _2;
920
- (_2 = yield _1.next()), !_2.done;
921
-
922
- ) {
923
- let item = _2.value;
924
- array.push(item);
925
- }
926
- } catch (e_9_1) {
927
- e_9 = { error: e_9_1 };
928
- } finally {
929
- try {
930
- if (_2 && !_2.done && (_0 = _1.return)) yield _0.call(_1);
931
- } finally {
932
- if (e_9) throw e_9.error;
933
- }
934
- }
935
- return array;
936
- }),
937
- _pagedList: arg =>
938
- this.rest
939
- .url(`/ip_policy_rules`)
940
- .query(arg)
941
- .get()
942
- .json()
943
- .then(onFulfilled, onRejected),
944
- _asyncList: function () {
945
- return __asyncGenerator(this, arguments, function* () {
946
- const limit = '100';
947
- let nextPage = 'initial loop';
948
- let page = { limit: limit };
949
- while (nextPage) {
950
- const pagedList = yield __await(this._pagedList(page));
951
- nextPage = pagedList.next_page_uri;
952
- const items = pagedList.ip_policy_rules;
953
- if (nextPage) {
954
- page = {
955
- before_id: items[items.length - 1].id,
956
- limit: limit,
957
- };
958
- }
959
- for (let item of items) {
960
- yield yield __await(item);
961
- }
962
- }
963
- });
964
- },
965
- /** Update attributes of an IP policy rule by ID */
966
- update: arg =>
967
- this.rest
968
- .url(`/ip_policy_rules/${arg.id}`)
969
- .patch(serializeMap(arg))
970
- .json()
971
- .then(onFulfilled, onRejected),
972
- };
973
- this.IPRestrictions = {
974
- /** Create a new IP restriction */
975
- create: arg =>
976
- this.rest
977
- .url(`/ip_restrictions`)
978
- .post(serializeMap(arg))
979
- .json()
980
- .then(onFulfilled, onRejected),
981
- /** Delete an IP restriction */
982
- delete: arg =>
983
- this.rest
984
- .url(`/ip_restrictions/${arg.id}`)
985
- .delete()
986
- .json()
987
- .then(onFulfilled, onRejected),
988
- /** Get detailed information about an IP restriction */
989
- get: arg =>
990
- this.rest
991
- .url(`/ip_restrictions/${arg.id}`)
992
- .get()
993
- .json()
994
- .then(onFulfilled, onRejected),
995
- /** List all IP restrictions on this account */
996
- list: () =>
997
- __awaiter(this, void 0, void 0, function* () {
998
- var e_10, _3;
999
- const array = [];
1000
- try {
1001
- for (
1002
- var _4 = __asyncValues(this.IPRestrictions._asyncList()), _5;
1003
- (_5 = yield _4.next()), !_5.done;
1004
-
1005
- ) {
1006
- let item = _5.value;
1007
- array.push(item);
1008
- }
1009
- } catch (e_10_1) {
1010
- e_10 = { error: e_10_1 };
1011
- } finally {
1012
- try {
1013
- if (_5 && !_5.done && (_3 = _4.return)) yield _3.call(_4);
1014
- } finally {
1015
- if (e_10) throw e_10.error;
1016
- }
1017
- }
1018
- return array;
1019
- }),
1020
- _pagedList: arg =>
1021
- this.rest
1022
- .url(`/ip_restrictions`)
1023
- .query(arg)
1024
- .get()
1025
- .json()
1026
- .then(onFulfilled, onRejected),
1027
- _asyncList: function () {
1028
- return __asyncGenerator(this, arguments, function* () {
1029
- const limit = '100';
1030
- let nextPage = 'initial loop';
1031
- let page = { limit: limit };
1032
- while (nextPage) {
1033
- const pagedList = yield __await(this._pagedList(page));
1034
- nextPage = pagedList.next_page_uri;
1035
- const items = pagedList.ip_restrictions;
1036
- if (nextPage) {
1037
- page = {
1038
- before_id: items[items.length - 1].id,
1039
- limit: limit,
1040
- };
1041
- }
1042
- for (let item of items) {
1043
- yield yield __await(item);
1044
- }
1045
- }
1046
- });
1047
- },
1048
- /** Update attributes of an IP restriction by ID */
1049
- update: arg =>
1050
- this.rest
1051
- .url(`/ip_restrictions/${arg.id}`)
1052
- .patch(serializeMap(arg))
1053
- .json()
1054
- .then(onFulfilled, onRejected),
1055
- };
1056
- this.IPWhitelist = {
1057
- /** Create a new IP whitelist entry that will restrict traffic to all tunnel endpoints on the account. */
1058
- create: arg =>
1059
- this.rest
1060
- .url(`/ip_whitelist`)
1061
- .post(serializeMap(arg))
1062
- .json()
1063
- .then(onFulfilled, onRejected),
1064
- /** Delete an IP whitelist entry. */
1065
- delete: arg =>
1066
- this.rest
1067
- .url(`/ip_whitelist/${arg.id}`)
1068
- .delete()
1069
- .json()
1070
- .then(onFulfilled, onRejected),
1071
- /** Get detailed information about an IP whitelist entry by ID. */
1072
- get: arg =>
1073
- this.rest
1074
- .url(`/ip_whitelist/${arg.id}`)
1075
- .get()
1076
- .json()
1077
- .then(onFulfilled, onRejected),
1078
- /** List all IP whitelist entries on this account */
1079
- list: () =>
1080
- __awaiter(this, void 0, void 0, function* () {
1081
- var e_11, _6;
1082
- const array = [];
1083
- try {
1084
- for (
1085
- var _7 = __asyncValues(this.IPWhitelist._asyncList()), _8;
1086
- (_8 = yield _7.next()), !_8.done;
1087
-
1088
- ) {
1089
- let item = _8.value;
1090
- array.push(item);
1091
- }
1092
- } catch (e_11_1) {
1093
- e_11 = { error: e_11_1 };
1094
- } finally {
1095
- try {
1096
- if (_8 && !_8.done && (_6 = _7.return)) yield _6.call(_7);
1097
- } finally {
1098
- if (e_11) throw e_11.error;
1099
- }
1100
- }
1101
- return array;
1102
- }),
1103
- _pagedList: arg =>
1104
- this.rest
1105
- .url(`/ip_whitelist`)
1106
- .query(arg)
1107
- .get()
1108
- .json()
1109
- .then(onFulfilled, onRejected),
1110
- _asyncList: function () {
1111
- return __asyncGenerator(this, arguments, function* () {
1112
- const limit = '100';
1113
- let nextPage = 'initial loop';
1114
- let page = { limit: limit };
1115
- while (nextPage) {
1116
- const pagedList = yield __await(this._pagedList(page));
1117
- nextPage = pagedList.next_page_uri;
1118
- const items = pagedList.whitelist;
1119
- if (nextPage) {
1120
- page = {
1121
- before_id: items[items.length - 1].id,
1122
- limit: limit,
1123
- };
1124
- }
1125
- for (let item of items) {
1126
- yield yield __await(item);
1127
- }
1128
- }
1129
- });
1130
- },
1131
- /** Update attributes of an IP whitelist entry by ID */
1132
- update: arg =>
1133
- this.rest
1134
- .url(`/ip_whitelist/${arg.id}`)
1135
- .patch(serializeMap(arg))
1136
- .json()
1137
- .then(onFulfilled, onRejected),
1138
- };
1139
- this.EndpointLoggingModule = {
1140
- replace: arg =>
1141
- this.rest
1142
- .url(`/endpoint_configurations/${arg.id}/logging`)
1143
- .put(serializeMap(arg))
1144
- .json()
1145
- .then(onFulfilled, onRejected),
1146
- get: arg =>
1147
- this.rest
1148
- .url(`/endpoint_configurations/${arg.id}/logging`)
1149
- .get()
1150
- .json()
1151
- .then(onFulfilled, onRejected),
1152
- delete: arg =>
1153
- this.rest
1154
- .url(`/endpoint_configurations/${arg.id}/logging`)
1155
- .delete()
1156
- .json()
1157
- .then(onFulfilled, onRejected),
1158
- };
1159
- this.EndpointCircuitBreakerModule = {
1160
- replace: arg =>
1161
- this.rest
1162
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1163
- .put(serializeMap(arg))
1164
- .json()
1165
- .then(onFulfilled, onRejected),
1166
- get: arg =>
1167
- this.rest
1168
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1169
- .get()
1170
- .json()
1171
- .then(onFulfilled, onRejected),
1172
- delete: arg =>
1173
- this.rest
1174
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1175
- .delete()
1176
- .json()
1177
- .then(onFulfilled, onRejected),
1178
- };
1179
- this.EndpointCompressionModule = {
1180
- replace: arg =>
1181
- this.rest
1182
- .url(`/endpoint_configurations/${arg.id}/compression`)
1183
- .put(serializeMap(arg))
1184
- .json()
1185
- .then(onFulfilled, onRejected),
1186
- get: arg =>
1187
- this.rest
1188
- .url(`/endpoint_configurations/${arg.id}/compression`)
1189
- .get()
1190
- .json()
1191
- .then(onFulfilled, onRejected),
1192
- delete: arg =>
1193
- this.rest
1194
- .url(`/endpoint_configurations/${arg.id}/compression`)
1195
- .delete()
1196
- .json()
1197
- .then(onFulfilled, onRejected),
1198
- };
1199
- this.EndpointTLSTerminationModule = {
1200
- replace: arg =>
1201
- this.rest
1202
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1203
- .put(serializeMap(arg))
1204
- .json()
1205
- .then(onFulfilled, onRejected),
1206
- get: arg =>
1207
- this.rest
1208
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1209
- .get()
1210
- .json()
1211
- .then(onFulfilled, onRejected),
1212
- delete: arg =>
1213
- this.rest
1214
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1215
- .delete()
1216
- .json()
1217
- .then(onFulfilled, onRejected),
1218
- };
1219
- this.EndpointIPPolicyModule = {
1220
- replace: arg =>
1221
- this.rest
1222
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1223
- .put(serializeMap(arg))
1224
- .json()
1225
- .then(onFulfilled, onRejected),
1226
- get: arg =>
1227
- this.rest
1228
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1229
- .get()
1230
- .json()
1231
- .then(onFulfilled, onRejected),
1232
- delete: arg =>
1233
- this.rest
1234
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1235
- .delete()
1236
- .json()
1237
- .then(onFulfilled, onRejected),
1238
- };
1239
- this.EndpointMutualTLSModule = {
1240
- replace: arg =>
1241
- this.rest
1242
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1243
- .put(serializeMap(arg))
1244
- .json()
1245
- .then(onFulfilled, onRejected),
1246
- get: arg =>
1247
- this.rest
1248
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1249
- .get()
1250
- .json()
1251
- .then(onFulfilled, onRejected),
1252
- delete: arg =>
1253
- this.rest
1254
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1255
- .delete()
1256
- .json()
1257
- .then(onFulfilled, onRejected),
1258
- };
1259
- this.EndpointRequestHeadersModule = {
1260
- replace: arg =>
1261
- this.rest
1262
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1263
- .put(serializeMap(arg))
1264
- .json()
1265
- .then(onFulfilled, onRejected),
1266
- get: arg =>
1267
- this.rest
1268
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1269
- .get()
1270
- .json()
1271
- .then(onFulfilled, onRejected),
1272
- delete: arg =>
1273
- this.rest
1274
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1275
- .delete()
1276
- .json()
1277
- .then(onFulfilled, onRejected),
1278
- };
1279
- this.EndpointResponseHeadersModule = {
1280
- replace: arg =>
1281
- this.rest
1282
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
1283
- .put(serializeMap(arg))
1284
- .json()
1285
- .then(onFulfilled, onRejected),
1286
- get: arg =>
1287
- this.rest
1288
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
1289
- .get()
1290
- .json()
1291
- .then(onFulfilled, onRejected),
1292
- delete: arg =>
1293
- this.rest
1294
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
1295
- .delete()
1296
- .json()
1297
- .then(onFulfilled, onRejected),
1298
- };
1299
- this.EndpointOAuthModule = {
1300
- replace: arg =>
1301
- this.rest
1302
- .url(`/endpoint_configurations/${arg.id}/oauth`)
1303
- .put(serializeMap(arg))
1304
- .json()
1305
- .then(onFulfilled, onRejected),
1306
- get: arg =>
1307
- this.rest
1308
- .url(`/endpoint_configurations/${arg.id}/oauth`)
1309
- .get()
1310
- .json()
1311
- .then(onFulfilled, onRejected),
1312
- delete: arg =>
1313
- this.rest
1314
- .url(`/endpoint_configurations/${arg.id}/oauth`)
1315
- .delete()
1316
- .json()
1317
- .then(onFulfilled, onRejected),
1318
- };
1319
- this.EndpointWebhookValidationModule = {
1320
- replace: arg =>
1321
- this.rest
1322
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
1323
- .put(serializeMap(arg))
1324
- .json()
1325
- .then(onFulfilled, onRejected),
1326
- get: arg =>
1327
- this.rest
1328
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
1329
- .get()
1330
- .json()
1331
- .then(onFulfilled, onRejected),
1332
- delete: arg =>
1333
- this.rest
1334
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
1335
- .delete()
1336
- .json()
1337
- .then(onFulfilled, onRejected),
1338
- };
1339
- this.EndpointSAMLModule = {
1340
- replace: arg =>
1341
- this.rest
1342
- .url(`/endpoint_configurations/${arg.id}/saml`)
1343
- .put(serializeMap(arg))
1344
- .json()
1345
- .then(onFulfilled, onRejected),
1346
- get: arg =>
1347
- this.rest
1348
- .url(`/endpoint_configurations/${arg.id}/saml`)
1349
- .get()
1350
- .json()
1351
- .then(onFulfilled, onRejected),
1352
- delete: arg =>
1353
- this.rest
1354
- .url(`/endpoint_configurations/${arg.id}/saml`)
1355
- .delete()
1356
- .json()
1357
- .then(onFulfilled, onRejected),
1358
- };
1359
- this.EndpointOIDCModule = {
1360
- replace: arg =>
1361
- this.rest
1362
- .url(`/endpoint_configurations/${arg.id}/oidc`)
1363
- .put(serializeMap(arg))
1364
- .json()
1365
- .then(onFulfilled, onRejected),
1366
- get: arg =>
1367
- this.rest
1368
- .url(`/endpoint_configurations/${arg.id}/oidc`)
1369
- .get()
1370
- .json()
1371
- .then(onFulfilled, onRejected),
1372
- delete: arg =>
1373
- this.rest
1374
- .url(`/endpoint_configurations/${arg.id}/oidc`)
1375
- .delete()
1376
- .json()
1377
- .then(onFulfilled, onRejected),
1378
- };
1379
- this.ReservedAddrs = {
1380
- /** Create a new reserved address. */
1381
- create: arg =>
1382
- this.rest
1383
- .url(`/reserved_addrs`)
1384
- .post(serializeMap(arg))
1385
- .json()
1386
- .then(onFulfilled, onRejected),
1387
- /** Delete a reserved address. */
1388
- delete: arg =>
1389
- this.rest
1390
- .url(`/reserved_addrs/${arg.id}`)
1391
- .delete()
1392
- .json()
1393
- .then(onFulfilled, onRejected),
1394
- /** Get the details of a reserved address. */
1395
- get: arg =>
1396
- this.rest
1397
- .url(`/reserved_addrs/${arg.id}`)
1398
- .get()
1399
- .json()
1400
- .then(onFulfilled, onRejected),
1401
- /** List all reserved addresses on this account. */
1402
- list: () =>
1403
- __awaiter(this, void 0, void 0, function* () {
1404
- var e_12, _9;
1405
- const array = [];
1406
- try {
1407
- for (
1408
- var _10 = __asyncValues(this.ReservedAddrs._asyncList()), _11;
1409
- (_11 = yield _10.next()), !_11.done;
1410
-
1411
- ) {
1412
- let item = _11.value;
1413
- array.push(item);
1414
- }
1415
- } catch (e_12_1) {
1416
- e_12 = { error: e_12_1 };
1417
- } finally {
1418
- try {
1419
- if (_11 && !_11.done && (_9 = _10.return)) yield _9.call(_10);
1420
- } finally {
1421
- if (e_12) throw e_12.error;
1422
- }
1423
- }
1424
- return array;
1425
- }),
1426
- _pagedList: arg =>
1427
- this.rest
1428
- .url(`/reserved_addrs`)
1429
- .query(arg)
1430
- .get()
1431
- .json()
1432
- .then(onFulfilled, onRejected),
1433
- _asyncList: function () {
1434
- return __asyncGenerator(this, arguments, function* () {
1435
- const limit = '100';
1436
- let nextPage = 'initial loop';
1437
- let page = { limit: limit };
1438
- while (nextPage) {
1439
- const pagedList = yield __await(this._pagedList(page));
1440
- nextPage = pagedList.next_page_uri;
1441
- const items = pagedList.reserved_addrs;
1442
- if (nextPage) {
1443
- page = {
1444
- before_id: items[items.length - 1].id,
1445
- limit: limit,
1446
- };
1447
- }
1448
- for (let item of items) {
1449
- yield yield __await(item);
1450
- }
1451
- }
1452
- });
1453
- },
1454
- /** Update the attributes of a reserved address. */
1455
- update: arg =>
1456
- this.rest
1457
- .url(`/reserved_addrs/${arg.id}`)
1458
- .patch(serializeMap(arg))
1459
- .json()
1460
- .then(onFulfilled, onRejected),
1461
- /** Detach the endpoint configuration attached to a reserved address. */
1462
- deleteEndpointConfig: arg =>
1463
- this.rest
1464
- .url(`/reserved_addrs/${arg.id}/endpoint_configuration`)
1465
- .delete()
1466
- .json()
1467
- .then(onFulfilled, onRejected),
1468
- };
1469
- this.ReservedDomains = {
1470
- /** Create a new reserved domain. */
1471
- create: arg =>
1472
- this.rest
1473
- .url(`/reserved_domains`)
1474
- .post(serializeMap(arg))
1475
- .json()
1476
- .then(onFulfilled, onRejected),
1477
- /** Delete a reserved domain. */
1478
- delete: arg =>
1479
- this.rest
1480
- .url(`/reserved_domains/${arg.id}`)
1481
- .delete()
1482
- .json()
1483
- .then(onFulfilled, onRejected),
1484
- /** Get the details of a reserved domain. */
1485
- get: arg =>
1486
- this.rest
1487
- .url(`/reserved_domains/${arg.id}`)
1488
- .get()
1489
- .json()
1490
- .then(onFulfilled, onRejected),
1491
- /** List all reserved domains on this account. */
1492
- list: () =>
1493
- __awaiter(this, void 0, void 0, function* () {
1494
- var e_13, _12;
1495
- const array = [];
1496
- try {
1497
- for (
1498
- var _13 = __asyncValues(this.ReservedDomains._asyncList()), _14;
1499
- (_14 = yield _13.next()), !_14.done;
1500
-
1501
- ) {
1502
- let item = _14.value;
1503
- array.push(item);
1504
- }
1505
- } catch (e_13_1) {
1506
- e_13 = { error: e_13_1 };
1507
- } finally {
1508
- try {
1509
- if (_14 && !_14.done && (_12 = _13.return)) yield _12.call(_13);
1510
- } finally {
1511
- if (e_13) throw e_13.error;
1512
- }
1513
- }
1514
- return array;
1515
- }),
1516
- _pagedList: arg =>
1517
- this.rest
1518
- .url(`/reserved_domains`)
1519
- .query(arg)
1520
- .get()
1521
- .json()
1522
- .then(onFulfilled, onRejected),
1523
- _asyncList: function () {
1524
- return __asyncGenerator(this, arguments, function* () {
1525
- const limit = '100';
1526
- let nextPage = 'initial loop';
1527
- let page = { limit: limit };
1528
- while (nextPage) {
1529
- const pagedList = yield __await(this._pagedList(page));
1530
- nextPage = pagedList.next_page_uri;
1531
- const items = pagedList.reserved_domains;
1532
- if (nextPage) {
1533
- page = {
1534
- before_id: items[items.length - 1].id,
1535
- limit: limit,
1536
- };
1537
- }
1538
- for (let item of items) {
1539
- yield yield __await(item);
1540
- }
1541
- }
1542
- });
1543
- },
1544
- /** Update the attributes of a reserved domain. */
1545
- update: arg =>
1546
- this.rest
1547
- .url(`/reserved_domains/${arg.id}`)
1548
- .patch(serializeMap(arg))
1549
- .json()
1550
- .then(onFulfilled, onRejected),
1551
- /** Detach the certificate management policy attached to a reserved domain. */
1552
- deleteCertificateManagementPolicy: arg =>
1553
- this.rest
1554
- .url(`/reserved_domains/${arg.id}/certificate_management_policy`)
1555
- .delete()
1556
- .json()
1557
- .then(onFulfilled, onRejected),
1558
- /** Detach the certificate attached to a reserved domain. */
1559
- deleteCertificate: arg =>
1560
- this.rest
1561
- .url(`/reserved_domains/${arg.id}/certificate`)
1562
- .delete()
1563
- .json()
1564
- .then(onFulfilled, onRejected),
1565
- /** Detach the http endpoint configuration attached to a reserved domain. */
1566
- deleteHTTPEndpointConfig: arg =>
1567
- this.rest
1568
- .url(`/reserved_domains/${arg.id}/http_endpoint_configuration`)
1569
- .delete()
1570
- .json()
1571
- .then(onFulfilled, onRejected),
1572
- /** Detach the https endpoint configuration attached to a reserved domain. */
1573
- deleteHTTPSEndpointConfig: arg =>
1574
- this.rest
1575
- .url(`/reserved_domains/${arg.id}/https_endpoint_configuration`)
1576
- .delete()
1577
- .json()
1578
- .then(onFulfilled, onRejected),
1579
- };
1580
- this.SSHCertificateAuthorities = {
1581
- /** Create a new SSH Certificate Authority */
1582
- create: arg =>
1583
- this.rest
1584
- .url(`/ssh_certificate_authorities`)
1585
- .post(serializeMap(arg))
1586
- .json()
1587
- .then(onFulfilled, onRejected),
1588
- /** Delete an SSH Certificate Authority */
1589
- delete: arg =>
1590
- this.rest
1591
- .url(`/ssh_certificate_authorities/${arg.id}`)
1592
- .delete()
1593
- .json()
1594
- .then(onFulfilled, onRejected),
1595
- /** Get detailed information about an SSH Certficate Authority */
1596
- get: arg =>
1597
- this.rest
1598
- .url(`/ssh_certificate_authorities/${arg.id}`)
1599
- .get()
1600
- .json()
1601
- .then(onFulfilled, onRejected),
1602
- /** List all SSH Certificate Authorities on this account */
1603
- list: () =>
1604
- __awaiter(this, void 0, void 0, function* () {
1605
- var e_14, _15;
1606
- const array = [];
1607
- try {
1608
- for (
1609
- var _16 = __asyncValues(
1610
- this.SSHCertificateAuthorities._asyncList()
1611
- ),
1612
- _17;
1613
- (_17 = yield _16.next()), !_17.done;
1614
-
1615
- ) {
1616
- let item = _17.value;
1617
- array.push(item);
1618
- }
1619
- } catch (e_14_1) {
1620
- e_14 = { error: e_14_1 };
1621
- } finally {
1622
- try {
1623
- if (_17 && !_17.done && (_15 = _16.return)) yield _15.call(_16);
1624
- } finally {
1625
- if (e_14) throw e_14.error;
1626
- }
1627
- }
1628
- return array;
1629
- }),
1630
- _pagedList: arg =>
1631
- this.rest
1632
- .url(`/ssh_certificate_authorities`)
1633
- .query(arg)
1634
- .get()
1635
- .json()
1636
- .then(onFulfilled, onRejected),
1637
- _asyncList: function () {
1638
- return __asyncGenerator(this, arguments, function* () {
1639
- const limit = '100';
1640
- let nextPage = 'initial loop';
1641
- let page = { limit: limit };
1642
- while (nextPage) {
1643
- const pagedList = yield __await(this._pagedList(page));
1644
- nextPage = pagedList.next_page_uri;
1645
- const items = pagedList.ssh_certificate_authorities;
1646
- if (nextPage) {
1647
- page = {
1648
- before_id: items[items.length - 1].id,
1649
- limit: limit,
1650
- };
1651
- }
1652
- for (let item of items) {
1653
- yield yield __await(item);
1654
- }
1655
- }
1656
- });
1657
- },
1658
- /** Update an SSH Certificate Authority */
1659
- update: arg =>
1660
- this.rest
1661
- .url(`/ssh_certificate_authorities/${arg.id}`)
1662
- .patch(serializeMap(arg))
1663
- .json()
1664
- .then(onFulfilled, onRejected),
1665
- };
1666
- this.SSHCredentials = {
1667
- /** 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. */
1668
- create: arg =>
1669
- this.rest
1670
- .url(`/ssh_credentials`)
1671
- .post(serializeMap(arg))
1672
- .json()
1673
- .then(onFulfilled, onRejected),
1674
- /** Delete an ssh_credential by ID */
1675
- delete: arg =>
1676
- this.rest
1677
- .url(`/ssh_credentials/${arg.id}`)
1678
- .delete()
1679
- .json()
1680
- .then(onFulfilled, onRejected),
1681
- /** Get detailed information about an ssh_credential */
1682
- get: arg =>
1683
- this.rest
1684
- .url(`/ssh_credentials/${arg.id}`)
1685
- .get()
1686
- .json()
1687
- .then(onFulfilled, onRejected),
1688
- /** List all ssh credentials on this account */
1689
- list: () =>
1690
- __awaiter(this, void 0, void 0, function* () {
1691
- var e_15, _18;
1692
- const array = [];
1693
- try {
1694
- for (
1695
- var _19 = __asyncValues(this.SSHCredentials._asyncList()), _20;
1696
- (_20 = yield _19.next()), !_20.done;
1697
-
1698
- ) {
1699
- let item = _20.value;
1700
- array.push(item);
1701
- }
1702
- } catch (e_15_1) {
1703
- e_15 = { error: e_15_1 };
1704
- } finally {
1705
- try {
1706
- if (_20 && !_20.done && (_18 = _19.return)) yield _18.call(_19);
1707
- } finally {
1708
- if (e_15) throw e_15.error;
1709
- }
1710
- }
1711
- return array;
1712
- }),
1713
- _pagedList: arg =>
1714
- this.rest
1715
- .url(`/ssh_credentials`)
1716
- .query(arg)
1717
- .get()
1718
- .json()
1719
- .then(onFulfilled, onRejected),
1720
- _asyncList: function () {
1721
- return __asyncGenerator(this, arguments, function* () {
1722
- const limit = '100';
1723
- let nextPage = 'initial loop';
1724
- let page = { limit: limit };
1725
- while (nextPage) {
1726
- const pagedList = yield __await(this._pagedList(page));
1727
- nextPage = pagedList.next_page_uri;
1728
- const items = pagedList.ssh_credentials;
1729
- if (nextPage) {
1730
- page = {
1731
- before_id: items[items.length - 1].id,
1732
- limit: limit,
1733
- };
1734
- }
1735
- for (let item of items) {
1736
- yield yield __await(item);
1737
- }
1738
- }
1739
- });
1740
- },
1741
- /** Update attributes of an ssh_credential by ID */
1742
- update: arg =>
1743
- this.rest
1744
- .url(`/ssh_credentials/${arg.id}`)
1745
- .patch(serializeMap(arg))
1746
- .json()
1747
- .then(onFulfilled, onRejected),
1748
- };
1749
- this.SSHHostCertificates = {
1750
- /** Create a new SSH Host Certificate */
1751
- create: arg =>
1752
- this.rest
1753
- .url(`/ssh_host_certificates`)
1754
- .post(serializeMap(arg))
1755
- .json()
1756
- .then(onFulfilled, onRejected),
1757
- /** Delete an SSH Host Certificate */
1758
- delete: arg =>
1759
- this.rest
1760
- .url(`/ssh_host_certificates/${arg.id}`)
1761
- .delete()
1762
- .json()
1763
- .then(onFulfilled, onRejected),
1764
- /** Get detailed information about an SSH Host Certficate */
1765
- get: arg =>
1766
- this.rest
1767
- .url(`/ssh_host_certificates/${arg.id}`)
1768
- .get()
1769
- .json()
1770
- .then(onFulfilled, onRejected),
1771
- /** List all SSH Host Certificates issued on this account */
1772
- list: () =>
1773
- __awaiter(this, void 0, void 0, function* () {
1774
- var e_16, _21;
1775
- const array = [];
1776
- try {
1777
- for (
1778
- var _22 = __asyncValues(this.SSHHostCertificates._asyncList()),
1779
- _23;
1780
- (_23 = yield _22.next()), !_23.done;
1781
-
1782
- ) {
1783
- let item = _23.value;
1784
- array.push(item);
1785
- }
1786
- } catch (e_16_1) {
1787
- e_16 = { error: e_16_1 };
1788
- } finally {
1789
- try {
1790
- if (_23 && !_23.done && (_21 = _22.return)) yield _21.call(_22);
1791
- } finally {
1792
- if (e_16) throw e_16.error;
1793
- }
1794
- }
1795
- return array;
1796
- }),
1797
- _pagedList: arg =>
1798
- this.rest
1799
- .url(`/ssh_host_certificates`)
1800
- .query(arg)
1801
- .get()
1802
- .json()
1803
- .then(onFulfilled, onRejected),
1804
- _asyncList: function () {
1805
- return __asyncGenerator(this, arguments, function* () {
1806
- const limit = '100';
1807
- let nextPage = 'initial loop';
1808
- let page = { limit: limit };
1809
- while (nextPage) {
1810
- const pagedList = yield __await(this._pagedList(page));
1811
- nextPage = pagedList.next_page_uri;
1812
- const items = pagedList.ssh_host_certificates;
1813
- if (nextPage) {
1814
- page = {
1815
- before_id: items[items.length - 1].id,
1816
- limit: limit,
1817
- };
1818
- }
1819
- for (let item of items) {
1820
- yield yield __await(item);
1821
- }
1822
- }
1823
- });
1824
- },
1825
- /** Update an SSH Host Certificate */
1826
- update: arg =>
1827
- this.rest
1828
- .url(`/ssh_host_certificates/${arg.id}`)
1829
- .patch(serializeMap(arg))
1830
- .json()
1831
- .then(onFulfilled, onRejected),
1832
- };
1833
- this.SSHUserCertificates = {
1834
- /** Create a new SSH User Certificate */
1835
- create: arg =>
1836
- this.rest
1837
- .url(`/ssh_user_certificates`)
1838
- .post(serializeMap(arg))
1839
- .json()
1840
- .then(onFulfilled, onRejected),
1841
- /** Delete an SSH User Certificate */
1842
- delete: arg =>
1843
- this.rest
1844
- .url(`/ssh_user_certificates/${arg.id}`)
1845
- .delete()
1846
- .json()
1847
- .then(onFulfilled, onRejected),
1848
- /** Get detailed information about an SSH User Certficate */
1849
- get: arg =>
1850
- this.rest
1851
- .url(`/ssh_user_certificates/${arg.id}`)
1852
- .get()
1853
- .json()
1854
- .then(onFulfilled, onRejected),
1855
- /** List all SSH User Certificates issued on this account */
1856
- list: () =>
1857
- __awaiter(this, void 0, void 0, function* () {
1858
- var e_17, _24;
1859
- const array = [];
1860
- try {
1861
- for (
1862
- var _25 = __asyncValues(this.SSHUserCertificates._asyncList()),
1863
- _26;
1864
- (_26 = yield _25.next()), !_26.done;
1865
-
1866
- ) {
1867
- let item = _26.value;
1868
- array.push(item);
1869
- }
1870
- } catch (e_17_1) {
1871
- e_17 = { error: e_17_1 };
1872
- } finally {
1873
- try {
1874
- if (_26 && !_26.done && (_24 = _25.return)) yield _24.call(_25);
1875
- } finally {
1876
- if (e_17) throw e_17.error;
1877
- }
1878
- }
1879
- return array;
1880
- }),
1881
- _pagedList: arg =>
1882
- this.rest
1883
- .url(`/ssh_user_certificates`)
1884
- .query(arg)
1885
- .get()
1886
- .json()
1887
- .then(onFulfilled, onRejected),
1888
- _asyncList: function () {
1889
- return __asyncGenerator(this, arguments, function* () {
1890
- const limit = '100';
1891
- let nextPage = 'initial loop';
1892
- let page = { limit: limit };
1893
- while (nextPage) {
1894
- const pagedList = yield __await(this._pagedList(page));
1895
- nextPage = pagedList.next_page_uri;
1896
- const items = pagedList.ssh_user_certificates;
1897
- if (nextPage) {
1898
- page = {
1899
- before_id: items[items.length - 1].id,
1900
- limit: limit,
1901
- };
1902
- }
1903
- for (let item of items) {
1904
- yield yield __await(item);
1905
- }
1906
- }
1907
- });
1908
- },
1909
- /** Update an SSH User Certificate */
1910
- update: arg =>
1911
- this.rest
1912
- .url(`/ssh_user_certificates/${arg.id}`)
1913
- .patch(serializeMap(arg))
1914
- .json()
1915
- .then(onFulfilled, onRejected),
1916
- };
1917
- this.TLSCertificates = {
1918
- /** Upload a new TLS certificate */
1919
- create: arg =>
1920
- this.rest
1921
- .url(`/tls_certificates`)
1922
- .post(serializeMap(arg))
1923
- .json()
1924
- .then(onFulfilled, onRejected),
1925
- /** Delete a TLS certificate */
1926
- delete: arg =>
1927
- this.rest
1928
- .url(`/tls_certificates/${arg.id}`)
1929
- .delete()
1930
- .json()
1931
- .then(onFulfilled, onRejected),
1932
- /** Get detailed information about a TLS certificate */
1933
- get: arg =>
1934
- this.rest
1935
- .url(`/tls_certificates/${arg.id}`)
1936
- .get()
1937
- .json()
1938
- .then(onFulfilled, onRejected),
1939
- /** List all TLS certificates on this account */
1940
- list: () =>
1941
- __awaiter(this, void 0, void 0, function* () {
1942
- var e_18, _27;
1943
- const array = [];
1944
- try {
1945
- for (
1946
- var _28 = __asyncValues(this.TLSCertificates._asyncList()), _29;
1947
- (_29 = yield _28.next()), !_29.done;
1948
-
1949
- ) {
1950
- let item = _29.value;
1951
- array.push(item);
1952
- }
1953
- } catch (e_18_1) {
1954
- e_18 = { error: e_18_1 };
1955
- } finally {
1956
- try {
1957
- if (_29 && !_29.done && (_27 = _28.return)) yield _27.call(_28);
1958
- } finally {
1959
- if (e_18) throw e_18.error;
1960
- }
1961
- }
1962
- return array;
1963
- }),
1964
- _pagedList: arg =>
1965
- this.rest
1966
- .url(`/tls_certificates`)
1967
- .query(arg)
1968
- .get()
1969
- .json()
1970
- .then(onFulfilled, onRejected),
1971
- _asyncList: function () {
1972
- return __asyncGenerator(this, arguments, function* () {
1973
- const limit = '100';
1974
- let nextPage = 'initial loop';
1975
- let page = { limit: limit };
1976
- while (nextPage) {
1977
- const pagedList = yield __await(this._pagedList(page));
1978
- nextPage = pagedList.next_page_uri;
1979
- const items = pagedList.tls_certificates;
1980
- if (nextPage) {
1981
- page = {
1982
- before_id: items[items.length - 1].id,
1983
- limit: limit,
1984
- };
1985
- }
1986
- for (let item of items) {
1987
- yield yield __await(item);
1988
- }
1989
- }
1990
- });
1991
- },
1992
- /** Update attributes of a TLS Certificate by ID */
1993
- update: arg =>
1994
- this.rest
1995
- .url(`/tls_certificates/${arg.id}`)
1996
- .patch(serializeMap(arg))
1997
- .json()
1998
- .then(onFulfilled, onRejected),
1999
- };
2000
- this.TunnelSessions = {
2001
- /** List all online tunnel sessions running on this account. */
2002
- list: () =>
2003
- __awaiter(this, void 0, void 0, function* () {
2004
- var e_19, _30;
2005
- const array = [];
2006
- try {
2007
- for (
2008
- var _31 = __asyncValues(this.TunnelSessions._asyncList()), _32;
2009
- (_32 = yield _31.next()), !_32.done;
2010
-
2011
- ) {
2012
- let item = _32.value;
2013
- array.push(item);
2014
- }
2015
- } catch (e_19_1) {
2016
- e_19 = { error: e_19_1 };
2017
- } finally {
2018
- try {
2019
- if (_32 && !_32.done && (_30 = _31.return)) yield _30.call(_31);
2020
- } finally {
2021
- if (e_19) throw e_19.error;
2022
- }
2023
- }
2024
- return array;
2025
- }),
2026
- _pagedList: arg =>
2027
- this.rest
2028
- .url(`/tunnel_sessions`)
2029
- .query(arg)
2030
- .get()
2031
- .json()
2032
- .then(onFulfilled, onRejected),
2033
- _asyncList: function () {
2034
- return __asyncGenerator(this, arguments, function* () {
2035
- const limit = '100';
2036
- let nextPage = 'initial loop';
2037
- let page = { limit: limit };
2038
- while (nextPage) {
2039
- const pagedList = yield __await(this._pagedList(page));
2040
- nextPage = pagedList.next_page_uri;
2041
- const items = pagedList.tunnel_sessions;
2042
- if (nextPage) {
2043
- page = {
2044
- before_id: items[items.length - 1].id,
2045
- limit: limit,
2046
- };
2047
- }
2048
- for (let item of items) {
2049
- yield yield __await(item);
2050
- }
2051
- }
2052
- });
2053
- },
2054
- /** Get the detailed status of a tunnel session by ID */
2055
- get: arg =>
2056
- this.rest
2057
- .url(`/tunnel_sessions/${arg.id}`)
2058
- .get()
2059
- .json()
2060
- .then(onFulfilled, onRejected),
2061
- /** 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. */
2062
- restart: arg =>
2063
- this.rest
2064
- .url(`/tunnel_sessions/${arg.id}/restart`)
2065
- .post(serializeMap(arg))
2066
- .json()
2067
- .then(onFulfilled, onRejected),
2068
- /** Issues a command instructing the ngrok agent that started this tunnel session to exit. */
2069
- stop: arg =>
2070
- this.rest
2071
- .url(`/tunnel_sessions/${arg.id}/stop`)
2072
- .post(serializeMap(arg))
2073
- .json()
2074
- .then(onFulfilled, onRejected),
2075
- /** 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 */
2076
- update: arg =>
2077
- this.rest
2078
- .url(`/tunnel_sessions/${arg.id}/update`)
2079
- .post(serializeMap(arg))
2080
- .json()
2081
- .then(onFulfilled, onRejected),
2082
- };
2083
- this.Tunnels = {
2084
- /** List all online tunnels currently running on the account. */
2085
- list: () =>
2086
- __awaiter(this, void 0, void 0, function* () {
2087
- var e_20, _33;
2088
- const array = [];
2089
- try {
2090
- for (
2091
- var _34 = __asyncValues(this.Tunnels._asyncList()), _35;
2092
- (_35 = yield _34.next()), !_35.done;
2093
-
2094
- ) {
2095
- let item = _35.value;
2096
- array.push(item);
2097
- }
2098
- } catch (e_20_1) {
2099
- e_20 = { error: e_20_1 };
2100
- } finally {
2101
- try {
2102
- if (_35 && !_35.done && (_33 = _34.return)) yield _33.call(_34);
2103
- } finally {
2104
- if (e_20) throw e_20.error;
2105
- }
2106
- }
2107
- return array;
2108
- }),
2109
- _pagedList: arg =>
2110
- this.rest
2111
- .url(`/tunnels`)
2112
- .query(arg)
2113
- .get()
2114
- .json()
2115
- .then(onFulfilled, onRejected),
2116
- _asyncList: function () {
2117
- return __asyncGenerator(this, arguments, function* () {
2118
- const limit = '100';
2119
- let nextPage = 'initial loop';
2120
- let page = { limit: limit };
2121
- while (nextPage) {
2122
- const pagedList = yield __await(this._pagedList(page));
2123
- nextPage = pagedList.next_page_uri;
2124
- const items = pagedList.tunnels;
2125
- if (nextPage) {
2126
- page = {
2127
- before_id: items[items.length - 1].id,
2128
- limit: limit,
2129
- };
2130
- }
2131
- for (let item of items) {
2132
- yield yield __await(item);
2133
- }
2134
- }
2135
- });
2136
- },
2137
- };
2138
- this.baseUrl = baseUrl;
2139
- if (apiToken) {
2140
- this.token = apiToken;
2141
- } else {
2142
- throw new Error('Cannot create ngrok client without an API token');
2143
- }
2144
- this.rest = wretch_1
2145
- .default()
2146
- .url(baseUrl)
2147
- .headers({
2148
- 'User-Agent': 'ngrok-ts-user-agent',
2149
- 'Ngrok-Version': '2',
2150
- })
2151
- .content('application/json')
2152
- .auth('Bearer ' + this.token);
2153
- }
2154
- }
2155
- exports.Ngrok = Ngrok;
2156
- function onFulfilled(f) {
2157
- return f;
2158
- }
2159
- function onRejected(e) {
2160
- let errMsg = JSON.parse(e.message);
2161
- errMsg.details = new Map(Object.entries(errMsg.details));
2162
- throw errMsg;
2163
- }
2164
- function replacer(key, value) {
2165
- if (value instanceof Map) {
2166
- return Object.fromEntries(value);
2167
- } else {
2168
- return value;
2169
- }
2170
- }
2171
- function serializeMap(obj) {
2172
- return JSON.stringify(obj, replacer);
2173
- }
26
+ __exportStar(require('./client'), exports);
27
+ __exportStar(require('./datatypes'), exports);
2174
28
  //# sourceMappingURL=index.js.map