Skip to content

Commit 2e9c428

Browse files
committed
Merge branch 'dsinghvi/patch-sdk' of github.com:OnedocLabs/fileforge-node-sdk into dsinghvi/patch-sdk
2 parents 5437996 + c22e3b9 commit 2e9c428

32 files changed

+496
-468
lines changed

.fernignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ src/core/helper.ts
55
src/core/fetcher/Fetcher.ts
66
src/core/form-data-utils/FormData.ts
77
src/core/form-data-utils/index.ts
8-
src/core/index.ts
8+
9+
tests/custom.test.ts
10+
911
README.md
10-
package.json
12+

.github/workflows/ci.yml

+58-50
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,61 @@ name: ci
33
on: [push]
44

55
jobs:
6-
compile:
7-
runs-on: ubuntu-latest
8-
9-
steps:
10-
- name: Checkout repo
11-
uses: actions/checkout@v3
12-
13-
- name: Set up node
14-
uses: actions/setup-node@v3
15-
16-
- name: Compile
17-
run: yarn && yarn build
18-
19-
test:
20-
runs-on: ubuntu-latest
21-
22-
steps:
23-
- name: Checkout repo
24-
uses: actions/checkout@v3
25-
26-
- name: Set up node
27-
uses: actions/setup-node@v3
28-
29-
- name: Compile
30-
run: yarn && yarn test
31-
32-
publish:
33-
needs: [compile, test]
34-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
35-
runs-on: ubuntu-latest
36-
37-
steps:
38-
- name: Checkout repo
39-
uses: actions/checkout@v3
40-
41-
- name: Set up node
42-
uses: actions/setup-node@v3
43-
44-
- name: Install dependencies
45-
run: yarn install
46-
47-
- name: Build
48-
run: yarn build
49-
50-
- name: Publish to npm
51-
run: |
52-
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
53-
npm publish --access public
54-
env:
55-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6+
compile:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v3
12+
13+
- name: Set up node
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 20
17+
18+
- name: Compile
19+
run: yarn && yarn build
20+
21+
test:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repo
26+
uses: actions/checkout@v3
27+
28+
- name: Set up node
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: 20
32+
33+
- name: Run tests
34+
run: yarn && yarn test
35+
env:
36+
FILEFORGE_API_KEY: ${{ secrets.FILEFORGE_API_KEY }}
37+
38+
publish:
39+
needs: [ compile, test ]
40+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout repo
45+
uses: actions/checkout@v3
46+
47+
- name: Set up node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 20
51+
52+
- name: Install dependencies
53+
run: yarn install
54+
55+
- name: Build
56+
run: yarn build
57+
58+
- name: Publish to npm
59+
run: |
60+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
61+
npm publish --access public
62+
env:
63+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# FileForge TypeScript Library
1+
# Fileforge TypeScript Library
22

33
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://buildwithfern.com/)
44

5-
The FileForge TypeScript library provides convenient access to the FileForge API from JavaScript/TypeScript.
5+
The Fileforge TypeScript library provides convenient access to the Fileforge API from JavaScript/TypeScript.
66

77
## Documentation
88

@@ -19,10 +19,10 @@ yarn add fileforge
1919
## Usage
2020

2121
```typescript
22-
import { FileForgeClient, FileForge } from "guesty";
22+
import { FileforgeClient, Fileforge } from "guesty";
2323
import * as fs from "fs";
2424

25-
const fileforge = new FileForgeClient({
25+
const fileforge = new FileforgeClient({
2626
apiKey: "...",
2727
});
2828

@@ -37,15 +37,15 @@ await fileforge.generate({
3737
## Exception Handling
3838

3939
When the API returns a non-success status code (4xx or 5xx response),
40-
a subclass of [FileForgeError](./src/errors/FileForgeError.ts) will be thrown:
40+
a subclass of [FileforgeError](./src/errors/FileforgeError.ts) will be thrown:
4141

4242
```ts
43-
import { FileForgeError } from 'fileforge';
43+
import { FileforgeError } from 'fileforge';
4444

4545
try {
4646
await fileforge.generate(...);
4747
} catch (err) {
48-
if (err instanceof FileForgeError) {
48+
if (err instanceof FileforgeError) {
4949
console.log(err.statusCode);
5050
console.log(err.message);
5151
console.log(err.body);
@@ -105,9 +105,9 @@ running in an unsupported environment, this provides a way for you to break the
105105
ensure the SDK works.
106106

107107
```ts
108-
import { FileForge } from 'fileforge';
108+
import { Fileforge } from 'fileforge';
109109

110-
const guesty = new FileForge({
110+
const guesty = new Fileforge({
111111
apiKey: "...",
112112
fetcher: // provide your implementation here
113113
});

0 commit comments

Comments
 (0)