@@ -18,7 +18,7 @@ export default class PubSubApiClient {
1818 */
1919 connect ( ) : Promise < void > ;
2020 /**
21- * Get connectivity state from current channel.
21+ * Gets the gRPC connectivity state from the current channel.
2222 * @returns {Promise<connectivityState> } Promise that holds channel's connectivity information {@link connectivityState}
2323 * @memberof PubSubApiClient.prototype
2424 */
@@ -48,12 +48,34 @@ export default class PubSubApiClient {
4848 * @memberof PubSubApiClient.prototype
4949 */
5050 subscribe ( topicName : string , subscribeCallback : SubscribeCallback , numRequested ?: number | null ) : void ;
51+ /**
52+ * Subscribes to a topic thanks to a managed subscription.
53+ * @param {string } subscriptionIdOrName managed subscription ID or developer name
54+ * @param {SubscribeCallback } subscribeCallback callback function for handling subscription events
55+ * @param {number | null } [numRequested] optional number of events requested. If not supplied or null, the client keeps the subscription alive forever.
56+ * @throws Throws an error if the managed subscription does not exist or is not in the `RUN` state.
57+ * @memberof PubSubApiClient.prototype
58+ */
59+ subscribeWithManagedSubscription ( subscriptionIdOrName : string , subscribeCallback : SubscribeCallback , numRequested ?: number | null ) : Promise < void > ;
5160 /**
5261 * Request additional events on an existing subscription.
5362 * @param {string } topicName topic name
54- * @param {number } numRequested number of events requested.
63+ * @param {number } numRequested number of events requested
5564 */
5665 requestAdditionalEvents ( topicName : string , numRequested : number ) : void ;
66+ /**
67+ * Request additional events on an existing managed subscription.
68+ * @param {string } subscriptionId managed subscription ID
69+ * @param {number } numRequested number of events requested
70+ */
71+ requestAdditionalManagedEvents ( subscriptionId : string , numRequested : number ) : void ;
72+ /**
73+ * Commits a replay ID on a managed subscription.
74+ * @param {string } subscriptionId managed subscription ID
75+ * @param {number } replayId event replay ID
76+ * @returns {string } commit request UUID
77+ */
78+ commitReplayId ( subscriptionId : string , replayId : number ) : string ;
5779 /**
5880 * Publishes a payload to a topic using the gRPC client.
5981 * @param {string } topicName name of the topic that we're subscribing to
@@ -70,62 +92,12 @@ export default class PubSubApiClient {
7092 close ( ) : void ;
7193 #private;
7294}
73- export type PublishResult = {
74- replayId : number ;
75- correlationKey : string ;
76- } ;
77- export type SubscribeCallback = ( subscription : SubscriptionInfo , callbackType : SubscribeCallbackType , data ?: any ) => any ;
78- export type Subscription = {
79- info : SubscriptionInfo ;
80- grpcSubscription : any ;
81- subscribeCallback : SubscribeCallback ;
82- } ;
83- export type SubscriptionInfo = {
84- topicName : string ;
85- requestedEventCount : number ;
86- receivedEventCount : number ;
87- lastReplayId : number ;
88- } ;
89- export type Configuration = {
90- authType : AuthType ;
91- pubSubEndpoint : string ;
92- loginUrl : string ;
93- username : string ;
94- password : string ;
95- userToken : string ;
96- clientId : string ;
97- clientSecret : string ;
98- privateKey : string ;
99- accessToken : string ;
100- instanceUrl : string ;
101- organizationId : string ;
102- } ;
103- export type Logger = {
104- debug : Function ;
105- info : Function ;
106- error : Function ;
107- warn : Function ;
108- } ;
109- export type SubscribeRequest = {
110- topicName : string ;
111- numRequested : number ;
112- replayPreset ?: number ;
113- replayId ?: number ;
114- } ;
95+ export type PublishResult = import ( "./utils/types.js" ) . PublishResult ;
96+ export type Subscription = import ( "./utils/types.js" ) . Subscription ;
97+ export type SubscriptionInfo = import ( "./utils/types.js" ) . SubscriptionInfo ;
98+ export type Configuration = import ( "./utils/types.js" ) . Configuration ;
99+ export type Logger = import ( "./utils/types.js" ) . Logger ;
100+ export type SubscribeRequest = import ( "./utils/types.js" ) . SubscribeRequest ;
115101import { connectivityState } from '@grpc/grpc-js' ;
116- import { Configuration } from './utils/configuration.js' ;
117- /**
118- * Enum for subscripe callback type values
119- */
120- type SubscribeCallbackType = string ;
121- declare namespace SubscribeCallbackType {
122- let EVENT : string ;
123- let LAST_EVENT : string ;
124- let ERROR : string ;
125- let END : string ;
126- let GRPC_STATUS : string ;
127- let GRPC_KEEP_ALIVE : string ;
128- }
129- import { AuthType } from './utils/configuration.js' ;
130- export { } ;
102+ import Configuration from './utils/configuration.js' ;
131103//# sourceMappingURL=client.d.ts.map
0 commit comments