UNPKG

@altostra/core

Version:

Core library for shared types and logic

75 lines (74 loc) 2.34 kB
/** * Source code location. Could be a repository or a URL. */ export declare type SourceCodeLocation = Repository | Url; /** * An object that defines resource fields with their types. */ export interface Repository { type: 'source-code.repository'; provider: string; url: string; commit: CommitRef; publicKey?: string; } /** * An object that specifies the commit link for the repository. It can be a commit, a branch, or a tag. */ export declare type CommitRef = Branch | Commit | Tag; /** * An object that defines commit fields with their types. */ export interface Commit { type: 'source-code.commit-ref.commit'; commitHash: string; } /** * An object that defines branch fields with their types. */ export interface Branch { type: 'source-code.commit-ref.branch'; branchName: string; } /** * An object that defines tag fields with their types. */ export interface Tag { type: 'source-code.commit-ref.tag'; tagName: string; } /** * An object that defines url fields with their types. */ export interface Url { type: 'source-code.url'; url: string; } /** * Validates the commit for the correct type for the fields. */ export declare const isCommit: import("@altostra/type-validations").ObjectOfTypeValidation<Commit>; /** * Validates the branch for the correct type for the fields. */ export declare const isBranch: import("@altostra/type-validations").ObjectOfTypeValidation<Branch>; /** * Validates the tag for the correct type for the fields. */ export declare const isTag: import("@altostra/type-validations").ObjectOfTypeValidation<Tag>; /** * Validates the commit ref for the correct type for the fields. */ export declare const isCommitRef: import("@altostra/type-validations").TypeValidation<Branch | Commit | Tag>; /** * Validates the repository for the correct type for the fields. */ export declare const isRepository: import("@altostra/type-validations").ObjectOfTypeValidation<Repository>; /** * Validates the url for the correct type for the fields. */ export declare const isUrl: import("@altostra/type-validations").ObjectOfTypeValidation<Url>; /** * Validates the location of the source code for the correct type for the fields. */ export declare const isSourceCodeLocation: import("@altostra/type-validations").TypeValidation<Repository | Url>;