@snyk/error-catalog-nodejs-public 4.0.4 → 5.0.1

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/catalogs/Fix-error-catalog.d.ts +10 -0
  3. package/src/catalogs/Fix-error-catalog.js +20 -0
  4. package/src/catalogs/Fix-error-catalog.js.map +1 -1
  5. package/src/catalogs/IsolatedBuilds-error-catalog.d.ts +4 -1
  6. package/src/catalogs/IsolatedBuilds-error-catalog.js +7 -1
  7. package/src/catalogs/IsolatedBuilds-error-catalog.js.map +1 -1
  8. package/src/catalogs/OpenAPI-error-catalog.d.ts +14 -6
  9. package/src/catalogs/OpenAPI-error-catalog.js +23 -7
  10. package/src/catalogs/OpenAPI-error-catalog.js.map +1 -1
  11. package/src/catalogs/OpenSourceEcosystems-error-catalog.d.ts +54 -2
  12. package/src/catalogs/OpenSourceEcosystems-error-catalog.js +108 -4
  13. package/src/catalogs/OpenSourceEcosystems-error-catalog.js.map +1 -1
  14. package/src/catalogs/OpenSourceProjectIssues-error-catalog.d.ts +5 -0
  15. package/src/catalogs/OpenSourceProjectIssues-error-catalog.js +10 -0
  16. package/src/catalogs/OpenSourceProjectIssues-error-catalog.js.map +1 -1
  17. package/src/catalogs/OpenSourceProjectSnapshots-error-catalog.d.ts +5 -0
  18. package/src/catalogs/OpenSourceProjectSnapshots-error-catalog.js +10 -0
  19. package/src/catalogs/OpenSourceProjectSnapshots-error-catalog.js.map +1 -1
  20. package/src/catalogs/OpenSourceUnmanaged-error-catalog.d.ts +3 -1
  21. package/src/catalogs/OpenSourceUnmanaged-error-catalog.js +5 -1
  22. package/src/catalogs/OpenSourceUnmanaged-error-catalog.js.map +1 -1
  23. package/src/catalogs/PurlVulnerabilityFetching-error-catalog.d.ts +22 -2
  24. package/src/catalogs/PurlVulnerabilityFetching-error-catalog.js +42 -2
  25. package/src/catalogs/PurlVulnerabilityFetching-error-catalog.js.map +1 -1
  26. package/src/catalogs/SbomExport-error-catalog.d.ts +10 -1
  27. package/src/catalogs/SbomExport-error-catalog.js +20 -2
  28. package/src/catalogs/SbomExport-error-catalog.js.map +1 -1
  29. package/src/catalogs/Snyk-error-catalog.d.ts +7 -1
  30. package/src/catalogs/Snyk-error-catalog.js +13 -1
  31. package/src/catalogs/Snyk-error-catalog.js.map +1 -1
  32. package/src/problem-error.js +1 -1
  33. package/src/problem-error.js.map +1 -1
  34. package/src/types.d.ts +3 -1
  35. package/src/types.js.map +1 -1
@@ -21,6 +21,7 @@ import { ProblemError } from '../problem-error';
21
21
  * @summary Service temporarily throttled
22
22
  * @category Snyk
23
23
  * @param {string} details the specific details that causes this error
24
+ * @param {string} classification the error classification determining if the error is user-actionable or not
24
25
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
25
26
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
26
27
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -31,13 +32,14 @@ export declare class TooManyRequestsError extends ProblemError {
31
32
  /**
32
33
  * @class
33
34
  * @name NotImplementedError
34
- * @description The server doesnt recognize the request method, or it cannot fulfill it. Review the request and try again.
35
+ * @description The server doesn't recognize the request method, or it cannot fulfill it. Review the request and try again.
35
36
  *
36
37
  * See more:
37
38
  * - [https://docs.snyk.io/snyk-api-info](https://docs.snyk.io/snyk-api-info)
38
39
  * @summary Server error response
39
40
  * @category Snyk
40
41
  * @param {string} details the specific details that causes this error
42
+ * @param {string} classification the error classification determining if the error is user-actionable or not
41
43
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
42
44
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
43
45
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -52,6 +54,7 @@ export declare class NotImplementedError extends ProblemError {
52
54
  * @summary Client request cannot be processed
53
55
  * @category Snyk
54
56
  * @param {string} details the specific details that causes this error
57
+ * @param {string} classification the error classification determining if the error is user-actionable or not
55
58
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
56
59
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
57
60
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -69,6 +72,7 @@ export declare class BadRequestError extends ProblemError {
69
72
  * @summary Server communication error
70
73
  * @category Snyk
71
74
  * @param {string} details the specific details that causes this error
75
+ * @param {string} classification the error classification determining if the error is user-actionable or not
72
76
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
73
77
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
74
78
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -83,6 +87,7 @@ export declare class TimeoutError extends ProblemError {
83
87
  * @summary Authentication error
84
88
  * @category Snyk
85
89
  * @param {string} details the specific details that causes this error
90
+ * @param {string} classification the error classification determining if the error is user-actionable or not
86
91
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
87
92
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
88
93
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -100,6 +105,7 @@ export declare class UnauthorisedError extends ProblemError {
100
105
  * @summary Request not fulfilled due to server error
101
106
  * @category Snyk
102
107
  * @param {string} details the specific details that causes this error
108
+ * @param {string} classification the error classification determining if the error is user-actionable or not
103
109
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
104
110
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
105
111
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -24,6 +24,7 @@ const problem_error_1 = require("../problem-error");
24
24
  * @summary Service temporarily throttled
25
25
  * @category Snyk
26
26
  * @param {string} details the specific details that causes this error
27
+ * @param {string} classification the error classification determining if the error is user-actionable or not
27
28
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
28
29
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
29
30
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -36,6 +37,7 @@ class TooManyRequestsError extends problem_error_1.ProblemError {
36
37
  status: 429,
37
38
  errorCode: 'SNYK-0001',
38
39
  level: 'warn',
40
+ classification: 'ACTIONABLE',
39
41
  instance,
40
42
  }, details, Object.assign({ links: [] }, additionalData), cause);
41
43
  this.name = this.constructor.name;
@@ -45,13 +47,14 @@ exports.TooManyRequestsError = TooManyRequestsError;
45
47
  /**
46
48
  * @class
47
49
  * @name NotImplementedError
48
- * @description The server doesnt recognize the request method, or it cannot fulfill it. Review the request and try again.
50
+ * @description The server doesn't recognize the request method, or it cannot fulfill it. Review the request and try again.
49
51
  *
50
52
  * See more:
51
53
  * - [https://docs.snyk.io/snyk-api-info](https://docs.snyk.io/snyk-api-info)
52
54
  * @summary Server error response
53
55
  * @category Snyk
54
56
  * @param {string} details the specific details that causes this error
57
+ * @param {string} classification the error classification determining if the error is user-actionable or not
55
58
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
56
59
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
57
60
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -64,6 +67,7 @@ class NotImplementedError extends problem_error_1.ProblemError {
64
67
  status: 501,
65
68
  errorCode: 'SNYK-0002',
66
69
  level: 'error',
70
+ classification: 'UNSUPPORTED',
67
71
  instance,
68
72
  }, details, Object.assign({ links: [
69
73
  'https://docs.snyk.io/snyk-api-info',
@@ -79,6 +83,7 @@ exports.NotImplementedError = NotImplementedError;
79
83
  * @summary Client request cannot be processed
80
84
  * @category Snyk
81
85
  * @param {string} details the specific details that causes this error
86
+ * @param {string} classification the error classification determining if the error is user-actionable or not
82
87
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
83
88
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
84
89
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -91,6 +96,7 @@ class BadRequestError extends problem_error_1.ProblemError {
91
96
  status: 400,
92
97
  errorCode: 'SNYK-0003',
93
98
  level: 'error',
99
+ classification: 'ACTIONABLE',
94
100
  instance,
95
101
  }, details, Object.assign({ links: [] }, additionalData), cause);
96
102
  this.name = this.constructor.name;
@@ -107,6 +113,7 @@ exports.BadRequestError = BadRequestError;
107
113
  * @summary Server communication error
108
114
  * @category Snyk
109
115
  * @param {string} details the specific details that causes this error
116
+ * @param {string} classification the error classification determining if the error is user-actionable or not
110
117
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
111
118
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
112
119
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -119,6 +126,7 @@ class TimeoutError extends problem_error_1.ProblemError {
119
126
  status: 504,
120
127
  errorCode: 'SNYK-0004',
121
128
  level: 'error',
129
+ classification: 'UNEXPECTED',
122
130
  instance,
123
131
  }, details, Object.assign({ links: [
124
132
  'https://status.snyk.io/',
@@ -134,6 +142,7 @@ exports.TimeoutError = TimeoutError;
134
142
  * @summary Authentication error
135
143
  * @category Snyk
136
144
  * @param {string} details the specific details that causes this error
145
+ * @param {string} classification the error classification determining if the error is user-actionable or not
137
146
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
138
147
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
139
148
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -146,6 +155,7 @@ class UnauthorisedError extends problem_error_1.ProblemError {
146
155
  status: 401,
147
156
  errorCode: 'SNYK-0005',
148
157
  level: 'error',
158
+ classification: 'ACTIONABLE',
149
159
  instance,
150
160
  }, details, Object.assign({ links: [] }, additionalData), cause);
151
161
  this.name = this.constructor.name;
@@ -162,6 +172,7 @@ exports.UnauthorisedError = UnauthorisedError;
162
172
  * @summary Request not fulfilled due to server error
163
173
  * @category Snyk
164
174
  * @param {string} details the specific details that causes this error
175
+ * @param {string} classification the error classification determining if the error is user-actionable or not
165
176
  * @param {Record<string, any>} [additionalData] a collection of relevant data specific to this error
166
177
  * @param {Error} [cause] the `Error` type that caused this error to be thrown
167
178
  * @param {string} [instance] the instance to use for this error. Overrides 'instance' metadata
@@ -174,6 +185,7 @@ class ServerError extends problem_error_1.ProblemError {
174
185
  status: 500,
175
186
  errorCode: 'SNYK-9999',
176
187
  level: 'error',
188
+ classification: 'UNEXPECTED',
177
189
  instance,
178
190
  }, details, Object.assign({ links: [
179
191
  'https://status.snyk.io/',
@@ -1 +1 @@
1
- {"version":3,"file":"Snyk-error-catalog.js","sourceRoot":"","sources":["../../../../../packages/error-catalog-nodejs-public/src/catalogs/Snyk-error-catalog.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD;;;;;;;;;;GAUG;AACH,MAAa,oBAAqB,SAAQ,4BAAY;IACpD,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,+BAA+B;YACtC,IAAI,EAAE,wDAAwD;YAC9D,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,WAAW;YACtB,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;AAED;;;;;;;;;;;;;GAaG;AACH,MAAa,mBAAoB,SAAQ,4BAAY;IACnD,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,wDAAwD;YAC9D,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,WAAW;YACtB,KAAK,EAAE,OAAO;YACd,QAAQ;SACT,EACD,OAAO,kBAEL,KAAK,EAAE;gBACP,oCAAoC;aACnC,IACE,cAAc,GAEnB,KAAK,CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;A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CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAzBD,8CAyBC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAa,WAAY,SAAQ,4BAAY;IAC3C,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,4CAA4C;YACnD,IAAI,EAAE,wDAAwD;YAC9D,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"}
1
+ {"version":3,"file":"Snyk-error-catalog.js","sourceRoot":"","sources":["../../../../../packages/error-catalog-nodejs-public/src/catalogs/Snyk-error-catalog.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD;;;;;;;;;;;GAWG;AACH,MAAa,oBAAqB,SAAQ,4BAAY;IACpD,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,+BAA+B;YACtC,IAAI,EAAE,wDAAwD;YAC9D,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,WAAW;YACtB,KAAK,EAAE,MAAM;YACb,cAAc,EAAE,YAAY;YAC5B,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;AA1BD,oDA0BC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAa,mBAAoB,SAAQ,4BAAY;IACnD,YACI,OAA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B,KAAK,CACN,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AA5BD,oCA4BC;AAED;;;;;;;;;;;GAWG;AACH,MAAa,iBAAkB,SAAQ,4BAAY;IACjD,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,sBAAsB;YAC7B,IAAI,EAAE,wDAAwD;YAC9D,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,WAAW;YACtB,KAAK,EAAE,OAAO;YACd,cAAc,EAAE,YAAY;YAC5B,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;AA1BD,8CA0BC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAa,WAAY,SAAQ,4BAAY;IAC3C,YACI,OAAe,EACf,cAAoC,EACpC,KAAa,EACb,QAAiB;QAEnB,KAAK,CACH;YACE,KAAK,EAAE,4CAA4C;YACnD,IAAI,EAAE,wDAAwD;YAC9D,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,WAAW;YACtB,KAAK,EAAE,OAAO;YACd,cAAc,EAAE,YAAY;YAC5B,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;AA5BD,kCA4BC"}
@@ -47,7 +47,7 @@ class ProblemError extends Error {
47
47
  }
48
48
  }
49
49
  toProblemJson(instance) {
50
- const payload = Object.assign({ type: this.metadata.type, title: this.metadata.title, status: this.metadata.status, errorCode: this.metadata.errorCode, detail: this.detail, instance }, this.additionalData);
50
+ const payload = Object.assign({ type: this.metadata.type, title: this.metadata.title, status: this.metadata.status, errorCode: this.metadata.errorCode, detail: this.detail, classification: this.metadata.classification, instance }, this.additionalData);
51
51
  return new types_1.ProblemJson(payload);
52
52
  }
53
53
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"problem-error.js","sourceRoot":"","sources":["../../../../packages/error-catalog-nodejs-public/src/problem-error.ts"],"names":[],"mappings":";;;AAAA,mCAQiB;AACjB,+BAA0B;AAC1B,iCAAiD;AAEjD,MAAa,YAAa,SAAQ,KAAK;IAOrC,YACkB,QAAuB,EACvB,MAAc,EACd,cAAoC,EACpC,KAAa;QAE7B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QALN,aAAQ,GAAR,QAAQ,CAAe;QACvB,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc,CAAsB;QACpC,UAAK,GAAL,KAAK,CAAQ;QAR/B,sLAAsL;QACtL,qJAAqJ;QACrI,wBAAmB,GAAG,IAAI,CAAC;QASzC,IAAI,cAAc,IAAI,cAAc,CAAC,iBAAiB,CAAC,EAAE;YACvD,IAAI,CAAC,EAAE,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;SAC7C;aAAM;YACL,IAAI,CAAC,EAAE,GAAG,IAAA,SAAE,GAAE,CAAC;SAChB;IACH,CAAC;IAED,MAAM,CAAC,QAAgB,EAAE,UAAwB;QAC/C,QAAQ,UAAU,EAAE;YAClB,KAAK,oBAAY,CAAC,OAAO;gBACvB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAClC,KAAK,oBAAY,CAAC,WAAW;gBAC3B,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACtC;gBACE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SAC1C;IACH,CAAC;IAED,aAAa,CAAC,QAAgB;QAC5B,MAAM,OAAO,mBACX,IAAI,EAAE,IAAI,CAAC,QAAQ,C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CAAC,CAAC;SAC9C,CAAC;QAEF,OAAO,IAAI,eAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF;AA1FD,oCA0FC"}
1
+ {"version":3,"file":"problem-error.js","sourceRoot":"","sources":["../../../../packages/error-catalog-nodejs-public/src/problem-error.ts"],"names":[],"mappings":";;;AAAA,mCAQiB;AACjB,+BAA0B;AAC1B,iCAAiD;AAEjD,MAAa,YAAa,SAAQ,KAAK;IAOrC,YACkB,QAAuB,EACvB,MAAc,EACd,cAAoC,EACpC,KAAa;QAE7B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QALN,aAAQ,GAAR,QAAQ,CAAe;QACvB,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc,CAAsB;QACpC,UAAK,GAAL,KAAK,CAAQ;QAR/B,sLAAsL;QACtL,qJAAqJ;QACrI,wBAAmB,GAAG,IAAI,CAAC;QASzC,IAAI,cAAc,IAAI,cAAc,CAAC,iBAAiB,CAAC,EAAE;YACvD,IAAI,CAAC,EAAE,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC;SAC7C;aAAM;YACL,IAAI,CAAC,EAAE,GAAG,IAAA,SAAE,GAAE,CAAC;SAChB;IACH,CAAC;IAED,MAAM,CAAC,QAAgB,EAAE,UAAwB;QAC/C,QAAQ,UAAU,EAAE;YAClB,KAAK,oBAAY,CAAC,OAAO;gBACvB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAClC,KAAK,oBAAY,CAAC,WAAW;gBAC3B,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACtC;gBACE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SAC1C;IACH,CAAC;IAED,aAAa,CAAC,QAAgB;QAC5B,MAAM,OAAO,mBACX,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EACxB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KA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CAAC;SAC9C,CAAC;QAEF,OAAO,IAAI,eAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF;AA3FD,oCA2FC"}
package/src/types.d.ts CHANGED
@@ -28,10 +28,12 @@ export type Problem = {
28
28
  instance?: string;
29
29
  /** The level of this error */
30
30
  level?: string;
31
+ /** Determining whether this error is a failure of Snyk to handle an operation that it was expected to, or if it derives from a requesting service producing something that cannot be handled. */
32
+ classification: string;
31
33
  /** Additional properties. */
32
34
  [x: string]: any;
33
35
  };
34
- export type ErrorMetadata = Pick<Problem, 'type' | 'title' | 'status' | 'errorCode' | 'level' | 'instance'>;
36
+ export type ErrorMetadata = Pick<Problem, 'type' | 'title' | 'status' | 'errorCode' | 'level' | 'instance' | 'classification'>;
35
37
  export declare enum ErrorFormats {
36
38
  JsonApi = 0,
37
39
  ProblemJson = 1
package/src/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../packages/error-catalog-nodejs-public/src/types.ts"],"names":[],"mappings":";;;AAwBA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,qDAAO,CAAA;IACP,6DAAW,CAAA;AACb,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAQD,MAAa,WAAW;IACtB,YAA6B,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAEjD,OAAO;QACL,OAAO;YACL,cAAc,EAAE,2BAA2B;SAC5C,CAAC;IACJ,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAZD,kCAYC;AA6BD,MAAa,OAAO;IAClB,YAA6B,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;IAAG,CAAC;IAEvD,OAAO;QACL,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AATD,0BASC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../packages/error-catalog-nodejs-public/src/types.ts"],"names":[],"mappings":";;;AAgCA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,qDAAO,CAAA;IACP,6DAAW,CAAA;AACb,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAQD,MAAa,WAAW;IACtB,YAA6B,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAEjD,OAAO;QACL,OAAO;YACL,cAAc,EAAE,2BAA2B;SAC5C,CAAC;IACJ,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAZD,kCAYC;AA6BD,MAAa,OAAO;IAClB,YAA6B,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;IAAG,CAAC;IAEvD,OAAO;QACL,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAVD,0BAUC"}