@takeshape/errors 11.52.0 → 11.55.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 (129) hide show
  1. package/dist/__tests__/bad-request.test.d.ts +1 -0
  2. package/dist/__tests__/bad-request.test.js +12 -0
  3. package/dist/__tests__/base-error.test.d.ts +1 -0
  4. package/dist/__tests__/base-error.test.js +31 -0
  5. package/dist/__tests__/service-provider-error.test.d.ts +1 -0
  6. package/dist/__tests__/service-provider-error.test.js +8 -0
  7. package/dist/api-indexing/__tests__/index.test.d.ts +1 -0
  8. package/dist/api-indexing/__tests__/index.test.js +22 -0
  9. package/dist/api-indexing/index.d.ts +0 -1
  10. package/dist/api-indexing/index.js +27 -45
  11. package/dist/authorization.d.ts +1 -2
  12. package/dist/authorization.js +7 -17
  13. package/dist/bad-data.d.ts +1 -2
  14. package/dist/bad-data.js +7 -17
  15. package/dist/bad-request.d.ts +1 -2
  16. package/dist/bad-request.js +15 -25
  17. package/dist/base-error.d.ts +0 -1
  18. package/dist/base-error.js +15 -36
  19. package/dist/branch-merge-error.d.ts +1 -2
  20. package/dist/branch-merge-error.js +12 -22
  21. package/dist/conflict.d.ts +1 -2
  22. package/dist/conflict.js +9 -19
  23. package/dist/deploy.d.ts +1 -2
  24. package/dist/deploy.js +7 -17
  25. package/dist/directive-mapping-error.d.ts +1 -2
  26. package/dist/directive-mapping-error.js +7 -17
  27. package/dist/download.d.ts +1 -2
  28. package/dist/download.js +7 -17
  29. package/dist/entitlement.d.ts +1 -2
  30. package/dist/entitlement.js +7 -17
  31. package/dist/forbidden.d.ts +1 -2
  32. package/dist/forbidden.js +9 -19
  33. package/dist/generate.d.ts +1 -2
  34. package/dist/generate.js +7 -17
  35. package/dist/guardrails.d.ts +1 -2
  36. package/dist/guardrails.js +21 -34
  37. package/dist/import.d.ts +1 -2
  38. package/dist/import.js +7 -17
  39. package/dist/index.d.ts +29 -30
  40. package/dist/index.js +29 -324
  41. package/dist/invalid-query-error.d.ts +1 -2
  42. package/dist/invalid-query-error.js +7 -17
  43. package/dist/invalid-version.d.ts +1 -2
  44. package/dist/invalid-version.js +7 -17
  45. package/dist/json-validation.d.ts +1 -2
  46. package/dist/json-validation.js +13 -23
  47. package/dist/lock.d.ts +1 -2
  48. package/dist/lock.js +7 -17
  49. package/dist/not-found.d.ts +1 -2
  50. package/dist/not-found.js +7 -17
  51. package/dist/parameter-serialization-error.d.ts +1 -2
  52. package/dist/parameter-serialization-error.js +7 -17
  53. package/dist/payment-method.d.ts +1 -2
  54. package/dist/payment-method.js +7 -17
  55. package/dist/remote-graphql-schema.d.ts +1 -2
  56. package/dist/remote-graphql-schema.js +7 -17
  57. package/dist/schema-build.d.ts +1 -2
  58. package/dist/schema-build.js +12 -26
  59. package/dist/schema-validation.d.ts +1 -2
  60. package/dist/schema-validation.js +13 -23
  61. package/dist/service-provider.d.ts +1 -2
  62. package/dist/service-provider.js +7 -17
  63. package/dist/suspend.d.ts +1 -2
  64. package/dist/suspend.js +9 -19
  65. package/dist/unauthorized.d.ts +1 -2
  66. package/dist/unauthorized.js +7 -17
  67. package/dist/unzip.d.ts +1 -2
  68. package/dist/unzip.js +7 -17
  69. package/package.json +20 -17
  70. package/dist/api-indexing/index.d.ts.map +0 -1
  71. package/dist/authorization.d.ts.map +0 -1
  72. package/dist/bad-data.d.ts.map +0 -1
  73. package/dist/bad-request.d.ts.map +0 -1
  74. package/dist/base-error.d.ts.map +0 -1
  75. package/dist/branch-merge-error.d.ts.map +0 -1
  76. package/dist/conflict.d.ts.map +0 -1
  77. package/dist/deploy.d.ts.map +0 -1
  78. package/dist/directive-mapping-error.d.ts.map +0 -1
  79. package/dist/download.d.ts.map +0 -1
  80. package/dist/entitlement.d.ts.map +0 -1
  81. package/dist/forbidden.d.ts.map +0 -1
  82. package/dist/generate.d.ts.map +0 -1
  83. package/dist/guardrails.d.ts.map +0 -1
  84. package/dist/import.d.ts.map +0 -1
  85. package/dist/index.d.ts.map +0 -1
  86. package/dist/invalid-query-error.d.ts.map +0 -1
  87. package/dist/invalid-version.d.ts.map +0 -1
  88. package/dist/json-validation.d.ts.map +0 -1
  89. package/dist/lock.d.ts.map +0 -1
  90. package/dist/not-found.d.ts.map +0 -1
  91. package/dist/parameter-serialization-error.d.ts.map +0 -1
  92. package/dist/payment-method.d.ts.map +0 -1
  93. package/dist/remote-graphql-schema.d.ts.map +0 -1
  94. package/dist/schema-build.d.ts.map +0 -1
  95. package/dist/schema-validation.d.ts.map +0 -1
  96. package/dist/service-provider.d.ts.map +0 -1
  97. package/dist/suspend.d.ts.map +0 -1
  98. package/dist/unauthorized.d.ts.map +0 -1
  99. package/dist/unzip.d.ts.map +0 -1
  100. package/es/api-indexing/index.js +0 -39
  101. package/es/authorization.js +0 -11
  102. package/es/bad-data.js +0 -11
  103. package/es/bad-request.js +0 -19
  104. package/es/base-error.js +0 -31
  105. package/es/branch-merge-error.js +0 -16
  106. package/es/conflict.js +0 -13
  107. package/es/deploy.js +0 -11
  108. package/es/directive-mapping-error.js +0 -11
  109. package/es/download.js +0 -11
  110. package/es/entitlement.js +0 -11
  111. package/es/forbidden.js +0 -13
  112. package/es/generate.js +0 -11
  113. package/es/guardrails.js +0 -28
  114. package/es/import.js +0 -11
  115. package/es/index.js +0 -30
  116. package/es/invalid-query-error.js +0 -11
  117. package/es/invalid-version.js +0 -11
  118. package/es/json-validation.js +0 -17
  119. package/es/lock.js +0 -11
  120. package/es/not-found.js +0 -11
  121. package/es/parameter-serialization-error.js +0 -11
  122. package/es/payment-method.js +0 -11
  123. package/es/remote-graphql-schema.js +0 -11
  124. package/es/schema-build.js +0 -20
  125. package/es/schema-validation.js +0 -17
  126. package/es/service-provider.js +0 -11
  127. package/es/suspend.js +0 -13
  128. package/es/unauthorized.js +0 -11
  129. package/es/unzip.js +0 -11
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { expect, test } from 'vitest';
2
+ import { BadRequestError } from "../bad-request.js";
3
+ test('BadRequestError provides an appropriate statusCode and validation method', () => {
4
+ const message = 'is broken';
5
+ const data = { validation: 'nah' };
6
+ const error = new BadRequestError(message, { validation: 'nah' });
7
+ expect(error.message).toEqual(message);
8
+ expect(error.statusCode).toEqual(400);
9
+ expect(error.validation).toEqual(data.validation);
10
+ expect(error.validationMessages).toEqual(data.validation);
11
+ expect(error.reportToSentry).toEqual(false);
12
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ import { expect, test } from 'vitest';
2
+ import { BaseError } from "../base-error.js";
3
+ class MockError extends BaseError {
4
+ static code = 'MockError';
5
+ static statusCode = 666;
6
+ extensions = {
7
+ http: { status: MockError.statusCode }
8
+ };
9
+ constructor(message = 'sign of the beast') {
10
+ super(message);
11
+ }
12
+ }
13
+ test('BaseError supports a code, status code, name, and default message when extended', () => {
14
+ const error = new MockError();
15
+ expect(error.name).toEqual('MockError');
16
+ expect(error.message).toEqual('sign of the beast');
17
+ expect(error.reportToSentry).toEqual(false);
18
+ expect(error.statusCode).toEqual(666);
19
+ expect(error.extensions.http.status).toEqual(666);
20
+ });
21
+ test('BaseError supports overriding a message when extended', () => {
22
+ const message = 'mock message';
23
+ const error = new MockError(message);
24
+ expect(error.reportToSentry).toEqual(false);
25
+ expect(error.unmaskError).toEqual(true);
26
+ expect(error.message).toEqual(message);
27
+ });
28
+ test('BaseError supports settings reportToSentry in options', () => {
29
+ const error = new BaseError('mock message', { reportToSentry: true });
30
+ expect(error.reportToSentry).toEqual(true);
31
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { expect, test } from 'vitest';
2
+ import { ServiceProviderError } from "../service-provider.js";
3
+ test('ServiceProviderError provides an appropriate statusCode and validation method', () => {
4
+ const message = 'is broken';
5
+ const error = new ServiceProviderError(message);
6
+ expect(error.message).toEqual(message);
7
+ expect(error.statusCode).toEqual(500);
8
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import { describe, expect, test } from 'vitest';
2
+ import { InvalidPaginationTypeError, MissingIndexedShapeError, apiIndexingLogErrorMessage } from "../index.js";
3
+ test('MissingIndexedShapeError', () => {
4
+ const error = new MissingIndexedShapeError('queryName');
5
+ expect(error.message).toEqual('Could not find indexed shape for queryName. Verify that itemsPath is set correctly.');
6
+ expect(error.code).toEqual('MissingIndexedShapeError');
7
+ });
8
+ test('InvalidPaginationTypeError', () => {
9
+ const error = new InvalidPaginationTypeError(['page', 'cursor', 'offset']);
10
+ expect(error.message).toEqual('Invalid pagination type. Valid types are page, cursor, offset.');
11
+ expect(error.code).toEqual('InvalidPaginationTypeError');
12
+ });
13
+ describe('apiIndexingLogErrorMessage', () => {
14
+ test('returns the message for an ApiIndexingError', () => {
15
+ const error = new MissingIndexedShapeError('queryName');
16
+ expect(apiIndexingLogErrorMessage('ShapeName', error)).toEqual(error.message);
17
+ });
18
+ test('returns the default otherwise', () => {
19
+ const error = new Error('some error');
20
+ expect(apiIndexingLogErrorMessage('ShapeName', error)).toEqual('Failed to index shape "ShapeName" due to an unexpected error.');
21
+ });
22
+ });
@@ -16,4 +16,3 @@ export declare class IndexItemMissingIdError extends ApiIndexingError {
16
16
  constructor(idFieldName: string);
17
17
  }
18
18
  export declare function apiIndexingLogErrorMessage(shapeName: string, error?: Error): string;
19
- //# sourceMappingURL=index.d.ts.map
@@ -1,50 +1,32 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.MissingIndexedShapeError = exports.InvalidPaginationTypeError = exports.IndexItemMissingIdError = exports.ApiIndexingError = void 0;
7
- exports.apiIndexingLogErrorMessage = apiIndexingLogErrorMessage;
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class ApiIndexingError extends Error {
12
- constructor(message, options) {
13
- super(message, options);
14
- this.name = this.constructor.name;
15
- this.message = message;
16
- if (typeof Error.captureStackTrace === 'function') {
17
- Error.captureStackTrace(this, this.constructor);
18
- } else {
19
- this.stack = new Error(message).stack;
1
+ export class ApiIndexingError extends Error {
2
+ static code;
3
+ code;
4
+ constructor(message) {
5
+ super(message);
6
+ this.code = this.constructor.code;
20
7
  }
21
- _defineProperty(this, "code", void 0);
22
- this.code = this.constructor.code;
23
- }
24
8
  }
25
- exports.ApiIndexingError = ApiIndexingError;
26
- _defineProperty(ApiIndexingError, "code", void 0);
27
- class MissingIndexedShapeError extends ApiIndexingError {
28
- constructor(queryName) {
29
- super(`Could not find indexed shape for ${queryName}. Verify that itemsPath is set correctly.`);
30
- }
9
+ export class MissingIndexedShapeError extends ApiIndexingError {
10
+ static code = 'MissingIndexedShapeError';
11
+ constructor(queryName) {
12
+ super(`Could not find indexed shape for ${queryName}. Verify that itemsPath is set correctly.`);
13
+ this.name = this.code;
14
+ }
15
+ }
16
+ export class InvalidPaginationTypeError extends ApiIndexingError {
17
+ static code = 'InvalidPaginationTypeError';
18
+ constructor(validTypes) {
19
+ super(`Invalid pagination type. Valid types are ${validTypes.join(', ')}.`);
20
+ }
31
21
  }
32
- exports.MissingIndexedShapeError = MissingIndexedShapeError;
33
- _defineProperty(MissingIndexedShapeError, "code", 'MissingIndexedShapeError');
34
- class InvalidPaginationTypeError extends ApiIndexingError {
35
- constructor(validTypes) {
36
- super(`Invalid pagination type. Valid types are ${validTypes.join(', ')}.`);
37
- }
22
+ export class IndexItemMissingIdError extends ApiIndexingError {
23
+ static code = 'IndexItemMissingIdError';
24
+ constructor(idFieldName) {
25
+ super(`Index item is missing a value for the id field "${idFieldName}". Please make sure that cache.idField is set correctly.`);
26
+ }
38
27
  }
39
- exports.InvalidPaginationTypeError = InvalidPaginationTypeError;
40
- _defineProperty(InvalidPaginationTypeError, "code", 'InvalidPaginationTypeError');
41
- class IndexItemMissingIdError extends ApiIndexingError {
42
- constructor(idFieldName) {
43
- super(`Index item is missing a value for the id field "${idFieldName}". Please make sure that cache.idField is set correctly.`);
44
- }
28
+ export function apiIndexingLogErrorMessage(shapeName, error) {
29
+ return error instanceof ApiIndexingError
30
+ ? error.message
31
+ : `Failed to index shape "${shapeName}" due to an unexpected error.`;
45
32
  }
46
- exports.IndexItemMissingIdError = IndexItemMissingIdError;
47
- _defineProperty(IndexItemMissingIdError, "code", 'IndexItemMissingIdError');
48
- function apiIndexingLogErrorMessage(shapeName, error) {
49
- return error instanceof ApiIndexingError ? error.message : `Failed to index shape "${shapeName}" due to an unexpected error.`;
50
- }
@@ -1,7 +1,6 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class AuthorizationError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  constructor(message?: string, options?: BaseErrorOptions);
6
6
  }
7
- //# sourceMappingURL=authorization.d.ts.map
@@ -1,18 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.AuthorizationError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class AuthorizationError extends _baseError.BaseError {
12
- constructor(message = 'Authorization Error', options = {}) {
13
- super(message, options);
14
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class AuthorizationError extends BaseError {
3
+ static code = 'AuthorizationError';
4
+ static statusCode = 401;
5
+ constructor(message = 'Authorization Error', options = {}) {
6
+ super(message, options);
7
+ }
15
8
  }
16
- exports.AuthorizationError = AuthorizationError;
17
- _defineProperty(AuthorizationError, "code", 'AuthorizationError');
18
- _defineProperty(AuthorizationError, "statusCode", 401);
@@ -1,7 +1,6 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class BadDataError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  constructor(message?: string, options?: BaseErrorOptions);
6
6
  }
7
- //# sourceMappingURL=bad-data.d.ts.map
package/dist/bad-data.js CHANGED
@@ -1,18 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BadDataError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class BadDataError extends _baseError.BaseError {
12
- constructor(message = 'Bad Data', options = {}) {
13
- super(message, options);
14
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class BadDataError extends BaseError {
3
+ static code = 'BadDataError';
4
+ static statusCode = 400;
5
+ constructor(message = 'Bad Data', options = {}) {
6
+ super(message, options);
7
+ }
15
8
  }
16
- exports.BadDataError = BadDataError;
17
- _defineProperty(BadDataError, "code", 'BadDataError');
18
- _defineProperty(BadDataError, "statusCode", 400);
@@ -1,4 +1,4 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class BadRequestError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
@@ -7,4 +7,3 @@ export declare class BadRequestError extends BaseError {
7
7
  get validation(): any;
8
8
  get validationMessages(): any;
9
9
  }
10
- //# sourceMappingURL=bad-request.d.ts.map
@@ -1,26 +1,16 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BadRequestError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class BadRequestError extends _baseError.BaseError {
12
- constructor(message = 'Bad Request', data, options = {}) {
13
- super(message, options);
14
- _defineProperty(this, "data", void 0);
15
- this.data = data;
16
- }
17
- get validation() {
18
- return this.data && (this.data.validation ?? this.data.errors);
19
- }
20
- get validationMessages() {
21
- return this.validation || null;
22
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class BadRequestError extends BaseError {
3
+ static code = 'BadRequestError';
4
+ static statusCode = 400;
5
+ data;
6
+ constructor(message = 'Bad Request', data, options = {}) {
7
+ super(message, options);
8
+ this.data = data;
9
+ }
10
+ get validation() {
11
+ return this.data && (this.data.validation ?? this.data.errors);
12
+ }
13
+ get validationMessages() {
14
+ return this.validation || null;
15
+ }
23
16
  }
24
- exports.BadRequestError = BadRequestError;
25
- _defineProperty(BadRequestError, "code", 'BadRequestError');
26
- _defineProperty(BadRequestError, "statusCode", 400);
@@ -22,4 +22,3 @@ export declare class BaseError extends Error {
22
22
  extensions?: BaseErrorExtensions;
23
23
  constructor(message: string, { cause, ...options }?: BaseErrorOptions);
24
24
  }
25
- //# sourceMappingURL=base-error.d.ts.map
@@ -1,38 +1,17 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BaseError = void 0;
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- class BaseError extends Error {
11
- constructor(message, {
12
- cause,
13
- ...options
14
- } = {}) {
15
- super(message, {
16
- cause
17
- });
18
- this.name = this.constructor.name;
19
- this.message = message;
20
- if (typeof Error.captureStackTrace === 'function') {
21
- Error.captureStackTrace(this, this.constructor);
22
- } else {
23
- this.stack = new Error(message).stack;
1
+ export class BaseError extends Error {
2
+ static code;
3
+ static statusCode;
4
+ code;
5
+ statusCode;
6
+ reportToSentry = false;
7
+ unmaskError = true;
8
+ extensions;
9
+ constructor(message, { cause, ...options } = {}) {
10
+ super(message, { cause });
11
+ this.code = this.constructor.code;
12
+ this.name = this.code;
13
+ this.statusCode = this.constructor.statusCode;
14
+ this.extensions = options.extensions;
15
+ this.reportToSentry = options.reportToSentry ?? this.reportToSentry;
24
16
  }
25
- _defineProperty(this, "code", void 0);
26
- _defineProperty(this, "statusCode", void 0);
27
- _defineProperty(this, "reportToSentry", false);
28
- _defineProperty(this, "unmaskError", true);
29
- _defineProperty(this, "extensions", void 0);
30
- this.code = this.constructor.code;
31
- this.statusCode = this.constructor.statusCode;
32
- this.extensions = options.extensions;
33
- this.reportToSentry = options.reportToSentry ?? this.reportToSentry;
34
- }
35
17
  }
36
- exports.BaseError = BaseError;
37
- _defineProperty(BaseError, "code", void 0);
38
- _defineProperty(BaseError, "statusCode", void 0);
@@ -1,4 +1,4 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class BranchMergeError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
@@ -6,4 +6,3 @@ export declare class BranchMergeError extends BaseError {
6
6
  constructor(message?: string, data?: Record<string, any>, options?: BaseErrorOptions);
7
7
  get errors(): any;
8
8
  }
9
- //# sourceMappingURL=branch-merge-error.d.ts.map
@@ -1,23 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BranchMergeError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class BranchMergeError extends _baseError.BaseError {
12
- constructor(message = 'Branch merge error', data, options = {}) {
13
- super(message, options);
14
- _defineProperty(this, "data", void 0);
15
- this.data = data;
16
- }
17
- get errors() {
18
- return this.data?.errors;
19
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class BranchMergeError extends BaseError {
3
+ static code = 'BranchMergeError';
4
+ static statusCode = 400;
5
+ data;
6
+ constructor(message = 'Branch merge error', data, options = {}) {
7
+ super(message, options);
8
+ this.data = data;
9
+ }
10
+ get errors() {
11
+ return this.data?.errors;
12
+ }
20
13
  }
21
- exports.BranchMergeError = BranchMergeError;
22
- _defineProperty(BranchMergeError, "code", 'BranchMergeError');
23
- _defineProperty(BranchMergeError, "statusCode", 400);
@@ -1,8 +1,7 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class ConflictError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  data: unknown;
6
6
  constructor(message?: string, data?: unknown, options?: BaseErrorOptions);
7
7
  }
8
- //# sourceMappingURL=conflict.d.ts.map
package/dist/conflict.js CHANGED
@@ -1,20 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ConflictError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class ConflictError extends _baseError.BaseError {
12
- constructor(message = 'Conflict', data, options = {}) {
13
- super(message, options);
14
- _defineProperty(this, "data", void 0);
15
- this.data = data;
16
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class ConflictError extends BaseError {
3
+ static code = 'ConflictError';
4
+ static statusCode = 409;
5
+ data;
6
+ constructor(message = 'Conflict', data, options = {}) {
7
+ super(message, options);
8
+ this.data = data;
9
+ }
17
10
  }
18
- exports.ConflictError = ConflictError;
19
- _defineProperty(ConflictError, "code", 'ConflictError');
20
- _defineProperty(ConflictError, "statusCode", 409);
package/dist/deploy.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class DeployError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  constructor(message?: string, options?: BaseErrorOptions);
6
6
  }
7
- //# sourceMappingURL=deploy.d.ts.map
package/dist/deploy.js CHANGED
@@ -1,18 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DeployError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class DeployError extends _baseError.BaseError {
12
- constructor(message = 'An error occurred while deploying static site', options = {}) {
13
- super(message, options);
14
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class DeployError extends BaseError {
3
+ static code = 'DeployError';
4
+ static statusCode = 500;
5
+ constructor(message = 'An error occurred while deploying static site', options = {}) {
6
+ super(message, options);
7
+ }
15
8
  }
16
- exports.DeployError = DeployError;
17
- _defineProperty(DeployError, "code", 'DeployError');
18
- _defineProperty(DeployError, "statusCode", 500);
@@ -1,7 +1,6 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class DirectiveMappingError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  constructor(message?: string, options?: BaseErrorOptions);
6
6
  }
7
- //# sourceMappingURL=directive-mapping-error.d.ts.map
@@ -1,18 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DirectiveMappingError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class DirectiveMappingError extends _baseError.BaseError {
12
- constructor(message = 'An error occurred while running a directive mapping operation', options = {}) {
13
- super(message, options);
14
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class DirectiveMappingError extends BaseError {
3
+ static code = 'DirectiveMappingError';
4
+ static statusCode = 500;
5
+ constructor(message = 'An error occurred while running a directive mapping operation', options = {}) {
6
+ super(message, options);
7
+ }
15
8
  }
16
- exports.DirectiveMappingError = DirectiveMappingError;
17
- _defineProperty(DirectiveMappingError, "code", 'DirectiveMappingError');
18
- _defineProperty(DirectiveMappingError, "statusCode", 500);
@@ -1,7 +1,6 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class DownloadError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  constructor(message?: string, options?: BaseErrorOptions);
6
6
  }
7
- //# sourceMappingURL=download.d.ts.map
package/dist/download.js CHANGED
@@ -1,18 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DownloadError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class DownloadError extends _baseError.BaseError {
12
- constructor(message = 'An error occurred while downloading static site', options = {}) {
13
- super(message, options);
14
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class DownloadError extends BaseError {
3
+ static code = 'DownloadError';
4
+ static statusCode = 500;
5
+ constructor(message = 'An error occurred while downloading static site', options = {}) {
6
+ super(message, options);
7
+ }
15
8
  }
16
- exports.DownloadError = DownloadError;
17
- _defineProperty(DownloadError, "code", 'DownloadError');
18
- _defineProperty(DownloadError, "statusCode", 500);
@@ -1,7 +1,6 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class EntitlementError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  constructor(message?: string, options?: BaseErrorOptions);
6
6
  }
7
- //# sourceMappingURL=entitlement.d.ts.map
@@ -1,18 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EntitlementError = void 0;
7
- var _baseError = require("./base-error");
8
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
- class EntitlementError extends _baseError.BaseError {
12
- constructor(message = 'Entitlement Error', options = {}) {
13
- super(message, options);
14
- }
1
+ import { BaseError } from "./base-error.js";
2
+ export class EntitlementError extends BaseError {
3
+ static code = 'EntitlementError';
4
+ static statusCode = 500;
5
+ constructor(message = 'Entitlement Error', options = {}) {
6
+ super(message, options);
7
+ }
15
8
  }
16
- exports.EntitlementError = EntitlementError;
17
- _defineProperty(EntitlementError, "code", 'EntitlementError');
18
- _defineProperty(EntitlementError, "statusCode", 500);
@@ -1,8 +1,7 @@
1
- import { BaseError, type BaseErrorOptions } from './base-error';
1
+ import { BaseError, type BaseErrorOptions } from './base-error.ts';
2
2
  export declare class ForbiddenError extends BaseError {
3
3
  static code: string;
4
4
  static statusCode: number;
5
5
  data: unknown;
6
6
  constructor(message?: string, data?: unknown, options?: BaseErrorOptions);
7
7
  }
8
- //# sourceMappingURL=forbidden.d.ts.map