@unito/integration-sdk 0.1.7 → 0.1.8

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.
package/.eslintrc.cjs CHANGED
@@ -14,6 +14,8 @@ module.exports = {
14
14
  'files': ['src/**/*.ts'],
15
15
  'rules': {
16
16
  'no-console': 'off',
17
+ // Typescript already checks for this, with an easy exception on leading underscores names
18
+ "@typescript-eslint/no-unused-vars": 'off',
17
19
  '@typescript-eslint/no-explicit-any': 'off'
18
20
  }
19
21
  },
@@ -1,10 +1,4 @@
1
1
  import * as HttpErrors from './httpErrors.js';
2
- export declare class NoIntegrationFoundError extends Error {
3
- }
4
- export declare class NoConfigurationFileError extends Error {
5
- }
6
- export declare class ConfigurationMalformed extends Error {
7
- }
8
2
  export declare class InvalidHandler extends Error {
9
3
  }
10
4
  /**
@@ -1,10 +1,4 @@
1
1
  import * as HttpErrors from './httpErrors.js';
2
- export class NoIntegrationFoundError extends Error {
3
- }
4
- export class NoConfigurationFileError extends Error {
5
- }
6
- export class ConfigurationMalformed extends Error {
7
- }
8
2
  export class InvalidHandler extends Error {
9
3
  }
10
4
  /**
@@ -28,6 +22,9 @@ export function buildHttpError(responseStatus, message) {
28
22
  else if (responseStatus === 408) {
29
23
  httpError = new HttpErrors.TimeoutError(message);
30
24
  }
25
+ else if (responseStatus === 410) {
26
+ httpError = new HttpErrors.ResourceGoneError(message);
27
+ }
31
28
  else if (responseStatus === 422) {
32
29
  httpError = new HttpErrors.UnprocessableEntityError(message);
33
30
  }
@@ -14,12 +14,12 @@ export declare class NotFoundError extends HttpError {
14
14
  export declare class TimeoutError extends HttpError {
15
15
  constructor(message?: string);
16
16
  }
17
- export declare class UnprocessableEntityError extends HttpError {
17
+ export declare class ResourceGoneError extends HttpError {
18
18
  constructor(message?: string);
19
19
  }
20
- export declare class RateLimitExceededError extends HttpError {
20
+ export declare class UnprocessableEntityError extends HttpError {
21
21
  constructor(message?: string);
22
22
  }
23
- export declare class WouldExceedLimitError extends HttpError {
23
+ export declare class RateLimitExceededError extends HttpError {
24
24
  constructor(message?: string);
25
25
  }
@@ -25,6 +25,11 @@ export class TimeoutError extends HttpError {
25
25
  super(message || 'Not found', 408);
26
26
  }
27
27
  }
28
+ export class ResourceGoneError extends HttpError {
29
+ constructor(message) {
30
+ super(message || 'Resource gone or unavailable', 410);
31
+ }
32
+ }
28
33
  export class UnprocessableEntityError extends HttpError {
29
34
  constructor(message) {
30
35
  super(message || 'Unprocessable Entity', 422);
@@ -35,8 +40,3 @@ export class RateLimitExceededError extends HttpError {
35
40
  super(message || 'Rate Limit Exceeded', 429);
36
41
  }
37
42
  }
38
- export class WouldExceedLimitError extends HttpError {
39
- constructor(message) {
40
- super(message || 'Would Exceed Limit', 429);
41
- }
42
- }