fix: update version of cockatiel to fix incompatible TypeScript types

Fixes #128
This commit is contained in:
Connor Peet 2020-09-18 20:25:00 -07:00
Родитель ac38732581
Коммит b9b2cd2a22
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: CF8FD2EA0DBC61BD
4 изменённых файлов: 38 добавлений и 28 удалений

Просмотреть файл

@ -1,3 +1,7 @@
## 1.0.1 2020-09-18
- **fix:** update version of cockatiel to fix incompatible TypeScript types (see [#128](https://github.com/microsoft/etcd3/issues/128))
## 1.0.1 2020-06-21
- **fix:** `proto` files not included in npm package

Просмотреть файл

@ -43,39 +43,39 @@
},
"homepage": "https://github.com/microsoft/etcd3#readme",
"devDependencies": {
"@types/chai": "^4.2.11",
"@types/chai-as-promised": "^7.1.2",
"@types/chai": "^4.2.12",
"@types/chai-as-promised": "^7.1.3",
"@types/chai-subset": "^1.3.3",
"@types/mocha": "^7.0.2",
"@types/node": "^14.0.13",
"@types/sinon": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^3.3.0",
"@typescript-eslint/parser": "^3.3.0",
"@types/mocha": "^8.0.3",
"@types/node": "^14.11.1",
"@types/sinon": "^9.0.5",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"change-case": "^4.1.1",
"concurrently": "^5.2.0",
"eslint": "^7.2.0",
"eslint-plugin-header": "^3.0.0",
"lodash": "^4.17.15",
"mocha": "^8.0.1",
"concurrently": "^5.3.0",
"eslint": "^7.9.0",
"eslint-plugin-header": "^3.1.0",
"lodash": "^4.17.20",
"mocha": "^8.1.3",
"ncp": "^2.0.0",
"node-fetch": "^2.6.0",
"node-fetch": "^2.6.1",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
"protobufjs": "^6.9.0",
"prettier": "^2.1.2",
"protobufjs": "^6.10.1",
"rimraf": "^3.0.2",
"sinon": "^9.0.2",
"ts-node": "^8.10.2",
"typedoc": "^0.17.0-3",
"typescript": "^3.9.5"
"sinon": "^9.0.3",
"ts-node": "^9.0.0",
"typedoc": "^0.19.1",
"typescript": "^4.0.3"
},
"dependencies": {
"@grpc/grpc-js": "^1.0.5",
"@grpc/proto-loader": "^0.5.4",
"@grpc/grpc-js": "^1.1.7",
"@grpc/proto-loader": "^0.5.5",
"bignumber.js": "^9.0.0",
"cockatiel": "^1.0.0"
"cockatiel": "^1.1.1"
},
"prettier": {
"singleQuote": true,

Просмотреть файл

@ -4,7 +4,13 @@
import { loadSync } from '@grpc/proto-loader';
import * as grpc from '@grpc/grpc-js';
import { ChannelOptions } from '@grpc/grpc-js/build/src/channel-options';
import { isBrokenCircuitError, Policy, IPolicy, ConsecutiveBreaker } from 'cockatiel';
import {
isBrokenCircuitError,
Policy,
IPolicy,
ConsecutiveBreaker,
IDefaultPolicyContext,
} from 'cockatiel';
import {
castGrpcError,
@ -156,7 +162,7 @@ export class Host {
host: string,
private readonly channelCredentials: grpc.ChannelCredentials,
private readonly channelOptions?: ChannelOptions,
public readonly faultHandling: IPolicy<unknown> = defaultCircuitBreaker(),
public readonly faultHandling: IPolicy<IDefaultPolicyContext> = defaultCircuitBreaker(),
) {
this.host = removeProtocolPrefix(host);
}
@ -225,7 +231,7 @@ export class ConnectionPool implements ICallable<Host> {
public static deterministicOrder = false;
private readonly hosts: Host[];
private readonly globalPolicy: IPolicy<unknown> =
private readonly globalPolicy: IPolicy<IDefaultPolicyContext> =
this.options.faultHandling?.global ?? Policy.handleWhen(isRecoverableError).retry().attempts(3);
private mockImpl: ICallable<Host> | null;
private authenticator: Authenticator;

Просмотреть файл

@ -3,7 +3,7 @@
*--------------------------------------------------------*/
import { ChannelOptions } from '@grpc/grpc-js/build/src/channel-options';
import { CallOptions } from '@grpc/grpc-js';
import { IPolicy, IBackoff } from 'cockatiel';
import { IPolicy, IBackoff, IDefaultPolicyContext } from 'cockatiel';
/**
* IOptions are passed into the client constructor to configure how the client
@ -123,8 +123,8 @@ export interface IOptions {
* ```
*/
faultHandling?: Partial<{
host: (hostname: string) => IPolicy<unknown>;
global: IPolicy<unknown>;
host: (hostname: string) => IPolicy<IDefaultPolicyContext>;
global: IPolicy<IDefaultPolicyContext>;
watchBackoff: IBackoff<unknown>;
}>;
}