@@ -15,11 +15,10 @@ import { Components } from "./api/resources/components/client/Client.js";
1515import { Actions } from "./api/resources/actions/client/Client.js" ;
1616import { Triggers } from "./api/resources/triggers/client/Client.js" ;
1717import { DeployedTriggers } from "./api/resources/deployedTriggers/client/Client.js" ;
18- import { FileStash } from "./api/resources/fileStash/client/Client.js" ;
1918import { Projects } from "./api/resources/projects/client/Client.js" ;
19+ import { FileStash } from "./api/resources/fileStash/client/Client.js" ;
2020import { Proxy } from "./api/resources/proxy/client/Client.js" ;
2121import { Tokens } from "./api/resources/tokens/client/Client.js" ;
22- import { SDK_VERSION } from "./version.js" ;
2322
2423export declare namespace PipedreamClient {
2524 export interface Options {
@@ -28,7 +27,6 @@ export declare namespace PipedreamClient {
2827 baseUrl ?: core . Supplier < string > ;
2928 clientId ?: core . Supplier < string > ;
3029 clientSecret ?: core . Supplier < string > ;
31- tokenProvider ?: core . TokenProvider ;
3230 projectId : string ;
3331 /** Override the x-pd-environment header */
3432 projectEnvironment ?: core . Supplier < Pipedream . ProjectEnvironment | undefined > ;
@@ -54,7 +52,7 @@ export declare namespace PipedreamClient {
5452
5553export class PipedreamClient {
5654 protected readonly _options : PipedreamClient . Options ;
57- protected readonly _tokenProvider : core . TokenProvider ;
55+ private readonly _oauthTokenProvider : core . OAuthTokenProvider ;
5856 protected _appCategories : AppCategories | undefined ;
5957 protected _apps : Apps | undefined ;
6058 protected _accounts : Accounts | undefined ;
@@ -63,8 +61,8 @@ export class PipedreamClient {
6361 protected _actions : Actions | undefined ;
6462 protected _triggers : Triggers | undefined ;
6563 protected _deployedTriggers : DeployedTriggers | undefined ;
66- protected _fileStash : FileStash | undefined ;
6764 protected _projects : Projects | undefined ;
65+ protected _fileStash : FileStash | undefined ;
6866 protected _proxy : Proxy | undefined ;
6967 protected _tokens : Tokens | undefined ;
7068 protected _oauthTokens : OauthTokens | undefined ;
@@ -77,19 +75,15 @@ export class PipedreamClient {
7775 "x-pd-environment" : _options ?. projectEnvironment ,
7876 "X-Fern-Language" : "JavaScript" ,
7977 "X-Fern-SDK-Name" : "@pipedream/sdk" ,
80- "X-Fern-SDK-Version" : SDK_VERSION ,
81- "User-Agent" : ` @pipedream/sdk/${ SDK_VERSION } ` ,
78+ "X-Fern-SDK-Version" : "2.0.14" ,
79+ "User-Agent" : " @pipedream/sdk/2.0.14" ,
8280 "X-Fern-Runtime" : core . RUNTIME . type ,
8381 "X-Fern-Runtime-Version" : core . RUNTIME . version ,
8482 } ,
8583 _options ?. headers ,
8684 ) ,
8785 } ;
8886
89- this . _tokenProvider = this . _options . tokenProvider ?? this . newOAuthTokenProvider ( ) ;
90- }
91-
92- private newOAuthTokenProvider ( ) : core . OAuthTokenProvider {
9387 const clientId = this . _options . clientId ?? process . env [ "PIPEDREAM_CLIENT_ID" ] ;
9488 if ( clientId == null ) {
9589 throw new Error (
@@ -104,7 +98,7 @@ export class PipedreamClient {
10498 ) ;
10599 }
106100
107- return new core . OAuthTokenProvider ( {
101+ this . _oauthTokenProvider = new core . OAuthTokenProvider ( {
108102 clientId,
109103 clientSecret,
110104 authClient : new OauthTokens ( {
@@ -117,91 +111,91 @@ export class PipedreamClient {
117111 public get appCategories ( ) : AppCategories {
118112 return ( this . _appCategories ??= new AppCategories ( {
119113 ...this . _options ,
120- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
114+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
121115 } ) ) ;
122116 }
123117
124118 public get apps ( ) : Apps {
125119 return ( this . _apps ??= new Apps ( {
126120 ...this . _options ,
127- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
121+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
128122 } ) ) ;
129123 }
130124
131125 public get accounts ( ) : Accounts {
132126 return ( this . _accounts ??= new Accounts ( {
133127 ...this . _options ,
134- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
128+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
135129 } ) ) ;
136130 }
137131
138132 public get users ( ) : Users {
139133 return ( this . _users ??= new Users ( {
140134 ...this . _options ,
141- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
135+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
142136 } ) ) ;
143137 }
144138
145139 public get components ( ) : Components {
146140 return ( this . _components ??= new Components ( {
147141 ...this . _options ,
148- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
142+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
149143 } ) ) ;
150144 }
151145
152146 public get actions ( ) : Actions {
153147 return ( this . _actions ??= new Actions ( {
154148 ...this . _options ,
155- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
149+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
156150 } ) ) ;
157151 }
158152
159153 public get triggers ( ) : Triggers {
160154 return ( this . _triggers ??= new Triggers ( {
161155 ...this . _options ,
162- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
156+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
163157 } ) ) ;
164158 }
165159
166160 public get deployedTriggers ( ) : DeployedTriggers {
167161 return ( this . _deployedTriggers ??= new DeployedTriggers ( {
168162 ...this . _options ,
169- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
163+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
170164 } ) ) ;
171165 }
172166
173- public get fileStash ( ) : FileStash {
174- return ( this . _fileStash ??= new FileStash ( {
167+ public get projects ( ) : Projects {
168+ return ( this . _projects ??= new Projects ( {
175169 ...this . _options ,
176- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
170+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
177171 } ) ) ;
178172 }
179173
180- public get projects ( ) : Projects {
181- return ( this . _projects ??= new Projects ( {
174+ public get fileStash ( ) : FileStash {
175+ return ( this . _fileStash ??= new FileStash ( {
182176 ...this . _options ,
183- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
177+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
184178 } ) ) ;
185179 }
186180
187181 public get proxy ( ) : Proxy {
188182 return ( this . _proxy ??= new Proxy ( {
189183 ...this . _options ,
190- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
184+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
191185 } ) ) ;
192186 }
193187
194188 public get tokens ( ) : Tokens {
195189 return ( this . _tokens ??= new Tokens ( {
196190 ...this . _options ,
197- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
191+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
198192 } ) ) ;
199193 }
200194
201195 public get oauthTokens ( ) : OauthTokens {
202196 return ( this . _oauthTokens ??= new OauthTokens ( {
203197 ...this . _options ,
204- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
198+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
205199 } ) ) ;
206200 }
207201}
0 commit comments