Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/ _generated_/rest/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { Records } from "./api/resources/records/client/Client";
import { Tokens } from "./api/resources/tokens/client/Client";
import { Query } from "./api/resources/query/client/Client";
import { Authentication } from "./api/resources/authentication/client/Client";
import { Deprecated } from "./api/resources/deprecated/client/Client";
import { Strings } from "./api/resources/strings/client/Client";
import { Files } from "./api/resources/files/client/Client";

export declare namespace SkyflowClient {
export interface Options {
Expand Down Expand Up @@ -39,6 +42,9 @@ export class SkyflowClient {
protected _tokens: Tokens | undefined;
protected _query: Query | undefined;
protected _authentication: Authentication | undefined;
protected _deprecated: Deprecated | undefined;
protected _strings: Strings | undefined;
protected _files: Files | undefined;

constructor(protected readonly _options: SkyflowClient.Options) {}

Expand All @@ -65,4 +71,16 @@ export class SkyflowClient {
public get authentication(): Authentication {
return (this._authentication ??= new Authentication(this._options));
}

public get deprecated(): Deprecated {
return (this._deprecated ??= new Deprecated(this._options));
}

public get strings(): Strings {
return (this._strings ??= new Strings(this._options));
}

public get files(): Files {
return (this._files ??= new Files(this._options));
}
}
2 changes: 1 addition & 1 deletion src/ _generated_/rest/api/errors/BadRequestError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as errors from "../../errors/index";
import * as core from "../../core";

export class BadRequestError extends errors.SkyflowError {
constructor(body: Record<string, unknown>, rawResponse?: core.RawResponse) {
constructor(body?: unknown, rawResponse?: core.RawResponse) {
super({
message: "BadRequestError",
statusCode: 400,
Expand Down
19 changes: 19 additions & 0 deletions src/ _generated_/rest/api/errors/InternalServerError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../errors/index";
import * as Skyflow from "../index";
import * as core from "../../core";

export class InternalServerError extends errors.SkyflowError {
constructor(body: Skyflow.ErrorResponse, rawResponse?: core.RawResponse) {
super({
message: "InternalServerError",
statusCode: 500,
body: body,
rawResponse: rawResponse,
});
Object.setPrototypeOf(this, InternalServerError.prototype);
}
}
2 changes: 1 addition & 1 deletion src/ _generated_/rest/api/errors/NotFoundError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as errors from "../../errors/index";
import * as core from "../../core";

export class NotFoundError extends errors.SkyflowError {
constructor(body: Record<string, unknown>, rawResponse?: core.RawResponse) {
constructor(body?: unknown, rawResponse?: core.RawResponse) {
super({
message: "NotFoundError",
statusCode: 404,
Expand Down
2 changes: 1 addition & 1 deletion src/ _generated_/rest/api/errors/UnauthorizedError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as errors from "../../errors/index";
import * as core from "../../core";

export class UnauthorizedError extends errors.SkyflowError {
constructor(body: Record<string, unknown>, rawResponse?: core.RawResponse) {
constructor(body?: unknown, rawResponse?: core.RawResponse) {
super({
message: "UnauthorizedError",
statusCode: 401,
Expand Down
1 change: 1 addition & 0 deletions src/ _generated_/rest/api/errors/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./NotFoundError";
export * from "./BadRequestError";
export * from "./UnauthorizedError";
export * from "./InternalServerError";
5 changes: 1 addition & 4 deletions src/ _generated_/rest/api/resources/audit/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,7 @@ export class Audit {
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 404:
throw new Skyflow.NotFoundError(
_response.error.body as Record<string, unknown>,
_response.rawResponse,
);
throw new Skyflow.NotFoundError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SkyflowError({
statusCode: _response.error.statusCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,11 @@ export class Authentication {
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 400:
throw new Skyflow.BadRequestError(
_response.error.body as Record<string, unknown>,
_response.rawResponse,
);
throw new Skyflow.BadRequestError(_response.error.body as unknown, _response.rawResponse);
case 401:
throw new Skyflow.UnauthorizedError(
_response.error.body as Record<string, unknown>,
_response.rawResponse,
);
throw new Skyflow.UnauthorizedError(_response.error.body as unknown, _response.rawResponse);
case 404:
throw new Skyflow.NotFoundError(
_response.error.body as Record<string, unknown>,
_response.rawResponse,
);
throw new Skyflow.NotFoundError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SkyflowError({
statusCode: _response.error.statusCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ export class BinLookup {
if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 404:
throw new Skyflow.NotFoundError(
_response.error.body as Record<string, unknown>,
_response.rawResponse,
);
throw new Skyflow.NotFoundError(_response.error.body as unknown, _response.rawResponse);
default:
throw new errors.SkyflowError({
statusCode: _response.error.statusCode,
Expand Down
Loading
Loading