@chevre/factory 7.0.0-alpha.2 → 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.
- package/lib/account/action/moneyTransfer.d.ts +6 -6
- package/lib/account/transaction.d.ts +3 -4
- package/lib/account.js +5 -5
- package/lib/action/accept/coaOffer.d.ts +5 -5
- package/lib/action/accept/pay.d.ts +4 -4
- package/lib/action/accept.d.ts +3 -3
- package/lib/action/authorize/invoice.d.ts +6 -6
- package/lib/action/authorize/offer/any.d.ts +3 -3
- package/lib/action/authorize/offer/eventService.d.ts +4 -4
- package/lib/action/authorize/offer/eventService.js +1 -1
- package/lib/action/authorize/offer/product.d.ts +4 -4
- package/lib/action/authorize/offer/product.js +1 -1
- package/lib/action/authorize/paymentMethod/any.d.ts +6 -6
- package/lib/action/authorize/ticketedObject.d.ts +4 -4
- package/lib/action/authorize.d.ts +4 -4
- package/lib/action/cancel/coaReserve.d.ts +4 -4
- package/lib/action/cancel/reservation.d.ts +4 -4
- package/lib/action/check/paymentMethod/movieTicket.d.ts +4 -4
- package/lib/action/check/thing.d.ts +5 -5
- package/lib/action/consume/use/reservation.d.ts +3 -3
- package/lib/action/consume/use.d.ts +3 -3
- package/lib/action/create.d.ts +3 -3
- package/lib/action/interact/confirm/pay.d.ts +3 -3
- package/lib/action/interact/confirm/registerService.d.ts +3 -3
- package/lib/action/interact/confirm/reservation.d.ts +3 -3
- package/lib/action/interact/confirm.d.ts +4 -4
- package/lib/action/interact/inform.d.ts +7 -7
- package/lib/action/interact/register/service.d.ts +3 -3
- package/lib/action/interact/register.d.ts +5 -5
- package/lib/action/reserve.d.ts +4 -4
- package/lib/action/trade/order.d.ts +5 -5
- package/lib/action/trade/pay.d.ts +5 -5
- package/lib/action/trade/refund.d.ts +5 -5
- package/lib/action/transfer/give/pointAward.d.ts +5 -5
- package/lib/action/transfer/give.d.ts +5 -5
- package/lib/action/transfer/moneyTransfer.d.ts +5 -5
- package/lib/action/transfer/return/invoice.d.ts +6 -6
- package/lib/action/transfer/return/order.d.ts +7 -7
- package/lib/action/transfer/return/pointAward.d.ts +6 -6
- package/lib/action/transfer/return/reserveTransaction.d.ts +6 -6
- package/lib/action/transfer/return.d.ts +3 -3
- package/lib/action/transfer/send/message/email.d.ts +3 -3
- package/lib/action/transfer/send/order.d.ts +3 -3
- package/lib/action/transfer/send.d.ts +6 -6
- package/lib/action/update/add.d.ts +4 -4
- package/lib/action/update/delete.d.ts +5 -5
- package/lib/action/update/replace.d.ts +4 -4
- package/lib/action/update/update.d.ts +4 -4
- package/lib/error/alreadyInUse.js +12 -31
- package/lib/error/argument.js +10 -30
- package/lib/error/argumentNull.js +10 -30
- package/lib/error/chevre.js +7 -26
- package/lib/error/forbidden.js +7 -28
- package/lib/error/gatewayTimeout.js +7 -28
- package/lib/error/internal.js +7 -28
- package/lib/error/notFound.js +10 -30
- package/lib/error/notImplemented.js +7 -28
- package/lib/error/rateLimitExceeded.js +7 -28
- package/lib/error/serviceUnavailable.js +7 -28
- package/lib/error/unauthorized.js +7 -28
- package/lib/error/unknown.js +7 -28
- package/lib/errors.js +13 -13
- package/lib/index.js +216 -216
- package/lib/invoice.d.ts +4 -4
- package/lib/offer.d.ts +2 -2
- package/lib/order.d.ts +19 -19
- package/lib/ownershipInfo.d.ts +7 -7
- package/lib/person.d.ts +3 -3
- package/lib/product.d.ts +3 -3
- package/lib/reservation.d.ts +1 -2
- package/lib/reservedCodeValues.js +24 -24
- package/lib/transaction.d.ts +4 -4
- package/package.json +2 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
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 =
|
|
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<
|
|
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 =
|
|
65
|
+
export type IAction = IBaseAction<IAttributes>;
|
|
66
66
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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 =
|
|
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<
|
|
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 =
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 =
|
|
15
|
+
actualMessage = `The specified '${entityName}' value is already in use for: ${fieldNames.join(', ')}.`;
|
|
32
16
|
}
|
|
33
17
|
/* istanbul ignore next */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
41
|
-
}(chevre_1.ChevreError));
|
|
22
|
+
}
|
|
42
23
|
exports.AlreadyInUseError = AlreadyInUseError;
|
package/lib/error/argument.js
CHANGED
|
@@ -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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 =
|
|
14
|
+
actualMessage = `Invalid or missing argument supplied: ${argumentName}.`;
|
|
32
15
|
}
|
|
33
16
|
/* istanbul ignore next */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
setPrototypeOf(_this, ArgumentError.prototype);
|
|
37
|
-
return _this;
|
|
17
|
+
super(errorCode_1.ErrorCode.Argument, actualMessage);
|
|
18
|
+
this.argumentName = argumentName;
|
|
38
19
|
}
|
|
39
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 =
|
|
14
|
+
actualMessage = `Missing argument: ${argumentName}.`;
|
|
32
15
|
}
|
|
33
16
|
/* istanbul ignore next */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
setPrototypeOf(_this, ArgumentNullError.prototype);
|
|
37
|
-
return _this;
|
|
17
|
+
super(errorCode_1.ErrorCode.ArgumentNull, actualMessage);
|
|
18
|
+
this.argumentName = argumentName;
|
|
38
19
|
}
|
|
39
|
-
|
|
40
|
-
}(chevre_1.ChevreError));
|
|
20
|
+
}
|
|
41
21
|
exports.ArgumentNullError = ArgumentNullError;
|
package/lib/error/chevre.js
CHANGED
|
@@ -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
|
-
|
|
24
|
-
|
|
7
|
+
class ChevreError extends Error {
|
|
8
|
+
reason;
|
|
25
9
|
/* istanbul ignore next */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
34
|
-
}(Error));
|
|
15
|
+
}
|
|
35
16
|
exports.ChevreError = ChevreError;
|
package/lib/error/forbidden.js
CHANGED
|
@@ -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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
35
|
-
setPrototypeOf(_this, ForbiddenError.prototype);
|
|
36
|
-
return _this;
|
|
16
|
+
super(errorCode_1.ErrorCode.Forbidden, actualMessage);
|
|
37
17
|
}
|
|
38
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
35
|
-
setPrototypeOf(_this, GatewayTimeoutError.prototype);
|
|
36
|
-
return _this;
|
|
16
|
+
super(errorCode_1.ErrorCode.GatewayTimeout, actualMessage);
|
|
37
17
|
}
|
|
38
|
-
|
|
39
|
-
}(chevre_1.ChevreError));
|
|
18
|
+
}
|
|
40
19
|
exports.GatewayTimeoutError = GatewayTimeoutError;
|
package/lib/error/internal.js
CHANGED
|
@@ -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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
35
|
-
setPrototypeOf(_this, InternalError.prototype);
|
|
36
|
-
return _this;
|
|
16
|
+
super(errorCode_1.ErrorCode.Internal, actualMessage);
|
|
37
17
|
}
|
|
38
|
-
|
|
39
|
-
}(chevre_1.ChevreError));
|
|
18
|
+
}
|
|
40
19
|
exports.InternalError = InternalError;
|
package/lib/error/notFound.js
CHANGED
|
@@ -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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 =
|
|
14
|
+
actualMessage = `Not Found: ${entityName}.`;
|
|
32
15
|
}
|
|
33
16
|
/* istanbul ignore next */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
setPrototypeOf(_this, NotFoundError.prototype);
|
|
37
|
-
return _this;
|
|
17
|
+
super(errorCode_1.ErrorCode.NotFound, actualMessage);
|
|
18
|
+
this.entityName = entityName;
|
|
38
19
|
}
|
|
39
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
35
|
-
setPrototypeOf(_this, NotImplementedError.prototype);
|
|
36
|
-
return _this;
|
|
16
|
+
super(errorCode_1.ErrorCode.NotImplemented, actualMessage);
|
|
37
17
|
}
|
|
38
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
35
|
-
setPrototypeOf(_this, RateLimitExceededError.prototype);
|
|
36
|
-
return _this;
|
|
16
|
+
super(errorCode_1.ErrorCode.RateLimitExceeded, actualMessage);
|
|
37
17
|
}
|
|
38
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
35
|
-
setPrototypeOf(_this, ServiceUnavailableError.prototype);
|
|
36
|
-
return _this;
|
|
16
|
+
super(errorCode_1.ErrorCode.ServiceUnavailable, actualMessage);
|
|
37
17
|
}
|
|
38
|
-
|
|
39
|
-
}(chevre_1.ChevreError));
|
|
18
|
+
}
|
|
40
19
|
exports.ServiceUnavailableError = ServiceUnavailableError;
|