-
Notifications
You must be signed in to change notification settings - Fork 2
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 #14 from Aut-Labs/github-task-final
GitHub task final
- Loading branch information
Showing
38 changed files
with
1,312 additions
and
2,208 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
import axios from "axios"; | ||
import { environment } from "./environment"; | ||
import { NetworkConfig } from "./ProviderFactory/network.config"; | ||
import { AuthSig } from "@aut-labs/connector/lib/esm/aut-sig"; | ||
|
||
export const getAppConfig = (): Promise<NetworkConfig[]> => { | ||
return axios | ||
.get(`${environment.apiUrl}/aut/config/network/${environment.networkEnv}`) | ||
.then((r) => r.data); | ||
}; | ||
|
||
interface EncryptRequest { | ||
autSig: AuthSig; | ||
message: string; | ||
hubAddress: string; | ||
} | ||
|
||
export const encryptMessage = (body: EncryptRequest): Promise<string> => { | ||
return axios | ||
.post(`${environment.apiUrl}/task/encrypt`, body) | ||
.then((r) => r.data); | ||
}; |
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,44 @@ | ||
import { | ||
BaseNFTModel, | ||
TaskContributionNFT, | ||
TaskContributionProperties | ||
} from "@aut-labs/sdk"; | ||
|
||
export class CommitContributionProperties extends TaskContributionProperties { | ||
branch: string; | ||
repository: string; | ||
organisation: string; | ||
constructor(data: CommitContributionProperties) { | ||
super(data); | ||
this.branch = data.branch; | ||
this.repository = data.repository; | ||
this.organisation = data.organisation; | ||
} | ||
} | ||
|
||
export class CommitContribution< | ||
T = CommitContributionProperties | ||
> extends TaskContributionNFT<T> { | ||
static getContributionNFT( | ||
contribution: CommitContribution | ||
): BaseNFTModel<any> { | ||
const taskContribution = new CommitContribution(contribution); | ||
return { | ||
name: taskContribution.name, | ||
description: taskContribution.description, | ||
properties: { | ||
branch: taskContribution.properties.branch, | ||
repository: taskContribution.properties.repository, | ||
organisation: taskContribution.properties.organisation | ||
} | ||
} as BaseNFTModel<any>; | ||
} | ||
constructor(data: CommitContribution<T> = {} as CommitContribution<T>) { | ||
super(data); | ||
this.properties = new CommitContributionProperties( | ||
data.properties as CommitContributionProperties | ||
) as T; | ||
} | ||
|
||
contributionType? = "Commit"; | ||
} |
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,44 @@ | ||
import { | ||
BaseNFTModel, | ||
TaskContributionNFT, | ||
TaskContributionProperties | ||
} from "@aut-labs/sdk"; | ||
|
||
export class PullRequestContributionProperties extends TaskContributionProperties { | ||
branch: string; | ||
repository: string; | ||
organisation: string; | ||
constructor(data: PullRequestContributionProperties) { | ||
super(data); | ||
this.branch = data.branch; | ||
this.repository = data.repository; | ||
this.organisation = data.organisation; | ||
} | ||
} | ||
|
||
export class PullRequestContribution< | ||
T = PullRequestContributionProperties | ||
> extends TaskContributionNFT<T> { | ||
static getContributionNFT( | ||
contribution: PullRequestContribution | ||
): BaseNFTModel<any> { | ||
const taskContribution = new PullRequestContribution(contribution); | ||
return { | ||
name: taskContribution.name, | ||
description: taskContribution.description, | ||
properties: { | ||
branch: taskContribution.properties.branch, | ||
repository: taskContribution.properties.repository, | ||
organisation: taskContribution.properties.organisation | ||
} | ||
} as BaseNFTModel<any>; | ||
} | ||
constructor(data: PullRequestContribution<T> = {} as PullRequestContribution<T>) { | ||
super(data); | ||
this.properties = new PullRequestContributionProperties( | ||
data.properties as PullRequestContributionProperties | ||
) as T; | ||
} | ||
|
||
contributionType? = "Pull Request"; | ||
} |
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
Oops, something went wrong.