Skip to content

Commit

Permalink
(fix): update fdr definition to make public sdk work (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Jun 5, 2024
1 parent c1ef978 commit c17558a
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 29 deletions.
7 changes: 3 additions & 4 deletions fern/apis/fdr/definition/api.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: registry
auth: bearer
default-environment: Dev
environments:
Dev: https://registry-dev2.buildwithfern.com
default-environment: Prod
environments:
Prod: https://registry.buildwithfern.com
error-discrimination:
strategy: property
property-name: error
audiences:
audiences:
- external
- fiddle
- snippets
Expand Down
2 changes: 1 addition & 1 deletion fern/apis/fdr/generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ groups:
namespaceExport: Fern
includeApiReference: true
extraDependencies:
"@fern-api/template-resolver": "^0.0.9"
"@fern-api/template-resolver": "0.3.0"

template-resolver:
audiences:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Read {
): Promise<core.APIResponse<FernRegistry.api.v1.read.ApiDefinition, FernRegistry.api.v1.read.getApi.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
`/registry/api/load/${apiDefinitionId}`
),
method: "GET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Register {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/registry/api/register"
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Diff {
_queryParams["currentApiDefinitionId"] = currentApiDefinitionId;
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/registry/diff"
),
method: "GET",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Read {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
`/registry/docs/load/${domain}`
),
method: "GET",
Expand Down Expand Up @@ -78,7 +78,7 @@ export class Read {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/registry/docs/load"
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Write {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/registry/docs/init"
),
method: "POST",
Expand Down Expand Up @@ -68,7 +68,7 @@ export class Write {
): Promise<core.APIResponse<void, FernRegistry.docs.v1.write.finishDocsRegister.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
`/registry/docs/register/${docsRegistrationId}`
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class Read {
): Promise<core.APIResponse<FernRegistry.OrgId, FernRegistry.docs.v2.read.getOrganizationForUrl.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/v2/registry/docs/organization-for-url"
),
method: "POST",
Expand Down Expand Up @@ -77,7 +77,7 @@ export class Read {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/v2/registry/docs/load-with-url"
),
method: "POST",
Expand Down Expand Up @@ -127,7 +127,7 @@ export class Read {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/v2/registry/docs/private/load-with-url"
),
method: "POST",
Expand Down Expand Up @@ -180,7 +180,7 @@ export class Read {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
`/v2/registry/docs/${docsConfigId}`
),
method: "GET",
Expand Down Expand Up @@ -228,7 +228,7 @@ export class Read {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/v2/registry/docs/search-api-key-with-index-segment"
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Write {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/v2/registry/docs/v2/init"
),
method: "POST",
Expand Down Expand Up @@ -84,7 +84,7 @@ export class Write {
> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/v2/registry/docs/preview/init"
),
method: "POST",
Expand Down Expand Up @@ -129,7 +129,7 @@ export class Write {
): Promise<core.APIResponse<void, FernRegistry.docs.v2.write.finishDocsRegister.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
`/v2/registry/docs/register/${docsRegistrationId}`
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class DocsCache {
): Promise<core.APIResponse<void, FernRegistry.docsCache.invalidate.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/docs-cache/invalidate"
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Snippets {
): Promise<core.APIResponse<FernRegistry.Snippet[], FernRegistry.snippets.get.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/snippets"
),
method: "POST",
Expand Down Expand Up @@ -97,7 +97,7 @@ export class Snippets {

const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/snippets/load"
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SnippetsFactory {
): Promise<core.APIResponse<void, FernRegistry.snippetsFactory.createSnippetsForSdk.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/snippets/create"
),
method: "POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Templates {
): Promise<core.APIResponse<void, FernRegistry.templates.register.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/snippet-template/register"
),
method: "POST",
Expand Down Expand Up @@ -68,7 +68,7 @@ export class Templates {
): Promise<core.APIResponse<void, FernRegistry.templates.registerBatch.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/snippet-template/register/batch"
),
method: "POST",
Expand Down Expand Up @@ -105,7 +105,7 @@ export class Templates {
): Promise<core.APIResponse<FernRegistry.EndpointSnippetTemplate, FernRegistry.templates.get.Error>> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Dev,
(await core.Supplier.get(this._options.environment)) ?? environments.FernRegistryEnvironment.Prod,
"/snippet-template/get"
),
method: "POST",
Expand Down
3 changes: 1 addition & 2 deletions packages/fdr-sdk/src/client/generated/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*/

export const FernRegistryEnvironment = {
Dev: "https://registry-dev2.buildwithfern.com",
Prod: "https://registry.buildwithfern.com",
} as const;

export type FernRegistryEnvironment = typeof FernRegistryEnvironment.Dev | typeof FernRegistryEnvironment.Prod;
export type FernRegistryEnvironment = typeof FernRegistryEnvironment.Prod;

0 comments on commit c17558a

Please sign in to comment.