-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from dimitrov-d/master
3.1.0 - New storage methods and Project module
- Loading branch information
Showing
14 changed files
with
469 additions
and
426 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,13 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@types/jest": "^29.5.12", | ||
"eslint-config-common": "*", | ||
"jest": "29.7.0", | ||
"prettier": "latest", | ||
"rimraf": "^5.0.5", | ||
"turbo": "latest", | ||
"jest": "29.7.0", | ||
"ts-jest": "29.1.1", | ||
"@types/jest": "^29.5.11" | ||
"ts-jest": "29.1.2", | ||
"turbo": "latest" | ||
}, | ||
"jest": { | ||
"testTimeout": 1800000, | ||
|
@@ -53,4 +53,4 @@ | |
"preset": "ts-jest", | ||
"verbose": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ApillonModule } from '../../lib/apillon'; | ||
import { ApillonApi } from '../../lib/apillon-api'; | ||
|
||
export class Project extends ApillonModule { | ||
/** | ||
* Base API url for project. | ||
*/ | ||
private API_PREFIX = '/project'; | ||
|
||
/** | ||
* Get credit balance for your project | ||
* @returns {Promise<number>} The credit balance of your project | ||
*/ | ||
public async getCreditBalance(): Promise<number> { | ||
const { balance } = await ApillonApi.get<{ balance: number }>( | ||
`${this.API_PREFIX}/credit`, | ||
); | ||
return balance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { getConfig } from './helpers/helper'; | ||
import { Project } from '../modules/project/project'; | ||
|
||
describe('Project Module tests', () => { | ||
let project: Project; | ||
|
||
beforeAll(async () => { | ||
project = new Project(getConfig()); | ||
}); | ||
|
||
describe('Project module tests', () => { | ||
test('Get project credit balance', async () => { | ||
const balance = await project.getCreditBalance(); | ||
expect(balance).toBeGreaterThan(0); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.