Skip to content

Commit

Permalink
Release 0.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jun 21, 2023
0 parents commit 4ecef1f
Show file tree
Hide file tree
Showing 129 changed files with 3,179 additions and 0 deletions.
1 change: 1 addition & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Specify files that shouldn't be modified by Fern
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ci

on: [push]

jobs:
compile:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn build

publish:
needs: [ compile ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
.DS_Store
/dist
/Client.d.ts
/Client.js
/index.d.ts
/index.js
/api
/core
/errors
/serialization
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
src
.gitignore
.github
.fernignore
.prettierrc.yml
tsconfig.json
yarn.lock
2 changes: 2 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tabWidth: 4
printWidth: 120
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@exa-online/fern-website-node-sdk",
"version": "0.0.20",
"private": false,
"repository": "https://github.com/eXa-online/fern-website-node-sdk",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"build": "tsc",
"prepack": "cp -rv dist/. ."
},
"dependencies": {
"url-join": "4.0.1",
"@types/url-join": "4.0.1",
"axios": "0.27.2",
"@ungap/url-search-params": "0.2.2",
"js-base64": "3.7.2"
},
"devDependencies": {
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
}
}
24 changes: 24 additions & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as core from "./core";
import { Website } from "./api/resources/website/client/Client";

export declare namespace FernWebsiteClient {
interface Options {
environment: core.Supplier<string>;
username?: core.Supplier<string | undefined>;
password?: core.Supplier<string | undefined>;
}
}

export class FernWebsiteClient {
constructor(protected readonly options: FernWebsiteClient.Options) {}

protected _website: Website | undefined;

public get website(): Website {
return (this._website ??= new Website(this.options));
}
}
1 change: 1 addition & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./resources";
15 changes: 15 additions & 0 deletions src/api/resources/commons/errors/BadRequestError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export class BadRequestError extends errors.FernWebsiteError {
constructor() {
super({
message: "BadRequestError",
statusCode: 400,
});
Object.setPrototypeOf(this, BadRequestError.prototype);
}
}
15 changes: 15 additions & 0 deletions src/api/resources/commons/errors/NotFoundError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export class NotFoundError extends errors.FernWebsiteError {
constructor() {
super({
message: "NotFoundError",
statusCode: 404,
});
Object.setPrototypeOf(this, NotFoundError.prototype);
}
}
2 changes: 2 additions & 0 deletions src/api/resources/commons/errors/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./NotFoundError";
export * from "./BadRequestError";
1 change: 1 addition & 0 deletions src/api/resources/commons/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./errors";
1 change: 1 addition & 0 deletions src/api/resources/fixtures/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./resources";
1 change: 1 addition & 0 deletions src/api/resources/fixtures/resources/article/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./types";
23 changes: 23 additions & 0 deletions src/api/resources/fixtures/resources/article/types/Article.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

/**
* @example
* {
* slug: "latest-developments-in-health-science",
* title: "Latest Developments in Health Science",
* image: "https://img.freepik.com/free-photo/young-handsome-physician-medical-robe-with-stethoscope_1303-17818.jpg?w=2000&t=st=1686580083~exp=1686580683~hmac=1dda277654d12f9b6e1e06d73d3e0048b25fd0ab67d48e96cd55429b44574122",
* publicationeDate: new Date("2023-06-12T16:20:12Z"),
* richtext: "<main>\n <img src=\"https://img.freepik.com/free-photo/young-handsome-physician-medical-robe-with-stethoscope_1303-17818.jpg?w=2000&t=st=1686580083~exp=1686580683~hmac=1dda277654d12f9b6e1e06d73d3e0048b25fd0ab67d48e96cd55429b44574122\" alt=\"Health news\" style=\"width:100%; display:block; margin-top:20px;\">\n <section id=\"medical-advancements\">\n <h2>Medical Advancements</h2>\n <p>There have been numerous medical advancements in the past year, from innovative treatments for rare diseases to groundbreaking surgical procedures.</p>\n <p>One such advancement is the use of gene therapy in treating inherited retinal diseases. Researchers have successfully used a virus to deliver a healthy version of a faulty gene to the retina in patients with a rare form of blindness.</p>\n <p>Another exciting development is the use of virtual reality in surgical training. Surgeons can now practice complex procedures in a simulated environment, reducing the risk of errors in real surgeries.</p>\n </section>\n <section id=\"health-research\">\n <h2>Health Research</h2>\n <p>Health researchers are constantly working to improve our understanding of illness and disease. A recent study has shown that exercise may be just as effective as medication in treating heart disease and diabetes.</p>\n <p>Another study has found that eating a plant-based diet can significantly reduce the risk of developing certain types of cancer. This is encouraging news for those who are looking for ways to prevent cancer through lifestyle changes.</p>\n </section>\n <section id=\"health-tips\">\n <h2>Health Tips</h2>\n <p>There are many ways to improve your health and wellbeing, and small changes can often make a big difference. Here are a few health tips to get you started:</p>\n <ul>\n <li>Drink plenty of water to stay hydrated</li>\n <li>Eat a balanced diet with plenty of fruits and vegetables</li>\n <li>Get regular exercise, such as walking or jogging</li>\n <li>Take breaks from sitting and stretch throughout the day</li>\n <li>Practice good sleep hygiene to ensure a good night's sleep</li>\n </ul>\n </section>\n</main>\n"
* }
*/
export interface Article {
slug: FernWebsite.fixtures.ArticleSlug;
title: string;
image?: string;
publicationeDate: Date;
richtext?: string;
}
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 FernWebsite from "../../../../..";

export interface ArticleCollection {
items: FernWebsite.fixtures.Article[];
total: number;
offset: number;
limit: number;
}
11 changes: 11 additions & 0 deletions src/api/resources/fixtures/resources/article/types/ArticleSlug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

/**
* The unique identifier for an article in the database, SEO-relevant
*
* @example
* "latest-developments-in-health-science"
*/
export type ArticleSlug = string;
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 FernWebsite from "../../../../..";

export interface CreatArticleRequest {
slug: FernWebsite.fixtures.ArticleSlug;
title: string;
image?: string;
publicationeDate?: Date;
richtext?: string;
}
4 changes: 4 additions & 0 deletions src/api/resources/fixtures/resources/article/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "./ArticleSlug";
export * from "./Article";
export * from "./ArticleCollection";
export * from "./CreatArticleRequest";
1 change: 1 addition & 0 deletions src/api/resources/fixtures/resources/blogpost/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./types";
25 changes: 25 additions & 0 deletions src/api/resources/fixtures/resources/blogpost/types/BlogPost.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

/**
* @example
* {
* slug: "medical-advancements",
* title: "Medical Advancements",
* author: "Jennifer Lee",
* image: "https://img.freepik.com/free-vector/robot-as-doctor-robotized-surgery-with-patient_613284-2477.jpg?w=1380&t=st=1686581395~exp=1686581995~hmac=a9f2469a8d38110c39a0b268c9a01bdea3f709508319d5f2f03c8fea7c0544d4",
* publicationeDate: new Date("2023-06-10T16:48:13"),
* richtext: "<p>Technology has revolutionized the healthcare industry, leading to numerous medical advancements that have improved patient outcomes. Here are just a few examples:</p> <ul>\n <li>Robotic Surgery</li>\n <p>Robotic surgery allows for minimally invasive procedures that are less painful, have a faster recovery time, and reduce the risk of infection. Surgeons are able to perform precise, complex movements with a greater degree of control, leading to better surgical outcomes.</p>\n <li>Gene Editing</li>\n <p>Advancements in gene editing and CRISPR technology have opened up a world of possibilities for treating genetic disorders. This technology allows scientists to make precise changes to DNA, potentially eliminating the genetic mutations that cause diseases.</p>\n <li>Artificial Organs</li>\n <p>Scientists are working on developing artificial organs that can mimic the function of real ones. These organs could be used to replace damaged or failing organs in patients, potentially saving lives. For example, artificial kidneys could eliminate the need for dialysis in patients with kidney disease.</p>\n <li>Immunotherapy</li>\n <p>Immunotherapy is a form of cancer treatment that uses the body's immune system to fight cancer cells. This approach has shown promising results in clinical trials, and has already been used to successfully treat certain types of cancer.</p>\n</ul> <p>These are just a few of the many medical advancements made possible by technology. As technology continues to advance, we can expect even more breakthroughs in the years to come.</p>\n"
* }
*/
export interface BlogPost {
slug: FernWebsite.fixtures.BlogPostSlug;
author: string;
title: string;
image?: string;
publicationeDate: Date;
richtext?: string;
}
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 FernWebsite from "../../../../..";

export interface BlogPostCollection {
items: FernWebsite.fixtures.BlogPost[];
total: number;
offset: number;
limit: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

/**
* The unique identifier for a blog post in the database, SEO-relevant
*
* @example
* "medical-advancements"
*/
export type BlogPostSlug = string;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export interface CreateBlogPostRequest {
slug: FernWebsite.fixtures.BlogPostSlug;
title: string;
author: string;
image?: string;
publicationeDate?: Date;
richtext?: string;
}
4 changes: 4 additions & 0 deletions src/api/resources/fixtures/resources/blogpost/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "./BlogPostSlug";
export * from "./BlogPost";
export * from "./BlogPostCollection";
export * from "./CreateBlogPostRequest";
4 changes: 4 additions & 0 deletions src/api/resources/fixtures/resources/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * as article from "./article";
export * from "./article/types";
export * as blogpost from "./blogpost";
export * from "./blogpost/types";
4 changes: 4 additions & 0 deletions src/api/resources/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * as fixtures from "./fixtures";
export * as commons from "./commons";
export * from "./commons/errors";
export * as website from "./website";
24 changes: 24 additions & 0 deletions src/api/resources/website/client/Client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as core from "../../../../core";
import { V1 } from "../resources/v1/client/Client";

export declare namespace Website {
interface Options {
environment: core.Supplier<string>;
username?: core.Supplier<string | undefined>;
password?: core.Supplier<string | undefined>;
}
}

export class Website {
constructor(protected readonly options: Website.Options) {}

protected _v1: V1 | undefined;

public get v1(): V1 {
return (this._v1 ??= new V1(this.options));
}
}
1 change: 1 addition & 0 deletions src/api/resources/website/client/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
2 changes: 2 additions & 0 deletions src/api/resources/website/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./resources";
export * from "./client";
1 change: 1 addition & 0 deletions src/api/resources/website/resources/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as v1 from "./v1";
31 changes: 31 additions & 0 deletions src/api/resources/website/resources/v1/client/Client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as core from "../../../../../../core";
import { Article } from "../resources/article/client/Client";
import { Blogpost } from "../resources/blogpost/client/Client";

export declare namespace V1 {
interface Options {
environment: core.Supplier<string>;
username?: core.Supplier<string | undefined>;
password?: core.Supplier<string | undefined>;
}
}

export class V1 {
constructor(protected readonly options: V1.Options) {}

protected _article: Article | undefined;

public get article(): Article {
return (this._article ??= new Article(this.options));
}

protected _blogpost: Blogpost | undefined;

public get blogpost(): Blogpost {
return (this._blogpost ??= new Blogpost(this.options));
}
}
1 change: 1 addition & 0 deletions src/api/resources/website/resources/v1/client/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
2 changes: 2 additions & 0 deletions src/api/resources/website/resources/v1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./resources";
export * from "./client";
Loading

0 comments on commit 4ecef1f

Please sign in to comment.