Skip to content

Commit

Permalink
Release 1.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Feb 11, 2025
1 parent 79b5ea4 commit 7467b3d
Show file tree
Hide file tree
Showing 63 changed files with 503 additions and 308 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/api",
"version": "1.15.0",
"version": "1.15.1",
"private": false,
"repository": "https://github.com/FlatFilers/flatfile-node",
"main": "./index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/accounts/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Accounts {
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.0",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -106,7 +106,7 @@ export class Accounts {
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.0",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
101 changes: 84 additions & 17 deletions src/api/resources/actions/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ export class Actions {
constructor(protected readonly _options: Actions.Options = {}) {}

public async create(
request: Flatfile.Action,
request: Flatfile.ActionCreateRequest,
requestOptions?: Actions.RequestOptions
): Promise<Flatfile.ActionResponse> {
): Promise<Flatfile.ApiActionResponse> {
const { spaceId, body: _body } = request;
const _queryParams: Record<string, string | string[] | object | object[]> = {};
_queryParams["spaceId"] = spaceId;
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlatfileEnvironment.Production,
Expand All @@ -40,17 +43,18 @@ export class Actions {
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.0",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.Action.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
queryParameters: _queryParams,
body: await serializers.ApiActionConfig.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.ActionResponse.parseOrThrow(_response.body, {
return await serializers.ApiActionResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -82,9 +86,12 @@ export class Actions {
}

public async bulkCreate(
request: Flatfile.Actions,
request: Flatfile.ActionsBulkCreateRequest,
requestOptions?: Actions.RequestOptions
): Promise<Flatfile.ActionsResponse> {
): Promise<Flatfile.ApiActionsResponse> {
const { spaceId, body: _body } = request;
const _queryParams: Record<string, string | string[] | object | object[]> = {};
_queryParams["spaceId"] = spaceId;
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlatfileEnvironment.Production,
Expand All @@ -96,17 +103,77 @@ export class Actions {
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.0",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.Actions.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
queryParameters: _queryParams,
body: await serializers.ApiActionConfigs.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.ActionsResponse.parseOrThrow(_response.body, {
return await serializers.ApiActionsResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
skipValidation: true,
breadcrumbsPrefix: ["response"],
});
}

if (_response.error.reason === "status-code") {
throw new errors.FlatfileError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
}

switch (_response.error.reason) {
case "non-json":
throw new errors.FlatfileError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
});
case "timeout":
throw new errors.FlatfileTimeoutError();
case "unknown":
throw new errors.FlatfileError({
message: _response.error.errorMessage,
});
}
}

public async getAll(
request: Flatfile.GetActionsRequest,
requestOptions?: Actions.RequestOptions
): Promise<Flatfile.ApiActionsResponse> {
const { spaceId } = request;
const _queryParams: Record<string, string | string[] | object | object[]> = {};
_queryParams["spaceId"] = spaceId;
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlatfileEnvironment.Production,
"/actions"
),
method: "GET",
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.ApiActionsResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -140,7 +207,7 @@ export class Actions {
public async get(
actionId: Flatfile.ActionId,
requestOptions?: Actions.RequestOptions
): Promise<Flatfile.ActionResponse> {
): Promise<Flatfile.ApiActionResponse> {
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlatfileEnvironment.Production,
Expand All @@ -152,7 +219,7 @@ export class Actions {
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.0",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -161,7 +228,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.ActionResponse.parseOrThrow(_response.body, {
return await serializers.ApiActionResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -196,7 +263,7 @@ export class Actions {
actionId: Flatfile.ActionId,
request: Flatfile.ActionUpdate,
requestOptions?: Actions.RequestOptions
): Promise<Flatfile.ActionResponse> {
): Promise<Flatfile.ApiActionResponse> {
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FlatfileEnvironment.Production,
Expand All @@ -208,7 +275,7 @@ export class Actions {
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.0",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -218,7 +285,7 @@ export class Actions {
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return await serializers.ActionResponse.parseOrThrow(_response.body, {
return await serializers.ApiActionResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -264,7 +331,7 @@ export class Actions {
"X-Disable-Hooks": "true",
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@flatfile/api",
"X-Fern-SDK-Version": "1.15.0",
"X-Fern-SDK-Version": "1.15.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/actions/client/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {};
export * from "./requests";
13 changes: 13 additions & 0 deletions src/api/resources/actions/client/requests/ActionCreateRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Flatfile from "../../../..";

export interface ActionCreateRequest {
/**
* The Space ID for which to create the Action.
*/
spaceId: Flatfile.SpaceId;
body: Flatfile.ApiActionConfig;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Flatfile from "../../../..";

export interface ActionsBulkCreateRequest {
/**
* The Space ID for which to create the Actions.
*/
spaceId: Flatfile.SpaceId;
body: Flatfile.ApiActionConfigs;
}
12 changes: 12 additions & 0 deletions src/api/resources/actions/client/requests/GetActionsRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Flatfile from "../../../..";

export interface GetActionsRequest {
/**
* The Space ID for which to get the Actions.
*/
spaceId: Flatfile.SpaceId;
}
3 changes: 3 additions & 0 deletions src/api/resources/actions/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { ActionCreateRequest } from "./ActionCreateRequest";
export { ActionsBulkCreateRequest } from "./ActionsBulkCreateRequest";
export { GetActionsRequest } from "./GetActionsRequest";
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

import * as Flatfile from "../../..";

export type ActionsResponse = Flatfile.ApiAction[];
export type ApiActionConfigs = Flatfile.ApiActionConfig[];
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

import * as Flatfile from "../../..";

export type ActionResponse = Flatfile.ApiAction;
export type ApiActionResponse = Flatfile.ApiAction;
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

import * as Flatfile from "../../..";

export type Actions = Flatfile.Action[];
export type ApiActionsResponse = Flatfile.ApiAction[];
6 changes: 3 additions & 3 deletions src/api/resources/actions/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./Actions";
export * from "./ActionResponse";
export * from "./ActionsResponse";
export * from "./ApiActionConfigs";
export * from "./ApiActionResponse";
export * from "./ApiActionsResponse";
Loading

0 comments on commit 7467b3d

Please sign in to comment.