-
Notifications
You must be signed in to change notification settings - Fork 1
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 #69 from RegestaItalia/fixPublishVisibility
Fix publish visibility
- Loading branch information
Showing
10 changed files
with
171 additions
and
86 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./validateDevclass"; | ||
export * from "./validateTransportTarget"; | ||
export * from "./validateTransportTarget"; | ||
export * from "./validatePackageVisibility"; |
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,21 @@ | ||
import { parsePackageName } from "../../commons"; | ||
import { RegistryType } from "../../registry"; | ||
|
||
export function validatePackageVisibility(registryType: RegistryType, packageName: string, isPrivate: boolean): string|true { | ||
if(registryType === RegistryType.PUBLIC){ | ||
if(isPrivate){ | ||
const packageNameParsed = parsePackageName({ | ||
fullName: packageName | ||
}); | ||
if(!packageNameParsed.organization){ | ||
return `Private packages on public registry need a scope!`; | ||
}else{ | ||
return true; | ||
} | ||
}else{ | ||
return true; | ||
} | ||
}else{ | ||
return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { TR_TARGET, TMSCSYS } from "../../client"; | ||
|
||
export async function validateTransportTarget(target: TR_TARGET, systemTmscsys: TMSCSYS[]): Promise<string|true|void> { | ||
export async function validateTransportTarget(target: TR_TARGET, systemTmscsys: TMSCSYS[]): Promise<string|true> { | ||
if (target) { | ||
target = target.trim().toUpperCase(); | ||
if(!systemTmscsys.find(o => o.sysnam === target)){ | ||
return `Transport target ${target} does not exist.`; | ||
}else{ | ||
return true; | ||
} | ||
}else{ | ||
return `Transport target ${target} not provided.`; | ||
} | ||
} |
Oops, something went wrong.