diff --git a/package.json b/package.json index 0a5bd09..331f2e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/sdk", - "version": "2.1.0", + "version": "2.1.1", "private": false, "repository": "github:PipedreamHQ/pipedream-sdk-typescript", "type": "commonjs", @@ -10,11 +10,6 @@ "exports": { ".": { "types": "./dist/cjs/index.d.ts", - "browser": { - "types": "./dist/esm/browser/index.d.mts", - "import": "./dist/esm/browser/index.mjs", - "default": "./dist/esm/browser/index.mjs" - }, "import": { "types": "./dist/esm/index.d.mts", "default": "./dist/esm/index.mjs" @@ -25,18 +20,6 @@ }, "default": "./dist/cjs/index.js" }, - "./browser": { - "types": "./dist/esm/browser/index.d.mts", - "import": { - "types": "./dist/esm/browser/index.d.mts", - "default": "./dist/esm/browser/index.mjs" - }, - "require": { - "types": "./dist/cjs/browser/index.d.ts", - "default": "./dist/cjs/browser/index.js" - }, - "default": "./dist/esm/browser/index.mjs" - }, "./serialization": { "types": "./dist/cjs/serialization/index.d.ts", "import": { @@ -49,18 +32,6 @@ }, "default": "./dist/cjs/serialization/index.js" }, - "./server": { - "types": "./dist/cjs/index.d.ts", - "import": { - "types": "./dist/esm/index.d.mts", - "default": "./dist/esm/index.mjs" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.js" - }, - "default": "./dist/cjs/index.js" - }, "./package.json": "./package.json" }, "files": [ @@ -90,8 +61,6 @@ "typescript": "~5.7.2" }, "browser": { - "./dist/cjs/wrapper/utils/getBaseUrl.js": "./dist/cjs/wrapper/utils/getBaseUrl.browser.js", - "./dist/esm/wrapper/utils/getBaseUrl.mjs": "./dist/esm/wrapper/utils/getBaseUrl.browser.mjs", "fs": false, "os": false, "path": false, diff --git a/src/api/resources/deployedTriggers/client/Client.ts b/src/api/resources/deployedTriggers/client/Client.ts index 8214c4d..d70447c 100644 --- a/src/api/resources/deployedTriggers/client/Client.ts +++ b/src/api/resources/deployedTriggers/client/Client.ts @@ -42,7 +42,7 @@ export class DeployedTriggers { public async list( request: Pipedream.DeployedTriggersListRequest, requestOptions?: DeployedTriggers.RequestOptions, - ): Promise> { + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Pipedream.DeployedTriggersListRequest, @@ -125,7 +125,7 @@ export class DeployedTriggers { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Pageable({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => diff --git a/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts b/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts index 6544889..ba809f1 100644 --- a/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts +++ b/src/api/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts @@ -10,4 +10,6 @@ export interface CreateOAuthTokenOpts { clientId: string; clientSecret: string; + /** Optional space-separated scopes for the access token. Defaults to '*'. */ + scope?: string; } diff --git a/src/api/resources/proxy/client/Client.ts b/src/api/resources/proxy/client/Client.ts index f2ff093..5bc1670 100644 --- a/src/api/resources/proxy/client/Client.ts +++ b/src/api/resources/proxy/client/Client.ts @@ -5,7 +5,6 @@ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers. import * as core from "../../../../core/index.js"; import * as environments from "../../../../environments.js"; import * as errors from "../../../../errors/index.js"; -import { base64Encode } from "../../../../core/index.js"; import * as serializers from "../../../../serialization/index.js"; import * as Pipedream from "../../../index.js"; @@ -24,67 +23,36 @@ export class Proxy { this._options = _options; } - /** - * Transform headers by prefixing each key with 'x-pd-proxy-' - */ - private transformProxyHeaders( - headers?: Record | null | undefined>, - ): Record | null | undefined> | undefined { - if (!headers) return undefined; - - const transformed: Record | null | undefined> = {}; - for (const [key, value] of Object.entries(headers)) { - transformed[`x-pd-proxy-${key}`] = value; - } - return transformed; - } - /** * Forward an authenticated GET request to an external API using an external user's account credentials - * - * @param {Pipedream.ProxyGetRequest} request - * @param {Proxy.RequestOptions} requestOptions - Request-specific configuration. - * * @throws {@link Pipedream.TooManyRequestsError} - * - * @example - * await client.proxy.get({ - * url: "https://api.example.com/endpoint", - * externalUserId: "external_user_id", - * accountId: "account_id", - * params: { key: "value" }, - * headers: { "X-Custom-Header": "value" } - * }) */ public get( + url64: string, request: Pipedream.ProxyGetRequest, requestOptions?: Proxy.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(url64, request, requestOptions)); } private async __get( + url64: string, request: Pipedream.ProxyGetRequest, requestOptions?: Proxy.RequestOptions, - ): Promise> { - const { url, externalUserId, accountId, params, headers } = request; - const url64 = base64Encode(url); - const transformedHeaders = this.transformProxyHeaders(headers); - const _queryParams: Record = { - external_user_id: externalUserId, - account_id: accountId, - ...(params || {}), - }; + ): Promise> { + const { externalUserId, accountId } = request; + const _queryParams: Record = {}; + _queryParams.external_user_id = externalUserId; + _queryParams.account_id = accountId; const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), "x-pd-environment": requestOptions?.projectEnvironment ?? this._options?.projectEnvironment, }), - transformedHeaders, requestOptions?.headers, ); - const _response = await core.fetcher({ + const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? @@ -94,21 +62,13 @@ export class Proxy { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + responseType: "binary-response", timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ProxyResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -145,51 +105,34 @@ export class Proxy { /** * Forward an authenticated POST request to an external API using an external user's account credentials - * - * @param {Pipedream.ProxyPostRequest} request - * @param {Proxy.RequestOptions} requestOptions - Request-specific configuration. - * * @throws {@link Pipedream.TooManyRequestsError} - * - * @example - * await client.proxy.post({ - * url: "https://api.example.com/endpoint", - * externalUserId: "external_user_id", - * accountId: "account_id", - * body: { "key": "value" }, - * params: { key: "value" }, - * headers: { "X-Custom-Header": "value" } - * }) */ public post( + url64: string, request: Pipedream.ProxyPostRequest, requestOptions?: Proxy.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__post(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__post(url64, request, requestOptions)); } private async __post( + url64: string, request: Pipedream.ProxyPostRequest, requestOptions?: Proxy.RequestOptions, - ): Promise> { - const { url, externalUserId, accountId, body: _body, params, headers } = request; - const url64 = base64Encode(url); - const transformedHeaders = this.transformProxyHeaders(headers); - const _queryParams: Record = { - external_user_id: externalUserId, - account_id: accountId, - ...(params || {}), - }; + ): Promise> { + const { externalUserId, accountId, body: _body } = request; + const _queryParams: Record = {}; + _queryParams.external_user_id = externalUserId; + _queryParams.account_id = accountId; const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), "x-pd-environment": requestOptions?.projectEnvironment ?? this._options?.projectEnvironment, }), - transformedHeaders, requestOptions?.headers, ); - const _response = await core.fetcher({ + const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? @@ -205,21 +148,13 @@ export class Proxy { unrecognizedObjectKeys: "strip", omitUndefined: true, }), + responseType: "binary-response", timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ProxyResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -256,51 +191,34 @@ export class Proxy { /** * Forward an authenticated PUT request to an external API using an external user's account credentials - * - * @param {Pipedream.ProxyPutRequest} request - * @param {Proxy.RequestOptions} requestOptions - Request-specific configuration. - * * @throws {@link Pipedream.TooManyRequestsError} - * - * @example - * await client.proxy.put({ - * url: "https://api.example.com/endpoint", - * externalUserId: "external_user_id", - * accountId: "account_id", - * body: { "key": "value" }, - * params: { key: "value" }, - * headers: { "X-Custom-Header": "value" } - * }) */ public put( + url64: string, request: Pipedream.ProxyPutRequest, requestOptions?: Proxy.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__put(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__put(url64, request, requestOptions)); } private async __put( + url64: string, request: Pipedream.ProxyPutRequest, requestOptions?: Proxy.RequestOptions, - ): Promise> { - const { url, externalUserId, accountId, body: _body, params, headers } = request; - const url64 = base64Encode(url); - const transformedHeaders = this.transformProxyHeaders(headers); - const _queryParams: Record = { - external_user_id: externalUserId, - account_id: accountId, - ...(params || {}), - }; + ): Promise> { + const { externalUserId, accountId, body: _body } = request; + const _queryParams: Record = {}; + _queryParams.external_user_id = externalUserId; + _queryParams.account_id = accountId; const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), "x-pd-environment": requestOptions?.projectEnvironment ?? this._options?.projectEnvironment, }), - transformedHeaders, requestOptions?.headers, ); - const _response = await core.fetcher({ + const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? @@ -316,21 +234,13 @@ export class Proxy { unrecognizedObjectKeys: "strip", omitUndefined: true, }), + responseType: "binary-response", timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ProxyResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -367,50 +277,34 @@ export class Proxy { /** * Forward an authenticated DELETE request to an external API using an external user's account credentials - * - * @param {Pipedream.ProxyDeleteRequest} request - * @param {Proxy.RequestOptions} requestOptions - Request-specific configuration. - * * @throws {@link Pipedream.TooManyRequestsError} - * - * @example - * await client.proxy.delete({ - * url: "https://api.example.com/endpoint", - * externalUserId: "external_user_id", - * accountId: "account_id", - * params: { key: "value" }, - * headers: { "X-Custom-Header": "value" } - * }) */ public delete( + url64: string, request: Pipedream.ProxyDeleteRequest, requestOptions?: Proxy.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(url64, request, requestOptions)); } private async __delete( + url64: string, request: Pipedream.ProxyDeleteRequest, requestOptions?: Proxy.RequestOptions, - ): Promise> { - const { url, externalUserId, accountId, params, headers } = request; - const url64 = base64Encode(url); - const transformedHeaders = this.transformProxyHeaders(headers); - const _queryParams: Record = { - external_user_id: externalUserId, - account_id: accountId, - ...(params || {}), - }; + ): Promise> { + const { externalUserId, accountId } = request; + const _queryParams: Record = {}; + _queryParams.external_user_id = externalUserId; + _queryParams.account_id = accountId; const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), "x-pd-environment": requestOptions?.projectEnvironment ?? this._options?.projectEnvironment, }), - transformedHeaders, requestOptions?.headers, ); - const _response = await core.fetcher({ + const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? @@ -420,21 +314,13 @@ export class Proxy { method: "DELETE", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + responseType: "binary-response", timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ProxyResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { @@ -471,51 +357,34 @@ export class Proxy { /** * Forward an authenticated PATCH request to an external API using an external user's account credentials - * - * @param {Pipedream.ProxyPatchRequest} request - * @param {Proxy.RequestOptions} requestOptions - Request-specific configuration. - * * @throws {@link Pipedream.TooManyRequestsError} - * - * @example - * await client.proxy.patch({ - * url: "https://api.example.com/endpoint", - * externalUserId: "external_user_id", - * accountId: "account_id", - * body: { "key": "value" }, - * params: { key: "value" }, - * headers: { "X-Custom-Header": "value" } - * }) */ public patch( + url64: string, request: Pipedream.ProxyPatchRequest, requestOptions?: Proxy.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__patch(request, requestOptions)); + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__patch(url64, request, requestOptions)); } private async __patch( + url64: string, request: Pipedream.ProxyPatchRequest, requestOptions?: Proxy.RequestOptions, - ): Promise> { - const { url, externalUserId, accountId, body: _body, params, headers } = request; - const url64 = base64Encode(url); - const transformedHeaders = this.transformProxyHeaders(headers); - const _queryParams: Record = { - external_user_id: externalUserId, - account_id: accountId, - ...(params || {}), - }; + ): Promise> { + const { externalUserId, accountId, body: _body } = request; + const _queryParams: Record = {}; + _queryParams.external_user_id = externalUserId; + _queryParams.account_id = accountId; const _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), "x-pd-environment": requestOptions?.projectEnvironment ?? this._options?.projectEnvironment, }), - transformedHeaders, requestOptions?.headers, ); - const _response = await core.fetcher({ + const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? @@ -531,21 +400,13 @@ export class Proxy { unrecognizedObjectKeys: "strip", omitUndefined: true, }), + responseType: "binary-response", timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { - data: serializers.ProxyResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; + return { data: _response.body, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/proxy/client/index.ts b/src/api/resources/proxy/client/index.ts index 82648c6..195f9aa 100644 --- a/src/api/resources/proxy/client/index.ts +++ b/src/api/resources/proxy/client/index.ts @@ -1,2 +1 @@ -export {}; export * from "./requests/index.js"; diff --git a/src/api/resources/proxy/client/requests/ProxyDeleteRequest.ts b/src/api/resources/proxy/client/requests/ProxyDeleteRequest.ts index b27978d..e1a266b 100644 --- a/src/api/resources/proxy/client/requests/ProxyDeleteRequest.ts +++ b/src/api/resources/proxy/client/requests/ProxyDeleteRequest.ts @@ -1,26 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../../../../core/index.js"; - /** * @example * { - * url: "https://api.example.com/endpoint", * externalUserId: "external_user_id", - * accountId: "account_id", - * params: { page: "1", limit: "10" }, - * headers: { "X-Custom-Header": "value" } + * accountId: "account_id" * } */ export interface ProxyDeleteRequest { - /** Target URL to proxy request to */ - url: string; /** The external user ID for the proxy request */ externalUserId: string; /** The account ID to use for authentication */ accountId: string; - /** Query parameters to forward */ - params?: Record; - /** Additional headers to include (will be prefixed with 'x-pd-proxy-') */ - headers?: Record | undefined>; } diff --git a/src/api/resources/proxy/client/requests/ProxyGetRequest.ts b/src/api/resources/proxy/client/requests/ProxyGetRequest.ts index 13c2c1a..b20f640 100644 --- a/src/api/resources/proxy/client/requests/ProxyGetRequest.ts +++ b/src/api/resources/proxy/client/requests/ProxyGetRequest.ts @@ -1,26 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../../../../core/index.js"; - /** * @example * { - * url: "https://api.example.com/endpoint", * externalUserId: "external_user_id", - * accountId: "account_id", - * params: { page: "1", limit: "10" }, - * headers: { "X-Custom-Header": "value" } + * accountId: "account_id" * } */ export interface ProxyGetRequest { - /** Target URL to proxy request to */ - url: string; /** The external user ID for the proxy request */ externalUserId: string; /** The account ID to use for authentication */ accountId: string; - /** Query parameters to forward */ - params?: Record; - /** Additional headers to include (will be prefixed with 'x-pd-proxy-') */ - headers?: Record | undefined>; } diff --git a/src/api/resources/proxy/client/requests/ProxyPatchRequest.ts b/src/api/resources/proxy/client/requests/ProxyPatchRequest.ts index cec8cd6..ce31c63 100644 --- a/src/api/resources/proxy/client/requests/ProxyPatchRequest.ts +++ b/src/api/resources/proxy/client/requests/ProxyPatchRequest.ts @@ -1,31 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../../../../core/index.js"; - /** * @example * { - * url: "https://api.example.com/endpoint", * externalUserId: "external_user_id", * accountId: "account_id", * body: { - * "key": "value" - * }, - * params: { page: "1", limit: "10" }, - * headers: { "X-Custom-Header": "value" } + * "string": { + * "key": "value" + * } + * } * } */ export interface ProxyPatchRequest { - /** Target URL to proxy request to */ - url: string; /** The external user ID for the proxy request */ externalUserId: string; /** The account ID to use for authentication */ accountId: string; /** Request body to forward to the target API */ body: Record; - /** Query parameters to forward */ - params?: Record; - /** Additional headers to include (will be prefixed with 'x-pd-proxy-') */ - headers?: Record | undefined>; } diff --git a/src/api/resources/proxy/client/requests/ProxyPostRequest.ts b/src/api/resources/proxy/client/requests/ProxyPostRequest.ts index fab40c8..0ddf019 100644 --- a/src/api/resources/proxy/client/requests/ProxyPostRequest.ts +++ b/src/api/resources/proxy/client/requests/ProxyPostRequest.ts @@ -1,31 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../../../../core/index.js"; - /** * @example * { - * url: "https://api.example.com/endpoint", * externalUserId: "external_user_id", * accountId: "account_id", * body: { - * "key": "value" - * }, - * params: { page: "1", limit: "10" }, - * headers: { "X-Custom-Header": "value" } + * "string": { + * "key": "value" + * } + * } * } */ export interface ProxyPostRequest { - /** Target URL to proxy request to */ - url: string; /** The external user ID for the proxy request */ externalUserId: string; /** The account ID to use for authentication */ accountId: string; /** Request body to forward to the target API */ body: Record; - /** Query parameters to forward */ - params?: Record; - /** Additional headers to include (will be prefixed with 'x-pd-proxy-') */ - headers?: Record | undefined>; } diff --git a/src/api/resources/proxy/client/requests/ProxyPutRequest.ts b/src/api/resources/proxy/client/requests/ProxyPutRequest.ts index c20df6f..7d3adc9 100644 --- a/src/api/resources/proxy/client/requests/ProxyPutRequest.ts +++ b/src/api/resources/proxy/client/requests/ProxyPutRequest.ts @@ -1,31 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../../../../core/index.js"; - /** * @example * { - * url: "https://api.example.com/endpoint", * externalUserId: "external_user_id", * accountId: "account_id", * body: { - * "key": "value" - * }, - * params: { page: "1", limit: "10" }, - * headers: { "X-Custom-Header": "value" } + * "string": { + * "key": "value" + * } + * } * } */ export interface ProxyPutRequest { - /** Target URL to proxy request to */ - url: string; /** The external user ID for the proxy request */ externalUserId: string; /** The account ID to use for authentication */ accountId: string; /** Request body to forward to the target API */ body: Record; - /** Query parameters to forward */ - params?: Record; - /** Additional headers to include (will be prefixed with 'x-pd-proxy-') */ - headers?: Record | undefined>; } diff --git a/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts b/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts index 71fbc39..114ccd4 100644 --- a/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts +++ b/src/api/resources/triggers/client/requests/DeployTriggerOpts.ts @@ -17,6 +17,8 @@ export interface DeployTriggerOpts { configuredProps?: Pipedream.ConfiguredProps; /** The ID for dynamic props */ dynamicPropsId?: string; + /** Optional ID of a workflow to receive trigger events */ + workflowId?: string; /** Optional webhook URL to receive trigger events */ webhookUrl?: string; } diff --git a/src/api/types/BackendClientOpts.ts b/src/api/types/BackendClientOpts.ts index 7b1920a..e7fe4cf 100644 --- a/src/api/types/BackendClientOpts.ts +++ b/src/api/types/BackendClientOpts.ts @@ -10,4 +10,6 @@ export interface BackendClientOpts { clientSecret?: string; /** The API URL to use */ apiUrl?: string; + /** Optional space-separated scopes for the access token. Defaults to '*'. */ + scope?: string; } diff --git a/src/api/types/DeployTriggerResponse.ts b/src/api/types/DeployTriggerResponse.ts index 66a2ea8..511b11e 100644 --- a/src/api/types/DeployTriggerResponse.ts +++ b/src/api/types/DeployTriggerResponse.ts @@ -6,5 +6,5 @@ import type * as Pipedream from "../index.js"; * Response received after deploying a trigger */ export interface DeployTriggerResponse { - data: Pipedream.DeployTriggerResponseData; + data: Pipedream.Emitter; } diff --git a/src/api/types/DeployTriggerResponseData.ts b/src/api/types/DeployTriggerResponseData.ts deleted file mode 100644 index d736aa1..0000000 --- a/src/api/types/DeployTriggerResponseData.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Pipedream from "../index.js"; - -export type DeployTriggerResponseData = - | Pipedream.DeployedComponent - | Pipedream.HttpInterface - | Pipedream.TimerInterface; diff --git a/src/api/types/DeployedComponent.ts b/src/api/types/DeployedComponent.ts index e1e6e98..c257a87 100644 --- a/src/api/types/DeployedComponent.ts +++ b/src/api/types/DeployedComponent.ts @@ -12,6 +12,8 @@ export interface DeployedComponent { ownerId: string; /** The ID of the component that was deployed */ componentId: string; + /** The component key (name) that was deployed */ + componentKey?: string; /** The configurable properties of the component */ configurableProps: Pipedream.ConfigurableProp[]; configuredProps: Pipedream.ConfiguredProps; diff --git a/src/api/types/Emitter.ts b/src/api/types/Emitter.ts new file mode 100644 index 0000000..6307cb7 --- /dev/null +++ b/src/api/types/Emitter.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Pipedream from "../index.js"; + +/** + * A component/interface that emits events + */ +export type Emitter = + | Pipedream.Emitter.DeployedComponent + | Pipedream.Emitter.HttpInterface + | Pipedream.Emitter.TimerInterface; + +export namespace Emitter { + export interface DeployedComponent extends Pipedream.DeployedComponent { + type: "DeployedComponent"; + } + + export interface HttpInterface extends Pipedream.HttpInterface { + type: "HttpInterface"; + } + + export interface TimerInterface extends Pipedream.TimerInterface { + type: "TimerInterface"; + } +} diff --git a/src/api/types/GetTriggerResponse.ts b/src/api/types/GetTriggerResponse.ts index 24894eb..f724e5b 100644 --- a/src/api/types/GetTriggerResponse.ts +++ b/src/api/types/GetTriggerResponse.ts @@ -6,5 +6,5 @@ import type * as Pipedream from "../index.js"; * Response received when retrieving a deployed trigger */ export interface GetTriggerResponse { - data: Pipedream.GetTriggerResponseData; + data: Pipedream.Emitter; } diff --git a/src/api/types/GetTriggerResponseData.ts b/src/api/types/GetTriggerResponseData.ts deleted file mode 100644 index 9e94fe9..0000000 --- a/src/api/types/GetTriggerResponseData.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Pipedream from "../index.js"; - -export type GetTriggerResponseData = Pipedream.DeployedComponent | Pipedream.HttpInterface | Pipedream.TimerInterface; diff --git a/src/api/types/GetTriggersResponse.ts b/src/api/types/GetTriggersResponse.ts index b07b1cf..98a8446 100644 --- a/src/api/types/GetTriggersResponse.ts +++ b/src/api/types/GetTriggersResponse.ts @@ -6,6 +6,6 @@ import type * as Pipedream from "../index.js"; * Response received when listing deployed triggers */ export interface GetTriggersResponse { - data: Pipedream.DeployedComponent[]; + data: Pipedream.Emitter[]; pageInfo: Pipedream.PageInfo; } diff --git a/src/api/types/HttpInterface.ts b/src/api/types/HttpInterface.ts index 7d70b0c..e797022 100644 --- a/src/api/types/HttpInterface.ts +++ b/src/api/types/HttpInterface.ts @@ -12,5 +12,5 @@ export interface HttpInterface { /** The timestamp when the HTTP interface was created (epoch milliseconds) */ createdAt: number; /** The timestamp when the HTTP interface was last updated (epoch milliseconds) */ - updatedAt?: number; + updatedAt: number; } diff --git a/src/api/types/ProxyResponseBinary.ts b/src/api/types/ProxyResponseBinary.ts new file mode 100644 index 0000000..e9d59fa --- /dev/null +++ b/src/api/types/ProxyResponseBinary.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Binary response from the proxied API + */ +export type ProxyResponseBinary = string; diff --git a/src/api/types/TimerInterface.ts b/src/api/types/TimerInterface.ts index 832d2c1..ef1c84f 100644 --- a/src/api/types/TimerInterface.ts +++ b/src/api/types/TimerInterface.ts @@ -13,5 +13,5 @@ export interface TimerInterface { /** The timestamp when the timer interface was created (epoch milliseconds) */ createdAt: number; /** The timestamp when the timer interface was last updated (epoch milliseconds) */ - updatedAt?: number; + updatedAt: number; } diff --git a/src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts b/src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts index 785b968..530d6ca 100644 --- a/src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts +++ b/src/serialization/resources/oauthTokens/client/requests/CreateOAuthTokenOpts.ts @@ -10,11 +10,13 @@ export const CreateOAuthTokenOpts: core.serialization.Schema< > = core.serialization.object({ clientId: core.serialization.property("client_id", core.serialization.string()), clientSecret: core.serialization.property("client_secret", core.serialization.string()), + scope: core.serialization.string().optional(), }); export declare namespace CreateOAuthTokenOpts { export interface Raw { client_id: string; client_secret: string; + scope?: string | null; } } diff --git a/src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts b/src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts index d7ccf3b..e41464c 100644 --- a/src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts +++ b/src/serialization/resources/triggers/client/requests/DeployTriggerOpts.ts @@ -13,6 +13,7 @@ export const DeployTriggerOpts: core.serialization.Schema< externalUserId: core.serialization.property("external_user_id", core.serialization.string()), configuredProps: core.serialization.property("configured_props", ConfiguredProps.optional()), dynamicPropsId: core.serialization.property("dynamic_props_id", core.serialization.string().optional()), + workflowId: core.serialization.property("workflow_id", core.serialization.string().optional()), webhookUrl: core.serialization.property("webhook_url", core.serialization.string().optional()), }); @@ -22,6 +23,7 @@ export declare namespace DeployTriggerOpts { external_user_id: string; configured_props?: ConfiguredProps.Raw | null; dynamic_props_id?: string | null; + workflow_id?: string | null; webhook_url?: string | null; } } diff --git a/src/serialization/types/BackendClientOpts.ts b/src/serialization/types/BackendClientOpts.ts index 254aaa8..6383a3c 100644 --- a/src/serialization/types/BackendClientOpts.ts +++ b/src/serialization/types/BackendClientOpts.ts @@ -11,6 +11,7 @@ export const BackendClientOpts: core.serialization.ObjectSchema< clientId: core.serialization.property("client_id", core.serialization.string().optional()), clientSecret: core.serialization.property("client_secret", core.serialization.string().optional()), apiUrl: core.serialization.property("api_url", core.serialization.string().optional()), + scope: core.serialization.string().optional(), }); export declare namespace BackendClientOpts { @@ -18,5 +19,6 @@ export declare namespace BackendClientOpts { client_id?: string | null; client_secret?: string | null; api_url?: string | null; + scope?: string | null; } } diff --git a/src/serialization/types/DeployTriggerResponse.ts b/src/serialization/types/DeployTriggerResponse.ts index 2986d62..469aff2 100644 --- a/src/serialization/types/DeployTriggerResponse.ts +++ b/src/serialization/types/DeployTriggerResponse.ts @@ -3,17 +3,17 @@ import type * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -import { DeployTriggerResponseData } from "./DeployTriggerResponseData.js"; +import { Emitter } from "./Emitter.js"; export const DeployTriggerResponse: core.serialization.ObjectSchema< serializers.DeployTriggerResponse.Raw, Pipedream.DeployTriggerResponse > = core.serialization.object({ - data: DeployTriggerResponseData, + data: Emitter, }); export declare namespace DeployTriggerResponse { export interface Raw { - data: DeployTriggerResponseData.Raw; + data: Emitter.Raw; } } diff --git a/src/serialization/types/DeployTriggerResponseData.ts b/src/serialization/types/DeployTriggerResponseData.ts deleted file mode 100644 index 9fe062d..0000000 --- a/src/serialization/types/DeployTriggerResponseData.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { DeployedComponent } from "./DeployedComponent.js"; -import { HttpInterface } from "./HttpInterface.js"; -import { TimerInterface } from "./TimerInterface.js"; - -export const DeployTriggerResponseData: core.serialization.Schema< - serializers.DeployTriggerResponseData.Raw, - Pipedream.DeployTriggerResponseData -> = core.serialization.undiscriminatedUnion([DeployedComponent, HttpInterface, TimerInterface]); - -export declare namespace DeployTriggerResponseData { - export type Raw = DeployedComponent.Raw | HttpInterface.Raw | TimerInterface.Raw; -} diff --git a/src/serialization/types/DeployedComponent.ts b/src/serialization/types/DeployedComponent.ts index 11d489a..b15e59a 100644 --- a/src/serialization/types/DeployedComponent.ts +++ b/src/serialization/types/DeployedComponent.ts @@ -13,6 +13,7 @@ export const DeployedComponent: core.serialization.ObjectSchema< id: core.serialization.string(), ownerId: core.serialization.property("owner_id", core.serialization.string()), componentId: core.serialization.property("component_id", core.serialization.string()), + componentKey: core.serialization.property("component_key", core.serialization.string().optional()), configurableProps: core.serialization.property("configurable_props", core.serialization.list(ConfigurableProp)), configuredProps: core.serialization.property("configured_props", ConfiguredProps), active: core.serialization.boolean(), @@ -28,6 +29,7 @@ export declare namespace DeployedComponent { id: string; owner_id: string; component_id: string; + component_key?: string | null; configurable_props: ConfigurableProp.Raw[]; configured_props: ConfiguredProps.Raw; active: boolean; diff --git a/src/serialization/types/Emitter.ts b/src/serialization/types/Emitter.ts new file mode 100644 index 0000000..b70ff19 --- /dev/null +++ b/src/serialization/types/Emitter.ts @@ -0,0 +1,35 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { DeployedComponent } from "./DeployedComponent.js"; +import { HttpInterface } from "./HttpInterface.js"; +import { TimerInterface } from "./TimerInterface.js"; + +export const Emitter: core.serialization.Schema = core.serialization + .union("type", { + DeployedComponent: DeployedComponent, + HttpInterface: HttpInterface, + TimerInterface: TimerInterface, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); + +export declare namespace Emitter { + export type Raw = Emitter.DeployedComponent | Emitter.HttpInterface | Emitter.TimerInterface; + + export interface DeployedComponent extends DeployedComponent.Raw { + type: "DeployedComponent"; + } + + export interface HttpInterface extends HttpInterface.Raw { + type: "HttpInterface"; + } + + export interface TimerInterface extends TimerInterface.Raw { + type: "TimerInterface"; + } +} diff --git a/src/serialization/types/GetTriggerResponse.ts b/src/serialization/types/GetTriggerResponse.ts index 24d2ef3..0a15c2a 100644 --- a/src/serialization/types/GetTriggerResponse.ts +++ b/src/serialization/types/GetTriggerResponse.ts @@ -3,17 +3,17 @@ import type * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -import { GetTriggerResponseData } from "./GetTriggerResponseData.js"; +import { Emitter } from "./Emitter.js"; export const GetTriggerResponse: core.serialization.ObjectSchema< serializers.GetTriggerResponse.Raw, Pipedream.GetTriggerResponse > = core.serialization.object({ - data: GetTriggerResponseData, + data: Emitter, }); export declare namespace GetTriggerResponse { export interface Raw { - data: GetTriggerResponseData.Raw; + data: Emitter.Raw; } } diff --git a/src/serialization/types/GetTriggerResponseData.ts b/src/serialization/types/GetTriggerResponseData.ts deleted file mode 100644 index 1c89f4f..0000000 --- a/src/serialization/types/GetTriggerResponseData.ts +++ /dev/null @@ -1,17 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Pipedream from "../../api/index.js"; -import * as core from "../../core/index.js"; -import type * as serializers from "../index.js"; -import { DeployedComponent } from "./DeployedComponent.js"; -import { HttpInterface } from "./HttpInterface.js"; -import { TimerInterface } from "./TimerInterface.js"; - -export const GetTriggerResponseData: core.serialization.Schema< - serializers.GetTriggerResponseData.Raw, - Pipedream.GetTriggerResponseData -> = core.serialization.undiscriminatedUnion([DeployedComponent, HttpInterface, TimerInterface]); - -export declare namespace GetTriggerResponseData { - export type Raw = DeployedComponent.Raw | HttpInterface.Raw | TimerInterface.Raw; -} diff --git a/src/serialization/types/GetTriggersResponse.ts b/src/serialization/types/GetTriggersResponse.ts index ba020f0..12c9e45 100644 --- a/src/serialization/types/GetTriggersResponse.ts +++ b/src/serialization/types/GetTriggersResponse.ts @@ -3,20 +3,20 @@ import type * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -import { DeployedComponent } from "./DeployedComponent.js"; +import { Emitter } from "./Emitter.js"; import { PageInfo } from "./PageInfo.js"; export const GetTriggersResponse: core.serialization.ObjectSchema< serializers.GetTriggersResponse.Raw, Pipedream.GetTriggersResponse > = core.serialization.object({ - data: core.serialization.list(DeployedComponent), + data: core.serialization.list(Emitter), pageInfo: core.serialization.property("page_info", PageInfo), }); export declare namespace GetTriggersResponse { export interface Raw { - data: DeployedComponent.Raw[]; + data: Emitter.Raw[]; page_info: PageInfo.Raw; } } diff --git a/src/serialization/types/HttpInterface.ts b/src/serialization/types/HttpInterface.ts index 30dd4e5..ca0b89a 100644 --- a/src/serialization/types/HttpInterface.ts +++ b/src/serialization/types/HttpInterface.ts @@ -11,7 +11,7 @@ export const HttpInterface: core.serialization.ObjectSchema = core.serialization.string(); + +export declare namespace ProxyResponseBinary { + export type Raw = string; +} diff --git a/src/serialization/types/TimerInterface.ts b/src/serialization/types/TimerInterface.ts index 77c2586..17df406 100644 --- a/src/serialization/types/TimerInterface.ts +++ b/src/serialization/types/TimerInterface.ts @@ -12,7 +12,7 @@ export const TimerInterface: core.serialization.ObjectSchema