@accordproject/concerto-util 4.0.0-alpha.2 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseexception.d.ts +7 -7
- package/dist/baseexception.js +40 -6
- package/dist/basefileexception.d.ts +16 -16
- package/dist/basefileexception.js +10 -11
- package/dist/concerto-util.js +1 -1
- package/dist/concerto-util.js.LICENSE.txt +1 -1
- package/dist/errorcodes.d.ts +7 -4
- package/dist/errorcodes.js +11 -6
- package/dist/filedownloader.d.ts +24 -17
- package/dist/filedownloader.js +19 -20
- package/dist/filewriter.d.ts +28 -25
- package/dist/filewriter.js +57 -31
- package/dist/identifiers.d.ts +5 -5
- package/dist/identifiers.js +10 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +0 -1
- package/dist/inmemorywriter.d.ts +11 -6
- package/dist/inmemorywriter.js +3 -4
- package/dist/label.d.ts +6 -6
- package/dist/label.js +7 -9
- package/dist/loaders/compositefileloader.d.ts +18 -13
- package/dist/loaders/compositefileloader.js +7 -8
- package/dist/loaders/defaultfileloader.d.ts +5 -5
- package/dist/loaders/defaultfileloader.js +4 -5
- package/dist/loaders/fileloader.d.ts +4 -0
- package/dist/loaders/fileloader.js +15 -0
- package/dist/loaders/githubfileloader.d.ts +22 -3
- package/dist/loaders/githubfileloader.js +7 -8
- package/dist/loaders/httpfileloader.d.ts +12 -11
- package/dist/loaders/httpfileloader.js +8 -7
- package/dist/logger.d.ts +35 -55
- package/dist/logger.js +24 -64
- package/dist/modelwriter.d.ts +12 -4
- package/dist/modelwriter.js +38 -10
- package/dist/null.d.ts +4 -4
- package/dist/null.js +2 -3
- package/dist/typedstack.d.ts +15 -14
- package/dist/typedstack.js +10 -12
- package/dist/warning.d.ts +5 -5
- package/dist/warning.js +7 -9
- package/dist/writer.d.ts +14 -10
- package/dist/writer.js +9 -10
- package/package.json +2 -2
- package/types/lib/logger.d.ts +2 -2
- package/types/lib/null.d.ts +15 -0
- package/dist/baseexception.js.map +0 -1
- package/dist/basefileexception.js.map +0 -1
- package/dist/errorcodes.js.map +0 -1
- package/dist/filedownloader.js.map +0 -1
- package/dist/filewriter.js.map +0 -1
- package/dist/identifiers.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inmemorywriter.js.map +0 -1
- package/dist/label.js.map +0 -1
- package/dist/loaders/compositefileloader.js.map +0 -1
- package/dist/loaders/defaultfileloader.js.map +0 -1
- package/dist/loaders/githubfileloader.js.map +0 -1
- package/dist/loaders/httpfileloader.js.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/modelwriter.js.map +0 -1
- package/dist/null.js.map +0 -1
- package/dist/typedstack.js.map +0 -1
- package/dist/warning.js.map +0 -1
- package/dist/writer.js.map +0 -1
package/dist/baseexception.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export = BaseException;
|
|
2
1
|
/**
|
|
3
2
|
* A base class for all Concerto exceptions
|
|
4
3
|
* @extends Error
|
|
@@ -6,13 +5,14 @@ export = BaseException;
|
|
|
6
5
|
* @memberof module:concerto-core
|
|
7
6
|
*/
|
|
8
7
|
declare class BaseException extends Error {
|
|
8
|
+
component: string;
|
|
9
|
+
errorType: string;
|
|
9
10
|
/**
|
|
10
11
|
* Create the BaseException.
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
12
|
+
* @param message - The exception message.
|
|
13
|
+
* @param component - The optional component which throws this error.
|
|
14
|
+
* @param errorType - The optional error code regarding the error
|
|
14
15
|
*/
|
|
15
|
-
constructor(message: string, component
|
|
16
|
-
component: string | undefined;
|
|
17
|
-
errorType: string;
|
|
16
|
+
constructor(message: string, component?: string, errorType?: string);
|
|
18
17
|
}
|
|
18
|
+
export = BaseException;
|
package/dist/baseexception.js
CHANGED
|
@@ -12,7 +12,42 @@
|
|
|
12
12
|
* limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
'use strict';
|
|
15
|
-
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
const ErrorCodes = __importStar(require("./errorcodes"));
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
50
|
+
const packageJson = require('../package.json');
|
|
16
51
|
/**
|
|
17
52
|
* A base class for all Concerto exceptions
|
|
18
53
|
* @extends Error
|
|
@@ -22,13 +57,13 @@ const ErrorCodes = require('./errorcodes');
|
|
|
22
57
|
class BaseException extends Error {
|
|
23
58
|
/**
|
|
24
59
|
* Create the BaseException.
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
60
|
+
* @param message - The exception message.
|
|
61
|
+
* @param component - The optional component which throws this error.
|
|
62
|
+
* @param errorType - The optional error code regarding the error
|
|
28
63
|
*/
|
|
29
64
|
constructor(message, component, errorType) {
|
|
30
65
|
super(message);
|
|
31
|
-
this.component = component ||
|
|
66
|
+
this.component = component || packageJson.name;
|
|
32
67
|
this.name = this.constructor.name;
|
|
33
68
|
this.message = message;
|
|
34
69
|
this.errorType = errorType || ErrorCodes.DEFAULT_BASE_EXCEPTION;
|
|
@@ -38,4 +73,3 @@ class BaseException extends Error {
|
|
|
38
73
|
}
|
|
39
74
|
}
|
|
40
75
|
module.exports = BaseException;
|
|
41
|
-
//# sourceMappingURL=baseexception.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import BaseException = require('./baseexception');
|
|
2
2
|
/**
|
|
3
3
|
* Exception throws when a Concerto file is semantically invalid
|
|
4
4
|
* @extends BaseException
|
|
@@ -7,32 +7,32 @@ export = BaseFileException;
|
|
|
7
7
|
* @memberof module:concerto-core
|
|
8
8
|
*/
|
|
9
9
|
declare class BaseFileException extends BaseException {
|
|
10
|
+
fileLocation: string | null;
|
|
11
|
+
shortMessage: string;
|
|
12
|
+
fileName: string | null;
|
|
10
13
|
/**
|
|
11
14
|
* Create an BaseFileException
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
15
|
+
* @param message - the message for the exception
|
|
16
|
+
* @param fileLocation - the optional file location associated with the exception
|
|
17
|
+
* @param fullMessage - the optional full message text
|
|
18
|
+
* @param fileName - the file name
|
|
19
|
+
* @param component - the component which throws this error
|
|
17
20
|
*/
|
|
18
|
-
constructor(message: string, fileLocation
|
|
19
|
-
fileLocation: string;
|
|
20
|
-
shortMessage: string;
|
|
21
|
-
fileName: string | undefined;
|
|
21
|
+
constructor(message: string, fileLocation?: string | null, fullMessage?: string | null, fileName?: string | null, component?: string);
|
|
22
22
|
/**
|
|
23
23
|
* Returns the file location associated with the exception or null
|
|
24
|
-
* @return
|
|
24
|
+
* @return the optional location associated with the exception
|
|
25
25
|
*/
|
|
26
|
-
getFileLocation(): string;
|
|
26
|
+
getFileLocation(): string | null;
|
|
27
27
|
/**
|
|
28
28
|
* Returns the error message without the location of the error
|
|
29
|
-
* @returns
|
|
29
|
+
* @returns the error message
|
|
30
30
|
*/
|
|
31
31
|
getShortMessage(): string;
|
|
32
32
|
/**
|
|
33
33
|
* Returns the fileName for the error
|
|
34
|
-
* @returns
|
|
34
|
+
* @returns the file name or null
|
|
35
35
|
*/
|
|
36
|
-
getFileName(): string;
|
|
36
|
+
getFileName(): string | null;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
export = BaseFileException;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
'use strict';
|
|
15
|
-
const BaseException = require(
|
|
15
|
+
const BaseException = require("./baseexception");
|
|
16
16
|
/**
|
|
17
17
|
* Exception throws when a Concerto file is semantically invalid
|
|
18
18
|
* @extends BaseException
|
|
@@ -23,13 +23,13 @@ const BaseException = require('./baseexception');
|
|
|
23
23
|
class BaseFileException extends BaseException {
|
|
24
24
|
/**
|
|
25
25
|
* Create an BaseFileException
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
26
|
+
* @param message - the message for the exception
|
|
27
|
+
* @param fileLocation - the optional file location associated with the exception
|
|
28
|
+
* @param fullMessage - the optional full message text
|
|
29
|
+
* @param fileName - the file name
|
|
30
|
+
* @param component - the component which throws this error
|
|
31
31
|
*/
|
|
32
|
-
constructor(message, fileLocation, fullMessage, fileName, component) {
|
|
32
|
+
constructor(message, fileLocation = null, fullMessage = null, fileName = null, component) {
|
|
33
33
|
super(fullMessage ? fullMessage : message, component);
|
|
34
34
|
this.fileLocation = fileLocation;
|
|
35
35
|
this.shortMessage = message;
|
|
@@ -37,25 +37,24 @@ class BaseFileException extends BaseException {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Returns the file location associated with the exception or null
|
|
40
|
-
* @return
|
|
40
|
+
* @return the optional location associated with the exception
|
|
41
41
|
*/
|
|
42
42
|
getFileLocation() {
|
|
43
43
|
return this.fileLocation;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Returns the error message without the location of the error
|
|
47
|
-
* @returns
|
|
47
|
+
* @returns the error message
|
|
48
48
|
*/
|
|
49
49
|
getShortMessage() {
|
|
50
50
|
return this.shortMessage;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Returns the fileName for the error
|
|
54
|
-
* @returns
|
|
54
|
+
* @returns the file name or null
|
|
55
55
|
*/
|
|
56
56
|
getFileName() {
|
|
57
57
|
return this.fileName;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
module.exports = BaseFileException;
|
|
61
|
-
//# sourceMappingURL=basefileexception.js.map
|