Skip to content

Commit

Permalink
Merge pull request #9 from UnofficialDathost/Development
Browse files Browse the repository at this point in the history
0.0.8
  • Loading branch information
WardPearce committed Jun 15, 2021
2 parents 4b91516 + afdb33e commit 166424a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/Production.yml
Expand Up @@ -33,10 +33,12 @@ jobs:
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Get release version
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: echo ::set-env name=DATHOST_VERSION::$(npm info dathost version)
- name: Get Version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'package.json'
prop_path: 'version'
- name: Delete npmrc
run: rm -f ./.npmrc
- name: Build with esbuild
Expand All @@ -45,9 +47,9 @@ jobs:
uses: marvinpinto/action-automatic-releases@v1.2.0
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.DATHOST_VERSION }}"
automatic_release_tag: "${{steps.version.outputs.prop}}"
prerelease: false
title: "${{ env.DATHOST_VERSION }}"
title: "${{steps.version.outputs.prop}}"
files: dist/**
- name: Build docs
run: npm run docs
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "dathost",
"version": "0.0.7",
"version": "0.0.8",
"description": "TypeScript wrapper for Dathost's API",
"main": "src/index.ts",
"files": [
Expand Down
5 changes: 4 additions & 1 deletion src/http.ts
Expand Up @@ -28,7 +28,10 @@ export default class HTTP {
)
}

public async get(url: string): Promise<any> {
public async get(url: string, raw = false): Promise<any> {
if (raw) {
return await this.request.get(url, { responseType: 'blob' })
}
return await this.request.get(url)
}

Expand Down
4 changes: 2 additions & 2 deletions src/server/file.ts
Expand Up @@ -36,8 +36,8 @@ export default class File {
await this.http.put(this.url, payload)
}

public async download(asText = false): Promise<ArrayBuffer | string> {
return await this.http.get(`${this.url}?as_text=${asText.toString()}`)
public async download(asText = false): Promise<Blob | string> {
return await this.http.get(`${this.url}?as_text=${asText.toString()}`, !asText)
}

public async upload(data: Blob): Promise<void> {
Expand Down

0 comments on commit 166424a

Please sign in to comment.