1- // This file was initially auto-generated by Fern from our API Definition.
2- // It was later customized by the Pipedream team.
1+ // This file was auto-generated by Fern from our API Definition.
32
4- import { SDK_VERSION } from "./version.js" ;
53import { Accounts } from "./api/resources/accounts/client/Client.js" ;
64import { Actions } from "./api/resources/actions/client/Client.js" ;
75import { AppCategories } from "./api/resources/appCategories/client/Client.js" ;
@@ -23,15 +21,14 @@ export declare namespace PipedreamClient {
2321 export interface Options extends BaseClientOptions {
2422 clientId ?: core . Supplier < string > ;
2523 clientSecret ?: core . Supplier < string > ;
26- tokenProvider ?: core . TokenProvider ;
2724 }
2825
2926 export interface RequestOptions extends BaseRequestOptions { }
3027}
3128
3229export class PipedreamClient {
3330 protected readonly _options : PipedreamClient . Options ;
34- protected readonly _tokenProvider : core . TokenProvider ;
31+ private readonly _oauthTokenProvider : core . OAuthTokenProvider ;
3532 protected _appCategories : AppCategories | undefined ;
3633 protected _apps : Apps | undefined ;
3734 protected _accounts : Accounts | undefined ;
@@ -40,8 +37,8 @@ export class PipedreamClient {
4037 protected _actions : Actions | undefined ;
4138 protected _triggers : Triggers | undefined ;
4239 protected _deployedTriggers : DeployedTriggers | undefined ;
43- protected _fileStash : FileStash | undefined ;
4440 protected _projects : Projects | undefined ;
41+ protected _fileStash : FileStash | undefined ;
4542 protected _proxy : Proxy | undefined ;
4643 protected _tokens : Tokens | undefined ;
4744 protected _oauthTokens : OauthTokens | undefined ;
@@ -54,19 +51,15 @@ export class PipedreamClient {
5451 "x-pd-environment" : _options ?. projectEnvironment ,
5552 "X-Fern-Language" : "JavaScript" ,
5653 "X-Fern-SDK-Name" : "@pipedream/sdk" ,
57- "X-Fern-SDK-Version" : SDK_VERSION ,
58- "User-Agent" : ` @pipedream/sdk/${ SDK_VERSION } ` ,
54+ "X-Fern-SDK-Version" : "2.3.3" ,
55+ "User-Agent" : " @pipedream/sdk/2.3.3" ,
5956 "X-Fern-Runtime" : core . RUNTIME . type ,
6057 "X-Fern-Runtime-Version" : core . RUNTIME . version ,
6158 } ,
6259 _options ?. headers ,
6360 ) ,
6461 } ;
6562
66- this . _tokenProvider = this . _options . tokenProvider ?? this . newOAuthTokenProvider ( ) ;
67- }
68-
69- private newOAuthTokenProvider ( ) : core . OAuthTokenProvider {
7063 const clientId = this . _options . clientId ?? process . env . PIPEDREAM_CLIENT_ID ;
7164 if ( clientId == null ) {
7265 throw new Error (
@@ -81,8 +74,9 @@ export class PipedreamClient {
8174 ) ;
8275 }
8376
84- return new core . OAuthTokenProvider ( {
77+ this . _oauthTokenProvider = new core . OAuthTokenProvider ( {
8578 clientId,
79+
8680 clientSecret,
8781 authClient : new OauthTokens ( {
8882 ...this . _options ,
@@ -94,91 +88,91 @@ export class PipedreamClient {
9488 public get appCategories ( ) : AppCategories {
9589 return ( this . _appCategories ??= new AppCategories ( {
9690 ...this . _options ,
97- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
91+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
9892 } ) ) ;
9993 }
10094
10195 public get apps ( ) : Apps {
10296 return ( this . _apps ??= new Apps ( {
10397 ...this . _options ,
104- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
98+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
10599 } ) ) ;
106100 }
107101
108102 public get accounts ( ) : Accounts {
109103 return ( this . _accounts ??= new Accounts ( {
110104 ...this . _options ,
111- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
105+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
112106 } ) ) ;
113107 }
114108
115109 public get users ( ) : Users {
116110 return ( this . _users ??= new Users ( {
117111 ...this . _options ,
118- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
112+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
119113 } ) ) ;
120114 }
121115
122116 public get components ( ) : Components {
123117 return ( this . _components ??= new Components ( {
124118 ...this . _options ,
125- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
119+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
126120 } ) ) ;
127121 }
128122
129123 public get actions ( ) : Actions {
130124 return ( this . _actions ??= new Actions ( {
131125 ...this . _options ,
132- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
126+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
133127 } ) ) ;
134128 }
135129
136130 public get triggers ( ) : Triggers {
137131 return ( this . _triggers ??= new Triggers ( {
138132 ...this . _options ,
139- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
133+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
140134 } ) ) ;
141135 }
142136
143137 public get deployedTriggers ( ) : DeployedTriggers {
144138 return ( this . _deployedTriggers ??= new DeployedTriggers ( {
145139 ...this . _options ,
146- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
140+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
147141 } ) ) ;
148142 }
149143
150- public get fileStash ( ) : FileStash {
151- return ( this . _fileStash ??= new FileStash ( {
144+ public get projects ( ) : Projects {
145+ return ( this . _projects ??= new Projects ( {
152146 ...this . _options ,
153- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
147+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
154148 } ) ) ;
155149 }
156150
157- public get projects ( ) : Projects {
158- return ( this . _projects ??= new Projects ( {
151+ public get fileStash ( ) : FileStash {
152+ return ( this . _fileStash ??= new FileStash ( {
159153 ...this . _options ,
160- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
154+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
161155 } ) ) ;
162156 }
163157
164158 public get proxy ( ) : Proxy {
165159 return ( this . _proxy ??= new Proxy ( {
166160 ...this . _options ,
167- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
161+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
168162 } ) ) ;
169163 }
170164
171165 public get tokens ( ) : Tokens {
172166 return ( this . _tokens ??= new Tokens ( {
173167 ...this . _options ,
174- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
168+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
175169 } ) ) ;
176170 }
177171
178172 public get oauthTokens ( ) : OauthTokens {
179173 return ( this . _oauthTokens ??= new OauthTokens ( {
180174 ...this . _options ,
181- token : async ( ) => await this . _tokenProvider . getToken ( ) ,
175+ token : async ( ) => await this . _oauthTokenProvider . getToken ( ) ,
182176 } ) ) ;
183177 }
184178}
0 commit comments