-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk): adds partially auto-generated SDK
The OpenAPI spec is used to auto generate a cross-platform (universal) SDK that can be used to hit the REST API endpoints from both a browser and NodeJS environments. Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
- Loading branch information
Showing
26 changed files
with
848 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,9 @@ | ||
# `@hyperledger-labs/bif-sdk` | ||
|
||
> TODO: description | ||
## Usage | ||
|
||
``` | ||
// TODO: DEMONSTRATE API | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "@hyperledger-labs/bif-sdk", | ||
"version": "0.2.0", | ||
"description": "Universal library used by both front end and back end components of BIF. Aims to be a developer swiss army knife.", | ||
"main": "dist/bif-sdk.node.umd.js", | ||
"mainMinified": "dist/bif-sdk.node.umd.min.js", | ||
"browser": "dist/bif-sdk.web.umd.js", | ||
"browserMinified": "dist/bif-sdk.web.umd.min.js", | ||
"module": "dist/lib/main/typescript/index.js", | ||
"types": "dist/types/main/typescript/index.d.ts", | ||
"files": [ | ||
"dist/*" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"engines": { | ||
"node": ">=10", | ||
"npm": ">=6" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/hyperledger-labs/blockchain-integration-framework.git" | ||
}, | ||
"keywords": [ | ||
"Hyperledger", | ||
"Blockchain", | ||
"Interoperability", | ||
"Integration" | ||
], | ||
"author": { | ||
"name": "Peter Somogyvari", | ||
"email": "peter.somogyvari@accenture.com", | ||
"url": "https://accenture.com" | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "Please add yourself to the list of contributors", | ||
"email": "your.name@example.com", | ||
"url": "https://example.com" | ||
} | ||
], | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/hyperledger-labs/blockchain-integration-framework/issues" | ||
}, | ||
"homepage": "https://github.com/hyperledger-labs/blockchain-integration-framework#readme", | ||
"dependencies": { | ||
"@hyperledger-labs/bif-common": "0.2.0", | ||
"axios": "0.19.2" | ||
} | ||
} |
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,19 @@ | ||
import { Logger, LoggerProvider } from '@hyperledger-labs/bif-common'; | ||
|
||
export interface IApiClientOptions { | ||
apiHost: string; | ||
apiPort: number; | ||
} | ||
|
||
export class ApiClient { | ||
|
||
private readonly log: Logger; | ||
|
||
constructor(public readonly options: IApiClientOptions) { | ||
this.log = LoggerProvider.getOrCreate({ label: 'api-client ' }); | ||
} | ||
|
||
public async call(): Promise<void> { | ||
this.log.debug(`call()`); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/bif-sdk/src/main/typescript/consortium/consortium-service.ts
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,14 @@ | ||
import { ApiClient } from "../api-client"; | ||
|
||
export interface IConsortiumServiceOptions { | ||
apiClient: ApiClient; | ||
} | ||
|
||
export class ConsortiumService { | ||
constructor(public readonly options: IConsortiumServiceOptions) { | ||
} | ||
|
||
async create(): Promise<void> { | ||
return; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/bif-sdk/src/main/typescript/generated/openapi/typescript-axios/.gitignore
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,4 @@ | ||
wwwroot/*.js | ||
node_modules | ||
typings | ||
dist |
23 changes: 23 additions & 0 deletions
23
.../bif-sdk/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator-ignore
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,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
1 change: 1 addition & 0 deletions
1
...bif-sdk/src/main/typescript/generated/openapi/typescript-axios/.openapi-generator/VERSION
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 @@ | ||
4.2.3 |
Oops, something went wrong.