/* * © 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.UnsupportedRuleNamesError = exports.RuleExtensionsLimitReachedError = exports.OrgOutsideAdminGroupError = exports.GroupRelationshipMustBeForAdminGroupError = exports.OrgRelationshipsMustBeUniqueError = exports.RuleExtensionAlreadyExistsForGroupError = exports.UnsupportedProjectError = exports.FeatureIsNotEnabledError = exports.AnalysisFileNameLengthLimitExceededError = exports.AnalysisTargetSizeLimitExceededError = exports.AnalysisResultSizeLimitExceededError = exports.AnalysisFileCountLimitExceededError = void 0; const types_1 = require("../types"); const problem_error_1 = require("../problem-error"); /** * @class * @name AnalysisFileCountLimitExceededError * @description This error occurs when the analysis target has a supported file count that exceeds current system limits. * * To reduce the file count, use a `.snyk` file to ignore specified directories or files. Alternatively, use the Snyk CLI to analyze individual subdirectories separately. * * See more: * - [https://docs.snyk.io/scan-applications/supported-languages-and-frameworks/supported-languages-frameworks-and-feature-availability-overview#code-analysis-snyk-code](https://docs.snyk.io/scan-applications/supported-languages-and-frameworks/supported-languages-frameworks-and-feature-availability-overview#code-analysis-snyk-code) * - [https://docs.snyk.io/scan-applications/start-scanning-using-the-cli-web-ui-or-api/snyk-code-and-your-repositories/excluding-directories-and-files-from-the-import-process](https://docs.snyk.io/scan-applications/start-scanning-using-the-cli-web-ui-or-api/snyk-code-and-your-repositories/excluding-directories-and-files-from-the-import-process) * - [https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli](https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli) * @summary Analysis file count limit exceeded * @category Code * @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 AnalysisFileCountLimitExceededError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Analysis file count limit exceeded', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0001', status: 422, description: `This error occurs when the analysis target has a supported file count that exceeds current system limits. To reduce the file count, use a \`.snyk\` file to ignore specified directories or files. Alternatively, use the Snyk CLI to analyze individual subdirectories separately.`, errorCode: 'SNYK-CODE-0001', level: 'error', classification: types_1.Classification.UNSUPPORTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-applications/supported-languages-and-frameworks/supported-languages-frameworks-and-feature-availability-overview#code-analysis-snyk-code', 'https://docs.snyk.io/scan-applications/start-scanning-using-the-cli-web-ui-or-api/snyk-code-and-your-repositories/excluding-directories-and-files-from-the-import-process', 'https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.AnalysisFileCountLimitExceededError = AnalysisFileCountLimitExceededError; /** * @class * @name AnalysisResultSizeLimitExceededError * @description This error occurs when the analysis target generates a result with a byte size that exceeds current system limits. * * To reduce the overall result size, use a `.snyk` file to ignore specified directories or files. Alternatively, use the Snyk CLI to analyze individual subdirectories separately. * * See more: * - [https://docs.snyk.io/scan-applications/start-scanning-using-the-cli-web-ui-or-api/snyk-code-and-your-repositories/excluding-directories-and-files-from-the-import-process](https://docs.snyk.io/scan-applications/start-scanning-using-the-cli-web-ui-or-api/snyk-code-and-your-repositories/excluding-directories-and-files-from-the-import-process) * - [https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli](https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli) * @summary Analysis result size limit exceeded * @category Code * @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 AnalysisResultSizeLimitExceededError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Analysis result size limit exceeded', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0002', status: 422, description: `This error occurs when the analysis target generates a result with a byte size that exceeds current system limits. To reduce the overall result size, use a \`.snyk\` file to ignore specified directories or files. Alternatively, use the Snyk CLI to analyze individual subdirectories separately.`, errorCode: 'SNYK-CODE-0002', level: 'error', classification: types_1.Classification.UNSUPPORTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-applications/start-scanning-using-the-cli-web-ui-or-api/snyk-code-and-your-repositories/excluding-directories-and-files-from-the-import-process', 'https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.AnalysisResultSizeLimitExceededError = AnalysisResultSizeLimitExceededError; /** * @class * @name AnalysisTargetSizeLimitExceededError * @description This error occurs when the analysis target byte size exceeds current system limits. * * To reduce the overall result size, use a `.snyk` file to ignore specified directories or files. Alternatively, use the Snyk CLI to analyze individual subdirectories separately. * * See more: * - [https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli](https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli) * @summary Analysis target size limit exceeded * @category Code * @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 AnalysisTargetSizeLimitExceededError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Analysis target size limit exceeded', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0003', status: 422, description: `This error occurs when the analysis target byte size exceeds current system limits. To reduce the overall result size, use a \`.snyk\` file to ignore specified directories or files. Alternatively, use the Snyk CLI to analyze individual subdirectories separately.`, errorCode: 'SNYK-CODE-0003', level: 'error', classification: types_1.Classification.UNSUPPORTED, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/snyk-cli/using-snyk-code-from-the-cli', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.AnalysisTargetSizeLimitExceededError = AnalysisTargetSizeLimitExceededError; /** * @class * @name AnalysisFileNameLengthLimitExceededError * @description This error occurs when the analysis target has a file name length that exceeds 255 bytes. * * To be able to scan the analysis target, rename the file to a name that is 255 bytes or less. * * See more: * - [https://docs.snyk.io/scan-with-snyk/supported-languages-and-frameworks/introduction-to-snyk-supported-languages-and-frameworks#filename-length-limitation](https://docs.snyk.io/scan-with-snyk/supported-languages-and-frameworks/introduction-to-snyk-supported-languages-and-frameworks#filename-length-limitation) * @summary Analysis target includes a file with a name longer than 255 bytes * @category Code * @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 AnalysisFileNameLengthLimitExceededError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Analysis target includes a file with a name longer than 255 bytes', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0004', status: 422, description: `This error occurs when the analysis target has a file name length that exceeds 255 bytes. To be able to scan the analysis target, rename the file to a name that is 255 bytes or less.`, errorCode: 'SNYK-CODE-0004', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-with-snyk/supported-languages-and-frameworks/introduction-to-snyk-supported-languages-and-frameworks#filename-length-limitation', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.AnalysisFileNameLengthLimitExceededError = AnalysisFileNameLengthLimitExceededError; /** * @class * @name FeatureIsNotEnabledError * @description This error occurs when Snyk Code is not enabled for the current Organization. Activate Snyk Code and try again.. * * See more: * - [https://docs.snyk.io/scan-using-snyk/snyk-code/configure-snyk-code#enable-snyk-code-in-snyk-web-ui](https://docs.snyk.io/scan-using-snyk/snyk-code/configure-snyk-code#enable-snyk-code-in-snyk-web-ui) * @summary Snyk Code is not enabled * @category Code * @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 FeatureIsNotEnabledError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Snyk Code is not enabled', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0005', status: 403, description: `This error occurs when Snyk Code is not enabled for the current Organization. Activate Snyk Code and try again..`, errorCode: 'SNYK-CODE-0005', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/scan-using-snyk/snyk-code/configure-snyk-code#enable-snyk-code-in-snyk-web-ui', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.FeatureIsNotEnabledError = FeatureIsNotEnabledError; /** * @class * @name UnsupportedProjectError * @description Snyk was unable to find supported files. * * See more: * - [https://docs.snyk.io/getting-started/supported-languages-frameworks-and-feature-availability-overview#code-analysis-snyk-code](https://docs.snyk.io/getting-started/supported-languages-frameworks-and-feature-availability-overview#code-analysis-snyk-code) * @summary Project not supported * @category Code * @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 UnsupportedProjectError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Project not supported', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0006', status: 422, description: `Snyk was unable to find supported files.`, errorCode: 'SNYK-CODE-0006', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [ 'https://docs.snyk.io/getting-started/supported-languages-frameworks-and-feature-availability-overview#code-analysis-snyk-code', ] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.UnsupportedProjectError = UnsupportedProjectError; /** * @class * @name RuleExtensionAlreadyExistsForGroupError * @description A Rule extension with the same type and attributes already exists * for the given Group. * * Either modify the existing Rule extension or create a new * Rule extension with a different type or attributes. * @summary Rule extension already exists for the Group * @category Code * @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 RuleExtensionAlreadyExistsForGroupError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Rule extension already exists for the Group', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0007', status: 409, description: `A Rule extension with the same type and attributes already exists for the given Group. Either modify the existing Rule extension or create a new Rule extension with a different type or attributes.`, errorCode: 'SNYK-CODE-0007', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.RuleExtensionAlreadyExistsForGroupError = RuleExtensionAlreadyExistsForGroupError; /** * @class * @name OrgRelationshipsMustBeUniqueError * @description Each Org relationship to a Snyk Code Rule extention must be unique. * * Make sure each Org in relationships has a different ID. * @summary Organization relationships must be unique * @category Code * @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 OrgRelationshipsMustBeUniqueError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Organization relationships must be unique', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0008', status: 400, description: `Each Org relationship to a Snyk Code Rule extention must be unique. Make sure each Org in relationships has a different ID.`, errorCode: 'SNYK-CODE-0008', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.OrgRelationshipsMustBeUniqueError = OrgRelationshipsMustBeUniqueError; /** * @class * @name GroupRelationshipMustBeForAdminGroupError * @description You cannot associate a Snyk Code Rule extension to any other Group. * * Make sure the Group ID under relationships matches the Group ID in the request path. * @summary Group relationship must match the Group in the requested URL * @category Code * @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 GroupRelationshipMustBeForAdminGroupError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Group relationship must match the Group in the requested URL', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0009', status: 400, description: `You cannot associate a Snyk Code Rule extension to any other Group. Make sure the Group ID under relationships matches the Group ID in the request path.`, errorCode: 'SNYK-CODE-0009', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.GroupRelationshipMustBeForAdminGroupError = GroupRelationshipMustBeForAdminGroupError; /** * @class * @name OrgOutsideAdminGroupError * @description You cannot associate a Snyk Code Rule extension to an Org outside of the administrating Group. * * Make sure each Org under relationships is within the Group in the requested URL. * @summary Organization outside of the administrating Group * @category Code * @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 OrgOutsideAdminGroupError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Organization outside of the administrating Group', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0010', status: 400, description: `You cannot associate a Snyk Code Rule extension to an Org outside of the administrating Group. Make sure each Org under relationships is within the Group in the requested URL.`, errorCode: 'SNYK-CODE-0010', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.OrgOutsideAdminGroupError = OrgOutsideAdminGroupError; /** * @class * @name RuleExtensionsLimitReachedError * @description You have hit the maximum number of published Snyk Code Rule extensions allowed for a Group. * * To create a new Rule extension you will have to remove an existing one. * @summary Rule extension limit reached * @category Code * @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 RuleExtensionsLimitReachedError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Rule extension limit reached', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0011', status: 400, description: `You have hit the maximum number of published Snyk Code Rule extensions allowed for a Group. To create a new Rule extension you will have to remove an existing one.`, errorCode: 'SNYK-CODE-0011', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.RuleExtensionsLimitReachedError = RuleExtensionsLimitReachedError; /** * @class * @name UnsupportedRuleNamesError * @description One or more rule names provided are not supported by Snyk Code Rule extensions. * * Remove the unsupported rule name(s) and then try again. * @summary Unsupported rule names in request * @category Code * @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 UnsupportedRuleNamesError extends problem_error_1.ProblemError { constructor(details, additionalData, cause, instance, logs) { super({ title: 'Unsupported rule names in request', type: 'https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-code-0012', status: 400, description: `One or more rule names provided are not supported by Snyk Code Rule extensions. Remove the unsupported rule name(s) and then try again.`, errorCode: 'SNYK-CODE-0012', level: 'error', classification: types_1.Classification.ACTIONABLE, instance, }, details, Object.assign({ links: [] }, additionalData), cause, logs); this.name = this.constructor.name; } } exports.UnsupportedRuleNamesError = UnsupportedRuleNamesError; //# sourceMappingURL=Code-error-catalog.js.map