Skip to content

Commit

Permalink
Merge pull request #2 from OnedocLabs/fern/setup-ts-sdk-generation
Browse files Browse the repository at this point in the history
(fern): setup ts sdk generation
  • Loading branch information
pierredge authored May 7, 2024
2 parents b02e829 + fefeb72 commit 63b5f16
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 10 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ts-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release TypeScript SDK

on:
workflow_dispatch:
inputs:
version:
description: "The version of the TypeScript SDK that you would like to release"
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3

- name: Download Fern
run: npm install -g fern-api

- name: Release Node SDK
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
NPM_TOKen: ${{ secrets.NPM_TOKEN }}
run: |
fern generate --group ts-sdk --version ${{ inputs.version }} --log-level debug
4 changes: 2 additions & 2 deletions fern/fern.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"organization": "fileforge",
"version": "0.19.31"
}
"version": "0.24.0"
}
20 changes: 17 additions & 3 deletions fern/generators.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
api:
- path: ../openapi.yml
overrides: ../openapi-overrides.yml
api:
- path: ../openapi.yml
overrides: ../openapi-overrides.yml
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-node-sdk
version: 0.16.0-rc8
output:
location: npm
package-name: 'fileforge'
# token: ${NPM_TOKEN}
github:
repository: OnedocLabs/fileforge-node-sdk
license: MIT
config:
namespaceExport: FileForge
145 changes: 140 additions & 5 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,28 @@ components:
type: apiKey
name: X-API-Key
in: header
schemas: {}
schemas:
def-0:
type: object
required:
- statusCode
- code
- message
description: Generic error response schema
properties:
statusCode:
type: number
description: The HTTP status code
example: 400
code:
type: string
description: A machine-readable error code
example: BAD_REQUEST
message:
type: string
description: A human-readable message
example: No index.html file provided
title: ErrorSchema
paths:
/status/:
get:
Expand All @@ -36,8 +57,28 @@ paths:
type: object
required: []
properties:
world:
test:
type: boolean
description: Generate a test document instead of a production document. The
generated document will contain a watermark. Defaults to
true.
default: true
host:
type: boolean
description: If enabled, the document will be hosted by FileForge and a
presigned URL will be returned.
default: false
expiresAt:
type: string
format: date-time
description: If host is enabled, the expiration date of the presigned URL.
Defaults to 7 days from now. Cannot exceed 7 days from
now.
fileName:
type: string
description: The name of the generated PDF file. Defaults to document. The file
name should not contain extensions nor path traversals.
default: document
files:
allOf:
- {}
Expand All @@ -52,10 +93,104 @@ paths:
security:
- apiKey: []
responses:
"200":
description: Default Response
"201":
description: PDF Document generated successfully
content:
application/pdf:
description: PDF Document
schema:
type: string
format: binary
application/json:
schema:
type: object
required:
- url
properties:
url:
type: string
format: uri
description: URL to the generated PDF document
"400":
description: Bad request
content:
application/json:
schema:
description: Bad request
$ref: "#/components/schemas/def-0"
"401":
description: Unauthorized
content:
application/json:
schema:
description: Unauthorized
$ref: "#/components/schemas/def-0"
"500":
description: Internal server error
"502":
description: Bad Gateway
content:
application/json:
schema:
description: Bad Gateway
$ref: "#/components/schemas/def-0"
/pdf/merge/:
post:
tags:
- PDF
requestBody:
content:
multipart/form-data:
schema:
type: object
required:
- files
- options
properties:
options:
type: object
required: []
properties: {}
files:
allOf:
- {}
- type: array
items:
type: string
format: binary
encoding:
options:
contentType: application/json
required: true
security:
- apiKey: []
responses:
"201":
description: PDF Document generated successfully
content:
application/pdf:
description: PDF Document
schema:
type: string
format: binary
"400":
description: Bad request
content:
application/json:
schema:
description: Bad request
$ref: "#/components/schemas/def-0"
"401":
description: Unauthorized
content:
application/json:
schema:
description: Unauthorized
$ref: "#/components/schemas/def-0"
"500":
description: Internal server error
servers:
- url: https://30c1-2a01-cb00-286-f500-f58d-848f-e524-f098.ngrok-free.app
- url: https://api.fileforge.com
description: Tunnel server
- url: http://localhost:3000
description: Development server

0 comments on commit 63b5f16

Please sign in to comment.