/* * © 2024 Snyk Limited * * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FailedToRenderDefaultTemplateError = exports.FailedToLoadCompiledJSONError = exports.PRTemplateInvalidPayloadError = exports.FailedToDeletePRTemplateError = exports.FailedToReadPRTemplateError = exports.FailedToCreatePRTemplateError = exports.FailedToGenerateHashError = exports.FailedToLoadCompiledYamlError = exports.FailedToParsePullRequestAttributesError = exports.FailedToCompilePrTemplateError = exports.PullRequestTemplateNotFoundError = exports.FailedToGetPullRequestAttributesError = exports.VersionParsingError = exports.DowngradeVersionUnsupportedError = exports.AlreadyLatestVersionError = exports.VersionNotFoundError = exports.NoMatureVersionsFoundError = exports.MetadataNotFoundError = exports.UnsupportedEcosystemError = exports.UnauthorisedAccessError = exports.SCMRateLimitError = exports.FixScenarioNotSupportedError = void 0; const types_1 = require("../types"); const problem_error_1 = require("../problem-error"); /** * @class * @name FixScenarioNotSupportedError * @description Snyk failed to open a fix PR as the scenario is not supported. * @summary Fix scenario not supported * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FixScenarioNotSupportedError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Fix scenario not supported', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#pr-failures-0001', status: 422, description: `Snyk failed to open a fix PR as the scenario is not supported.`, errorCode: 'PR-FAILURES-0001', level: 'error', classification: types_1.Classification.UNSUPPORTED, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FixScenarioNotSupportedError = FixScenarioNotSupportedError; /** * @class * @name SCMRateLimitError * @description SCM rate limit exceeded due to too many requests. * @summary SCM rate limit * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class SCMRateLimitError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'SCM rate limit', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#pr-failures-0002', status: 429, description: `SCM rate limit exceeded due to too many requests.`, errorCode: 'PR-FAILURES-0002', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.SCMRateLimitError = SCMRateLimitError; /** * @class * @name UnauthorisedAccessError * @description Request failed due to unathorised access. Please read documentation around adding users and permitted roles. * * See more: * - [https://docs.snyk.io/snyk-admin/groups-and-organizations/organizations/manage-users-in-organizations](https://docs.snyk.io/snyk-admin/groups-and-organizations/organizations/manage-users-in-organizations) * @summary Unauthorised access * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class UnauthorisedAccessError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Unauthorised access', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#pr-failures-0003', status: 403, description: `Request failed due to unathorised access. Please read documentation around adding users and permitted roles.`, errorCode: 'PR-FAILURES-0003', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/snyk-admin/groups-and-organizations/organizations/manage-users-in-organizations', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.UnauthorisedAccessError = UnauthorisedAccessError; /** * @class * @name UnsupportedEcosystemError * @description The language or package manager is not supported. Please refer to the supported package managers in the documentation. * * See more: * - [https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/upgrade-dependencies-with-automatic-prs/upgrade-open-source-dependencies-with-automatic-prs#supported-languages-and-scms](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/upgrade-dependencies-with-automatic-prs/upgrade-open-source-dependencies-with-automatic-prs#supported-languages-and-scms) * @summary Unsupported ecosystem * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class UnsupportedEcosystemError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Unsupported ecosystem', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-packages-0001', status: 400, description: `The language or package manager is not supported. Please refer to the supported package managers in the documentation.`, errorCode: 'SNYK-PACKAGES-0001', level: 'error', classification: types_1.Classification.UNSUPPORTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/upgrade-dependencies-with-automatic-prs/upgrade-open-source-dependencies-with-automatic-prs#supported-languages-and-scms', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.UnsupportedEcosystemError = UnsupportedEcosystemError; /** * @class * @name MetadataNotFoundError * @description Package metadata not or found or missing. * * See more: * - [https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/upgrade-dependencies-with-automatic-prs/upgrade-private-dependencies-with-automatic-prs#private-packages-api](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/upgrade-dependencies-with-automatic-prs/upgrade-private-dependencies-with-automatic-prs#private-packages-api) * @summary Metadata not found * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class MetadataNotFoundError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Metadata not found', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-packages-0003', status: 404, description: `Package metadata not or found or missing.`, errorCode: 'SNYK-PACKAGES-0003', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/upgrade-dependencies-with-automatic-prs/upgrade-private-dependencies-with-automatic-prs#private-packages-api', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.MetadataNotFoundError = MetadataNotFoundError; /** * @class * @name NoMatureVersionsFoundError * @description Unable to provide a recommended version as no mature versions were found. * @summary No mature versions found for package * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class NoMatureVersionsFoundError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'No mature versions found for package', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-packages-0005', status: 404, description: `Unable to provide a recommended version as no mature versions were found.`, errorCode: 'SNYK-PACKAGES-0005', level: 'warn', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.NoMatureVersionsFoundError = NoMatureVersionsFoundError; /** * @class * @name VersionNotFoundError * @description Unable to provide a recommended version for package using this policy. * @summary No recommended version found * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class VersionNotFoundError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'No recommended version found', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-packages-0006', status: 404, description: `Unable to provide a recommended version for package using this policy.`, errorCode: 'SNYK-PACKAGES-0006', level: 'warn', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.VersionNotFoundError = VersionNotFoundError; /** * @class * @name AlreadyLatestVersionError * @description No newer version found for this package, as it is already to latest version. * @summary Package is already at latest version * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class AlreadyLatestVersionError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Package is already at latest version', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-packages-0007', status: 404, description: `No newer version found for this package, as it is already to latest version.`, errorCode: 'SNYK-PACKAGES-0007', level: 'warn', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.AlreadyLatestVersionError = AlreadyLatestVersionError; /** * @class * @name DowngradeVersionUnsupportedError * @description Unable to suggest a downgrade for a package version. * @summary Version downgrade is not supported * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class DowngradeVersionUnsupportedError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Version downgrade is not supported', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-packages-0008', status: 400, description: `Unable to suggest a downgrade for a package version.`, errorCode: 'SNYK-PACKAGES-0008', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.DowngradeVersionUnsupportedError = DowngradeVersionUnsupportedError; /** * @class * @name VersionParsingError * @description Not a valid version for semver format. * * See more: * - [https://semver.org/](https://semver.org/) * @summary Invalid version * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class VersionParsingError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Invalid version', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-packages-0009', status: 400, description: `Not a valid version for semver format.`, errorCode: 'SNYK-PACKAGES-0009', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://semver.org/', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.VersionParsingError = VersionParsingError; /** * @class * @name FailedToGetPullRequestAttributesError * @description Snyk could not get the custom pull request template attributes, using the given variables and the fetched pr template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Failed to get pull request attributes * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToGetPullRequestAttributesError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Failed to get pull request attributes', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0001', status: 500, description: `Snyk could not get the custom pull request template attributes, using the given variables and the fetched pr template.`, errorCode: 'SNYK-PR-TEMPLATE-0001', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToGetPullRequestAttributesError = FailedToGetPullRequestAttributesError; /** * @class * @name PullRequestTemplateNotFoundError * @description We could not find your pull request template, have you created one yet? Please check the attached link for instructions on how to setup your pull request template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Not found * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class PullRequestTemplateNotFoundError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Not found', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0002', status: 404, description: `We could not find your pull request template, have you created one yet? Please check the attached link for instructions on how to setup your pull request template.`, errorCode: 'SNYK-PR-TEMPLATE-0002', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.PullRequestTemplateNotFoundError = PullRequestTemplateNotFoundError; /** * @class * @name FailedToCompilePrTemplateError * @description Could not compile your customize pull request template. Please check for syntax errors using the Snyk variables inside the template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Failed to compile pull request template * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToCompilePrTemplateError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Failed to compile pull request template', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0003', status: 400, description: `Could not compile your customize pull request template. Please check for syntax errors using the Snyk variables inside the template.`, errorCode: 'SNYK-PR-TEMPLATE-0003', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToCompilePrTemplateError = FailedToCompilePrTemplateError; /** * @class * @name FailedToParsePullRequestAttributesError * @description Snyk could not parse the custom pull request template, using the given variables and assigning them to the fetched pr template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Failed to parse pull request attributes * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToParsePullRequestAttributesError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Failed to parse pull request attributes', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0004', status: 500, description: `Snyk could not parse the custom pull request template, using the given variables and assigning them to the fetched pr template.`, errorCode: 'SNYK-PR-TEMPLATE-0004', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToParsePullRequestAttributesError = FailedToParsePullRequestAttributesError; /** * @class * @name FailedToLoadCompiledYamlError * @description Could not load YAML file after substituting Snyk variables into the custom PR template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Failed to load YAML file after substituting Snyk variables * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToLoadCompiledYamlError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Failed to load YAML file after substituting Snyk variables', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0005', status: 500, description: `Could not load YAML file after substituting Snyk variables into the custom PR template.`, errorCode: 'SNYK-PR-TEMPLATE-0005', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToLoadCompiledYamlError = FailedToLoadCompiledYamlError; /** * @class * @name FailedToGenerateHashError * @description Snyk could not generate hash using the customer PR files and projects vulnIds. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Failed to generate hash for custom PR template * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToGenerateHashError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Failed to generate hash for custom PR template', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0006', status: 500, description: `Snyk could not generate hash using the customer PR files and projects vulnIds.`, errorCode: 'SNYK-PR-TEMPLATE-0006', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToGenerateHashError = FailedToGenerateHashError; /** * @class * @name FailedToCreatePRTemplateError * @description Snyk could not create pull request template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Unable to create pull request template * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToCreatePRTemplateError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Unable to create pull request template', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0007', status: 500, description: `Snyk could not create pull request template.`, errorCode: 'SNYK-PR-TEMPLATE-0007', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToCreatePRTemplateError = FailedToCreatePRTemplateError; /** * @class * @name FailedToReadPRTemplateError * @description Snyk could not get pull request template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Unable to get pull request template * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToReadPRTemplateError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Unable to get pull request template', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0008', status: 500, description: `Snyk could not get pull request template.`, errorCode: 'SNYK-PR-TEMPLATE-0008', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToReadPRTemplateError = FailedToReadPRTemplateError; /** * @class * @name FailedToDeletePRTemplateError * @description Snyk could not delete pull request template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Unable to delete pull request template * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToDeletePRTemplateError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Unable to delete pull request template', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0009', status: 500, description: `Snyk could not delete pull request template.`, errorCode: 'SNYK-PR-TEMPLATE-0009', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToDeletePRTemplateError = FailedToDeletePRTemplateError; /** * @class * @name PRTemplateInvalidPayloadError * @description The pull request template payload is invalid. * @summary Invalid payload * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class PRTemplateInvalidPayloadError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Invalid payload', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0010', status: 500, description: `The pull request template payload is invalid.`, errorCode: 'SNYK-PR-TEMPLATE-0010', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.PRTemplateInvalidPayloadError = PRTemplateInvalidPayloadError; /** * @class * @name FailedToLoadCompiledJSONError * @description Could not load JSON file after substituting Snyk variables into the custom PR template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Failed to load JSON file after substituting Snyk variables * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToLoadCompiledJSONError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Failed to load JSON file after substituting Snyk variables', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0011', status: 500, description: `Could not load JSON file after substituting Snyk variables into the custom PR template.`, errorCode: 'SNYK-PR-TEMPLATE-0011', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToLoadCompiledJSONError = FailedToLoadCompiledJSONError; /** * @class * @name FailedToRenderDefaultTemplateError * @description Could not render default PR template. * * See more: * - [https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta](https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta) * @summary Failed to render default PR template * @category Fix * @param {string} details the specific details that causes this error * @param {string} description the general description for this error * @param {Classification} classification the error classification determining if the error is user-actionable or not * @param {Record} [additionalData] a collection of relevant data specific to this error * @param {Error} [cause] the `Error` type that caused this error to be thrown * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata */ class FailedToRenderDefaultTemplateError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Failed to render default PR template', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-pr-template-0012', status: 500, description: `Could not render default PR template.`, errorCode: 'SNYK-PR-TEMPLATE-0012', level: 'error', classification: types_1.Classification.UNEXPECTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-application-code/snyk-open-source/open-source-basics/customize-pr-templates-closed-beta', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FailedToRenderDefaultTemplateError = FailedToRenderDefaultTemplateError; //# sourceMappingURL=Fix-error-catalog.js.map