Previously, Travis pushed the build artitfacts to the preview server. This required us to use JWT to secure the POST request from Travis, to ensure we couldn't receive malicious builds. JWT has been deprecated and we are moving our builds to CircleCI. This commit rewrites the TypeScript part of the preview server that handles converting build artifact into hosted previews of the docs.
38 lines
938 B
TypeScript
38 lines
938 B
TypeScript
export const enum BuildNums {
|
|
BUILD_INFO_ERROR = 1,
|
|
BUILD_INFO_404,
|
|
BUILD_INFO_BUILD_FAILED,
|
|
BUILD_INFO_INVALID_GH_ORG,
|
|
BUILD_INFO_INVALID_GH_REPO,
|
|
CHANGED_FILES_ERROR,
|
|
CHANGED_FILES_404,
|
|
CHANGED_FILES_NONE,
|
|
BUILD_ARTIFACTS_ERROR,
|
|
BUILD_ARTIFACTS_404,
|
|
BUILD_ARTIFACTS_EMPTY,
|
|
BUILD_ARTIFACTS_MISSING,
|
|
DOWNLOAD_ARTIFACT_ERROR,
|
|
DOWNLOAD_ARTIFACT_404,
|
|
DOWNLOAD_ARTIFACT_TOO_BIG,
|
|
TRUST_CHECK_ERROR,
|
|
TRUST_CHECK_UNTRUSTED,
|
|
TRUST_CHECK_TRUSTED_LABEL,
|
|
TRUST_CHECK_ACTIVE_TRUSTED_USER,
|
|
TRUST_CHECK_INACTIVE_TRUSTED_USER,
|
|
}
|
|
|
|
export const enum PrNums {
|
|
CHANGED_FILES_ERROR = 1,
|
|
CHANGED_FILES_404,
|
|
CHANGED_FILES_NONE,
|
|
TRUST_CHECK_ERROR,
|
|
TRUST_CHECK_UNTRUSTED,
|
|
TRUST_CHECK_TRUSTED_LABEL,
|
|
TRUST_CHECK_ACTIVE_TRUSTED_USER,
|
|
TRUST_CHECK_INACTIVE_TRUSTED_USER,
|
|
}
|
|
|
|
export const SHA = '1234567890'.repeat(4);
|
|
export const ALT_SHA = 'abcde'.repeat(8);
|
|
export const SIMILAR_SHA = SHA.slice(0, -1) + 'A';
|