@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
package/src/util.ts ADDED
@@ -0,0 +1,48 @@
1
+ export function onFulfilled(f) {
2
+ return f;
3
+ }
4
+
5
+ export function onRejected(e: Error) {
6
+ const errMsg = deserializeResult(JSON.parse(e.message));
7
+ errMsg.details = new Map(Object.entries(errMsg.details));
8
+ throw errMsg;
9
+ }
10
+
11
+ export function deserializeResult(obj) {
12
+ return objectKeysTo(obj, snakeToLowerCamel);
13
+ }
14
+
15
+ export function serializeArgument(obj) {
16
+ return JSON.stringify(objectKeysTo(obj, lowerCamelToSnake), replacer);
17
+ }
18
+
19
+ function replacer(key, value) {
20
+ if (value instanceof Map) {
21
+ return Object.fromEntries(value);
22
+ } else {
23
+ return value;
24
+ }
25
+ }
26
+
27
+ function snakeToLowerCamel(s: string): string {
28
+ return s.replace(/([-_]\w)/g, g => g[1].toUpperCase());
29
+ }
30
+
31
+ function lowerCamelToSnake(s: string): string {
32
+ return s.replace(/[A-Z]/g, g => `_${g.toLowerCase()}`);
33
+ }
34
+
35
+ function objectKeysTo(obj, keyFunc) {
36
+ if (obj === null) {
37
+ return obj;
38
+ } else if (Array.isArray(obj)) {
39
+ return obj.map(item => objectKeysTo(item, keyFunc));
40
+ } else if (typeof obj === 'object') {
41
+ return Object.keys(obj).reduce((acc, k) => {
42
+ acc[keyFunc(k)] = objectKeysTo(obj[k], keyFunc);
43
+ return acc;
44
+ }, {});
45
+ } else {
46
+ return obj;
47
+ }
48
+ }
@@ -5,54 +5,68 @@ global.fetch = require('node-fetch');
5
5
 
6
6
  describe('valid ngrok api key', () => {
7
7
  let ngrok;
8
+ let noMocks = process.env.TEST_NO_MOCK == '1';
9
+ let ifMock = fn => {
10
+ if (!noMocks) {
11
+ return fn();
12
+ }
13
+ };
8
14
 
9
15
  beforeAll(() => {
10
16
  ngrok = new Ngrok({
11
17
  apiToken: process.env.NGROK_API_KEY,
12
- baseUrl: 'https://api.ngrok.com.lan',
18
+ baseUrl: 'https://api.ngrok.com',
13
19
  });
14
20
  });
15
21
 
16
22
  test('non-empty api keys list', () => {
17
- nock('https://api.ngrok.com.lan')
18
- .get('/api_keys')
19
- .reply(200, {
20
- keys: [
21
- {
22
- id: 'ak_1jCnOTFMXku4RbU8icW3lncpCoz',
23
- uri: 'https://api.ngrok.com.lan/api_keys/ak_1jCnOTFMXku4RbU8icW3lncpCoz',
24
- description: '',
25
- metadata: '',
26
- created_at: '2020-10-21T21:48:28Z',
27
- token: null,
28
- },
29
- ],
30
- uri: 'https://api.ngrok.com.lan/api_keys',
31
- next_page_uri: null,
32
- });
23
+ ifMock(() =>
24
+ nock('https://api.ngrok.com')
25
+ .get('/api_keys')
26
+ .query({
27
+ limit: '100',
28
+ })
29
+ .reply(200, {
30
+ keys: [
31
+ {
32
+ id: 'ak_1jCnOTFMXku4RbU8icW3lncpCoz',
33
+ uri: 'https://api.ngrok.com/api_keys/ak_1jCnOTFMXku4RbU8icW3lncpCoz',
34
+ description: '',
35
+ metadata: '',
36
+ created_at: '2020-10-21T21:48:28Z',
37
+ token: null,
38
+ },
39
+ ],
40
+ uri: 'https://api.ngrok.com/api_keys',
41
+ next_page_uri: null,
42
+ })
43
+ );
33
44
 
34
45
  expect.assertions(1);
35
- return ngrok.APIKeys.list({}).then(data => {
36
- expect(data.keys.length).toBeGreaterThan(0);
46
+ return ngrok.apiKeys.list().then(result => {
47
+ expect(result.length).toBeGreaterThan(0);
37
48
  });
38
49
  });
39
50
 
40
51
  test('api keys invalid id', () => {
41
- nock('https://api.ngrok.com.lan')
42
- .get('/api_keys/1000')
43
- .reply(404, {
44
- error_code: 'ERR_NGROK_222',
45
- status_code: 404,
46
- msg: "The API Key resource identified by '100' could not be found because the identifier is not a valid identifier.",
47
- details: { operation_id: 'op_1jF49fn7npJRATGKUgqig5GgHMA' },
48
- });
52
+ ifMock(() =>
53
+ nock('https://api.ngrok.com')
54
+ .get('/api_keys/1000')
55
+ .reply(404, {
56
+ error_code: 'ERR_NGROK_222',
57
+ status_code: 404,
58
+ msg: "The API Key resource identified by '100' could not be found because the identifier is not a valid identifier.",
59
+ details: { operation_id: 'op_1jF49fn7npJRATGKUgqig5GgHMA' },
60
+ })
61
+ );
49
62
 
50
63
  expect.assertions(1);
51
64
  return (
52
- ngrok.APIKeys.get({ id: '1000' })
65
+ ngrok.apiKeys
66
+ .get({ id: '1000' })
53
67
  /* eslint jest/no-conditional-expect: "warn" */
54
- .catch(data => {
55
- expect(JSON.stringify(data)).toMatch(
68
+ .catch(result => {
69
+ expect(JSON.stringify(result)).toMatch(
56
70
  'the identifier is not a valid identifier'
57
71
  );
58
72
  })
@@ -6,58 +6,62 @@ const nock = require('nock');
6
6
 
7
7
  describe('valid ngrok api key', () => {
8
8
  let ngrok;
9
+ let noMocks = process.env.TEST_NO_MOCK == '1';
10
+ let ifMock = fn => {
11
+ if (!noMocks) {
12
+ return fn();
13
+ }
14
+ };
9
15
 
10
16
  beforeAll(() => {
11
17
  ngrok = new Ngrok({
12
18
  apiToken: process.env.NGROK_API_KEY,
13
- baseUrl: 'https://api.ngrok.com.lan',
19
+ baseUrl: 'https://api.ngrok.com',
14
20
  });
15
21
  });
16
22
 
17
23
  test('create endpoint configuration', () => {
18
24
  expect.assertions(1);
19
25
 
20
- nock('https://api.ngrok.com.lan')
21
- .post('/endpoint_configurations')
22
- .reply(200, {
23
- id: 'ec_1jFQm2FyjAGRYLijtEADZ2S9O3f',
24
- type: 'https',
25
- description: 'some endpoint configuration description',
26
- metadata: 'some endpoint configuration metadata',
27
- created_at: '2020-10-22T20:11:54Z',
28
- uri: 'https://api.ngrok.com.lan/endpoint_configurations/ec_1jFQm2FyjAGRYLijtEADZ2S9O3f',
29
- basic_auth: {
30
- enabled: true,
31
- auth_provider_id: 'agent',
32
- realm: 'ngrok',
33
- allow_options: true,
34
- },
35
- circuit_breaker: null,
36
- compression: null,
37
- request_headers: null,
38
- response_headers: null,
39
- ip_policy: null,
40
- mutual_tls: null,
41
- tls_termination: null,
42
- webhook_validation: null,
43
- oauth: null,
44
- logging: null,
45
- });
26
+ ifMock(() =>
27
+ nock('https://api.ngrok.com')
28
+ .post('/endpoint_configurations')
29
+ .reply(200, {
30
+ id: 'ec_1jFQm2FyjAGRYLijtEADZ2S9O3f',
31
+ type: 'https',
32
+ description: 'some endpoint configuration description',
33
+ metadata: 'some endpoint configuration metadata',
34
+ created_at: '2020-10-22T20:11:54Z',
35
+ uri: 'https://api.ngrok.com/endpoint_configurations/ec_1jFQm2FyjAGRYLijtEADZ2S9O3f',
36
+ basic_auth: null,
37
+ circuit_breaker: {
38
+ enabled: true,
39
+ errorThresholdPercentage: 0.6,
40
+ numBuckets: 16,
41
+ },
42
+ compression: null,
43
+ request_headers: null,
44
+ response_headers: null,
45
+ ip_policy: null,
46
+ mutual_tls: null,
47
+ tls_termination: null,
48
+ webhook_validation: null,
49
+ oauth: null,
50
+ logging: null,
51
+ })
52
+ );
46
53
 
47
54
  let epConfCreate = {
48
55
  type: 'https',
49
56
  description: 'some endpoint configuration description',
50
57
  metadata: 'some endpoint configuration metadata',
51
- basic_auth: {
52
- enabled: true,
53
- auth_provider_id: 'agent',
54
- realm: 'ngrok',
55
- allow_options: true,
58
+ circuitBreaker: {
59
+ errorThresholdPercentage: 0.6,
56
60
  },
57
61
  };
58
62
 
59
- return ngrok.EndpointConfigurations.create(epConfCreate).then(data => {
60
- expect(data.basic_auth.enabled).toBeTruthy();
63
+ return ngrok.endpointConfigurations.create(epConfCreate).then(data => {
64
+ expect(data.circuitBreaker.enabled).toBeTruthy();
61
65
  });
62
66
  });
63
67
  });
package/tsconfig.json CHANGED
@@ -1,17 +1,27 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
2
3
  "compilerOptions": {
3
- "declaration": true,
4
- "outDir": "lib",
4
+ "target": "es6",
5
5
  "module": "commonjs",
6
- "lib": [ "es2015" ],
7
- "target": "es5",
6
+ "declaration": true,
8
7
  "sourceMap": true,
9
- "skipLibCheck": true
8
+ "declarationMap": true,
9
+ "skipLibCheck": true,
10
+ "types": [
11
+ ],
12
+ "lib": [
13
+ "es2019"
14
+ ],
15
+ "outDir": "lib"
10
16
  },
11
17
  "include": [
12
- "src"
18
+ "src/**/*.ts"
13
19
  ],
14
20
  "exclude": [
15
21
  "node_modules"
16
- ]
22
+ ],
23
+ "typedocOptions": {
24
+ "entryPoints": ["src/index.ts"],
25
+ "out": "docs"
26
+ }
17
27
  }
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}