Skip to content

Commit 75be802

Browse files
committed
Update main client file
1 parent 91f4157 commit 75be802

File tree

1 file changed

+16
-39
lines changed

1 file changed

+16
-39
lines changed

src/Client.ts

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,32 @@
1-
/**
2-
* This file was auto-generated by Fern from our API Definition.
3-
*/
1+
// This file was initially auto-generated by Fern from our API Definition.
2+
// It was later customized by the Pipedream team.
43

5-
import * as environments from "./environments.js";
6-
import * as core from "./core/index.js";
7-
import * as Pipedream from "./api/index.js";
8-
import { OauthTokens } from "./api/resources/oauthTokens/client/Client.js";
9-
import { mergeHeaders } from "./core/headers.js";
4+
import { SDK_VERSION } from "version.js";
5+
import { Accounts } from "./api/resources/accounts/client/Client.js";
6+
import { Actions } from "./api/resources/actions/client/Client.js";
107
import { AppCategories } from "./api/resources/appCategories/client/Client.js";
118
import { Apps } from "./api/resources/apps/client/Client.js";
12-
import { Accounts } from "./api/resources/accounts/client/Client.js";
13-
import { Users } from "./api/resources/users/client/Client.js";
149
import { Components } from "./api/resources/components/client/Client.js";
15-
import { Actions } from "./api/resources/actions/client/Client.js";
16-
import { Triggers } from "./api/resources/triggers/client/Client.js";
1710
import { DeployedTriggers } from "./api/resources/deployedTriggers/client/Client.js";
1811
import { FileStash } from "./api/resources/fileStash/client/Client.js";
12+
import { OauthTokens } from "./api/resources/oauthTokens/client/Client.js";
1913
import { Projects } from "./api/resources/projects/client/Client.js";
2014
import { Proxy } from "./api/resources/proxy/client/Client.js";
2115
import { Tokens } from "./api/resources/tokens/client/Client.js";
22-
import { SDK_VERSION } from "./version.js";
16+
import { Triggers } from "./api/resources/triggers/client/Client.js";
17+
import { Users } from "./api/resources/users/client/Client.js";
18+
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
19+
import { mergeHeaders } from "./core/headers.js";
20+
import * as core from "./core/index.js";
2321

2422
export declare namespace PipedreamClient {
25-
export interface Options {
26-
environment?: core.Supplier<environments.PipedreamEnvironment | string>;
27-
/** Specify a custom URL to connect the client to. */
28-
baseUrl?: core.Supplier<string>;
23+
export interface Options extends BaseClientOptions {
2924
clientId?: core.Supplier<string>;
3025
clientSecret?: core.Supplier<string>;
3126
tokenProvider?: core.TokenProvider;
32-
projectId: string;
33-
/** Override the x-pd-environment header */
34-
projectEnvironment?: core.Supplier<Pipedream.ProjectEnvironment | undefined>;
35-
/** Additional headers to include in requests. */
36-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
37-
}
38-
39-
export interface RequestOptions {
40-
/** The maximum time to wait for a response in seconds. */
41-
timeoutInSeconds?: number;
42-
/** The number of times to retry the request. Defaults to 2. */
43-
maxRetries?: number;
44-
/** A hook to abort the request. */
45-
abortSignal?: AbortSignal;
46-
/** Override the x-pd-environment header */
47-
projectEnvironment?: Pipedream.ProjectEnvironment | undefined;
48-
/** Additional query string parameters to include in the request. */
49-
queryParams?: Record<string, unknown>;
50-
/** Additional headers to include in the request. */
51-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
5227
}
28+
29+
export interface RequestOptions extends BaseRequestOptions {}
5330
}
5431

5532
export class PipedreamClient {
@@ -90,14 +67,14 @@ export class PipedreamClient {
9067
}
9168

9269
private newOAuthTokenProvider(): core.OAuthTokenProvider {
93-
const clientId = this._options.clientId ?? process.env["PIPEDREAM_CLIENT_ID"];
70+
const clientId = this._options.clientId ?? process.env.PIPEDREAM_CLIENT_ID;
9471
if (clientId == null) {
9572
throw new Error(
9673
"clientId is required; either pass it as an argument or set the PIPEDREAM_CLIENT_ID environment variable",
9774
);
9875
}
9976

100-
const clientSecret = this._options.clientSecret ?? process.env["PIPEDREAM_CLIENT_SECRET"];
77+
const clientSecret = this._options.clientSecret ?? process.env.PIPEDREAM_CLIENT_SECRET;
10178
if (clientSecret == null) {
10279
throw new Error(
10380
"clientSecret is required; either pass it as an argument or set the PIPEDREAM_CLIENT_SECRET environment variable",

0 commit comments

Comments
 (0)