Skip to content

Commit 41f0169

Browse files
SDK regeneration
1 parent 9102f38 commit 41f0169

File tree

74 files changed

+1268
-697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1268
-697
lines changed

package.json

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/sdk",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"private": false,
55
"repository": "github:PipedreamHQ/pipedream-sdk-typescript",
66
"type": "commonjs",
@@ -10,11 +10,6 @@
1010
"exports": {
1111
".": {
1212
"types": "./dist/cjs/index.d.ts",
13-
"browser": {
14-
"types": "./dist/esm/browser/index.d.mts",
15-
"import": "./dist/esm/browser/index.mjs",
16-
"default": "./dist/esm/browser/index.mjs"
17-
},
1813
"import": {
1914
"types": "./dist/esm/index.d.mts",
2015
"default": "./dist/esm/index.mjs"
@@ -25,18 +20,6 @@
2520
},
2621
"default": "./dist/cjs/index.js"
2722
},
28-
"./browser": {
29-
"types": "./dist/esm/browser/index.d.mts",
30-
"import": {
31-
"types": "./dist/esm/browser/index.d.mts",
32-
"default": "./dist/esm/browser/index.mjs"
33-
},
34-
"require": {
35-
"types": "./dist/cjs/browser/index.d.ts",
36-
"default": "./dist/cjs/browser/index.js"
37-
},
38-
"default": "./dist/esm/browser/index.mjs"
39-
},
4023
"./serialization": {
4124
"types": "./dist/cjs/serialization/index.d.ts",
4225
"import": {
@@ -49,18 +32,6 @@
4932
},
5033
"default": "./dist/cjs/serialization/index.js"
5134
},
52-
"./server": {
53-
"types": "./dist/cjs/index.d.ts",
54-
"import": {
55-
"types": "./dist/esm/index.d.mts",
56-
"default": "./dist/esm/index.mjs"
57-
},
58-
"require": {
59-
"types": "./dist/cjs/index.d.ts",
60-
"default": "./dist/cjs/index.js"
61-
},
62-
"default": "./dist/cjs/index.js"
63-
},
6435
"./package.json": "./package.json"
6536
},
6637
"files": [
@@ -93,8 +64,6 @@
9364
"@biomejs/biome": "2.2.5"
9465
},
9566
"browser": {
96-
"./dist/cjs/wrapper/utils/getBaseUrl.js": "./dist/cjs/wrapper/utils/getBaseUrl.browser.js",
97-
"./dist/esm/wrapper/utils/getBaseUrl.mjs": "./dist/esm/wrapper/utils/getBaseUrl.browser.mjs",
9867
"fs": false,
9968
"os": false,
10069
"path": false,

src/Client.ts

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
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";
53
import { Accounts } from "./api/resources/accounts/client/Client.js";
64
import { Actions } from "./api/resources/actions/client/Client.js";
75
import { 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

3229
export 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
}

src/api/errors/BadRequestError.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
import type * as core from "../../core/index.js";
4+
import * as errors from "../../errors/index.js";
5+
6+
export class BadRequestError extends errors.PipedreamError {
7+
constructor(body?: unknown, rawResponse?: core.RawResponse) {
8+
super({
9+
message: "BadRequestError",
10+
statusCode: 400,
11+
body: body,
12+
rawResponse: rawResponse,
13+
});
14+
Object.setPrototypeOf(this, BadRequestError.prototype);
15+
}
16+
}

src/api/errors/NotFoundError.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
import type * as core from "../../core/index.js";
4+
import * as errors from "../../errors/index.js";
5+
6+
export class NotFoundError extends errors.PipedreamError {
7+
constructor(body?: unknown, rawResponse?: core.RawResponse) {
8+
super({
9+
message: "NotFoundError",
10+
statusCode: 404,
11+
body: body,
12+
rawResponse: rawResponse,
13+
});
14+
Object.setPrototypeOf(this, NotFoundError.prototype);
15+
}
16+
}

src/api/errors/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
export * from "./BadRequestError.js";
2+
export * from "./NotFoundError.js";
13
export * from "./TooManyRequestsError.js";

src/api/resources/accounts/client/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as Pipedream from "../../../index.js";
1010

1111
export declare namespace Accounts {
1212
export interface Options extends BaseClientOptions {
13-
token?: core.Supplier<core.BearerToken | undefined>;
13+
token?: core.Supplier<core.BearerToken>;
1414
}
1515

1616
export interface RequestOptions extends BaseRequestOptions {}

src/api/resources/actions/client/Client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as Pipedream from "../../../index.js";
1010

1111
export declare namespace Actions {
1212
export interface Options extends BaseClientOptions {
13-
token?: core.Supplier<core.BearerToken | undefined>;
13+
token?: core.Supplier<core.BearerToken>;
1414
}
1515

1616
export interface RequestOptions extends BaseRequestOptions {}
@@ -29,6 +29,7 @@ export class Actions {
2929
* @param {Pipedream.ActionsListRequest} request
3030
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
3131
*
32+
* @throws {@link Pipedream.BadRequestError}
3233
* @throws {@link Pipedream.TooManyRequestsError}
3334
*
3435
* @example
@@ -108,6 +109,8 @@ export class Actions {
108109
}
109110
if (_response.error.reason === "status-code") {
110111
switch (_response.error.statusCode) {
112+
case 400:
113+
throw new Pipedream.BadRequestError(_response.error.body, _response.rawResponse);
111114
case 429:
112115
throw new Pipedream.TooManyRequestsError(_response.error.body, _response.rawResponse);
113116
default:

src/api/resources/appCategories/client/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type * as Pipedream from "../../../index.js";
1010

1111
export declare namespace AppCategories {
1212
export interface Options extends BaseClientOptions {
13-
token?: core.Supplier<core.BearerToken | undefined>;
13+
token?: core.Supplier<core.BearerToken>;
1414
}
1515

1616
export interface RequestOptions extends BaseRequestOptions {}

src/api/resources/apps/client/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type * as Pipedream from "../../../index.js";
1010

1111
export declare namespace Apps {
1212
export interface Options extends BaseClientOptions {
13-
token?: core.Supplier<core.BearerToken | undefined>;
13+
token?: core.Supplier<core.BearerToken>;
1414
}
1515

1616
export interface RequestOptions extends BaseRequestOptions {}

src/api/resources/components/client/Client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as Pipedream from "../../../index.js";
1010

1111
export declare namespace Components {
1212
export interface Options extends BaseClientOptions {
13-
token?: core.Supplier<core.BearerToken | undefined>;
13+
token?: core.Supplier<core.BearerToken>;
1414
}
1515

1616
export interface RequestOptions extends BaseRequestOptions {}
@@ -29,6 +29,7 @@ export class Components {
2929
* @param {Pipedream.ComponentsListRequest} request
3030
* @param {Components.RequestOptions} requestOptions - Request-specific configuration.
3131
*
32+
* @throws {@link Pipedream.BadRequestError}
3233
* @throws {@link Pipedream.TooManyRequestsError}
3334
*
3435
* @example
@@ -115,6 +116,8 @@ export class Components {
115116
}
116117
if (_response.error.reason === "status-code") {
117118
switch (_response.error.statusCode) {
119+
case 400:
120+
throw new Pipedream.BadRequestError(_response.error.body, _response.rawResponse);
118121
case 429:
119122
throw new Pipedream.TooManyRequestsError(_response.error.body, _response.rawResponse);
120123
default:

0 commit comments

Comments
 (0)