From 35e01ffeb43ba8cb432662afb5dd5ee0b237f140 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sun, 28 Apr 2024 18:59:32 +0000 Subject: [PATCH] SDK regeneration --- .mock/fern.config.json | 2 +- .mock/generators.yml | 2 +- package.json | 2 +- reference.md | 14 +-- src/Client.ts | 8 +- .../commons/errors/UnauthorizedError.ts | 2 +- .../commons/errors/UnavailableError.ts | 2 +- .../commons/errors/UserNotInOrgError.ts | 2 +- src/api/resources/snippets/client/Client.ts | 118 +++++++++--------- .../client/requests/GetSnippetRequest.ts | 14 +-- .../client/requests/ListSnippetsRequest.ts | 8 +- .../snippets/errors/ApiIdRequiredError.ts | 2 +- .../snippets/errors/EndpointNotFound.ts | 2 +- .../snippets/errors/InvalidPageError.ts | 2 +- .../snippets/errors/OrgIdAndApiIdNotFound.ts | 2 +- .../snippets/errors/OrgIdNotFound.ts | 2 +- .../snippets/errors/OrgIdRequiredError.ts | 2 +- .../resources/snippets/errors/SdkNotFound.ts | 2 +- .../snippets/types/CustomSnippetPayload.ts | 8 +- .../snippets/types/EndpointIdentifier.ts | 6 +- src/api/resources/snippets/types/GoSnippet.ts | 4 +- .../resources/snippets/types/JavaSnippet.ts | 4 +- .../resources/snippets/types/PythonSnippet.ts | 4 +- .../resources/snippets/types/RubySnippet.ts | 4 +- src/api/resources/snippets/types/Sdk.ts | 19 +-- src/api/resources/snippets/types/Snippet.ts | 22 ++-- .../types/SnippetsByEndpointMethod.ts | 4 +- .../resources/snippets/types/SnippetsPage.ts | 4 +- .../snippets/types/TypeScriptSnippet.ts | 4 +- src/api/resources/templates/client/Client.ts | 58 ++++----- .../client/requests/GetSnippetTemplate.ts | 10 +- .../RegisterSnippetTemplateBatchRequest.ts | 10 +- .../RegisterSnippetTemplateRequest.ts | 10 +- .../templates/errors/SnippetNotFound.ts | 2 +- .../resources/templates/types/DictTemplate.ts | 8 +- .../types/DiscriminatedUnionTemplate.ts | 6 +- .../types/EndpointSnippetTemplate.ts | 8 +- .../resources/templates/types/EnumTemplate.ts | 4 +- .../templates/types/GenericTemplate.ts | 4 +- .../templates/types/IterableTemplate.ts | 6 +- .../resources/templates/types/PayloadInput.ts | 4 +- .../templates/types/SnippetRegistryEntry.ts | 8 +- .../templates/types/SnippetTemplate.ts | 4 +- src/api/resources/templates/types/Template.ts | 26 ++-- .../templates/types/TemplateInput.ts | 8 +- .../templates/types/UnionTemplate.ts | 6 +- .../types/VersionedSnippetTemplate.ts | 6 +- src/environments.ts | 4 +- .../{FernError.ts => FernInternalError.ts} | 4 +- ...utError.ts => FernInternalTimeoutError.ts} | 4 +- src/errors/index.ts | 4 +- src/index.ts | 8 +- 52 files changed, 244 insertions(+), 239 deletions(-) rename src/errors/{FernError.ts => FernInternalError.ts} (89%) rename src/errors/{FernTimeoutError.ts => FernInternalTimeoutError.ts} (50%) diff --git a/.mock/fern.config.json b/.mock/fern.config.json index 3aaceb6..2839cf3 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { "organization" : "fern", - "version" : "0.0.5351" + "version" : "0.0.5354" } \ No newline at end of file diff --git a/.mock/generators.yml b/.mock/generators.yml index ec019e1..87770f5 100644 --- a/.mock/generators.yml +++ b/.mock/generators.yml @@ -71,7 +71,7 @@ groups: license: MIT config: noSerdeLayer: true - namespaceExport: Fern + namespaceExport: FernInternal includeApiReference: true fiddle: diff --git a/package.json b/package.json index bb37bba..c31568b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fern/typescript-sdk", - "version": "0.0.5351", + "version": "0.0.5354", "private": false, "repository": "https://github.com/fern-api/fern-typescript", "license": "MIT", diff --git a/reference.md b/reference.md index f6a68b0..cf08ded 100644 --- a/reference.md +++ b/reference.md @@ -2,7 +2,7 @@ ## Snippets -
fern.snippets.get({ ...params }) -> Fern.Snippet[] +
fernInternal.snippets.get({ ...params }) -> FernInternal.Snippet[]
@@ -39,9 +39,9 @@ Get snippet by endpoint method and path
```ts -await fern.snippets.get({ +await fernInternal.snippets.get({ endpoint: { - method: Fern.EndpointMethod.Get, + method: FernInternal.EndpointMethod.Get, path: "/v1/search" } }); @@ -66,7 +66,7 @@ await fern.snippets.get({
-**request: `Fern.GetSnippetRequest`** +**request: `FernInternal.GetSnippetRequest`**
@@ -97,7 +97,7 @@ await fern.snippets.get({
-
fern.snippets.load({ ...params }) -> Fern.SnippetsPage +
fernInternal.snippets.load({ ...params }) -> FernInternal.SnippetsPage
@@ -114,7 +114,7 @@ await fern.snippets.get({
```ts -await fern.snippets.load({ +await fernInternal.snippets.load({ page: 1, orgId: "vellum", apiId: "vellum-ai", @@ -145,7 +145,7 @@ await fern.snippets.load({
-**request: `Fern.ListSnippetsRequest`** +**request: `FernInternal.ListSnippetsRequest`**
diff --git a/src/Client.ts b/src/Client.ts index 84c2234..b2bfefc 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -7,9 +7,9 @@ import * as core from "./core"; import { Snippets } from "./api/resources/snippets/client/Client"; import { Templates } from "./api/resources/templates/client/Client"; -export declare namespace FernClient { +export declare namespace FernInternalClient { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; } @@ -19,8 +19,8 @@ export declare namespace FernClient { } } -export class FernClient { - constructor(protected readonly _options: FernClient.Options = {}) {} +export class FernInternalClient { + constructor(protected readonly _options: FernInternalClient.Options = {}) {} protected _snippets: Snippets | undefined; diff --git a/src/api/resources/commons/errors/UnauthorizedError.ts b/src/api/resources/commons/errors/UnauthorizedError.ts index a5286dc..2252c01 100644 --- a/src/api/resources/commons/errors/UnauthorizedError.ts +++ b/src/api/resources/commons/errors/UnauthorizedError.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class UnauthorizedError extends errors.FernError { +export class UnauthorizedError extends errors.FernInternalError { constructor(body: string) { super({ message: "UnauthorizedError", diff --git a/src/api/resources/commons/errors/UnavailableError.ts b/src/api/resources/commons/errors/UnavailableError.ts index 1a0f6a3..dd5294a 100644 --- a/src/api/resources/commons/errors/UnavailableError.ts +++ b/src/api/resources/commons/errors/UnavailableError.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class UnavailableError extends errors.FernError { +export class UnavailableError extends errors.FernInternalError { constructor(body: string) { super({ message: "UnavailableError", diff --git a/src/api/resources/commons/errors/UserNotInOrgError.ts b/src/api/resources/commons/errors/UserNotInOrgError.ts index ae22ed0..9f05909 100644 --- a/src/api/resources/commons/errors/UserNotInOrgError.ts +++ b/src/api/resources/commons/errors/UserNotInOrgError.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class UserNotInOrgError extends errors.FernError { +export class UserNotInOrgError extends errors.FernInternalError { constructor() { super({ message: "UserNotInOrgError", diff --git a/src/api/resources/snippets/client/Client.ts b/src/api/resources/snippets/client/Client.ts index 5868b5d..adbe51a 100644 --- a/src/api/resources/snippets/client/Client.ts +++ b/src/api/resources/snippets/client/Client.ts @@ -4,13 +4,13 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; import urlJoin from "url-join"; import * as errors from "../../../../errors"; export declare namespace Snippets { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; } @@ -25,31 +25,31 @@ export class Snippets { /** * Get snippet by endpoint method and path - * @throws {@link Fern.UnauthorizedError} - * @throws {@link Fern.UserNotInOrgError} - * @throws {@link Fern.UnavailableError} - * @throws {@link Fern.ApiIdRequiredError} - * @throws {@link Fern.OrgIdRequiredError} - * @throws {@link Fern.OrgIdAndApiIdNotFound} - * @throws {@link Fern.OrgIdNotFound} - * @throws {@link Fern.EndpointNotFound} - * @throws {@link Fern.SdkNotFound} + * @throws {@link FernInternal.UnauthorizedError} + * @throws {@link FernInternal.UserNotInOrgError} + * @throws {@link FernInternal.UnavailableError} + * @throws {@link FernInternal.ApiIdRequiredError} + * @throws {@link FernInternal.OrgIdRequiredError} + * @throws {@link FernInternal.OrgIdAndApiIdNotFound} + * @throws {@link FernInternal.OrgIdNotFound} + * @throws {@link FernInternal.EndpointNotFound} + * @throws {@link FernInternal.SdkNotFound} * * @example - * await fern.snippets.get({ + * await fernInternal.snippets.get({ * endpoint: { - * method: Fern.EndpointMethod.Get, + * method: FernInternal.EndpointMethod.Get, * path: "/v1/search" * } * }) */ public async get( - request: Fern.GetSnippetRequest, + request: FernInternal.GetSnippetRequest, requestOptions?: Snippets.RequestOptions - ): Promise { + ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FernEnvironment.Dev, + (await core.Supplier.get(this._options.environment)) ?? environments.FernInternalEnvironment.Dev, "/snippets" ), method: "POST", @@ -57,7 +57,7 @@ export class Snippets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern/typescript-sdk", - "X-Fern-SDK-Version": "0.0.5351", + "X-Fern-SDK-Version": "0.0.5354", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -67,31 +67,31 @@ export class Snippets { maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { - return _response.body as Fern.Snippet[]; + return _response.body as FernInternal.Snippet[]; } if (_response.error.reason === "status-code") { switch ((_response.error.body as any)?.["error"]) { case "UnauthorizedError": - throw new Fern.UnauthorizedError(_response.error.body as string); + throw new FernInternal.UnauthorizedError(_response.error.body as string); case "UserNotInOrgError": - throw new Fern.UserNotInOrgError(); + throw new FernInternal.UserNotInOrgError(); case "UnavailableError": - throw new Fern.UnavailableError(_response.error.body as string); + throw new FernInternal.UnavailableError(_response.error.body as string); case "ApiIdRequiredError": - throw new Fern.ApiIdRequiredError(_response.error.body as string); + throw new FernInternal.ApiIdRequiredError(_response.error.body as string); case "OrgIdRequiredError": - throw new Fern.OrgIdRequiredError(_response.error.body as string); + throw new FernInternal.OrgIdRequiredError(_response.error.body as string); case "OrgIdAndApiIdNotFound": - throw new Fern.OrgIdAndApiIdNotFound(_response.error.body as string); + throw new FernInternal.OrgIdAndApiIdNotFound(_response.error.body as string); case "OrgIdNotFound": - throw new Fern.OrgIdNotFound(_response.error.body as string); + throw new FernInternal.OrgIdNotFound(_response.error.body as string); case "EndpointNotFound": - throw new Fern.EndpointNotFound(_response.error.body as string); + throw new FernInternal.EndpointNotFound(_response.error.body as string); case "SDKNotFound": - throw new Fern.SdkNotFound(_response.error.body as string); + throw new FernInternal.SdkNotFound(_response.error.body as string); default: - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -100,32 +100,32 @@ export class Snippets { switch (_response.error.reason) { case "non-json": - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.FernTimeoutError(); + throw new errors.FernInternalTimeoutError(); case "unknown": - throw new errors.FernError({ + throw new errors.FernInternalError({ message: _response.error.errorMessage, }); } } /** - * @throws {@link Fern.UnauthorizedError} - * @throws {@link Fern.UserNotInOrgError} - * @throws {@link Fern.UnavailableError} - * @throws {@link Fern.InvalidPageError} - * @throws {@link Fern.ApiIdRequiredError} - * @throws {@link Fern.OrgIdRequiredError} - * @throws {@link Fern.OrgIdAndApiIdNotFound} - * @throws {@link Fern.OrgIdNotFound} - * @throws {@link Fern.SdkNotFound} + * @throws {@link FernInternal.UnauthorizedError} + * @throws {@link FernInternal.UserNotInOrgError} + * @throws {@link FernInternal.UnavailableError} + * @throws {@link FernInternal.InvalidPageError} + * @throws {@link FernInternal.ApiIdRequiredError} + * @throws {@link FernInternal.OrgIdRequiredError} + * @throws {@link FernInternal.OrgIdAndApiIdNotFound} + * @throws {@link FernInternal.OrgIdNotFound} + * @throws {@link FernInternal.SdkNotFound} * * @example - * await fern.snippets.load({ + * await fernInternal.snippets.load({ * page: 1, * orgId: "vellum", * apiId: "vellum-ai", @@ -137,9 +137,9 @@ export class Snippets { * }) */ public async load( - request: Fern.ListSnippetsRequest = {}, + request: FernInternal.ListSnippetsRequest = {}, requestOptions?: Snippets.RequestOptions - ): Promise { + ): Promise { const { page, ..._body } = request; const _queryParams: Record = {}; if (page != null) { @@ -148,7 +148,7 @@ export class Snippets { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FernEnvironment.Dev, + (await core.Supplier.get(this._options.environment)) ?? environments.FernInternalEnvironment.Dev, "/snippets/load" ), method: "POST", @@ -156,7 +156,7 @@ export class Snippets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern/typescript-sdk", - "X-Fern-SDK-Version": "0.0.5351", + "X-Fern-SDK-Version": "0.0.5354", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -167,31 +167,31 @@ export class Snippets { maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { - return _response.body as Fern.SnippetsPage; + return _response.body as FernInternal.SnippetsPage; } if (_response.error.reason === "status-code") { switch ((_response.error.body as any)?.["error"]) { case "UnauthorizedError": - throw new Fern.UnauthorizedError(_response.error.body as string); + throw new FernInternal.UnauthorizedError(_response.error.body as string); case "UserNotInOrgError": - throw new Fern.UserNotInOrgError(); + throw new FernInternal.UserNotInOrgError(); case "UnavailableError": - throw new Fern.UnavailableError(_response.error.body as string); + throw new FernInternal.UnavailableError(_response.error.body as string); case "InvalidPageError": - throw new Fern.InvalidPageError(_response.error.body as string); + throw new FernInternal.InvalidPageError(_response.error.body as string); case "ApiIdRequiredError": - throw new Fern.ApiIdRequiredError(_response.error.body as string); + throw new FernInternal.ApiIdRequiredError(_response.error.body as string); case "OrgIdRequiredError": - throw new Fern.OrgIdRequiredError(_response.error.body as string); + throw new FernInternal.OrgIdRequiredError(_response.error.body as string); case "OrgIdAndApiIdNotFound": - throw new Fern.OrgIdAndApiIdNotFound(_response.error.body as string); + throw new FernInternal.OrgIdAndApiIdNotFound(_response.error.body as string); case "OrgIdNotFound": - throw new Fern.OrgIdNotFound(_response.error.body as string); + throw new FernInternal.OrgIdNotFound(_response.error.body as string); case "SDKNotFound": - throw new Fern.SdkNotFound(_response.error.body as string); + throw new FernInternal.SdkNotFound(_response.error.body as string); default: - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -200,14 +200,14 @@ export class Snippets { switch (_response.error.reason) { case "non-json": - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.FernTimeoutError(); + throw new errors.FernInternalTimeoutError(); case "unknown": - throw new errors.FernError({ + throw new errors.FernInternalError({ message: _response.error.errorMessage, }); } diff --git a/src/api/resources/snippets/client/requests/GetSnippetRequest.ts b/src/api/resources/snippets/client/requests/GetSnippetRequest.ts index 8c90ea4..496b5b8 100644 --- a/src/api/resources/snippets/client/requests/GetSnippetRequest.ts +++ b/src/api/resources/snippets/client/requests/GetSnippetRequest.ts @@ -2,13 +2,13 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../../.."; +import * as FernInternal from "../../../.."; /** * @example * { * endpoint: { - * method: Fern.EndpointMethod.Get, + * method: FernInternal.EndpointMethod.Get, * path: "/v1/search" * } * } @@ -19,23 +19,23 @@ export interface GetSnippetRequest { * you must specify an organization ID. * */ - orgId?: Fern.OrgId; + orgId?: FernInternal.OrgId; /** * If you have more than one API, you must specify its ID. * */ - apiId?: Fern.ApiId; + apiId?: FernInternal.ApiId; /** * The SDKs for which to load snippets. If unspecified, * snippets for the latest published SDKs will be returned. * */ - sdks?: Fern.Sdk[]; - endpoint: Fern.EndpointIdentifier; + sdks?: FernInternal.Sdk[]; + endpoint: FernInternal.EndpointIdentifier; /** * The JSON payload to be used as the input for the code snippet. This should just be thought of as the * request body you'd be sending to the endpoint as a cURL. If not specified then the default payload will be used. * */ - payload?: Fern.CustomSnippetPayload; + payload?: FernInternal.CustomSnippetPayload; } diff --git a/src/api/resources/snippets/client/requests/ListSnippetsRequest.ts b/src/api/resources/snippets/client/requests/ListSnippetsRequest.ts index 61f1634..29f742c 100644 --- a/src/api/resources/snippets/client/requests/ListSnippetsRequest.ts +++ b/src/api/resources/snippets/client/requests/ListSnippetsRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../../.."; +import * as FernInternal from "../../../.."; /** * @example @@ -24,16 +24,16 @@ export interface ListSnippetsRequest { * you must specify an organization ID. * */ - orgId?: Fern.OrgId; + orgId?: FernInternal.OrgId; /** * If you have more than one API, you must specify its ID. * */ - apiId?: Fern.ApiId; + apiId?: FernInternal.ApiId; /** * The SDKs for which to load snippets. If unspecified, * snippets for the latest published SDKs will be returned. * */ - sdks?: Fern.Sdk[]; + sdks?: FernInternal.Sdk[]; } diff --git a/src/api/resources/snippets/errors/ApiIdRequiredError.ts b/src/api/resources/snippets/errors/ApiIdRequiredError.ts index f770412..3bb0fd1 100644 --- a/src/api/resources/snippets/errors/ApiIdRequiredError.ts +++ b/src/api/resources/snippets/errors/ApiIdRequiredError.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class ApiIdRequiredError extends errors.FernError { +export class ApiIdRequiredError extends errors.FernInternalError { constructor(body: string) { super({ message: "ApiIdRequiredError", diff --git a/src/api/resources/snippets/errors/EndpointNotFound.ts b/src/api/resources/snippets/errors/EndpointNotFound.ts index 79f3d13..eeafb69 100644 --- a/src/api/resources/snippets/errors/EndpointNotFound.ts +++ b/src/api/resources/snippets/errors/EndpointNotFound.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class EndpointNotFound extends errors.FernError { +export class EndpointNotFound extends errors.FernInternalError { constructor(body: string) { super({ message: "EndpointNotFound", diff --git a/src/api/resources/snippets/errors/InvalidPageError.ts b/src/api/resources/snippets/errors/InvalidPageError.ts index af1cbbc..2ea1a76 100644 --- a/src/api/resources/snippets/errors/InvalidPageError.ts +++ b/src/api/resources/snippets/errors/InvalidPageError.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class InvalidPageError extends errors.FernError { +export class InvalidPageError extends errors.FernInternalError { constructor(body: string) { super({ message: "InvalidPageError", diff --git a/src/api/resources/snippets/errors/OrgIdAndApiIdNotFound.ts b/src/api/resources/snippets/errors/OrgIdAndApiIdNotFound.ts index 92f34f6..8f604d1 100644 --- a/src/api/resources/snippets/errors/OrgIdAndApiIdNotFound.ts +++ b/src/api/resources/snippets/errors/OrgIdAndApiIdNotFound.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class OrgIdAndApiIdNotFound extends errors.FernError { +export class OrgIdAndApiIdNotFound extends errors.FernInternalError { constructor(body: string) { super({ message: "OrgIdAndApiIdNotFound", diff --git a/src/api/resources/snippets/errors/OrgIdNotFound.ts b/src/api/resources/snippets/errors/OrgIdNotFound.ts index 7812f09..2cbc7d9 100644 --- a/src/api/resources/snippets/errors/OrgIdNotFound.ts +++ b/src/api/resources/snippets/errors/OrgIdNotFound.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class OrgIdNotFound extends errors.FernError { +export class OrgIdNotFound extends errors.FernInternalError { constructor(body: string) { super({ message: "OrgIdNotFound", diff --git a/src/api/resources/snippets/errors/OrgIdRequiredError.ts b/src/api/resources/snippets/errors/OrgIdRequiredError.ts index f9b45a4..8194fd9 100644 --- a/src/api/resources/snippets/errors/OrgIdRequiredError.ts +++ b/src/api/resources/snippets/errors/OrgIdRequiredError.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class OrgIdRequiredError extends errors.FernError { +export class OrgIdRequiredError extends errors.FernInternalError { constructor(body: string) { super({ message: "OrgIdRequiredError", diff --git a/src/api/resources/snippets/errors/SdkNotFound.ts b/src/api/resources/snippets/errors/SdkNotFound.ts index 7bcfc04..2ea73ac 100644 --- a/src/api/resources/snippets/errors/SdkNotFound.ts +++ b/src/api/resources/snippets/errors/SdkNotFound.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class SdkNotFound extends errors.FernError { +export class SdkNotFound extends errors.FernInternalError { constructor(body: string) { super({ message: "SDKNotFound", diff --git a/src/api/resources/snippets/types/CustomSnippetPayload.ts b/src/api/resources/snippets/types/CustomSnippetPayload.ts index 9e3dd5f..8003b2a 100644 --- a/src/api/resources/snippets/types/CustomSnippetPayload.ts +++ b/src/api/resources/snippets/types/CustomSnippetPayload.ts @@ -2,11 +2,11 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface CustomSnippetPayload { - headers?: Fern.ParameterPayload[]; - pathParameters?: Fern.ParameterPayload[]; - queryParameters?: Fern.ParameterPayload[]; + headers?: FernInternal.ParameterPayload[]; + pathParameters?: FernInternal.ParameterPayload[]; + queryParameters?: FernInternal.ParameterPayload[]; requestBody?: unknown; } diff --git a/src/api/resources/snippets/types/EndpointIdentifier.ts b/src/api/resources/snippets/types/EndpointIdentifier.ts index c18db26..d22e1c4 100644 --- a/src/api/resources/snippets/types/EndpointIdentifier.ts +++ b/src/api/resources/snippets/types/EndpointIdentifier.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface EndpointIdentifier { - path: Fern.EndpointPath; - method: Fern.EndpointMethod; + path: FernInternal.EndpointPath; + method: FernInternal.EndpointMethod; } diff --git a/src/api/resources/snippets/types/GoSnippet.ts b/src/api/resources/snippets/types/GoSnippet.ts index bf8b4c7..369c1ac 100644 --- a/src/api/resources/snippets/types/GoSnippet.ts +++ b/src/api/resources/snippets/types/GoSnippet.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface GoSnippet { - sdk: Fern.GoSdk; + sdk: FernInternal.GoSdk; client: string; } diff --git a/src/api/resources/snippets/types/JavaSnippet.ts b/src/api/resources/snippets/types/JavaSnippet.ts index cdf5be8..9cb11f8 100644 --- a/src/api/resources/snippets/types/JavaSnippet.ts +++ b/src/api/resources/snippets/types/JavaSnippet.ts @@ -2,10 +2,10 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface JavaSnippet { - sdk: Fern.JavaSdk; + sdk: FernInternal.JavaSdk; async_client: string; sync_client: string; } diff --git a/src/api/resources/snippets/types/PythonSnippet.ts b/src/api/resources/snippets/types/PythonSnippet.ts index 94d29a8..8d2b8e9 100644 --- a/src/api/resources/snippets/types/PythonSnippet.ts +++ b/src/api/resources/snippets/types/PythonSnippet.ts @@ -2,10 +2,10 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface PythonSnippet { - sdk: Fern.PythonSdk; + sdk: FernInternal.PythonSdk; async_client: string; sync_client: string; } diff --git a/src/api/resources/snippets/types/RubySnippet.ts b/src/api/resources/snippets/types/RubySnippet.ts index cb8c3e0..ed618ce 100644 --- a/src/api/resources/snippets/types/RubySnippet.ts +++ b/src/api/resources/snippets/types/RubySnippet.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface RubySnippet { - sdk: Fern.RubySdk; + sdk: FernInternal.RubySdk; client: string; } diff --git a/src/api/resources/snippets/types/Sdk.ts b/src/api/resources/snippets/types/Sdk.ts index 77def25..4942f54 100644 --- a/src/api/resources/snippets/types/Sdk.ts +++ b/src/api/resources/snippets/types/Sdk.ts @@ -2,28 +2,33 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; -export type Sdk = Fern.Sdk.Typescript | Fern.Sdk.Python | Fern.Sdk.Go | Fern.Sdk.Ruby | Fern.Sdk.Java; +export type Sdk = + | FernInternal.Sdk.Typescript + | FernInternal.Sdk.Python + | FernInternal.Sdk.Go + | FernInternal.Sdk.Ruby + | FernInternal.Sdk.Java; export declare namespace Sdk { - interface Typescript extends Fern.TypeScriptSdk { + interface Typescript extends FernInternal.TypeScriptSdk { type: "typescript"; } - interface Python extends Fern.PythonSdk { + interface Python extends FernInternal.PythonSdk { type: "python"; } - interface Go extends Fern.GoSdk { + interface Go extends FernInternal.GoSdk { type: "go"; } - interface Ruby extends Fern.RubySdk { + interface Ruby extends FernInternal.RubySdk { type: "ruby"; } - interface Java extends Fern.JavaSdk { + interface Java extends FernInternal.JavaSdk { type: "java"; } } diff --git a/src/api/resources/snippets/types/Snippet.ts b/src/api/resources/snippets/types/Snippet.ts index a8ef4cd..a0176d4 100644 --- a/src/api/resources/snippets/types/Snippet.ts +++ b/src/api/resources/snippets/types/Snippet.ts @@ -2,33 +2,33 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export type Snippet = - | Fern.Snippet.Typescript - | Fern.Snippet.Python - | Fern.Snippet.Java - | Fern.Snippet.Go - | Fern.Snippet.Ruby; + | FernInternal.Snippet.Typescript + | FernInternal.Snippet.Python + | FernInternal.Snippet.Java + | FernInternal.Snippet.Go + | FernInternal.Snippet.Ruby; export declare namespace Snippet { - interface Typescript extends Fern.TypeScriptSnippet { + interface Typescript extends FernInternal.TypeScriptSnippet { type: "typescript"; } - interface Python extends Fern.PythonSnippet { + interface Python extends FernInternal.PythonSnippet { type: "python"; } - interface Java extends Fern.JavaSnippet { + interface Java extends FernInternal.JavaSnippet { type: "java"; } - interface Go extends Fern.GoSnippet { + interface Go extends FernInternal.GoSnippet { type: "go"; } - interface Ruby extends Fern.RubySnippet { + interface Ruby extends FernInternal.RubySnippet { type: "ruby"; } } diff --git a/src/api/resources/snippets/types/SnippetsByEndpointMethod.ts b/src/api/resources/snippets/types/SnippetsByEndpointMethod.ts index 2dbf136..a2df937 100644 --- a/src/api/resources/snippets/types/SnippetsByEndpointMethod.ts +++ b/src/api/resources/snippets/types/SnippetsByEndpointMethod.ts @@ -2,6 +2,6 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; -export type SnippetsByEndpointMethod = Record; +export type SnippetsByEndpointMethod = Record; diff --git a/src/api/resources/snippets/types/SnippetsPage.ts b/src/api/resources/snippets/types/SnippetsPage.ts index 6e54cb4..8b2a16a 100644 --- a/src/api/resources/snippets/types/SnippetsPage.ts +++ b/src/api/resources/snippets/types/SnippetsPage.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface SnippetsPage { /** If present, pass this into the `page` query parameter to load the next page. */ @@ -11,5 +11,5 @@ export interface SnippetsPage { * The snippets are returned as a map of endpoint path (e.g. `/api/users`) * to a map of endpoint method (e.g. `POST`) to snippets. */ - snippets: Record; + snippets: Record; } diff --git a/src/api/resources/snippets/types/TypeScriptSnippet.ts b/src/api/resources/snippets/types/TypeScriptSnippet.ts index cb924c5..aadced6 100644 --- a/src/api/resources/snippets/types/TypeScriptSnippet.ts +++ b/src/api/resources/snippets/types/TypeScriptSnippet.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface TypeScriptSnippet { - sdk: Fern.TypeScriptSdk; + sdk: FernInternal.TypeScriptSdk; client: string; } diff --git a/src/api/resources/templates/client/Client.ts b/src/api/resources/templates/client/Client.ts index 00c2635..71b9686 100644 --- a/src/api/resources/templates/client/Client.ts +++ b/src/api/resources/templates/client/Client.ts @@ -4,13 +4,13 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; import urlJoin from "url-join"; import * as errors from "../../../../errors"; export declare namespace Templates { interface Options { - environment?: core.Supplier; + environment?: core.Supplier; token?: core.Supplier; } @@ -27,12 +27,12 @@ export class Templates { * Store endpoint snippet for a particular SDK. */ public async register( - request: Fern.RegisterSnippetTemplateRequest, + request: FernInternal.RegisterSnippetTemplateRequest, requestOptions?: Templates.RequestOptions ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FernEnvironment.Dev, + (await core.Supplier.get(this._options.environment)) ?? environments.FernInternalEnvironment.Dev, "/snippet-template/register" ), method: "POST", @@ -40,7 +40,7 @@ export class Templates { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern/typescript-sdk", - "X-Fern-SDK-Version": "0.0.5351", + "X-Fern-SDK-Version": "0.0.5354", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -54,7 +54,7 @@ export class Templates { } if (_response.error.reason === "status-code") { - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -62,14 +62,14 @@ export class Templates { switch (_response.error.reason) { case "non-json": - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.FernTimeoutError(); + throw new errors.FernInternalTimeoutError(); case "unknown": - throw new errors.FernError({ + throw new errors.FernInternalError({ message: _response.error.errorMessage, }); } @@ -79,12 +79,12 @@ export class Templates { * Store endpoint snippets for a particular SDK. */ public async registerBatch( - request: Fern.RegisterSnippetTemplateBatchRequest, + request: FernInternal.RegisterSnippetTemplateBatchRequest, requestOptions?: Templates.RequestOptions ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FernEnvironment.Dev, + (await core.Supplier.get(this._options.environment)) ?? environments.FernInternalEnvironment.Dev, "/snippet-template/register/batch" ), method: "POST", @@ -92,7 +92,7 @@ export class Templates { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern/typescript-sdk", - "X-Fern-SDK-Version": "0.0.5351", + "X-Fern-SDK-Version": "0.0.5354", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -106,7 +106,7 @@ export class Templates { } if (_response.error.reason === "status-code") { - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -114,14 +114,14 @@ export class Templates { switch (_response.error.reason) { case "non-json": - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.FernTimeoutError(); + throw new errors.FernInternalTimeoutError(); case "unknown": - throw new errors.FernError({ + throw new errors.FernInternalError({ message: _response.error.errorMessage, }); } @@ -129,16 +129,16 @@ export class Templates { /** * Get the endpoint's snippet template for a particular SDK. - * @throws {@link Fern.UnauthorizedError} - * @throws {@link Fern.SnippetNotFound} + * @throws {@link FernInternal.UnauthorizedError} + * @throws {@link FernInternal.SnippetNotFound} */ public async get( - request: Fern.GetSnippetTemplate, + request: FernInternal.GetSnippetTemplate, requestOptions?: Templates.RequestOptions - ): Promise { + ): Promise { const _response = await core.fetcher({ url: urlJoin( - (await core.Supplier.get(this._options.environment)) ?? environments.FernEnvironment.Dev, + (await core.Supplier.get(this._options.environment)) ?? environments.FernInternalEnvironment.Dev, "/snippet-template/get" ), method: "POST", @@ -146,7 +146,7 @@ export class Templates { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern/typescript-sdk", - "X-Fern-SDK-Version": "0.0.5351", + "X-Fern-SDK-Version": "0.0.5354", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -156,17 +156,17 @@ export class Templates { maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { - return _response.body as Fern.EndpointSnippetTemplate; + return _response.body as FernInternal.EndpointSnippetTemplate; } if (_response.error.reason === "status-code") { switch ((_response.error.body as any)?.["error"]) { case "UnauthorizedError": - throw new Fern.UnauthorizedError(_response.error.body as string); + throw new FernInternal.UnauthorizedError(_response.error.body as string); case "SnippetNotFound": - throw new Fern.SnippetNotFound(_response.error.body as string); + throw new FernInternal.SnippetNotFound(_response.error.body as string); default: - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.body, }); @@ -175,14 +175,14 @@ export class Templates { switch (_response.error.reason) { case "non-json": - throw new errors.FernError({ + throw new errors.FernInternalError({ statusCode: _response.error.statusCode, body: _response.error.rawBody, }); case "timeout": - throw new errors.FernTimeoutError(); + throw new errors.FernInternalTimeoutError(); case "unknown": - throw new errors.FernError({ + throw new errors.FernInternalError({ message: _response.error.errorMessage, }); } diff --git a/src/api/resources/templates/client/requests/GetSnippetTemplate.ts b/src/api/resources/templates/client/requests/GetSnippetTemplate.ts index 0f81b24..d497154 100644 --- a/src/api/resources/templates/client/requests/GetSnippetTemplate.ts +++ b/src/api/resources/templates/client/requests/GetSnippetTemplate.ts @@ -2,19 +2,19 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../../.."; +import * as FernInternal from "../../../.."; export interface GetSnippetTemplate { /** * The organization to create snippets for. * */ - orgId: Fern.OrgId; + orgId: FernInternal.OrgId; /** * The API name. * */ - apiId: Fern.ApiId; - sdk: Fern.Sdk; - endpointId: Fern.EndpointIdentifier; + apiId: FernInternal.ApiId; + sdk: FernInternal.Sdk; + endpointId: FernInternal.EndpointIdentifier; } diff --git a/src/api/resources/templates/client/requests/RegisterSnippetTemplateBatchRequest.ts b/src/api/resources/templates/client/requests/RegisterSnippetTemplateBatchRequest.ts index c0f4309..356ca3e 100644 --- a/src/api/resources/templates/client/requests/RegisterSnippetTemplateBatchRequest.ts +++ b/src/api/resources/templates/client/requests/RegisterSnippetTemplateBatchRequest.ts @@ -2,19 +2,19 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../../.."; +import * as FernInternal from "../../../.."; export interface RegisterSnippetTemplateBatchRequest { /** * The organization to create snippets for. * */ - orgId: Fern.OrgId; + orgId: FernInternal.OrgId; /** * The API name. * */ - apiId: Fern.ApiId; - apiDefinitionId: Fern.ApiDefinitionId; - snippets: Fern.SnippetRegistryEntry[]; + apiId: FernInternal.ApiId; + apiDefinitionId: FernInternal.ApiDefinitionId; + snippets: FernInternal.SnippetRegistryEntry[]; } diff --git a/src/api/resources/templates/client/requests/RegisterSnippetTemplateRequest.ts b/src/api/resources/templates/client/requests/RegisterSnippetTemplateRequest.ts index c36c643..59741d2 100644 --- a/src/api/resources/templates/client/requests/RegisterSnippetTemplateRequest.ts +++ b/src/api/resources/templates/client/requests/RegisterSnippetTemplateRequest.ts @@ -2,19 +2,19 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../../.."; +import * as FernInternal from "../../../.."; export interface RegisterSnippetTemplateRequest { /** * The organization to create snippets for. * */ - orgId: Fern.OrgId; + orgId: FernInternal.OrgId; /** * The API name. * */ - apiId: Fern.ApiId; - apiDefinitionId: Fern.ApiDefinitionId; - snippet: Fern.SnippetRegistryEntry; + apiId: FernInternal.ApiId; + apiDefinitionId: FernInternal.ApiDefinitionId; + snippet: FernInternal.SnippetRegistryEntry; } diff --git a/src/api/resources/templates/errors/SnippetNotFound.ts b/src/api/resources/templates/errors/SnippetNotFound.ts index 5817945..aab9b21 100644 --- a/src/api/resources/templates/errors/SnippetNotFound.ts +++ b/src/api/resources/templates/errors/SnippetNotFound.ts @@ -4,7 +4,7 @@ import * as errors from "../../../../errors"; -export class SnippetNotFound extends errors.FernError { +export class SnippetNotFound extends errors.FernInternalError { constructor(body: string) { super({ message: "SnippetNotFound", diff --git a/src/api/resources/templates/types/DictTemplate.ts b/src/api/resources/templates/types/DictTemplate.ts index ac1b7d0..a433a0c 100644 --- a/src/api/resources/templates/types/DictTemplate.ts +++ b/src/api/resources/templates/types/DictTemplate.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface DictTemplate { imports?: string[]; @@ -14,8 +14,8 @@ export interface DictTemplate { /** Commonly the braces of a container like `{ $FERN_INPUT }`, but may even be something like `new Dict( $FERN_INPUT )` */ containerTemplateString: string; delimiter: string; - keyTemplate: Fern.Template; - valueTemplate: Fern.Template; + keyTemplate: FernInternal.Template; + valueTemplate: FernInternal.Template; keyValueSeparator: string; - templateInput?: Fern.PayloadInput; + templateInput?: FernInternal.PayloadInput; } diff --git a/src/api/resources/templates/types/DiscriminatedUnionTemplate.ts b/src/api/resources/templates/types/DiscriminatedUnionTemplate.ts index 5745a41..f2772ef 100644 --- a/src/api/resources/templates/types/DiscriminatedUnionTemplate.ts +++ b/src/api/resources/templates/types/DiscriminatedUnionTemplate.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface DiscriminatedUnionTemplate { imports?: string[]; @@ -14,6 +14,6 @@ export interface DiscriminatedUnionTemplate { templateString: string; discriminantField: string; /** A map of the union member's discriminant to the template to use to create it */ - members: Record; - templateInput?: Fern.PayloadInput; + members: Record; + templateInput?: FernInternal.PayloadInput; } diff --git a/src/api/resources/templates/types/EndpointSnippetTemplate.ts b/src/api/resources/templates/types/EndpointSnippetTemplate.ts index 6f375e1..5e41a1d 100644 --- a/src/api/resources/templates/types/EndpointSnippetTemplate.ts +++ b/src/api/resources/templates/types/EndpointSnippetTemplate.ts @@ -2,10 +2,10 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface EndpointSnippetTemplate { - sdk: Fern.Sdk; - endpointId: Fern.EndpointIdentifier; - snippetTemplate: Fern.VersionedSnippetTemplate; + sdk: FernInternal.Sdk; + endpointId: FernInternal.EndpointIdentifier; + snippetTemplate: FernInternal.VersionedSnippetTemplate; } diff --git a/src/api/resources/templates/types/EnumTemplate.ts b/src/api/resources/templates/types/EnumTemplate.ts index 71a75f1..5a234ce 100644 --- a/src/api/resources/templates/types/EnumTemplate.ts +++ b/src/api/resources/templates/types/EnumTemplate.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface EnumTemplate { imports?: string[]; @@ -13,5 +13,5 @@ export interface EnumTemplate { isOptional: boolean; templateString?: string; values: Record; - templateInput?: Fern.PayloadInput; + templateInput?: FernInternal.PayloadInput; } diff --git a/src/api/resources/templates/types/GenericTemplate.ts b/src/api/resources/templates/types/GenericTemplate.ts index f486c06..90064f3 100644 --- a/src/api/resources/templates/types/GenericTemplate.ts +++ b/src/api/resources/templates/types/GenericTemplate.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface GenericTemplate { imports?: string[]; @@ -13,7 +13,7 @@ export interface GenericTemplate { isOptional: boolean; templateString: string; /** An ordered list of inputs to the template. */ - templateInputs?: Fern.TemplateInput[]; + templateInputs?: FernInternal.TemplateInput[]; /** In the event you have multiple template inputs, how do you concat them together */ inputDelimiter?: string; } diff --git a/src/api/resources/templates/types/IterableTemplate.ts b/src/api/resources/templates/types/IterableTemplate.ts index 10ed8d6..718ae8e 100644 --- a/src/api/resources/templates/types/IterableTemplate.ts +++ b/src/api/resources/templates/types/IterableTemplate.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface IterableTemplate { imports?: string[]; @@ -18,6 +18,6 @@ export interface IterableTemplate { * In the event of an array, the root template would be something like `[ fern!{{ child }} ]` * and so the child would be the actual object type seen in the example. */ - innerTemplate: Fern.Template; - templateInput?: Fern.PayloadInput; + innerTemplate: FernInternal.Template; + templateInput?: FernInternal.PayloadInput; } diff --git a/src/api/resources/templates/types/PayloadInput.ts b/src/api/resources/templates/types/PayloadInput.ts index 7976629..1e6c67d 100644 --- a/src/api/resources/templates/types/PayloadInput.ts +++ b/src/api/resources/templates/types/PayloadInput.ts @@ -2,10 +2,10 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface PayloadInput { - location: Fern.PayloadLocation; + location: FernInternal.PayloadLocation; /** Dot delimited path to the value within the payload, if omitted the full payload is used. */ path?: string; } diff --git a/src/api/resources/templates/types/SnippetRegistryEntry.ts b/src/api/resources/templates/types/SnippetRegistryEntry.ts index 9ec9b7a..1f1057d 100644 --- a/src/api/resources/templates/types/SnippetRegistryEntry.ts +++ b/src/api/resources/templates/types/SnippetRegistryEntry.ts @@ -2,10 +2,10 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface SnippetRegistryEntry { - sdk: Fern.Sdk; - endpointId: Fern.EndpointIdentifier; - snippetTemplate: Fern.VersionedSnippetTemplate; + sdk: FernInternal.Sdk; + endpointId: FernInternal.EndpointIdentifier; + snippetTemplate: FernInternal.VersionedSnippetTemplate; } diff --git a/src/api/resources/templates/types/SnippetTemplate.ts b/src/api/resources/templates/types/SnippetTemplate.ts index d9f9de9..32043b0 100644 --- a/src/api/resources/templates/types/SnippetTemplate.ts +++ b/src/api/resources/templates/types/SnippetTemplate.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface SnippetTemplate { clientInstantiation: string; - functionInvocation: Fern.Template; + functionInvocation: FernInternal.Template; } diff --git a/src/api/resources/templates/types/Template.ts b/src/api/resources/templates/types/Template.ts index b46f9c6..9615eae 100644 --- a/src/api/resources/templates/types/Template.ts +++ b/src/api/resources/templates/types/Template.ts @@ -2,38 +2,38 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export type Template = - | Fern.Template.Generic - | Fern.Template.Enum - | Fern.Template.DiscriminatedUnion - | Fern.Template.Union - | Fern.Template.Dict - | Fern.Template.Iterable; + | FernInternal.Template.Generic + | FernInternal.Template.Enum + | FernInternal.Template.DiscriminatedUnion + | FernInternal.Template.Union + | FernInternal.Template.Dict + | FernInternal.Template.Iterable; export declare namespace Template { - interface Generic extends Fern.GenericTemplate { + interface Generic extends FernInternal.GenericTemplate { type: "generic"; } - interface Enum extends Fern.EnumTemplate { + interface Enum extends FernInternal.EnumTemplate { type: "enum"; } - interface DiscriminatedUnion extends Fern.DiscriminatedUnionTemplate { + interface DiscriminatedUnion extends FernInternal.DiscriminatedUnionTemplate { type: "discriminatedUnion"; } - interface Union extends Fern.UnionTemplate { + interface Union extends FernInternal.UnionTemplate { type: "union"; } - interface Dict extends Fern.DictTemplate { + interface Dict extends FernInternal.DictTemplate { type: "dict"; } - interface Iterable extends Fern.IterableTemplate { + interface Iterable extends FernInternal.IterableTemplate { type: "iterable"; } } diff --git a/src/api/resources/templates/types/TemplateInput.ts b/src/api/resources/templates/types/TemplateInput.ts index 88d91c7..3392d6a 100644 --- a/src/api/resources/templates/types/TemplateInput.ts +++ b/src/api/resources/templates/types/TemplateInput.ts @@ -2,17 +2,17 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; -export type TemplateInput = Fern.TemplateInput.Template | Fern.TemplateInput.Payload; +export type TemplateInput = FernInternal.TemplateInput.Template | FernInternal.TemplateInput.Payload; export declare namespace TemplateInput { interface Template { type: "template"; - value: Fern.Template; + value: FernInternal.Template; } - interface Payload extends Fern.PayloadInput { + interface Payload extends FernInternal.PayloadInput { type: "payload"; } } diff --git a/src/api/resources/templates/types/UnionTemplate.ts b/src/api/resources/templates/types/UnionTemplate.ts index 29557d1..ec7c275 100644 --- a/src/api/resources/templates/types/UnionTemplate.ts +++ b/src/api/resources/templates/types/UnionTemplate.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; export interface UnionTemplate { imports?: string[]; @@ -13,6 +13,6 @@ export interface UnionTemplate { isOptional: boolean; templateString: string; /** A map of the union member's typeID to the template. */ - members: Record; - templateInput?: Fern.PayloadInput; + members: Record; + templateInput?: FernInternal.PayloadInput; } diff --git a/src/api/resources/templates/types/VersionedSnippetTemplate.ts b/src/api/resources/templates/types/VersionedSnippetTemplate.ts index b06a0dd..047bc56 100644 --- a/src/api/resources/templates/types/VersionedSnippetTemplate.ts +++ b/src/api/resources/templates/types/VersionedSnippetTemplate.ts @@ -2,12 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Fern from "../../.."; +import * as FernInternal from "../../.."; -export type VersionedSnippetTemplate = Fern.VersionedSnippetTemplate.V1; +export type VersionedSnippetTemplate = FernInternal.VersionedSnippetTemplate.V1; export declare namespace VersionedSnippetTemplate { - interface V1 extends Fern.SnippetTemplate { + interface V1 extends FernInternal.SnippetTemplate { type: "v1"; } } diff --git a/src/environments.ts b/src/environments.ts index 052600b..cc1de37 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -export const FernEnvironment = { +export const FernInternalEnvironment = { Dev: "https://registry-dev2.buildwithfern.com", Prod: "https://registry.buildwithfern.com", } as const; -export type FernEnvironment = typeof FernEnvironment.Dev | typeof FernEnvironment.Prod; +export type FernInternalEnvironment = typeof FernInternalEnvironment.Dev | typeof FernInternalEnvironment.Prod; diff --git a/src/errors/FernError.ts b/src/errors/FernInternalError.ts similarity index 89% rename from src/errors/FernError.ts rename to src/errors/FernInternalError.ts index 4bf2e8e..7c1e188 100644 --- a/src/errors/FernError.ts +++ b/src/errors/FernInternalError.ts @@ -2,13 +2,13 @@ * This file was auto-generated by Fern from our API Definition. */ -export class FernError extends Error { +export class FernInternalError extends Error { readonly statusCode?: number; readonly body?: unknown; constructor({ message, statusCode, body }: { message?: string; statusCode?: number; body?: unknown }) { super(buildMessage({ message, statusCode, body })); - Object.setPrototypeOf(this, FernError.prototype); + Object.setPrototypeOf(this, FernInternalError.prototype); if (statusCode != null) { this.statusCode = statusCode; } diff --git a/src/errors/FernTimeoutError.ts b/src/errors/FernInternalTimeoutError.ts similarity index 50% rename from src/errors/FernTimeoutError.ts rename to src/errors/FernInternalTimeoutError.ts index 6fd41f2..08d7442 100644 --- a/src/errors/FernTimeoutError.ts +++ b/src/errors/FernInternalTimeoutError.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -export class FernTimeoutError extends Error { +export class FernInternalTimeoutError extends Error { constructor() { super("Timeout"); - Object.setPrototypeOf(this, FernTimeoutError.prototype); + Object.setPrototypeOf(this, FernInternalTimeoutError.prototype); } } diff --git a/src/errors/index.ts b/src/errors/index.ts index 72b3bb9..8eafea8 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -1,2 +1,2 @@ -export { FernError } from "./FernError"; -export { FernTimeoutError } from "./FernTimeoutError"; +export { FernInternalError } from "./FernInternalError"; +export { FernInternalTimeoutError } from "./FernInternalTimeoutError"; diff --git a/src/index.ts b/src/index.ts index 46b0249..66426d9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -export * as Fern from "./api"; -export { FernClient } from "./Client"; -export { FernEnvironment } from "./environments"; -export { FernError, FernTimeoutError } from "./errors"; +export * as FernInternal from "./api"; +export { FernInternalClient } from "./Client"; +export { FernInternalEnvironment } from "./environments"; +export { FernInternalError, FernInternalTimeoutError } from "./errors";