@chevre/factory 7.0.0-alpha.1 → 7.0.0-alpha.3

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 (73) hide show
  1. package/lib/account/action/moneyTransfer.d.ts +6 -6
  2. package/lib/account/transaction.d.ts +3 -4
  3. package/lib/account.js +5 -5
  4. package/lib/action/accept/coaOffer.d.ts +5 -5
  5. package/lib/action/accept/pay.d.ts +4 -4
  6. package/lib/action/accept.d.ts +3 -3
  7. package/lib/action/authorize/invoice.d.ts +6 -6
  8. package/lib/action/authorize/offer/any.d.ts +3 -3
  9. package/lib/action/authorize/offer/eventService.d.ts +4 -4
  10. package/lib/action/authorize/offer/eventService.js +1 -1
  11. package/lib/action/authorize/offer/product.d.ts +4 -4
  12. package/lib/action/authorize/offer/product.js +1 -1
  13. package/lib/action/authorize/paymentMethod/any.d.ts +6 -6
  14. package/lib/action/authorize/ticketedObject.d.ts +4 -4
  15. package/lib/action/authorize.d.ts +4 -4
  16. package/lib/action/cancel/coaReserve.d.ts +4 -4
  17. package/lib/action/cancel/reservation.d.ts +4 -4
  18. package/lib/action/check/paymentMethod/movieTicket.d.ts +4 -4
  19. package/lib/action/check/thing.d.ts +5 -5
  20. package/lib/action/consume/use/reservation.d.ts +3 -3
  21. package/lib/action/consume/use.d.ts +3 -3
  22. package/lib/action/create.d.ts +3 -3
  23. package/lib/action/interact/confirm/pay.d.ts +3 -3
  24. package/lib/action/interact/confirm/registerService.d.ts +3 -3
  25. package/lib/action/interact/confirm/reservation.d.ts +3 -3
  26. package/lib/action/interact/confirm.d.ts +4 -4
  27. package/lib/action/interact/inform.d.ts +7 -7
  28. package/lib/action/interact/register/service.d.ts +3 -3
  29. package/lib/action/interact/register.d.ts +5 -5
  30. package/lib/action/reserve.d.ts +4 -4
  31. package/lib/action/trade/order.d.ts +5 -5
  32. package/lib/action/trade/pay.d.ts +5 -5
  33. package/lib/action/trade/refund.d.ts +5 -5
  34. package/lib/action/transfer/give/pointAward.d.ts +5 -5
  35. package/lib/action/transfer/give.d.ts +5 -5
  36. package/lib/action/transfer/moneyTransfer.d.ts +5 -5
  37. package/lib/action/transfer/return/invoice.d.ts +6 -6
  38. package/lib/action/transfer/return/order.d.ts +7 -7
  39. package/lib/action/transfer/return/pointAward.d.ts +6 -6
  40. package/lib/action/transfer/return/reserveTransaction.d.ts +6 -6
  41. package/lib/action/transfer/return.d.ts +3 -3
  42. package/lib/action/transfer/send/message/email.d.ts +3 -3
  43. package/lib/action/transfer/send/order.d.ts +3 -3
  44. package/lib/action/transfer/send.d.ts +6 -6
  45. package/lib/action/update/add.d.ts +4 -4
  46. package/lib/action/update/delete.d.ts +5 -5
  47. package/lib/action/update/replace.d.ts +4 -4
  48. package/lib/action/update/update.d.ts +4 -4
  49. package/lib/error/alreadyInUse.js +12 -31
  50. package/lib/error/argument.js +10 -30
  51. package/lib/error/argumentNull.js +10 -30
  52. package/lib/error/chevre.js +7 -26
  53. package/lib/error/forbidden.js +7 -28
  54. package/lib/error/gatewayTimeout.js +7 -28
  55. package/lib/error/internal.js +7 -28
  56. package/lib/error/notFound.js +10 -30
  57. package/lib/error/notImplemented.js +7 -28
  58. package/lib/error/rateLimitExceeded.js +7 -28
  59. package/lib/error/serviceUnavailable.js +7 -28
  60. package/lib/error/unauthorized.js +7 -28
  61. package/lib/error/unknown.js +7 -28
  62. package/lib/errors.js +13 -13
  63. package/lib/index.js +216 -216
  64. package/lib/invoice.d.ts +4 -4
  65. package/lib/offer.d.ts +2 -2
  66. package/lib/order.d.ts +19 -19
  67. package/lib/ownershipInfo.d.ts +7 -7
  68. package/lib/person.d.ts +3 -3
  69. package/lib/product.d.ts +3 -3
  70. package/lib/reservation.d.ts +1 -2
  71. package/lib/reservedCodeValues.js +24 -24
  72. package/lib/transaction.d.ts +4 -4
  73. package/package.json +3 -4
@@ -1,11 +1,11 @@
1
- import * as ActionFactory from '../../action';
1
+ import { IParticipantAsPerson, IParticipantAsWebApplication, IParticipantAsSoftwareApplication, IAction as IBaseAction, IAttributes as IBaseAttributes } from '../../action';
2
2
  import { ActionType } from '../../actionType';
3
3
  import { Identifier as WebAPIIdentifier, IService as IWebAPI } from '../../service/webAPI';
4
4
  import { IInstrumentAsApplication } from './instrumentAsApplication';
5
5
  import { EventType } from '../../eventType';
6
6
  import { OrganizationType } from '../../organizationType';
7
7
  import { PlaceType } from '../../placeType';
8
- export type IAgent = ActionFactory.IParticipantAsPerson | ActionFactory.IParticipantAsWebApplication | ActionFactory.IParticipantAsSoftwareApplication;
8
+ export type IAgent = IParticipantAsPerson | IParticipantAsWebApplication | IParticipantAsSoftwareApplication;
9
9
  interface IImportFromCOAParams {
10
10
  project: {
11
11
  id: string;
@@ -52,7 +52,7 @@ export interface IInstrumentAsCOAAPI {
52
52
  }
53
53
  export type IInstrument = IInstrumentAsApplication | IInstrumentAsCOAAPI;
54
54
  export type ITargetCollection = any;
55
- export interface IAttributes extends Pick<ActionFactory.IAttributes<ActionType.ReplaceAction, IObject, IResult>, 'typeOf' | 'targetCollection' | 'sameAs' | 'result' | 'replacer' | 'project' | 'object' | 'instrument' | 'error' | 'agent'> {
55
+ export interface IAttributes extends Pick<IBaseAttributes<ActionType.ReplaceAction, IObject, IResult>, 'typeOf' | 'targetCollection' | 'sameAs' | 'result' | 'replacer' | 'project' | 'object' | 'instrument' | 'error' | 'agent'> {
56
56
  potentialActions?: never;
57
57
  purpose?: never;
58
58
  replacer?: IReplacer;
@@ -62,5 +62,5 @@ export interface IAttributes extends Pick<ActionFactory.IAttributes<ActionType.R
62
62
  /**
63
63
  * 置換アクション
64
64
  */
65
- export type IAction = ActionFactory.IAction<IAttributes>;
65
+ export type IAction = IBaseAction<IAttributes>;
66
66
  export {};
@@ -1,4 +1,4 @@
1
- import * as ActionFactory from '../../action';
1
+ import { IParticipantAsPerson, IParticipantAsWebApplication, IParticipantAsSoftwareApplication, IParticipantAsProject, IAction as IBaseAction, IAttributes as IBaseAttributes } from '../../action';
2
2
  import { ActionType } from '../../actionType';
3
3
  import { IInstrumentAsApplication } from './instrumentAsApplication';
4
4
  import { IObject } from './update/object';
@@ -7,12 +7,12 @@ import { ITargetCollection } from './update/targetCollection';
7
7
  export * from './update/object';
8
8
  export * from './update/result';
9
9
  export * from './update/targetCollection';
10
- export type IAgent = ActionFactory.IParticipantAsPerson | ActionFactory.IParticipantAsWebApplication | ActionFactory.IParticipantAsSoftwareApplication | ActionFactory.IParticipantAsProject;
10
+ export type IAgent = IParticipantAsPerson | IParticipantAsWebApplication | IParticipantAsSoftwareApplication | IParticipantAsProject;
11
11
  export interface IInstrumentAsTask {
12
12
  typeOf: 'Task';
13
13
  }
14
14
  export type IInstrument = IInstrumentAsApplication | IInstrumentAsTask;
15
- export interface IAttributes extends Pick<ActionFactory.IAttributes<ActionType.UpdateAction, IObject, IResult>, 'typeOf' | 'targetCollection' | 'sameAs' | 'result' | 'project' | 'object' | 'instrument' | 'error' | 'agent'> {
15
+ export interface IAttributes extends Pick<IBaseAttributes<ActionType.UpdateAction, IObject, IResult>, 'typeOf' | 'targetCollection' | 'sameAs' | 'result' | 'project' | 'object' | 'instrument' | 'error' | 'agent'> {
16
16
  potentialActions?: never;
17
17
  purpose?: never;
18
18
  agent: IAgent;
@@ -22,4 +22,4 @@ export interface IAttributes extends Pick<ActionFactory.IAttributes<ActionType.U
22
22
  /**
23
23
  * 編集アクション
24
24
  */
25
- export type IAction = ActionFactory.IAction<IAttributes>;
25
+ export type IAction = IBaseAction<IAttributes>;
@@ -1,42 +1,23 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.AlreadyInUseError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * AlreadyInUseError
24
8
  */
25
- var AlreadyInUseError = /** @class */ (function (_super) {
26
- __extends(AlreadyInUseError, _super);
27
- function AlreadyInUseError(entityName, fieldNames, message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class AlreadyInUseError extends chevre_1.ChevreError {
10
+ entityName;
11
+ fieldNames;
12
+ constructor(entityName, fieldNames, message) {
13
+ let actualMessage = message;
30
14
  if (message === undefined || message.length === 0) {
31
- actualMessage = "The specified '".concat(entityName, "' value is already in use for: ").concat(fieldNames.join(', '), ".");
15
+ actualMessage = `The specified '${entityName}' value is already in use for: ${fieldNames.join(', ')}.`;
32
16
  }
33
17
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.AlreadyInUse, actualMessage) || this;
35
- _this.entityName = entityName;
36
- _this.fieldNames = fieldNames;
37
- setPrototypeOf(_this, AlreadyInUseError.prototype);
38
- return _this;
18
+ super(errorCode_1.ErrorCode.AlreadyInUse, actualMessage);
19
+ this.entityName = entityName;
20
+ this.fieldNames = fieldNames;
39
21
  }
40
- return AlreadyInUseError;
41
- }(chevre_1.ChevreError));
22
+ }
42
23
  exports.AlreadyInUseError = AlreadyInUseError;
@@ -1,41 +1,21 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.ArgumentError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * ArgumentError
24
8
  */
25
- var ArgumentError = /** @class */ (function (_super) {
26
- __extends(ArgumentError, _super);
27
- function ArgumentError(argumentName, message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class ArgumentError extends chevre_1.ChevreError {
10
+ argumentName;
11
+ constructor(argumentName, message) {
12
+ let actualMessage = message;
30
13
  if (message === undefined || message.length === 0) {
31
- actualMessage = "Invalid or missing argument supplied: ".concat(argumentName, ".");
14
+ actualMessage = `Invalid or missing argument supplied: ${argumentName}.`;
32
15
  }
33
16
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.Argument, actualMessage) || this;
35
- _this.argumentName = argumentName;
36
- setPrototypeOf(_this, ArgumentError.prototype);
37
- return _this;
17
+ super(errorCode_1.ErrorCode.Argument, actualMessage);
18
+ this.argumentName = argumentName;
38
19
  }
39
- return ArgumentError;
40
- }(chevre_1.ChevreError));
20
+ }
41
21
  exports.ArgumentError = ArgumentError;
@@ -1,41 +1,21 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.ArgumentNullError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * ArgumentNullError
24
8
  */
25
- var ArgumentNullError = /** @class */ (function (_super) {
26
- __extends(ArgumentNullError, _super);
27
- function ArgumentNullError(argumentName, message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class ArgumentNullError extends chevre_1.ChevreError {
10
+ argumentName;
11
+ constructor(argumentName, message) {
12
+ let actualMessage = message;
30
13
  if (message === undefined || message.length === 0) {
31
- actualMessage = "Missing argument: ".concat(argumentName, ".");
14
+ actualMessage = `Missing argument: ${argumentName}.`;
32
15
  }
33
16
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.ArgumentNull, actualMessage) || this;
35
- _this.argumentName = argumentName;
36
- setPrototypeOf(_this, ArgumentNullError.prototype);
37
- return _this;
17
+ super(errorCode_1.ErrorCode.ArgumentNull, actualMessage);
18
+ this.argumentName = argumentName;
38
19
  }
39
- return ArgumentNullError;
40
- }(chevre_1.ChevreError));
20
+ }
41
21
  exports.ArgumentNullError = ArgumentNullError;
@@ -1,35 +1,16 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.ChevreError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
4
  /**
21
5
  * ChevreError
22
6
  */
23
- var ChevreError = /** @class */ (function (_super) {
24
- __extends(ChevreError, _super);
7
+ class ChevreError extends Error {
8
+ reason;
25
9
  /* istanbul ignore next */
26
- function ChevreError(code, message) {
27
- var _this = _super.call(this, message) || this;
28
- _this.name = 'ChevreError';
29
- _this.reason = code;
30
- setPrototypeOf(_this, ChevreError.prototype);
31
- return _this;
10
+ constructor(code, message) {
11
+ super(message);
12
+ this.name = 'ChevreError';
13
+ this.reason = code;
32
14
  }
33
- return ChevreError;
34
- }(Error));
15
+ }
35
16
  exports.ChevreError = ChevreError;
@@ -1,40 +1,19 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.ForbiddenError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * ForbiddenError
24
8
  */
25
- var ForbiddenError = /** @class */ (function (_super) {
26
- __extends(ForbiddenError, _super);
27
- function ForbiddenError(message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class ForbiddenError extends chevre_1.ChevreError {
10
+ constructor(message) {
11
+ let actualMessage = message;
30
12
  if (message === undefined || message.length === 0) {
31
13
  actualMessage = 'Forbidden.';
32
14
  }
33
15
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.Forbidden, actualMessage) || this;
35
- setPrototypeOf(_this, ForbiddenError.prototype);
36
- return _this;
16
+ super(errorCode_1.ErrorCode.Forbidden, actualMessage);
37
17
  }
38
- return ForbiddenError;
39
- }(chevre_1.ChevreError));
18
+ }
40
19
  exports.ForbiddenError = ForbiddenError;
@@ -1,40 +1,19 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.GatewayTimeoutError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * GatewayTimeoutError
24
8
  */
25
- var GatewayTimeoutError = /** @class */ (function (_super) {
26
- __extends(GatewayTimeoutError, _super);
27
- function GatewayTimeoutError(message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class GatewayTimeoutError extends chevre_1.ChevreError {
10
+ constructor(message) {
11
+ let actualMessage = message;
30
12
  if (message === undefined || message.length === 0) {
31
13
  actualMessage = 'Gateway Timeout';
32
14
  }
33
15
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.GatewayTimeout, actualMessage) || this;
35
- setPrototypeOf(_this, GatewayTimeoutError.prototype);
36
- return _this;
16
+ super(errorCode_1.ErrorCode.GatewayTimeout, actualMessage);
37
17
  }
38
- return GatewayTimeoutError;
39
- }(chevre_1.ChevreError));
18
+ }
40
19
  exports.GatewayTimeoutError = GatewayTimeoutError;
@@ -1,40 +1,19 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.InternalError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * InternalError
24
8
  */
25
- var InternalError = /** @class */ (function (_super) {
26
- __extends(InternalError, _super);
27
- function InternalError(message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class InternalError extends chevre_1.ChevreError {
10
+ constructor(message) {
11
+ let actualMessage = message;
30
12
  if (message === undefined || message.length === 0) {
31
13
  actualMessage = 'Internal server error.';
32
14
  }
33
15
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.Internal, actualMessage) || this;
35
- setPrototypeOf(_this, InternalError.prototype);
36
- return _this;
16
+ super(errorCode_1.ErrorCode.Internal, actualMessage);
37
17
  }
38
- return InternalError;
39
- }(chevre_1.ChevreError));
18
+ }
40
19
  exports.InternalError = InternalError;
@@ -1,41 +1,21 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.NotFoundError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * NotFoundError
24
8
  */
25
- var NotFoundError = /** @class */ (function (_super) {
26
- __extends(NotFoundError, _super);
27
- function NotFoundError(entityName, message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class NotFoundError extends chevre_1.ChevreError {
10
+ entityName;
11
+ constructor(entityName, message) {
12
+ let actualMessage = message;
30
13
  if (message === undefined || message.length === 0) {
31
- actualMessage = "Not Found: ".concat(entityName, ".");
14
+ actualMessage = `Not Found: ${entityName}.`;
32
15
  }
33
16
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.NotFound, actualMessage) || this;
35
- _this.entityName = entityName;
36
- setPrototypeOf(_this, NotFoundError.prototype);
37
- return _this;
17
+ super(errorCode_1.ErrorCode.NotFound, actualMessage);
18
+ this.entityName = entityName;
38
19
  }
39
- return NotFoundError;
40
- }(chevre_1.ChevreError));
20
+ }
41
21
  exports.NotFoundError = NotFoundError;
@@ -1,40 +1,19 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.NotImplementedError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * NotImplementedError
24
8
  */
25
- var NotImplementedError = /** @class */ (function (_super) {
26
- __extends(NotImplementedError, _super);
27
- function NotImplementedError(message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class NotImplementedError extends chevre_1.ChevreError {
10
+ constructor(message) {
11
+ let actualMessage = message;
30
12
  if (message === undefined || message.length === 0) {
31
13
  actualMessage = 'Method is not yet implemented.';
32
14
  }
33
15
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.NotImplemented, actualMessage) || this;
35
- setPrototypeOf(_this, NotImplementedError.prototype);
36
- return _this;
16
+ super(errorCode_1.ErrorCode.NotImplemented, actualMessage);
37
17
  }
38
- return NotImplementedError;
39
- }(chevre_1.ChevreError));
18
+ }
40
19
  exports.NotImplementedError = NotImplementedError;
@@ -1,40 +1,19 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.RateLimitExceededError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * RateLimitExceededError
24
8
  */
25
- var RateLimitExceededError = /** @class */ (function (_super) {
26
- __extends(RateLimitExceededError, _super);
27
- function RateLimitExceededError(message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class RateLimitExceededError extends chevre_1.ChevreError {
10
+ constructor(message) {
11
+ let actualMessage = message;
30
12
  if (message === undefined || message.length === 0) {
31
13
  actualMessage = 'Rate limit exceeded.';
32
14
  }
33
15
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.RateLimitExceeded, actualMessage) || this;
35
- setPrototypeOf(_this, RateLimitExceededError.prototype);
36
- return _this;
16
+ super(errorCode_1.ErrorCode.RateLimitExceeded, actualMessage);
37
17
  }
38
- return RateLimitExceededError;
39
- }(chevre_1.ChevreError));
18
+ }
40
19
  exports.RateLimitExceededError = RateLimitExceededError;
@@ -1,40 +1,19 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.ServiceUnavailableError = void 0;
19
- var setPrototypeOf = require("setprototypeof"); // eslint-disable-line @typescript-eslint/no-require-imports
20
- var errorCode_1 = require("../errorCode");
21
- var chevre_1 = require("./chevre");
4
+ const errorCode_1 = require("../errorCode");
5
+ const chevre_1 = require("./chevre");
22
6
  /**
23
7
  * ServiceUnavailableError
24
8
  */
25
- var ServiceUnavailableError = /** @class */ (function (_super) {
26
- __extends(ServiceUnavailableError, _super);
27
- function ServiceUnavailableError(message) {
28
- var _this = this;
29
- var actualMessage = message;
9
+ class ServiceUnavailableError extends chevre_1.ChevreError {
10
+ constructor(message) {
11
+ let actualMessage = message;
30
12
  if (message === undefined || message.length === 0) {
31
13
  actualMessage = 'Service unavailable temporarily.';
32
14
  }
33
15
  /* istanbul ignore next */
34
- _this = _super.call(this, errorCode_1.ErrorCode.ServiceUnavailable, actualMessage) || this;
35
- setPrototypeOf(_this, ServiceUnavailableError.prototype);
36
- return _this;
16
+ super(errorCode_1.ErrorCode.ServiceUnavailable, actualMessage);
37
17
  }
38
- return ServiceUnavailableError;
39
- }(chevre_1.ChevreError));
18
+ }
40
19
  exports.ServiceUnavailableError = ServiceUnavailableError;