Skip to content

Commit da3be87

Browse files
committed
build: release v4.1.0
1 parent 1b3c2c1 commit da3be87

File tree

7 files changed

+39
-8
lines changed

7 files changed

+39
-8
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ Returns: Promise that resolves once the connection is established.
418418
| `instanceUrl` | string | Salesforce instance URL |
419419
| `organizationId` | string | optional organization ID. If you don't provide one, we'll attempt to parse it from the accessToken. |
420420
421+
#### `async getConnectivityState() → Promise<connectivityState>}`
422+
423+
Get connectivity state from current channel.
424+
425+
Returns: Promise that holds channel's [connectivity state](https://grpc.github.io/grpc/node/grpc.html#.connectivityState).
426+
421427
#### `async publish(topicName, payload, correlationKeyopt) → {Promise.<PublishResult>}`
422428

423429
Publishes a payload to a topic using the gRPC client.

dist/client.cjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var import_avro_js3 = __toESM(require("avro-js"), 1);
3939
var import_certifi = __toESM(require("certifi"), 1);
4040
var import_grpc_js = __toESM(require("@grpc/grpc-js"), 1);
4141
var import_proto_loader = __toESM(require("@grpc/proto-loader"), 1);
42+
var import_grpc_js2 = require("@grpc/grpc-js");
4243

4344
// src/utils/schemaCache.js
4445
var SchemaCache = class {
@@ -728,6 +729,14 @@ var PubSubApiClient = class {
728729
});
729730
}
730731
}
732+
/**
733+
* Get connectivity state from current channel.
734+
* @returns {Promise<connectivityState>} Promise that holds channel's connectivity information {@link connectivityState}
735+
* @memberof PubSubApiClient.prototype
736+
*/
737+
async getConnectivityState() {
738+
return this.#client?.getChannel()?.getConnectivityState(false);
739+
}
731740
/**
732741
* Subscribes to a topic and retrieves all past events in retention window.
733742
* @param {string} topicName name of the topic that we're subscribing to

dist/client.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ export default class PubSubApiClient {
2424
* @memberof PubSubApiClient.prototype
2525
*/
2626
connectWithAuth(accessToken: string, instanceUrl: string, organizationId?: string): Promise<void>;
27+
/**
28+
* Get connectivity state from current channel.
29+
* @returns {Promise<connectivityState>} Promise that holds channel's connectivity information {@link connectivityState}
30+
* @memberof PubSubApiClient.prototype
31+
*/
32+
getConnectivityState(): Promise<connectivityState>;
2733
/**
2834
* Subscribes to a topic and retrieves all past events in retention window.
2935
* @param {string} topicName name of the topic that we're subscribing to
@@ -81,6 +87,7 @@ export type Logger = {
8187
error: Function;
8288
warn: Function;
8389
};
90+
import { connectivityState } from '@grpc/grpc-js';
8491
import { EventEmitter } from 'events';
8592
import PubSubEventEmitter from './utils/pubSubEventEmitter.js';
8693
//# sourceMappingURL=client.d.ts.map

dist/client.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/client.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import avro3 from "avro-js";
66
import certifi from "certifi";
77
import grpc from "@grpc/grpc-js";
88
import protoLoader from "@grpc/proto-loader";
9+
import { connectivityState } from "@grpc/grpc-js";
910

1011
// src/utils/schemaCache.js
1112
var SchemaCache = class {
@@ -695,6 +696,14 @@ var PubSubApiClient = class {
695696
});
696697
}
697698
}
699+
/**
700+
* Get connectivity state from current channel.
701+
* @returns {Promise<connectivityState>} Promise that holds channel's connectivity information {@link connectivityState}
702+
* @memberof PubSubApiClient.prototype
703+
*/
704+
async getConnectivityState() {
705+
return this.#client?.getChannel()?.getConnectivityState(false);
706+
}
698707
/**
699708
* Subscribes to a topic and retrieves all past events in retention window.
700709
* @param {string} topicName name of the topic that we're subscribing to

dist/utils/eventParser.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "salesforce-pubsub-api-client",
3-
"version": "4.0.1",
3+
"version": "4.1.0",
44
"type": "module",
55
"description": "A node client for the Salesforce Pub/Sub API",
66
"author": "pozil",
@@ -28,16 +28,16 @@
2828
"certifi": "^14.5.15",
2929
"dotenv": "^16.4.5",
3030
"jsforce": "^1.11.1",
31-
"undici": "^6.18.2"
31+
"undici": "^6.19.2"
3232
},
3333
"devDependencies": {
3434
"@chialab/esbuild-plugin-meta-url": "^0.18.2",
35-
"eslint": "^9.4.0",
35+
"eslint": "^9.6.0",
3636
"husky": "^9.0.11",
37-
"lint-staged": "^15.2.5",
38-
"prettier": "^3.3.0",
37+
"lint-staged": "^15.2.7",
38+
"prettier": "^3.3.2",
3939
"tsup": "^8.1.0",
40-
"typescript": "^5.4.5"
40+
"typescript": "^5.5.3"
4141
},
4242
"lint-staged": {
4343
"**/src/*.{css,html,js,json,md,yaml,yml}": [

0 commit comments

Comments
 (0)