@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.
- package/.eslintrc.js +4 -1
- package/CHANGELOG.md +34 -0
- package/README.md +148 -2
- package/docs/CNAME +1 -0
- package/docs/assets/css/main.css +2660 -0
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +248 -0
- package/docs/assets/js/search.js +1 -0
- package/docs/classes/client.Ngrok.html +681 -0
- package/docs/classes/services.APIKeys.html +453 -0
- package/docs/classes/services.AbuseReports.html +360 -0
- package/docs/classes/services.AgentIngresses.html +442 -0
- package/docs/classes/services.CertificateAuthorities.html +453 -0
- package/docs/classes/services.Credentials.html +452 -0
- package/docs/classes/services.EndpointCircuitBreakerModule.html +369 -0
- package/docs/classes/services.EndpointCompressionModule.html +369 -0
- package/docs/classes/services.EndpointConfigurations.html +451 -0
- package/docs/classes/services.EndpointIPPolicyModule.html +369 -0
- package/docs/classes/services.EndpointLoggingModule.html +369 -0
- package/docs/classes/services.EndpointMutualTLSModule.html +369 -0
- package/docs/classes/services.EndpointOAuthModule.html +369 -0
- package/docs/classes/services.EndpointOIDCModule.html +369 -0
- package/docs/classes/services.EndpointRequestHeadersModule.html +369 -0
- package/docs/classes/services.EndpointResponseHeadersModule.html +369 -0
- package/docs/classes/services.EndpointSAMLModule.html +369 -0
- package/docs/classes/services.EndpointTLSTerminationModule.html +369 -0
- package/docs/classes/services.EndpointWebhookValidationModule.html +369 -0
- package/docs/classes/services.EventDestinations.html +442 -0
- package/docs/classes/services.EventSources.html +448 -0
- package/docs/classes/services.EventStreams.html +442 -0
- package/docs/classes/services.EventSubscriptions.html +442 -0
- package/docs/classes/services.IPPolicies.html +452 -0
- package/docs/classes/services.IPPolicyRules.html +450 -0
- package/docs/classes/services.IPRestrictions.html +454 -0
- package/docs/classes/services.ReservedAddrs.html +483 -0
- package/docs/classes/services.ReservedDomains.html +580 -0
- package/docs/classes/services.SSHCertificateAuthorities.html +450 -0
- package/docs/classes/services.SSHCredentials.html +450 -0
- package/docs/classes/services.SSHHostCertificates.html +451 -0
- package/docs/classes/services.SSHUserCertificates.html +451 -0
- package/docs/classes/services.TLSCertificates.html +453 -0
- package/docs/classes/services.TunnelSessions.html +451 -0
- package/docs/classes/services.Tunnels.html +322 -0
- package/docs/index.html +239 -0
- package/docs/interfaces/client.NgrokConfig.html +179 -0
- package/docs/interfaces/datatypes.APIKey.html +262 -0
- package/docs/interfaces/datatypes.APIKeyCreate.html +186 -0
- package/docs/interfaces/datatypes.APIKeyList.html +205 -0
- package/docs/interfaces/datatypes.APIKeyUpdate.html +200 -0
- package/docs/interfaces/datatypes.AWSAuth.html +186 -0
- package/docs/interfaces/datatypes.AWSCredentials.html +186 -0
- package/docs/interfaces/datatypes.AWSRole.html +167 -0
- package/docs/interfaces/datatypes.AbuseReport.html +281 -0
- package/docs/interfaces/datatypes.AbuseReportCreate.html +186 -0
- package/docs/interfaces/datatypes.AbuseReportHostname.html +186 -0
- package/docs/interfaces/datatypes.AgentIngress.html +300 -0
- package/docs/interfaces/datatypes.AgentIngressCreate.html +205 -0
- package/docs/interfaces/datatypes.AgentIngressList.html +205 -0
- package/docs/interfaces/datatypes.AgentIngressUpdate.html +200 -0
- package/docs/interfaces/datatypes.CertificateAuthority.html +357 -0
- package/docs/interfaces/datatypes.CertificateAuthorityCreate.html +205 -0
- package/docs/interfaces/datatypes.CertificateAuthorityList.html +205 -0
- package/docs/interfaces/datatypes.CertificateAuthorityUpdate.html +200 -0
- package/docs/interfaces/datatypes.Credential.html +281 -0
- package/docs/interfaces/datatypes.CredentialCreate.html +205 -0
- package/docs/interfaces/datatypes.CredentialList.html +205 -0
- package/docs/interfaces/datatypes.CredentialUpdate.html +219 -0
- package/docs/interfaces/datatypes.Empty.html +130 -0
- package/docs/interfaces/datatypes.EndpointCircuitBreaker.html +262 -0
- package/docs/interfaces/datatypes.EndpointCircuitBreakerReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointCompression.html +167 -0
- package/docs/interfaces/datatypes.EndpointCompressionReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointConfiguration.html +490 -0
- package/docs/interfaces/datatypes.EndpointConfigurationCreate.html +433 -0
- package/docs/interfaces/datatypes.EndpointConfigurationList.html +205 -0
- package/docs/interfaces/datatypes.EndpointConfigurationUpdate.html +433 -0
- package/docs/interfaces/datatypes.EndpointIPPolicy.html +181 -0
- package/docs/interfaces/datatypes.EndpointIPPolicyMutate.html +186 -0
- package/docs/interfaces/datatypes.EndpointIPPolicyReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointLogging.html +186 -0
- package/docs/interfaces/datatypes.EndpointLoggingMutate.html +186 -0
- package/docs/interfaces/datatypes.EndpointLoggingReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointMutualTLS.html +186 -0
- package/docs/interfaces/datatypes.EndpointMutualTLSMutate.html +186 -0
- package/docs/interfaces/datatypes.EndpointMutualTLSReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointOAuth.html +281 -0
- package/docs/interfaces/datatypes.EndpointOAuthFacebook.html +243 -0
- package/docs/interfaces/datatypes.EndpointOAuthGitHub.html +281 -0
- package/docs/interfaces/datatypes.EndpointOAuthGoogle.html +243 -0
- package/docs/interfaces/datatypes.EndpointOAuthMicrosoft.html +243 -0
- package/docs/interfaces/datatypes.EndpointOAuthProvider.html +224 -0
- package/docs/interfaces/datatypes.EndpointOAuthReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointOIDC.html +319 -0
- package/docs/interfaces/datatypes.EndpointOIDCReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointRequestHeaders.html +205 -0
- package/docs/interfaces/datatypes.EndpointRequestHeadersReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointResponseHeaders.html +205 -0
- package/docs/interfaces/datatypes.EndpointResponseHeadersReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointSAML.html +433 -0
- package/docs/interfaces/datatypes.EndpointSAMLMutate.html +338 -0
- package/docs/interfaces/datatypes.EndpointSAMLReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointTLSTermination.html +205 -0
- package/docs/interfaces/datatypes.EndpointTLSTerminationReplace.html +176 -0
- package/docs/interfaces/datatypes.EndpointWebhookValidation.html +205 -0
- package/docs/interfaces/datatypes.EndpointWebhookValidationReplace.html +176 -0
- package/docs/interfaces/datatypes.Error.html +204 -0
- package/docs/interfaces/datatypes.EventDestination.html +281 -0
- package/docs/interfaces/datatypes.EventDestinationCreate.html +224 -0
- package/docs/interfaces/datatypes.EventDestinationList.html +205 -0
- package/docs/interfaces/datatypes.EventDestinationUpdate.html +243 -0
- package/docs/interfaces/datatypes.EventSource.html +186 -0
- package/docs/interfaces/datatypes.EventSourceCreate.html +186 -0
- package/docs/interfaces/datatypes.EventSourceItem.html +193 -0
- package/docs/interfaces/datatypes.EventSourceList.html +186 -0
- package/docs/interfaces/datatypes.EventSourcePaging.html +174 -0
- package/docs/interfaces/datatypes.EventSourceReplace.html +167 -0
- package/docs/interfaces/datatypes.EventSourceUpdate.html +186 -0
- package/docs/interfaces/datatypes.EventStream.html +319 -0
- package/docs/interfaces/datatypes.EventStreamCreate.html +262 -0
- package/docs/interfaces/datatypes.EventStreamList.html +205 -0
- package/docs/interfaces/datatypes.EventStreamUpdate.html +262 -0
- package/docs/interfaces/datatypes.EventSubscription.html +281 -0
- package/docs/interfaces/datatypes.EventSubscriptionCreate.html +224 -0
- package/docs/interfaces/datatypes.EventSubscriptionList.html +205 -0
- package/docs/interfaces/datatypes.EventSubscriptionUpdate.html +243 -0
- package/docs/interfaces/datatypes.EventTarget.html +205 -0
- package/docs/interfaces/datatypes.EventTargetCloudwatchLogs.html +186 -0
- package/docs/interfaces/datatypes.EventTargetFirehose.html +186 -0
- package/docs/interfaces/datatypes.EventTargetKinesis.html +186 -0
- package/docs/interfaces/datatypes.IPPolicy.html +262 -0
- package/docs/interfaces/datatypes.IPPolicyCreate.html +205 -0
- package/docs/interfaces/datatypes.IPPolicyList.html +205 -0
- package/docs/interfaces/datatypes.IPPolicyRule.html +281 -0
- package/docs/interfaces/datatypes.IPPolicyRuleCreate.html +224 -0
- package/docs/interfaces/datatypes.IPPolicyRuleList.html +205 -0
- package/docs/interfaces/datatypes.IPPolicyRuleUpdate.html +219 -0
- package/docs/interfaces/datatypes.IPPolicyUpdate.html +200 -0
- package/docs/interfaces/datatypes.IPRestriction.html +300 -0
- package/docs/interfaces/datatypes.IPRestrictionCreate.html +243 -0
- package/docs/interfaces/datatypes.IPRestrictionList.html +205 -0
- package/docs/interfaces/datatypes.IPRestrictionUpdate.html +238 -0
- package/docs/interfaces/datatypes.Item.html +167 -0
- package/docs/interfaces/datatypes.Paging.html +176 -0
- package/docs/interfaces/datatypes.Ref.html +186 -0
- package/docs/interfaces/datatypes.ReservedAddr.html +300 -0
- package/docs/interfaces/datatypes.ReservedAddrCreate.html +224 -0
- package/docs/interfaces/datatypes.ReservedAddrList.html +205 -0
- package/docs/interfaces/datatypes.ReservedAddrUpdate.html +219 -0
- package/docs/interfaces/datatypes.ReservedDomain.html +414 -0
- package/docs/interfaces/datatypes.ReservedDomainCertJob.html +224 -0
- package/docs/interfaces/datatypes.ReservedDomainCertPolicy.html +186 -0
- package/docs/interfaces/datatypes.ReservedDomainCertStatus.html +186 -0
- package/docs/interfaces/datatypes.ReservedDomainCreate.html +300 -0
- package/docs/interfaces/datatypes.ReservedDomainList.html +205 -0
- package/docs/interfaces/datatypes.ReservedDomainUpdate.html +276 -0
- package/docs/interfaces/datatypes.SSHCertificateAuthority.html +281 -0
- package/docs/interfaces/datatypes.SSHCertificateAuthorityCreate.html +243 -0
- package/docs/interfaces/datatypes.SSHCertificateAuthorityList.html +205 -0
- package/docs/interfaces/datatypes.SSHCertificateAuthorityUpdate.html +200 -0
- package/docs/interfaces/datatypes.SSHCredential.html +281 -0
- package/docs/interfaces/datatypes.SSHCredentialCreate.html +224 -0
- package/docs/interfaces/datatypes.SSHCredentialList.html +205 -0
- package/docs/interfaces/datatypes.SSHCredentialUpdate.html +219 -0
- package/docs/interfaces/datatypes.SSHHostCertificate.html +376 -0
- package/docs/interfaces/datatypes.SSHHostCertificateCreate.html +281 -0
- package/docs/interfaces/datatypes.SSHHostCertificateList.html +205 -0
- package/docs/interfaces/datatypes.SSHHostCertificateUpdate.html +200 -0
- package/docs/interfaces/datatypes.SSHUserCertificate.html +414 -0
- package/docs/interfaces/datatypes.SSHUserCertificateCreate.html +319 -0
- package/docs/interfaces/datatypes.SSHUserCertificateList.html +205 -0
- package/docs/interfaces/datatypes.SSHUserCertificateUpdate.html +200 -0
- package/docs/interfaces/datatypes.TLSCertificate.html +547 -0
- package/docs/interfaces/datatypes.TLSCertificateCreate.html +224 -0
- package/docs/interfaces/datatypes.TLSCertificateList.html +205 -0
- package/docs/interfaces/datatypes.TLSCertificateSANs.html +186 -0
- package/docs/interfaces/datatypes.TLSCertificateUpdate.html +200 -0
- package/docs/interfaces/datatypes.Tunnel.html +281 -0
- package/docs/interfaces/datatypes.TunnelList.html +205 -0
- package/docs/interfaces/datatypes.TunnelSession.html +338 -0
- package/docs/interfaces/datatypes.TunnelSessionList.html +205 -0
- package/docs/interfaces/datatypes.TunnelSessionsUpdate.html +162 -0
- package/docs/modules/client.html +137 -0
- package/docs/modules/datatypes.html +668 -0
- package/docs/modules/services.html +260 -0
- package/docs/modules.html +119 -0
- package/lib/client.d.ts +145 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +102 -0
- package/lib/client.js.map +1 -0
- package/lib/{types.d.ts → datatypes.d.ts} +620 -816
- package/lib/datatypes.d.ts.map +1 -0
- package/lib/{types.js → datatypes.js} +1 -1
- package/lib/datatypes.js.map +1 -0
- package/lib/index.d.ts +3 -314
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +25 -887
- package/lib/index.js.map +1 -1
- package/lib/services.d.ts +773 -0
- package/lib/services.d.ts.map +1 -0
- package/lib/services.js +2761 -0
- package/lib/services.js.map +1 -0
- package/lib/util.d.ts +5 -0
- package/lib/util.d.ts.map +1 -0
- package/lib/util.js +53 -0
- package/lib/util.js.map +1 -0
- package/package.json +12 -3
- package/src/client.ts +265 -0
- package/src/{types.ts → datatypes.ts} +648 -869
- package/src/index.ts +2 -616
- package/src/services.ts +2560 -0
- package/src/util.ts +48 -0
- package/test/apikey.test.js +44 -30
- package/test/endpointConfigurations.test.js +38 -34
- package/tsconfig.json +17 -7
- 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
|
+
}
|
package/test/apikey.test.js
CHANGED
|
@@ -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
|
|
18
|
+
baseUrl: 'https://api.ngrok.com',
|
|
13
19
|
});
|
|
14
20
|
});
|
|
15
21
|
|
|
16
22
|
test('non-empty api keys list', () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|
|
36
|
-
expect(
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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.
|
|
65
|
+
ngrok.apiKeys
|
|
66
|
+
.get({ id: '1000' })
|
|
53
67
|
/* eslint jest/no-conditional-expect: "warn" */
|
|
54
|
-
.catch(
|
|
55
|
-
expect(JSON.stringify(
|
|
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
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
52
|
-
|
|
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.
|
|
60
|
-
expect(data.
|
|
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
|
-
"
|
|
4
|
-
"outDir": "lib",
|
|
4
|
+
"target": "es6",
|
|
5
5
|
"module": "commonjs",
|
|
6
|
-
"
|
|
7
|
-
"target": "es5",
|
|
6
|
+
"declaration": true,
|
|
8
7
|
"sourceMap": true,
|
|
9
|
-
"
|
|
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":""}
|