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