@snyk/error-catalog-nodejs-public 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +7 -0
  2. package/package.json +15 -0
  3. package/src/catalogs/Fix-error-catalog.d.ts +100 -0
  4. package/src/catalogs/Fix-error-catalog.js +180 -0
  5. package/src/catalogs/Fix-error-catalog.js.map +1 -0
  6. package/src/catalogs/IsolatedBuilds-error-catalog.d.ts +32 -0
  7. package/src/catalogs/IsolatedBuilds-error-catalog.js +60 -0
  8. package/src/catalogs/IsolatedBuilds-error-catalog.js.map +1 -0
  9. package/src/catalogs/OpenAPI-error-catalog.d.ts +119 -0
  10. package/src/catalogs/OpenAPI-error-catalog.js +215 -0
  11. package/src/catalogs/OpenAPI-error-catalog.js.map +1 -0
  12. package/src/catalogs/OpenSourceEcosystems-error-catalog.d.ts +771 -0
  13. package/src/catalogs/OpenSourceEcosystems-error-catalog.js +1371 -0
  14. package/src/catalogs/OpenSourceEcosystems-error-catalog.js.map +1 -0
  15. package/src/catalogs/OpenSourceProjectIssues-error-catalog.d.ts +71 -0
  16. package/src/catalogs/OpenSourceProjectIssues-error-catalog.js +130 -0
  17. package/src/catalogs/OpenSourceProjectIssues-error-catalog.js.map +1 -0
  18. package/src/catalogs/OpenSourceProjectSnapshots-error-catalog.d.ts +71 -0
  19. package/src/catalogs/OpenSourceProjectSnapshots-error-catalog.js +130 -0
  20. package/src/catalogs/OpenSourceProjectSnapshots-error-catalog.js.map +1 -0
  21. package/src/catalogs/OpenSourceUnmanaged-error-catalog.d.ts +36 -0
  22. package/src/catalogs/OpenSourceUnmanaged-error-catalog.js +67 -0
  23. package/src/catalogs/OpenSourceUnmanaged-error-catalog.js.map +1 -0
  24. package/src/catalogs/PurlVulnerabilityFetching-error-catalog.d.ts +290 -0
  25. package/src/catalogs/PurlVulnerabilityFetching-error-catalog.js +520 -0
  26. package/src/catalogs/PurlVulnerabilityFetching-error-catalog.js.map +1 -0
  27. package/src/catalogs/SbomExport-error-catalog.d.ts +130 -0
  28. package/src/catalogs/SbomExport-error-catalog.js +235 -0
  29. package/src/catalogs/SbomExport-error-catalog.js.map +1 -0
  30. package/src/catalogs/Snyk-error-catalog.d.ts +94 -0
  31. package/src/catalogs/Snyk-error-catalog.js +170 -0
  32. package/src/catalogs/Snyk-error-catalog.js.map +1 -0
  33. package/src/catalogs/error-catalog.d.ts +10 -0
  34. package/src/catalogs/error-catalog.js +14 -0
  35. package/src/catalogs/error-catalog.js.map +1 -0
  36. package/src/catalogs/error-codes.d.ts +138 -0
  37. package/src/catalogs/error-codes.js +140 -0
  38. package/src/catalogs/error-codes.js.map +1 -0
  39. package/src/composite-error.d.ts +13 -0
  40. package/src/composite-error.js +27 -0
  41. package/src/composite-error.js.map +1 -0
  42. package/src/index.d.ts +3 -0
  43. package/src/index.js +7 -0
  44. package/src/index.js.map +1 -0
  45. package/src/problem-error.d.ts +20 -0
  46. package/src/problem-error.js +78 -0
  47. package/src/problem-error.js.map +1 -0
  48. package/src/types.d.ts +66 -0
  49. package/src/types.js +35 -0
  50. package/src/types.js.map +1 -0
  51. package/src/util/index.d.ts +1 -0
  52. package/src/util/index.js +5 -0
  53. package/src/util/index.js.map +1 -0
  54. package/src/util/json-api.d.ts +7 -0
  55. package/src/util/json-api.js +70 -0
  56. package/src/util/json-api.js.map +1 -0
@@ -0,0 +1,235 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvalidDepGraphError = exports.EmptyRequestBodyError = exports.MissingAuthTokenError = exports.DepGraphResponseError = exports.UnsupportedProjectError = exports.IaCOrSASTProjectError = exports.UnexpectedParseDepGraphError = exports.UnexpectedDepGraphResponseError = exports.InternalServerError = void 0;
4
+ const problem_error_1 = require("../problem-error");
5
+ /**
6
+ * @class
7
+ * @name InternalServerError
8
+ * @description An unexpected error occurred during the SBOM generation. Review the request, then try again. If the error persists, contact Snyk Support.
9
+ * @summary SBOM generation export server error
10
+ * @category SbomExport
11
+ * @param {string} details the specific details that causes this error
12
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
13
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
14
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
15
+ */
16
+ class InternalServerError extends problem_error_1.ProblemError {
17
+ constructor(details, additionalData, cause, instance) {
18
+ super({
19
+ title: 'SBOM generation export server error',
20
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9000',
21
+ status: 500,
22
+ errorCode: 'SNYK-OS-9000',
23
+ level: 'error',
24
+ instance,
25
+ }, details, Object.assign({ links: [] }, additionalData), cause);
26
+ this.name = this.constructor.name;
27
+ }
28
+ }
29
+ exports.InternalServerError = InternalServerError;
30
+ /**
31
+ * @class
32
+ * @name UnexpectedDepGraphResponseError
33
+ * @description An unexpected dependency graph error occurred. Review the request, then try again. If the error persists, contact Snyk Support.
34
+ * @summary Dependency graph error
35
+ * @category SbomExport
36
+ * @param {string} details the specific details that causes this error
37
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
38
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
39
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
40
+ */
41
+ class UnexpectedDepGraphResponseError extends problem_error_1.ProblemError {
42
+ constructor(details, additionalData, cause, instance) {
43
+ super({
44
+ title: 'Dependency graph error',
45
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9001',
46
+ status: 500,
47
+ errorCode: 'SNYK-OS-9001',
48
+ level: 'error',
49
+ instance,
50
+ }, details, Object.assign({ links: [] }, additionalData), cause);
51
+ this.name = this.constructor.name;
52
+ }
53
+ }
54
+ exports.UnexpectedDepGraphResponseError = UnexpectedDepGraphResponseError;
55
+ /**
56
+ * @class
57
+ * @name UnexpectedParseDepGraphError
58
+ * @description The dependency graph cannot be parsed due to an unexpected error. Review the request, then try again. If the error persists, contact Snyk Support.
59
+ * @summary Error parsing dependency graph
60
+ * @category SbomExport
61
+ * @param {string} details the specific details that causes this error
62
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
63
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
64
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
65
+ */
66
+ class UnexpectedParseDepGraphError extends problem_error_1.ProblemError {
67
+ constructor(details, additionalData, cause, instance) {
68
+ super({
69
+ title: 'Error parsing dependency graph',
70
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9002',
71
+ status: 500,
72
+ errorCode: 'SNYK-OS-9002',
73
+ level: 'error',
74
+ instance,
75
+ }, details, Object.assign({ links: [] }, additionalData), cause);
76
+ this.name = this.constructor.name;
77
+ }
78
+ }
79
+ exports.UnexpectedParseDepGraphError = UnexpectedParseDepGraphError;
80
+ /**
81
+ * @class
82
+ * @name IaCOrSASTProjectError
83
+ * @description Only SBOMs for Snyk Open Source or Snyk Container projects are supported.
84
+ * @summary SBOM not supported due to project type
85
+ * @category SbomExport
86
+ * @param {string} details the specific details that causes this error
87
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
88
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
89
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
90
+ */
91
+ class IaCOrSASTProjectError extends problem_error_1.ProblemError {
92
+ constructor(details, additionalData, cause, instance) {
93
+ super({
94
+ title: 'SBOM not supported due to project type',
95
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9003',
96
+ status: 404,
97
+ errorCode: 'SNYK-OS-9003',
98
+ level: 'warn',
99
+ instance,
100
+ }, details, Object.assign({ links: [] }, additionalData), cause);
101
+ this.name = this.constructor.name;
102
+ }
103
+ }
104
+ exports.IaCOrSASTProjectError = IaCOrSASTProjectError;
105
+ /**
106
+ * @class
107
+ * @name UnsupportedProjectError
108
+ * @description Only SBOMs for open source projects are supported (Snyk Open Source).
109
+ * @summary SBOM not supported
110
+ * @category SbomExport
111
+ * @param {string} details the specific details that causes this error
112
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
113
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
114
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
115
+ */
116
+ class UnsupportedProjectError extends problem_error_1.ProblemError {
117
+ constructor(details, additionalData, cause, instance) {
118
+ super({
119
+ title: 'SBOM not supported',
120
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9004',
121
+ status: 404,
122
+ errorCode: 'SNYK-OS-9004',
123
+ level: 'warn',
124
+ instance,
125
+ }, details, Object.assign({ links: [] }, additionalData), cause);
126
+ this.name = this.constructor.name;
127
+ }
128
+ }
129
+ exports.UnsupportedProjectError = UnsupportedProjectError;
130
+ /**
131
+ * @class
132
+ * @name DepGraphResponseError
133
+ * @description The server cannot process the request due to incomplete data. Review the request, then try again.
134
+ * @summary Dependency graph request cannot be processed
135
+ * @category SbomExport
136
+ * @param {string} details the specific details that causes this error
137
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
138
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
139
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
140
+ */
141
+ class DepGraphResponseError extends problem_error_1.ProblemError {
142
+ constructor(details, additionalData, cause, instance) {
143
+ super({
144
+ title: 'Dependency graph request cannot be processed',
145
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9005',
146
+ status: 404,
147
+ errorCode: 'SNYK-OS-9005',
148
+ level: 'warn',
149
+ instance,
150
+ }, details, Object.assign({ links: [] }, additionalData), cause);
151
+ this.name = this.constructor.name;
152
+ }
153
+ }
154
+ exports.DepGraphResponseError = DepGraphResponseError;
155
+ /**
156
+ * @class
157
+ * @name MissingAuthTokenError
158
+ * @description The API token is misconfigured or expired. Configure or generate the API token, then try again.
159
+ *
160
+ * See more:
161
+ * - [https://docs.snyk.io/snyk-api-info/revoking-and-regenerating-snyk-api-tokens](https://docs.snyk.io/snyk-api-info/revoking-and-regenerating-snyk-api-tokens)
162
+ * @summary Authorization failed due to missing API token
163
+ * @category SbomExport
164
+ * @param {string} details the specific details that causes this error
165
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
166
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
167
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
168
+ */
169
+ class MissingAuthTokenError extends problem_error_1.ProblemError {
170
+ constructor(details, additionalData, cause, instance) {
171
+ super({
172
+ title: 'Authorization failed due to missing API token',
173
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9006',
174
+ status: 401,
175
+ errorCode: 'SNYK-OS-9006',
176
+ level: 'warn',
177
+ instance,
178
+ }, details, Object.assign({ links: [
179
+ 'https://docs.snyk.io/snyk-api-info/revoking-and-regenerating-snyk-api-tokens',
180
+ ] }, additionalData), cause);
181
+ this.name = this.constructor.name;
182
+ }
183
+ }
184
+ exports.MissingAuthTokenError = MissingAuthTokenError;
185
+ /**
186
+ * @class
187
+ * @name EmptyRequestBodyError
188
+ * @description The body of the request is empty. Review the request, then try again.
189
+ * @summary Client request cannot be processed
190
+ * @category SbomExport
191
+ * @param {string} details the specific details that causes this error
192
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
193
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
194
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
195
+ */
196
+ class EmptyRequestBodyError extends problem_error_1.ProblemError {
197
+ constructor(details, additionalData, cause, instance) {
198
+ super({
199
+ title: 'Client request cannot be processed',
200
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9007',
201
+ status: 400,
202
+ errorCode: 'SNYK-OS-9007',
203
+ level: 'warn',
204
+ instance,
205
+ }, details, Object.assign({ links: [] }, additionalData), cause);
206
+ this.name = this.constructor.name;
207
+ }
208
+ }
209
+ exports.EmptyRequestBodyError = EmptyRequestBodyError;
210
+ /**
211
+ * @class
212
+ * @name InvalidDepGraphError
213
+ * @description The request cannot be processed due to an internal error. Review the request, then try again.
214
+ * @summary Invalid dependency graph
215
+ * @category SbomExport
216
+ * @param {string} details the specific details that causes this error
217
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
218
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
219
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
220
+ */
221
+ class InvalidDepGraphError extends problem_error_1.ProblemError {
222
+ constructor(details, additionalData, cause, instance) {
223
+ super({
224
+ title: 'Invalid dependency graph',
225
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-os-9008',
226
+ status: 400,
227
+ errorCode: 'SNYK-OS-9008',
228
+ level: 'warn',
229
+ instance,
230
+ }, details, Object.assign({ links: [] }, additionalData), cause);
231
+ this.name = this.constructor.name;
232
+ }
233
+ }
234
+ exports.InvalidDepGraphError = InvalidDepGraphError;
235
+ //# sourceMappingURL=SbomExport-error-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SbomExport-error-catalog.js","sourceRoot":"","sources":["../../../../../packages/error-catalog-nodejs-public/src/catalogs/SbomExport-error-catalog.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD;;;;;;;;;;GAUG;AACH,MAAa,mBAAoB,SAAQ,4BAAY;IACnD,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,qCAAqC;YAC5C,IAAI,EAAE,2DAA2D;YACjE,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,cAAc;YACzB,KAAK,EAAE,OAAO;YACd,QAAQ;SACT,EACD,OAAO,kBAEL,KAAK,EAAE,EAAE,IACN,cAAc,GAEnB,KAAK,CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAzBD,kDAyBC;AAED;;;;;;;;;;GAUG;AACH,MAAa,+BAAgC,SAAQ,4BAAY;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AK,CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AA3BD,sDA2BC;AAED;;;;;;;;;;GAUG;AACH,MAAa,qBAAsB,SAAQ,4BAAY;IACrD,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,oCAAoC;YAC3C,IAAI,EAAE,2DAA2D;YACjE,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,cAAc;YACzB,KAAK,EAAE,MAAM;YACb,QAAQ;SACT,EACD,OAAO,kBAEL,KAAK,EAAE,EAAE,IACN,cAAc,GAEnB,KAAK,CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAzBD,sDAyBC;AAED;;;;;;;;;;GAUG;AACH,MAAa,oBAAqB,SAAQ,4BAAY;IACpD,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,0BAA0B;YACjC,IAAI,EAAE,2DAA2D;YACjE,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,cAAc;YACzB,KAAK,EAAE,MAAM;YACb,QAAQ;SACT,EACD,OAAO,kBAEL,KAAK,EAAE,EAAE,IACN,cAAc,GAEnB,KAAK,CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAzBD,oDAyBC"}
@@ -0,0 +1,94 @@
1
+ import { ProblemError } from '../problem-error';
2
+ /**
3
+ * @class
4
+ * @name TooManyRequestsError
5
+ * @description The request rate limit has been exceeded. Wait a few minutes, then try again.
6
+ * @summary Service temporarily throttled
7
+ * @category Snyk
8
+ * @param {string} details the specific details that causes this error
9
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
10
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
11
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
12
+ */
13
+ export declare class TooManyRequestsError extends ProblemError {
14
+ constructor(details: string, additionalData?: Record<string, any>, cause?: Error, instance?: string);
15
+ }
16
+ /**
17
+ * @class
18
+ * @name NotImplementedError
19
+ * @description The server doesn’t recognize the request method, or it cannot fulfill it. Review the request and try again.
20
+ *
21
+ * See more:
22
+ * - [https://docs.snyk.io/snyk-api-info](https://docs.snyk.io/snyk-api-info)
23
+ * @summary Server error response
24
+ * @category Snyk
25
+ * @param {string} details the specific details that causes this error
26
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
27
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
28
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
29
+ */
30
+ export declare class NotImplementedError extends ProblemError {
31
+ constructor(details: string, additionalData?: Record<string, any>, cause?: Error, instance?: string);
32
+ }
33
+ /**
34
+ * @class
35
+ * @name BadRequestError
36
+ * @description The server cannot process the request due to a client error, such as malformed request syntax, size too large, invalid request message framing, or deceptive request routing. Review the request and try again.
37
+ * @summary Client request cannot be processed
38
+ * @category Snyk
39
+ * @param {string} details the specific details that causes this error
40
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
41
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
42
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
43
+ */
44
+ export declare class BadRequestError extends ProblemError {
45
+ constructor(details: string, additionalData?: Record<string, any>, cause?: Error, instance?: string);
46
+ }
47
+ /**
48
+ * @class
49
+ * @name TimeoutError
50
+ * @description The server timed out during the request. Check Snyk status, then try again.
51
+ *
52
+ * See more:
53
+ * - [https://status.snyk.io/](https://status.snyk.io/)
54
+ * @summary Server communication error
55
+ * @category Snyk
56
+ * @param {string} details the specific details that causes this error
57
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
58
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
59
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
60
+ */
61
+ export declare class TimeoutError extends ProblemError {
62
+ constructor(details: string, additionalData?: Record<string, any>, cause?: Error, instance?: string);
63
+ }
64
+ /**
65
+ * @class
66
+ * @name UnauthorisedError
67
+ * @description Authentication credentials not recognized, or user access is not provisioned. Revise credentials and try again, or request access from your Snyk administrator.
68
+ * @summary Authentication error
69
+ * @category Snyk
70
+ * @param {string} details the specific details that causes this error
71
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
72
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
73
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
74
+ */
75
+ export declare class UnauthorisedError extends ProblemError {
76
+ constructor(details: string, additionalData?: Record<string, any>, cause?: Error, instance?: string);
77
+ }
78
+ /**
79
+ * @class
80
+ * @name ServerError
81
+ * @description The server cannot process the request due to an unexpected error. Check Snyk status, then try again.
82
+ *
83
+ * See more:
84
+ * - [https://status.snyk.io/](https://status.snyk.io/)
85
+ * @summary Request not fulfilled due to server error
86
+ * @category Snyk
87
+ * @param {string} details the specific details that causes this error
88
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
89
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
90
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
91
+ */
92
+ export declare class ServerError extends ProblemError {
93
+ constructor(details: string, additionalData?: Record<string, any>, cause?: Error, instance?: string);
94
+ }
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServerError = exports.UnauthorisedError = exports.TimeoutError = exports.BadRequestError = exports.NotImplementedError = exports.TooManyRequestsError = void 0;
4
+ const problem_error_1 = require("../problem-error");
5
+ /**
6
+ * @class
7
+ * @name TooManyRequestsError
8
+ * @description The request rate limit has been exceeded. Wait a few minutes, then try again.
9
+ * @summary Service temporarily throttled
10
+ * @category Snyk
11
+ * @param {string} details the specific details that causes this error
12
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
13
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
14
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
15
+ */
16
+ class TooManyRequestsError extends problem_error_1.ProblemError {
17
+ constructor(details, additionalData, cause, instance) {
18
+ super({
19
+ title: 'Service temporarily throttled',
20
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-0001',
21
+ status: 429,
22
+ errorCode: 'SNYK-0001',
23
+ level: 'warn',
24
+ instance,
25
+ }, details, Object.assign({ links: [] }, additionalData), cause);
26
+ this.name = this.constructor.name;
27
+ }
28
+ }
29
+ exports.TooManyRequestsError = TooManyRequestsError;
30
+ /**
31
+ * @class
32
+ * @name NotImplementedError
33
+ * @description The server doesn’t recognize the request method, or it cannot fulfill it. Review the request and try again.
34
+ *
35
+ * See more:
36
+ * - [https://docs.snyk.io/snyk-api-info](https://docs.snyk.io/snyk-api-info)
37
+ * @summary Server error response
38
+ * @category Snyk
39
+ * @param {string} details the specific details that causes this error
40
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
41
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
42
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
43
+ */
44
+ class NotImplementedError extends problem_error_1.ProblemError {
45
+ constructor(details, additionalData, cause, instance) {
46
+ super({
47
+ title: 'Server error response',
48
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-0002',
49
+ status: 501,
50
+ errorCode: 'SNYK-0002',
51
+ level: 'error',
52
+ instance,
53
+ }, details, Object.assign({ links: [
54
+ 'https://docs.snyk.io/snyk-api-info',
55
+ ] }, additionalData), cause);
56
+ this.name = this.constructor.name;
57
+ }
58
+ }
59
+ exports.NotImplementedError = NotImplementedError;
60
+ /**
61
+ * @class
62
+ * @name BadRequestError
63
+ * @description The server cannot process the request due to a client error, such as malformed request syntax, size too large, invalid request message framing, or deceptive request routing. Review the request and try again.
64
+ * @summary Client request cannot be processed
65
+ * @category Snyk
66
+ * @param {string} details the specific details that causes this error
67
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
68
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
69
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
70
+ */
71
+ class BadRequestError extends problem_error_1.ProblemError {
72
+ constructor(details, additionalData, cause, instance) {
73
+ super({
74
+ title: 'Client request cannot be processed',
75
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-0003',
76
+ status: 400,
77
+ errorCode: 'SNYK-0003',
78
+ level: 'error',
79
+ instance,
80
+ }, details, Object.assign({ links: [] }, additionalData), cause);
81
+ this.name = this.constructor.name;
82
+ }
83
+ }
84
+ exports.BadRequestError = BadRequestError;
85
+ /**
86
+ * @class
87
+ * @name TimeoutError
88
+ * @description The server timed out during the request. Check Snyk status, then try again.
89
+ *
90
+ * See more:
91
+ * - [https://status.snyk.io/](https://status.snyk.io/)
92
+ * @summary Server communication error
93
+ * @category Snyk
94
+ * @param {string} details the specific details that causes this error
95
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
96
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
97
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
98
+ */
99
+ class TimeoutError extends problem_error_1.ProblemError {
100
+ constructor(details, additionalData, cause, instance) {
101
+ super({
102
+ title: 'Server communication error',
103
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-0004',
104
+ status: 504,
105
+ errorCode: 'SNYK-0004',
106
+ level: 'error',
107
+ instance,
108
+ }, details, Object.assign({ links: [
109
+ 'https://status.snyk.io/',
110
+ ] }, additionalData), cause);
111
+ this.name = this.constructor.name;
112
+ }
113
+ }
114
+ exports.TimeoutError = TimeoutError;
115
+ /**
116
+ * @class
117
+ * @name UnauthorisedError
118
+ * @description Authentication credentials not recognized, or user access is not provisioned. Revise credentials and try again, or request access from your Snyk administrator.
119
+ * @summary Authentication error
120
+ * @category Snyk
121
+ * @param {string} details the specific details that causes this error
122
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
123
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
124
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
125
+ */
126
+ class UnauthorisedError extends problem_error_1.ProblemError {
127
+ constructor(details, additionalData, cause, instance) {
128
+ super({
129
+ title: 'Authentication error',
130
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-0005',
131
+ status: 401,
132
+ errorCode: 'SNYK-0005',
133
+ level: 'error',
134
+ instance,
135
+ }, details, Object.assign({ links: [] }, additionalData), cause);
136
+ this.name = this.constructor.name;
137
+ }
138
+ }
139
+ exports.UnauthorisedError = UnauthorisedError;
140
+ /**
141
+ * @class
142
+ * @name ServerError
143
+ * @description The server cannot process the request due to an unexpected error. Check Snyk status, then try again.
144
+ *
145
+ * See more:
146
+ * - [https://status.snyk.io/](https://status.snyk.io/)
147
+ * @summary Request not fulfilled due to server error
148
+ * @category Snyk
149
+ * @param {string} details the specific details that causes this error
150
+ * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
151
+ * @param {Error} [cause] the `Error` type that caused this error to be thrown
152
+ * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
153
+ */
154
+ class ServerError extends problem_error_1.ProblemError {
155
+ constructor(details, additionalData, cause, instance) {
156
+ super({
157
+ title: 'Request not fulfilled due to server error ',
158
+ type: 'https://docs.snyk.io/more-info/error-catalog#snyk-9999',
159
+ status: 500,
160
+ errorCode: 'SNYK-9999',
161
+ level: 'error',
162
+ instance,
163
+ }, details, Object.assign({ links: [
164
+ 'https://status.snyk.io/',
165
+ ] }, additionalData), cause);
166
+ this.name = this.constructor.name;
167
+ }
168
+ }
169
+ exports.ServerError = ServerError;
170
+ //# sourceMappingURL=Snyk-error-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Snyk-error-catalog.js","sourceRoot":"","sources":["../../../../../packages/error-catalog-nod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C9D,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,WAAW;YACtB,KAAK,EAAE,OAAO;YACd,QAAQ;SACT,EACD,OAAO,kBAEL,KAAK,EAAE;gBACP,yBAAyB;aACxB,IACE,cAAc,GAEnB,KAAK,CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AA3BD,kCA2BC"}
@@ -0,0 +1,10 @@
1
+ export * as Snyk from './Snyk-error-catalog';
2
+ export * as OpenSourceEcosystems from './OpenSourceEcosystems-error-catalog';
3
+ export * as OpenSourceProjectSnapshots from './OpenSourceProjectSnapshots-error-catalog';
4
+ export * as OpenSourceProjectIssues from './OpenSourceProjectIssues-error-catalog';
5
+ export * as PurlVulnerabilityFetching from './PurlVulnerabilityFetching-error-catalog';
6
+ export * as IsolatedBuilds from './IsolatedBuilds-error-catalog';
7
+ export * as OpenAPI from './OpenAPI-error-catalog';
8
+ export * as OpenSourceUnmanaged from './OpenSourceUnmanaged-error-catalog';
9
+ export * as SbomExport from './SbomExport-error-catalog';
10
+ export * as Fix from './Fix-error-catalog';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Fix = exports.SbomExport = exports.OpenSourceUnmanaged = exports.OpenAPI = exports.IsolatedBuilds = exports.PurlVulnerabilityFetching = exports.OpenSourceProjectIssues = exports.OpenSourceProjectSnapshots = exports.OpenSourceEcosystems = exports.Snyk = void 0;
4
+ exports.Snyk = require("./Snyk-error-catalog");
5
+ exports.OpenSourceEcosystems = require("./OpenSourceEcosystems-error-catalog");
6
+ exports.OpenSourceProjectSnapshots = require("./OpenSourceProjectSnapshots-error-catalog");
7
+ exports.OpenSourceProjectIssues = require("./OpenSourceProjectIssues-error-catalog");
8
+ exports.PurlVulnerabilityFetching = require("./PurlVulnerabilityFetching-error-catalog");
9
+ exports.IsolatedBuilds = require("./IsolatedBuilds-error-catalog");
10
+ exports.OpenAPI = require("./OpenAPI-error-catalog");
11
+ exports.OpenSourceUnmanaged = require("./OpenSourceUnmanaged-error-catalog");
12
+ exports.SbomExport = require("./SbomExport-error-catalog");
13
+ exports.Fix = require("./Fix-error-catalog");
14
+ //# sourceMappingURL=error-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-catalog.js","sourceRoot":"","sources":["../../../../../packages/error-catalog-nodejs-public/src/catalogs/error-catalog.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAC7C,+EAA6E;AAC7E,2FAAyF;AACzF,qFAAmF;AACnF,yFAAuF;AACvF,mEAAiE;AACjE,qDAAmD;AACnD,6EAA2E;AAC3E,2DAAyD;AACzD,6CAA2C"}