Skip to content

Commit

Permalink
feat(sdk): leg work for adding api to sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
rallieon committed Jun 21, 2021
1 parent 7330eec commit b3e130b
Show file tree
Hide file tree
Showing 34 changed files with 65 additions and 333 deletions.
35 changes: 35 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 0 additions & 56 deletions packages/client/README.md

This file was deleted.

54 changes: 0 additions & 54 deletions packages/client/package.json

This file was deleted.

56 changes: 0 additions & 56 deletions packages/documentation/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions packages/documentation/jest.config.js

This file was deleted.

20 changes: 0 additions & 20 deletions packages/documentation/src/__tests__/game/game.test.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/documentation/src/__tests__/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages/documentation/src/game/game.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/documentation/src/game/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/documentation/src/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/documentation/tsconfig.build.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/documentation/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/haste-game-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

The haste game server is an example of the @haste-sdk/server package. It utilizes the haste arcade api to demonstrate how to leverge a shared leaderboard and payouts.
The haste game server is an example of the @haste-sdk/sdk package. It utilizes the haste arcade api to demonstrate how to leverge a shared leaderboard and payouts.

See [here](https://github.com/playhaste/haste-sdk/blob/main/README.md) for an overview of the haste-sdk repository.

Expand Down
2 changes: 1 addition & 1 deletion packages/haste-game-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@haste-sdk/haste-game-server",
"version": "0.0.0",
"description": "The haste game server is an example of the @haste-sdk/server package. It utilizes the haste arcade api to demonstrate how to leverge a shared leaderboard and payouts.",
"description": "The haste game server is an example of the @haste-sdk/sdk package. It utilizes the haste arcade api to demonstrate how to leverge a shared leaderboard and payouts.",
"contributors": [
"Keith LaForce <keith@playhaste.com>",
"Eric LaForce <eric@playhaste.com>",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/README.md → packages/sdk/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# haste-server
# haste-sdk

## Overview

Expand Down Expand Up @@ -33,7 +33,7 @@ See [here](https://github.com/playhaste/haste-sdk/blob/main/README.md#Usage) for

### Testing

@haste/server utilizes Jest for running tests. To run all tests in the server package use the following command
@haste/sdk utilizes Jest for running tests. To run all tests in the server package use the following command

`npm run test`

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@haste-sdk/documentation",
"name": "@haste-sdk/sdk",
"version": "0.0.0",
"description": "The documentation site for the haste-sdk is generated from source code of the SDK and CLI packages.",
"description": "The sdk to be used to empower developers to leverage the Haste Arcade. The SDK is intended to be used in server side code alongside the developers game logic.",
"contributors": [
"Keith LaForce <keith@playhaste.com>",
"Eric LaForce <eric@playhaste.com>",
Expand Down Expand Up @@ -29,7 +29,9 @@
"url": "https://github.com/playhaste/haste-sdk/issues"
},
"dependencies": {
"@haste-sdk/domain": "0.0.0"
"@haste-sdk/domain": "0.0.0",
"@types/axios": "^0.14.0",
"axios": "^0.21.1"
},
"devDependencies": {
"@types/jest": "^26.0.22",
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions packages/sdk/src/api/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Game } from '@haste-sdk/domain';
import axios from 'axios';

export default class Api {
url: string;

constructor() {
this.url = `${process.env.API_PROTOCOL}://${process.env.API_HOST}${
process.env.API_PORT !== '' ? ':' + process.env.API_PORT : ''
}`;
}

async play(value: string) {
const path = `${this.url}/api/user/verify`;
const params = {
response: value,
};

await axios.post<Game>(path, params);
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions packages/server/jest.config.js

This file was deleted.

Loading

0 comments on commit b3e130b

Please sign in to comment.