|
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. |
4 | 3 |
|
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"; |
10 | 7 | import { AppCategories } from "./api/resources/appCategories/client/Client.js"; |
11 | 8 | 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"; |
14 | 9 | 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"; |
17 | 10 | import { DeployedTriggers } from "./api/resources/deployedTriggers/client/Client.js"; |
18 | 11 | import { FileStash } from "./api/resources/fileStash/client/Client.js"; |
| 12 | +import { OauthTokens } from "./api/resources/oauthTokens/client/Client.js"; |
19 | 13 | import { Projects } from "./api/resources/projects/client/Client.js"; |
20 | 14 | import { Proxy } from "./api/resources/proxy/client/Client.js"; |
21 | 15 | 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"; |
23 | 21 |
|
24 | 22 | 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 { |
29 | 24 | clientId?: core.Supplier<string>; |
30 | 25 | clientSecret?: core.Supplier<string>; |
31 | 26 | 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>; |
52 | 27 | } |
| 28 | + |
| 29 | + export interface RequestOptions extends BaseRequestOptions {} |
53 | 30 | } |
54 | 31 |
|
55 | 32 | export class PipedreamClient { |
@@ -90,14 +67,14 @@ export class PipedreamClient { |
90 | 67 | } |
91 | 68 |
|
92 | 69 | 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; |
94 | 71 | if (clientId == null) { |
95 | 72 | throw new Error( |
96 | 73 | "clientId is required; either pass it as an argument or set the PIPEDREAM_CLIENT_ID environment variable", |
97 | 74 | ); |
98 | 75 | } |
99 | 76 |
|
100 | | - const clientSecret = this._options.clientSecret ?? process.env["PIPEDREAM_CLIENT_SECRET"]; |
| 77 | + const clientSecret = this._options.clientSecret ?? process.env.PIPEDREAM_CLIENT_SECRET; |
101 | 78 | if (clientSecret == null) { |
102 | 79 | throw new Error( |
103 | 80 | "clientSecret is required; either pass it as an argument or set the PIPEDREAM_CLIENT_SECRET environment variable", |
|
0 commit comments