influx 5.0.3 → 5.0.7
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/CHANGELOG.md +7 -0
- package/lib/src/backoff/backoff.d.ts +15 -15
- package/lib/src/backoff/backoff.js +2 -1
- package/lib/src/backoff/exponential.d.ts +52 -52
- package/lib/src/backoff/exponential.js +40 -39
- package/lib/src/builder.d.ts +265 -265
- package/lib/src/builder.js +366 -365
- package/lib/src/doc.d.ts +315 -310
- package/lib/src/doc.js +340 -329
- package/lib/src/grammar/ds.d.ts +45 -45
- package/lib/src/grammar/ds.js +56 -55
- package/lib/src/grammar/escape.d.ts +25 -25
- package/lib/src/grammar/escape.js +108 -107
- package/lib/src/grammar/index.d.ts +3 -3
- package/lib/src/grammar/index.js +8 -7
- package/lib/src/grammar/times.d.ts +74 -74
- package/lib/src/grammar/times.js +325 -318
- package/lib/src/host.d.ts +26 -24
- package/lib/src/host.js +34 -32
- package/lib/src/index.d.ts +659 -653
- package/lib/src/index.js +870 -866
- package/lib/src/pool.d.ts +149 -148
- package/lib/src/pool.js +344 -333
- package/lib/src/results.d.ts +118 -119
- package/lib/src/results.js +146 -139
- package/lib/src/schema.d.ts +58 -58
- package/lib/src/schema.js +117 -116
- package/package.json +10 -10
package/lib/src/host.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import {
|
|
3
|
-
import * as urlModule from 'url';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { RequestOptions } from 'https';
|
|
3
|
+
import * as urlModule from 'url';
|
|
4
|
+
import { IBackoffStrategy } from './backoff/backoff';
|
|
5
|
+
export declare class Host {
|
|
6
|
+
private backoff;
|
|
7
|
+
readonly options: RequestOptions;
|
|
8
|
+
readonly url: urlModule.Url;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new Host instance.
|
|
11
|
+
* @param {String} url
|
|
12
|
+
* @param {IBackoffStrategy} backoff
|
|
13
|
+
*/
|
|
14
|
+
constructor(url: string, backoff: IBackoffStrategy, options: RequestOptions);
|
|
15
|
+
/**
|
|
16
|
+
* Marks a failure on the host and returns the length of time it
|
|
17
|
+
* should be removed from the pool
|
|
18
|
+
* @return {Number} removal time in milliseconds
|
|
19
|
+
*/
|
|
20
|
+
fail(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Should be called when a successful operation is run against the host.
|
|
23
|
+
* It resets the host's backoff strategy.
|
|
24
|
+
*/
|
|
25
|
+
success(): void;
|
|
26
|
+
}
|
package/lib/src/host.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* @param {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var urlModule = require("url");
|
|
4
|
+
var Host = (function () {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new Host instance.
|
|
7
|
+
* @param {String} url
|
|
8
|
+
* @param {IBackoffStrategy} backoff
|
|
9
|
+
*/
|
|
10
|
+
function Host(url, backoff, options) {
|
|
11
|
+
this.backoff = backoff;
|
|
12
|
+
this.options = options;
|
|
13
|
+
this.url = urlModule.parse(url);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Marks a failure on the host and returns the length of time it
|
|
17
|
+
* should be removed from the pool
|
|
18
|
+
* @return {Number} removal time in milliseconds
|
|
19
|
+
*/
|
|
20
|
+
Host.prototype.fail = function () {
|
|
21
|
+
var value = this.backoff.getDelay();
|
|
22
|
+
this.backoff = this.backoff.next();
|
|
23
|
+
return value;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Should be called when a successful operation is run against the host.
|
|
27
|
+
* It resets the host's backoff strategy.
|
|
28
|
+
*/
|
|
29
|
+
Host.prototype.success = function () {
|
|
30
|
+
this.backoff = this.backoff.reset();
|
|
31
|
+
};
|
|
32
|
+
return Host;
|
|
33
|
+
}());
|
|
34
|
+
exports.Host = Host;
|