@accordproject/concerto-util 4.2.0 → 5.0.0-beta.2
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 +2 -1
- package/dist/baseexception.js +5 -2
- package/dist/basefileexception.d.ts +3 -2
- package/dist/basefileexception.js +10 -4
- package/dist/esm/baseexception.mjs +13 -0
- package/dist/esm/baseexception.mjs.map +7 -0
- package/dist/esm/basefileexception.mjs +14 -0
- package/dist/esm/basefileexception.mjs.map +7 -0
- package/dist/esm/chunk-3RJ6JXLX.mjs +29 -0
- package/dist/esm/chunk-3RJ6JXLX.mjs.map +7 -0
- package/dist/esm/chunk-3U4T7O4P.mjs +41 -0
- package/dist/esm/chunk-3U4T7O4P.mjs.map +7 -0
- package/dist/esm/chunk-D4MNWWBB.mjs +43 -0
- package/dist/esm/chunk-D4MNWWBB.mjs.map +7 -0
- package/dist/esm/chunk-DTVQ7VXD.mjs +30 -0
- package/dist/esm/chunk-DTVQ7VXD.mjs.map +7 -0
- package/dist/esm/chunk-FHUVVHGR.mjs +48 -0
- package/dist/esm/chunk-FHUVVHGR.mjs.map +7 -0
- package/dist/esm/chunk-FK2LDKS6.mjs +36 -0
- package/dist/esm/chunk-FK2LDKS6.mjs.map +7 -0
- package/dist/esm/chunk-G6IDW2UD.mjs +183 -0
- package/dist/esm/chunk-G6IDW2UD.mjs.map +7 -0
- package/dist/esm/chunk-GOLEPEBI.mjs +56 -0
- package/dist/esm/chunk-GOLEPEBI.mjs.map +7 -0
- package/dist/esm/chunk-I33X6SGY.mjs +70 -0
- package/dist/esm/chunk-I33X6SGY.mjs.map +7 -0
- package/dist/esm/chunk-K4OOJFK5.mjs +93 -0
- package/dist/esm/chunk-K4OOJFK5.mjs.map +7 -0
- package/dist/esm/chunk-LPNGJFU2.mjs +22 -0
- package/dist/esm/chunk-LPNGJFU2.mjs.map +7 -0
- package/dist/esm/chunk-PBL5N3A2.mjs +33 -0
- package/dist/esm/chunk-PBL5N3A2.mjs.map +7 -0
- package/dist/esm/chunk-PMP2SMHG.mjs +17 -0
- package/dist/esm/chunk-PMP2SMHG.mjs.map +7 -0
- package/dist/esm/chunk-Q6G4HQJ7.mjs +151 -0
- package/dist/esm/chunk-Q6G4HQJ7.mjs.map +7 -0
- package/dist/esm/chunk-RBUQLLXW.mjs +51 -0
- package/dist/esm/chunk-RBUQLLXW.mjs.map +7 -0
- package/dist/esm/chunk-T6ZBQYEB.mjs +97 -0
- package/dist/esm/chunk-T6ZBQYEB.mjs.map +7 -0
- package/dist/esm/chunk-TP3CT6S4.mjs +35 -0
- package/dist/esm/chunk-TP3CT6S4.mjs.map +7 -0
- package/dist/esm/chunk-WPVG6LP3.mjs +63 -0
- package/dist/esm/chunk-WPVG6LP3.mjs.map +7 -0
- package/dist/esm/chunk-YQVUNOO6.mjs +93 -0
- package/dist/esm/chunk-YQVUNOO6.mjs.map +7 -0
- package/dist/esm/errorcodes.mjs +22 -0
- package/dist/esm/errorcodes.mjs.map +7 -0
- package/dist/esm/filedownloader.mjs +12 -0
- package/dist/esm/filedownloader.mjs.map +7 -0
- package/dist/esm/filewriter.mjs +13 -0
- package/dist/esm/filewriter.mjs.map +7 -0
- package/dist/esm/identifiers.mjs +12 -0
- package/dist/esm/identifiers.mjs.map +7 -0
- package/dist/esm/index.mjs +78 -0
- package/dist/esm/index.mjs.map +7 -0
- package/dist/esm/inmemorywriter.mjs +13 -0
- package/dist/esm/inmemorywriter.mjs.map +7 -0
- package/dist/esm/label.mjs +12 -0
- package/dist/esm/label.mjs.map +7 -0
- package/dist/esm/loaders/compositefileloader.mjs +12 -0
- package/dist/esm/loaders/compositefileloader.mjs.map +7 -0
- package/dist/esm/loaders/defaultfileloader.mjs +15 -0
- package/dist/esm/loaders/defaultfileloader.mjs.map +7 -0
- package/dist/esm/loaders/fileloader.mjs +3 -0
- package/dist/esm/loaders/fileloader.mjs.map +7 -0
- package/dist/esm/loaders/githubfileloader.mjs +13 -0
- package/dist/esm/loaders/githubfileloader.mjs.map +7 -0
- package/dist/esm/loaders/httpfileloader.mjs +12 -0
- package/dist/esm/loaders/httpfileloader.mjs.map +7 -0
- package/dist/esm/logger.mjs +12 -0
- package/dist/esm/logger.mjs.map +7 -0
- package/dist/esm/modelwriter.mjs +10 -0
- package/dist/esm/modelwriter.mjs.map +7 -0
- package/dist/esm/null.mjs +12 -0
- package/dist/esm/null.mjs.map +7 -0
- package/dist/esm/typedstack.mjs +12 -0
- package/dist/esm/typedstack.mjs.map +7 -0
- package/dist/esm/warning.mjs +10 -0
- package/dist/esm/warning.mjs.map +7 -0
- package/dist/esm/writer.mjs +12 -0
- package/dist/esm/writer.mjs.map +7 -0
- package/dist/esm-browser/baseexception.mjs +11 -0
- package/dist/esm-browser/baseexception.mjs.map +7 -0
- package/dist/esm-browser/basefileexception.mjs +12 -0
- package/dist/esm-browser/basefileexception.mjs.map +7 -0
- package/dist/esm-browser/chunk-3XGAUT4O.mjs +100 -0
- package/dist/esm-browser/chunk-3XGAUT4O.mjs.map +7 -0
- package/dist/esm-browser/chunk-4X5DBZDM.mjs +24 -0
- package/dist/esm-browser/chunk-4X5DBZDM.mjs.map +7 -0
- package/dist/esm-browser/chunk-6SOOHVQB.mjs +65 -0
- package/dist/esm-browser/chunk-6SOOHVQB.mjs.map +7 -0
- package/dist/esm-browser/chunk-7DYPHXUR.mjs +50 -0
- package/dist/esm-browser/chunk-7DYPHXUR.mjs.map +7 -0
- package/dist/esm-browser/chunk-7LYWQ57N.mjs +461 -0
- package/dist/esm-browser/chunk-7LYWQ57N.mjs.map +7 -0
- package/dist/esm-browser/chunk-BDMF4RRF.mjs +72 -0
- package/dist/esm-browser/chunk-BDMF4RRF.mjs.map +7 -0
- package/dist/esm-browser/chunk-BSBOEFWN.mjs +57 -0
- package/dist/esm-browser/chunk-BSBOEFWN.mjs.map +7 -0
- package/dist/esm-browser/chunk-DOL2YKDZ.mjs +26 -0
- package/dist/esm-browser/chunk-DOL2YKDZ.mjs.map +7 -0
- package/dist/esm-browser/chunk-EGOFDABS.mjs +62 -0
- package/dist/esm-browser/chunk-EGOFDABS.mjs.map +7 -0
- package/dist/esm-browser/chunk-LZTTRWN3.mjs +153 -0
- package/dist/esm-browser/chunk-LZTTRWN3.mjs.map +7 -0
- package/dist/esm-browser/chunk-MCUSZIV7.mjs +41 -0
- package/dist/esm-browser/chunk-MCUSZIV7.mjs.map +7 -0
- package/dist/esm-browser/chunk-N42BHUZ6.mjs +35 -0
- package/dist/esm-browser/chunk-N42BHUZ6.mjs.map +7 -0
- package/dist/esm-browser/chunk-NAP47VIV.mjs +36 -0
- package/dist/esm-browser/chunk-NAP47VIV.mjs.map +7 -0
- package/dist/esm-browser/chunk-NQ5PDAAD.mjs +95 -0
- package/dist/esm-browser/chunk-NQ5PDAAD.mjs.map +7 -0
- package/dist/esm-browser/chunk-NSJTBLWA.mjs +71 -0
- package/dist/esm-browser/chunk-NSJTBLWA.mjs.map +7 -0
- package/dist/esm-browser/chunk-R6CSKES3.mjs +183 -0
- package/dist/esm-browser/chunk-R6CSKES3.mjs.map +7 -0
- package/dist/esm-browser/chunk-S52XDDAF.mjs +30 -0
- package/dist/esm-browser/chunk-S52XDDAF.mjs.map +7 -0
- package/dist/esm-browser/chunk-SU6SG5PJ.mjs +45 -0
- package/dist/esm-browser/chunk-SU6SG5PJ.mjs.map +7 -0
- package/dist/esm-browser/chunk-WCGRUR5U.mjs +30 -0
- package/dist/esm-browser/chunk-WCGRUR5U.mjs.map +7 -0
- package/dist/esm-browser/chunk-YJQCJTA7.mjs +53 -0
- package/dist/esm-browser/chunk-YJQCJTA7.mjs.map +7 -0
- package/dist/esm-browser/chunk-YURYZDD2.mjs +453 -0
- package/dist/esm-browser/chunk-YURYZDD2.mjs.map +7 -0
- package/dist/esm-browser/errorcodes.mjs +20 -0
- package/dist/esm-browser/errorcodes.mjs.map +7 -0
- package/dist/esm-browser/filedownloader.mjs +11 -0
- package/dist/esm-browser/filedownloader.mjs.map +7 -0
- package/dist/esm-browser/filewriter.mjs +12 -0
- package/dist/esm-browser/filewriter.mjs.map +7 -0
- package/dist/esm-browser/identifiers.mjs +10 -0
- package/dist/esm-browser/identifiers.mjs.map +7 -0
- package/dist/esm-browser/index.mjs +83 -0
- package/dist/esm-browser/index.mjs.map +7 -0
- package/dist/esm-browser/inmemorywriter.mjs +11 -0
- package/dist/esm-browser/inmemorywriter.mjs.map +7 -0
- package/dist/esm-browser/label.mjs +10 -0
- package/dist/esm-browser/label.mjs.map +7 -0
- package/dist/esm-browser/loaders/compositefileloader.mjs +10 -0
- package/dist/esm-browser/loaders/compositefileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/defaultfileloader.mjs +14 -0
- package/dist/esm-browser/loaders/defaultfileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/fileloader.mjs +7 -0
- package/dist/esm-browser/loaders/fileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/githubfileloader.mjs +12 -0
- package/dist/esm-browser/loaders/githubfileloader.mjs.map +7 -0
- package/dist/esm-browser/loaders/httpfileloader.mjs +11 -0
- package/dist/esm-browser/loaders/httpfileloader.mjs.map +7 -0
- package/dist/esm-browser/logger.mjs +10 -0
- package/dist/esm-browser/logger.mjs.map +7 -0
- package/dist/esm-browser/modelwriter.mjs +9 -0
- package/dist/esm-browser/modelwriter.mjs.map +7 -0
- package/dist/esm-browser/null.mjs +10 -0
- package/dist/esm-browser/null.mjs.map +7 -0
- package/dist/esm-browser/typedstack.mjs +10 -0
- package/dist/esm-browser/typedstack.mjs.map +7 -0
- package/dist/esm-browser/warning.mjs +8 -0
- package/dist/esm-browser/warning.mjs.map +7 -0
- package/dist/esm-browser/writer.mjs +10 -0
- package/dist/esm-browser/writer.mjs.map +7 -0
- package/dist/filedownloader.d.ts +14 -6
- package/dist/filedownloader.js +32 -12
- package/dist/filewriter.d.ts +3 -2
- package/dist/filewriter.js +10 -4
- package/dist/identifiers.js +4 -2
- package/dist/index.d.ts +18 -17
- package/dist/index.js +34 -31
- package/dist/inmemorywriter.d.ts +3 -2
- package/dist/inmemorywriter.js +10 -4
- package/dist/loaders/compositefileloader.d.ts +2 -1
- package/dist/loaders/compositefileloader.js +5 -2
- package/dist/loaders/defaultfileloader.d.ts +3 -2
- package/dist/loaders/defaultfileloader.js +14 -8
- package/dist/loaders/githubfileloader.d.ts +3 -2
- package/dist/loaders/githubfileloader.js +10 -4
- package/dist/loaders/httpfileloader.d.ts +2 -1
- package/dist/loaders/httpfileloader.js +10 -3
- package/dist/logger.d.ts +2 -1
- package/dist/logger.js +5 -2
- package/dist/modelwriter.js +6 -4
- package/dist/null.d.ts +3 -2
- package/dist/null.js +5 -2
- package/dist/typedstack.d.ts +2 -1
- package/dist/typedstack.js +5 -2
- package/dist/writer.d.ts +2 -1
- package/dist/writer.js +5 -2
- package/package.json +16 -8
- package/dist/concerto-util.js +0 -2
- package/dist/concerto-util.js.LICENSE.txt +0 -19
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
init_browser_process_shim
|
|
4
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
5
|
+
|
|
6
|
+
// node-builtin-stub:fs
|
|
7
|
+
var require_fs = __commonJS({
|
|
8
|
+
"node-builtin-stub:fs"(exports, module) {
|
|
9
|
+
init_browser_process_shim();
|
|
10
|
+
module.exports = {};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// node-builtin-stub:path
|
|
15
|
+
var require_path = __commonJS({
|
|
16
|
+
"node-builtin-stub:path"(exports, module) {
|
|
17
|
+
init_browser_process_shim();
|
|
18
|
+
module.exports = {};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
require_fs,
|
|
24
|
+
require_path
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-DOL2YKDZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["node-builtin-stub:fs", "node-builtin-stub:path"],
|
|
4
|
+
"sourcesContent": ["module.exports = {};", "module.exports = {};"],
|
|
5
|
+
"mappings": ";;;;;;AAAA;AAAA;AAAA;AAAA,WAAO,UAAU,CAAC;AAAA;AAAA;;;ACAlB;AAAA;AAAA;AAAA,WAAO,UAAU,CAAC;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_browser
|
|
3
|
+
} from "./chunk-7LYWQ57N.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__toESM,
|
|
6
|
+
init_browser_process_shim
|
|
7
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
8
|
+
|
|
9
|
+
// src/loaders/httpfileloader.ts
|
|
10
|
+
init_browser_process_shim();
|
|
11
|
+
var import_debug = __toESM(require_browser());
|
|
12
|
+
var debug = (0, import_debug.default)("concerto:HTTPFileLoader");
|
|
13
|
+
var HTTPFileLoader = class {
|
|
14
|
+
/**
|
|
15
|
+
* Create the HTTPFileLoader.
|
|
16
|
+
* @param processFile - a function to apply to the content of the file
|
|
17
|
+
*/
|
|
18
|
+
constructor(processFile) {
|
|
19
|
+
this.processFile = processFile;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns true if this ModelLoader can process the URL
|
|
23
|
+
* @param url - the URL
|
|
24
|
+
* @return true if this ModelLoader accepts the URL
|
|
25
|
+
* @abstract
|
|
26
|
+
*/
|
|
27
|
+
accepts(url) {
|
|
28
|
+
return url.startsWith("http://") || url.startsWith("https://");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Load a text File from a URL and return it
|
|
32
|
+
* @param requestUrl - the url to get
|
|
33
|
+
* @param options - additional options
|
|
34
|
+
* @return a promise to the File
|
|
35
|
+
*/
|
|
36
|
+
async load(requestUrl, options) {
|
|
37
|
+
if (!options) {
|
|
38
|
+
options = {
|
|
39
|
+
method: "GET",
|
|
40
|
+
headers: {
|
|
41
|
+
"Content-Type": "text/plain"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
debug("loading", requestUrl);
|
|
46
|
+
const response = await fetch(requestUrl, options);
|
|
47
|
+
if (!response.ok) {
|
|
48
|
+
throw new Error(`HTTP request failed with status: ${response.status}`);
|
|
49
|
+
}
|
|
50
|
+
const text = await response.text();
|
|
51
|
+
const url = new URL(requestUrl);
|
|
52
|
+
const name = "@" + (url.host + url.pathname).replace(/\//g, ".");
|
|
53
|
+
return this.processFile(name, text);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var httpfileloader_default = HTTPFileLoader;
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
HTTPFileLoader,
|
|
60
|
+
httpfileloader_default
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=chunk-EGOFDABS.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/loaders/httpfileloader.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FileLoader } from './fileloader';\nimport createDebug from 'debug';\n\nconst debug = createDebug('concerto:HTTPFileLoader');\n\n// Ensure fetch is recognized if not in global types\ndeclare const fetch: (input: string | URL, init?: RequestInit) => Promise<{ ok: boolean; status: number; text(): Promise<string> }>;\n\n/**\n * Loads Files from an HTTP(S) URL using fetch.\n * @class\n * @private\n * @memberof module:concerto-util\n */\nclass HTTPFileLoader<T> implements FileLoader<T> {\n public processFile: (name: string, text: string) => T;\n\n /**\n * Create the HTTPFileLoader.\n * @param processFile - a function to apply to the content of the file\n */\n constructor(processFile: (name: string, text: string) => T) {\n this.processFile = processFile;\n }\n\n /**\n * Returns true if this ModelLoader can process the URL\n * @param url - the URL\n * @return true if this ModelLoader accepts the URL\n * @abstract\n */\n accepts(url: string): boolean {\n return url.startsWith('http://') || url.startsWith('https://');\n }\n\n /**\n * Load a text File from a URL and return it\n * @param requestUrl - the url to get\n * @param options - additional options\n * @return a promise to the File\n */\n async load(requestUrl: string, options?: RequestInit): Promise<T> {\n if (!options) {\n options = {\n method: 'GET',\n headers: {\n 'Content-Type': 'text/plain',\n }\n };\n }\n\n debug('loading', requestUrl);\n const response = await fetch(requestUrl, options);\n if (!response.ok) {\n throw new Error(`HTTP request failed with status: ${response.status}`);\n }\n const text = await response.text();\n const url = new URL(requestUrl);\n // external Files have a name that starts with '@'\n // (so that they are identified as external when an archive is read back in)\n const name = '@' + (url.host + url.pathname).replace(/\\//g, '.');\n return this.processFile(name, text);\n }\n}\n\nexport { HTTPFileLoader };\nexport default HTTPFileLoader;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAAA;AAeA,mBAAwB;AAExB,IAAM,YAAQ,aAAAA,SAAY,yBAAyB;AAWnD,IAAM,iBAAN,MAAiD;AAAA;AAAA;AAAA;AAAA;AAAA,EAO7C,YAAY,aAAgD;AACxD,SAAK,cAAc;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,QAAQ,KAAsB;AAC1B,WAAO,IAAI,WAAW,SAAS,KAAK,IAAI,WAAW,UAAU;AAAA,EACjE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,KAAK,YAAoB,SAAmC;AAC9D,QAAI,CAAC,SAAS;AACV,gBAAU;AAAA,QACN,QAAQ;AAAA,QACR,SAAS;AAAA,UACL,gBAAgB;AAAA,QACpB;AAAA,MACJ;AAAA,IACJ;AAEA,UAAM,WAAW,UAAU;AAC3B,UAAM,WAAW,MAAM,MAAM,YAAY,OAAO;AAChD,QAAI,CAAC,SAAS,IAAI;AACd,YAAM,IAAI,MAAM,oCAAoC,SAAS,MAAM,EAAE;AAAA,IACzE;AACA,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,UAAM,MAAM,IAAI,IAAI,UAAU;AAG9B,UAAM,OAAO,OAAO,IAAI,OAAO,IAAI,UAAU,QAAQ,OAAO,GAAG;AAC/D,WAAO,KAAK,YAAY,MAAM,IAAI;AAAA,EACtC;AACJ;AAGA,IAAO,yBAAQ;",
|
|
6
|
+
"names": ["createDebug"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_browser_process_shim
|
|
3
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
4
|
+
|
|
5
|
+
// src/logger.ts
|
|
6
|
+
init_browser_process_shim();
|
|
7
|
+
var levels = {
|
|
8
|
+
error: 0,
|
|
9
|
+
warn: 1,
|
|
10
|
+
info: 2,
|
|
11
|
+
http: 3,
|
|
12
|
+
verbose: 4,
|
|
13
|
+
debug: 5,
|
|
14
|
+
silly: 6
|
|
15
|
+
};
|
|
16
|
+
var timestamp = () => (/* @__PURE__ */ new Date()).toLocaleTimeString();
|
|
17
|
+
var prettifyJson = (obj) => {
|
|
18
|
+
return obj;
|
|
19
|
+
};
|
|
20
|
+
var defaultTransportShim = (level, ...args) => {
|
|
21
|
+
let mutatedLevel = level;
|
|
22
|
+
const data = args;
|
|
23
|
+
let first = data.shift();
|
|
24
|
+
if (first && typeof first === "object" && first.level && first.message) {
|
|
25
|
+
const padding = first.padding && first.padding[first.level];
|
|
26
|
+
if (first.level === "error" && first.stack) {
|
|
27
|
+
mutatedLevel = "error";
|
|
28
|
+
first = `${first.message}
|
|
29
|
+
${first.stack}`;
|
|
30
|
+
} else if (Object.keys(levels).includes(first.level)) {
|
|
31
|
+
mutatedLevel = first.level;
|
|
32
|
+
first = first.message;
|
|
33
|
+
}
|
|
34
|
+
first = padding ? `${padding} ${first}` : first;
|
|
35
|
+
}
|
|
36
|
+
data.unshift(first);
|
|
37
|
+
const stream = ["error", "warn"].includes(mutatedLevel) ? console.error : console.log;
|
|
38
|
+
stream(
|
|
39
|
+
`${timestamp()} - ${mutatedLevel}:`,
|
|
40
|
+
...data.map((obj) => obj instanceof Error ? `${obj.message}
|
|
41
|
+
${obj.stack}` : obj).map(prettifyJson)
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
var defaultTransport = {};
|
|
45
|
+
Object.keys(levels).forEach((level) => {
|
|
46
|
+
const typedLevel = level;
|
|
47
|
+
defaultTransport[typedLevel] = (...args) => defaultTransportShim(typedLevel, ...args);
|
|
48
|
+
});
|
|
49
|
+
var Logger = class {
|
|
50
|
+
/**
|
|
51
|
+
* A reusable function for logging at multiple levels
|
|
52
|
+
* @param level - the required log level. e.g. error, warn, info, debug, etc.
|
|
53
|
+
* @param args - the input obj to prettify
|
|
54
|
+
*/
|
|
55
|
+
static dispatch(level, ...args) {
|
|
56
|
+
if (levels[level] > levels[this.level]) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.transports.forEach((t) => {
|
|
60
|
+
if (t[level]) {
|
|
61
|
+
t[level](...args);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Add a custom transport for logging
|
|
67
|
+
* @param transport - The transport object should have function for the usual logging operations e.g. error, warn, info, debug, etc.
|
|
68
|
+
*/
|
|
69
|
+
static add(transport) {
|
|
70
|
+
this.transports.push(transport);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Write an error statement to the console.
|
|
74
|
+
*
|
|
75
|
+
* Prints to `stderr` with newline.
|
|
76
|
+
* @param args - args
|
|
77
|
+
*/
|
|
78
|
+
static error(...args) {
|
|
79
|
+
this.dispatch("error", ...args);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Write a warning statement to the console.
|
|
83
|
+
*
|
|
84
|
+
* Prints to `stderr` with newline.
|
|
85
|
+
* @param args - args
|
|
86
|
+
*/
|
|
87
|
+
static warn(...args) {
|
|
88
|
+
this.dispatch("warn", ...args);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Write an info statement to the console.
|
|
92
|
+
*
|
|
93
|
+
* Prints to `stdout` with newline.
|
|
94
|
+
* @param args - args
|
|
95
|
+
*/
|
|
96
|
+
static info(...args) {
|
|
97
|
+
this.dispatch("info", ...args);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Write an info statement to the console. Alias for `logger.log`
|
|
101
|
+
*
|
|
102
|
+
* Prints to `stdout` with newline.
|
|
103
|
+
* @param args - args
|
|
104
|
+
*/
|
|
105
|
+
static log(...args) {
|
|
106
|
+
this.info(...args);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Write an http statement to the console.
|
|
110
|
+
*
|
|
111
|
+
* Prints to `stdout` with newline.
|
|
112
|
+
* @param args - args
|
|
113
|
+
*/
|
|
114
|
+
static http(...args) {
|
|
115
|
+
this.dispatch("http", ...args);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Write a verbose log statement to the console.
|
|
119
|
+
*
|
|
120
|
+
* Prints to `stdout` with newline.
|
|
121
|
+
* @param args - args
|
|
122
|
+
*/
|
|
123
|
+
static verbose(...args) {
|
|
124
|
+
this.dispatch("verbose", ...args);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Write a debug statement to the console.
|
|
128
|
+
*
|
|
129
|
+
* Prints to `stdout` with newline.
|
|
130
|
+
* @param args - args
|
|
131
|
+
*/
|
|
132
|
+
static debug(...args) {
|
|
133
|
+
this.dispatch("debug", ...args);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Write a silly level statement to the console.
|
|
137
|
+
*
|
|
138
|
+
* Prints to `stdout` with newline.
|
|
139
|
+
* @param args - args
|
|
140
|
+
*/
|
|
141
|
+
static silly(...args) {
|
|
142
|
+
this.dispatch("silly", ...args);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
Logger.level = "info";
|
|
146
|
+
Logger.transports = [defaultTransport];
|
|
147
|
+
var logger_default = Logger;
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
Logger,
|
|
151
|
+
logger_default
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=chunk-LZTTRWN3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/logger.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable no-console */\n/* eslint-disable no-use-before-define */\n\n/**\n * Default levels for the npm configuration.\n */\nconst levels: Record<string, number> = {\n error: 0,\n warn: 1,\n info: 2,\n http: 3,\n verbose: 4,\n debug: 5,\n silly: 6\n};\n\nconst timestamp = () => (new Date()).toLocaleTimeString();\n\n/**\n* Helper function to format JSON objects\n* @param obj - the input obj to prettify\n* @returns - the prettified object\n*/\nconst prettifyJson = (obj: unknown): unknown => {\n return obj;\n};\n\n/**\n* The default transport for logging at multiple levels to the console\n* @param level - the required log level. e.g. error, warn, info, debug, etc.\n* @param args - the input obj to prettify\n*/\ntype LogLevel = keyof typeof levels;\ntype Transport = Partial<Record<LogLevel, (...args: unknown[]) => void>>;\n\nconst defaultTransportShim = (level: LogLevel, ...args: any[]): void => {\n let mutatedLevel = level;\n const data = args;\n let first = data.shift();\n\n // Flatten log object\n if(first && typeof first === 'object' && first.level && first.message){\n const padding = first.padding && first.padding[first.level];\n if (first.level === 'error' && first.stack) {\n mutatedLevel = 'error';\n first = `${first.message}\\n${first.stack}`;\n } else if (Object.keys(levels).includes(first.level)) {\n mutatedLevel = first.level;\n first = first.message;\n }\n first = padding ? `${padding} ${first}` : first;\n }\n\n data.unshift(first);\n\n const stream = ['error', 'warn'].includes(mutatedLevel) ? console.error : console.log;\n\n stream(\n `${timestamp()} - ${mutatedLevel}:`,\n ...data\n .map(obj => obj instanceof Error ? `${obj.message}\\n${obj.stack}`: obj)\n .map(prettifyJson)\n );\n};\n\nconst defaultTransport: Record<LogLevel, (...args: unknown[]) => void> = {} as Record<LogLevel, (...args: unknown[]) => void>;\nObject.keys(levels).forEach(level => {\n const typedLevel = level as LogLevel;\n defaultTransport[typedLevel] = (...args: unknown[]) => defaultTransportShim(typedLevel, ...args);\n});\n\n/**\n * A utility class with static function that print to the console\n */\nclass Logger {\n static level = 'info';\n static transports: Transport[] = [ defaultTransport ];\n\n /**\n * A reusable function for logging at multiple levels\n * @param level - the required log level. e.g. error, warn, info, debug, etc.\n * @param args - the input obj to prettify\n */\n static dispatch(level: LogLevel, ...args: unknown[]): void {\n if (levels[level] > levels[this.level]){\n return;\n }\n\n this.transports.forEach(t => {\n if(t[level]){\n t[level](...args);\n }\n });\n }\n\n /**\n * Add a custom transport for logging\n * @param transport - The transport object should have function for the usual logging operations e.g. error, warn, info, debug, etc.\n */\n static add(transport: Transport): void {\n this.transports.push(transport);\n }\n\n /**\n * Write an error statement to the console.\n *\n * Prints to `stderr` with newline.\n * @param args - args\n */\n static error(...args: unknown[]): void{ this.dispatch('error', ...args); }\n\n /**\n * Write a warning statement to the console.\n *\n * Prints to `stderr` with newline.\n * @param args - args\n */\n static warn(...args: unknown[]): void{ this.dispatch('warn', ...args); }\n\n /**\n * Write an info statement to the console.\n *\n * Prints to `stdout` with newline.\n * @param args - args\n */\n static info(...args: unknown[]): void{ this.dispatch('info', ...args); }\n\n /**\n * Write an info statement to the console. Alias for `logger.log`\n *\n * Prints to `stdout` with newline.\n * @param args - args\n */\n static log(...args: unknown[]): void{ this.info(...args); }\n\n /**\n * Write an http statement to the console.\n *\n * Prints to `stdout` with newline.\n * @param args - args\n */\n static http(...args: unknown[]): void{ this.dispatch('http', ...args); }\n\n /**\n * Write a verbose log statement to the console.\n *\n * Prints to `stdout` with newline.\n * @param args - args\n */\n static verbose(...args: unknown[]): void{ this.dispatch('verbose', ...args); }\n\n /**\n * Write a debug statement to the console.\n *\n * Prints to `stdout` with newline.\n * @param args - args\n */\n static debug(...args: unknown[]): void{ this.dispatch('debug', ...args); }\n\n /**\n * Write a silly level statement to the console.\n *\n * Prints to `stdout` with newline.\n * @param args - args\n */\n static silly(...args: unknown[]): void{ this.dispatch('silly', ...args); }\n}\n\nexport { Logger };\nexport default Logger;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export,
|
|
3
|
+
init_browser_process_shim
|
|
4
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
5
|
+
|
|
6
|
+
// src/identifiers.ts
|
|
7
|
+
var identifiers_exports = {};
|
|
8
|
+
__export(identifiers_exports, {
|
|
9
|
+
ID_REGEX: () => ID_REGEX,
|
|
10
|
+
normalizeIdentifier: () => normalizeIdentifier
|
|
11
|
+
});
|
|
12
|
+
init_browser_process_shim();
|
|
13
|
+
var ID_REGEX = /^(\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\$|_|\\u[0-9A-Fa-f]{4})(?:\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\$|_|\\u[0-9A-Fa-f]{4}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\u200C|\u200D)*$/u;
|
|
14
|
+
function normalizeIdentifier(identifier, truncateLength = -1) {
|
|
15
|
+
const replacer = (_match, group1) => {
|
|
16
|
+
let escapedChar = "";
|
|
17
|
+
for (const codePoint of group1) {
|
|
18
|
+
escapedChar += `_${codePoint.codePointAt(0).toString(16)}`;
|
|
19
|
+
}
|
|
20
|
+
return escapedChar;
|
|
21
|
+
};
|
|
22
|
+
let result = identifier ?? String(identifier);
|
|
23
|
+
if (typeof result !== "string") {
|
|
24
|
+
throw new Error(`Unsupported identifier type, '${typeof result}'.`);
|
|
25
|
+
}
|
|
26
|
+
result = result.replace(/^(?:\p{Nd}|\p{Mn}|\p{Mc}|(?!_)\p{Pc})/u, "_$&").replace(/[-‐−@#:;><|/\\\u200c\u200d]/g, "_").replace(/\s/g, "_").replace(/(?!\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\$|_|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\u200C|\u200D|\\u[0-9A-Fa-f]{4})(.)/gu, replacer).replace(/([\uD800-\uDFFF])/g, replacer);
|
|
27
|
+
if (truncateLength > 0) {
|
|
28
|
+
result = result.substring(0, truncateLength);
|
|
29
|
+
}
|
|
30
|
+
if (!ID_REGEX.test(result)) {
|
|
31
|
+
throw new Error(`Unexpected error. Not able to escape identifier '${result}'.`);
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
ID_REGEX,
|
|
38
|
+
normalizeIdentifier,
|
|
39
|
+
identifiers_exports
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=chunk-MCUSZIV7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/identifiers.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use strict';\n\n// Conforms to Concerto Spec for identifiers\nexport const ID_REGEX = /^(\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4})(?:\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4}|\\p{Mn}|\\p{Mc}|\\p{Nd}|\\p{Pc}|\\u200C|\\u200D)*$/u;\n\n/**\n * Function that attempts to normalize arbitrary strings\n * into valid Concerto identifiers\n *\n * @param identifier - the input value\n * @param truncateLength - Length at which to truncate the identifier\n * @returns - An identifier that meets the Concerto specification\n */\nexport function normalizeIdentifier(identifier: string | null | undefined, truncateLength: number = -1): string {\n const replacer = (_match: string, group1: string) => {\n let escapedChar = '';\n // Loop through characters with multiple code points\n for (const codePoint of group1) {\n // @ts-ignore\n escapedChar += `_${codePoint.codePointAt(0).toString(16)}`;\n }\n return escapedChar;\n };\n\n // Stringify null & undefined values\n let result = identifier ?? String(identifier);\n\n if (typeof result !== 'string'){\n throw new Error(`Unsupported identifier type, '${typeof result}'.`);\n }\n\n // 1. If the identifier begins with a character that is only valid as a\n // continuation, a digit, a combining mark or a connector other than _,\n // add a leading underscore\n result = result\n .replace(/^(?:\\p{Nd}|\\p{Mn}|\\p{Mc}|(?!_)\\p{Pc})/u, '_$&')\n\n // 2. Substitute Whitespace, and joiners\n .replace(/[-\u2010\u2212@#:;><|/\\\\\\u200c\\u200d]/g, '_')\n .replace(/\\s/g, '_')\n\n // 3a. Replace Invalid Characters\n .replace(/(?!\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\p{Mn}|\\p{Mc}|\\p{Nd}|\\p{Pc}|\\u200C|\\u200D|\\\\u[0-9A-Fa-f]{4})(.)/gu, replacer)\n\n // 3b. Escape Surrogate Pairs\n .replace(/([\\uD800-\\uDFFF])/g, replacer);\n\n // 4. Optionally truncate the identifier\n if (truncateLength > 0){\n result = result.substring(0,truncateLength);\n }\n\n // Check validity\n if (!ID_REGEX.test(result)){\n throw new Error(`Unexpected error. Not able to escape identifier '${result}'.`);\n }\n return result;\n}"],
|
|
5
|
+
"mappings": ";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,IAAM,WAAW;AAUjB,SAAS,oBAAoB,YAAuC,iBAAyB,IAAY;AAC5G,QAAM,WAAW,CAAC,QAAgB,WAAmB;AACjD,QAAI,cAAc;AAElB,eAAW,aAAa,QAAQ;AAE5B,qBAAe,IAAI,UAAU,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC;AAAA,IAC5D;AACA,WAAO;AAAA,EACX;AAGA,MAAI,SAAS,cAAc,OAAO,UAAU;AAE5C,MAAI,OAAO,WAAW,UAAS;AAC3B,UAAM,IAAI,MAAM,iCAAiC,OAAO,MAAM,IAAI;AAAA,EACtE;AAKA,WAAS,OACJ,QAAQ,0CAA0C,KAAK,EAGvD,QAAQ,gCAAgC,GAAG,EAC3C,QAAQ,OAAO,GAAG,EAGlB,QAAQ,uHAAuH,QAAQ,EAGvI,QAAQ,sBAAsB,QAAQ;AAG3C,MAAI,iBAAiB,GAAE;AACnB,aAAS,OAAO,UAAU,GAAE,cAAc;AAAA,EAC9C;AAGA,MAAI,CAAC,SAAS,KAAK,MAAM,GAAE;AACvB,UAAM,IAAI,MAAM,oDAAoD,MAAM,IAAI;AAAA,EAClF;AACA,SAAO;AACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compositefileloader_default
|
|
3
|
+
} from "./chunk-BDMF4RRF.mjs";
|
|
4
|
+
import {
|
|
5
|
+
githubfileloader_default
|
|
6
|
+
} from "./chunk-SU6SG5PJ.mjs";
|
|
7
|
+
import {
|
|
8
|
+
httpfileloader_default
|
|
9
|
+
} from "./chunk-EGOFDABS.mjs";
|
|
10
|
+
import {
|
|
11
|
+
init_browser_process_shim
|
|
12
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
13
|
+
|
|
14
|
+
// src/loaders/defaultfileloader.ts
|
|
15
|
+
init_browser_process_shim();
|
|
16
|
+
var DefaultFileLoader = class extends compositefileloader_default {
|
|
17
|
+
/**
|
|
18
|
+
* Create the DefaultFileLoader.
|
|
19
|
+
* @param processFile - a function to apply to the content of the file
|
|
20
|
+
*/
|
|
21
|
+
constructor(processFile) {
|
|
22
|
+
super();
|
|
23
|
+
const http = new httpfileloader_default(processFile);
|
|
24
|
+
const github = new githubfileloader_default(processFile);
|
|
25
|
+
this.addFileLoader(github);
|
|
26
|
+
this.addFileLoader(http);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var defaultfileloader_default = DefaultFileLoader;
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
DefaultFileLoader,
|
|
33
|
+
defaultfileloader_default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=chunk-N42BHUZ6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/loaders/defaultfileloader.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport CompositeFileLoader from './compositefileloader';\nimport HTTPFileLoader from './httpfileloader';\nimport GitHubFileLoader from './githubfileloader';\n\n/**\n * <p>\n * A default CompositeFileLoader implementation which supports\n * github://, http:// and https:// URLs.\n * </p>\n * @private\n * @class\n * @see See {@link CompositeFileLoader}\n * @memberof module:concerto-util\n */\nclass DefaultFileLoader<T> extends CompositeFileLoader<T> {\n /**\n * Create the DefaultFileLoader.\n * @param processFile - a function to apply to the content of the file\n */\n constructor(processFile: (name: string, text: string) => T) {\n super();\n const http = new HTTPFileLoader(processFile);\n const github = new GitHubFileLoader(processFile);\n this.addFileLoader(github);\n this.addFileLoader(http);\n }\n}\n\nexport { DefaultFileLoader };\nexport default DefaultFileLoader;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AA4BA,IAAM,oBAAN,cAAmC,4BAAuB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtD,YAAY,aAAgD;AACxD,UAAM;AACN,UAAM,OAAO,IAAI,uBAAe,WAAW;AAC3C,UAAM,SAAS,IAAI,yBAAiB,WAAW;AAC/C,SAAK,cAAc,MAAM;AACzB,SAAK,cAAc,IAAI;AAAA,EAC3B;AACJ;AAGA,IAAO,4BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export,
|
|
3
|
+
init_browser_process_shim
|
|
4
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
5
|
+
|
|
6
|
+
// src/errorcodes.ts
|
|
7
|
+
var errorcodes_exports = {};
|
|
8
|
+
__export(errorcodes_exports, {
|
|
9
|
+
CONCERTO_DEPRECATION_001: () => CONCERTO_DEPRECATION_001,
|
|
10
|
+
CONCERTO_DEPRECATION_002: () => CONCERTO_DEPRECATION_002,
|
|
11
|
+
DEFAULT_BASE_EXCEPTION: () => DEFAULT_BASE_EXCEPTION,
|
|
12
|
+
DEFAULT_VALIDATOR_EXCEPTION: () => DEFAULT_VALIDATOR_EXCEPTION,
|
|
13
|
+
DEPRECATION_WARNING: () => DEPRECATION_WARNING,
|
|
14
|
+
REGEX_VALIDATOR_EXCEPTION: () => REGEX_VALIDATOR_EXCEPTION,
|
|
15
|
+
TYPE_NOT_FOUND_EXCEPTION: () => TYPE_NOT_FOUND_EXCEPTION
|
|
16
|
+
});
|
|
17
|
+
init_browser_process_shim();
|
|
18
|
+
var DEFAULT_BASE_EXCEPTION = "DefaultBaseException";
|
|
19
|
+
var DEFAULT_VALIDATOR_EXCEPTION = "DefaultValidatorException";
|
|
20
|
+
var REGEX_VALIDATOR_EXCEPTION = "RegexValidatorException";
|
|
21
|
+
var TYPE_NOT_FOUND_EXCEPTION = "TypeNotFoundException";
|
|
22
|
+
var DEPRECATION_WARNING = "DeprecationWarning";
|
|
23
|
+
var CONCERTO_DEPRECATION_001 = "concerto-dep:001";
|
|
24
|
+
var CONCERTO_DEPRECATION_002 = "concerto-dep:002";
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
DEFAULT_BASE_EXCEPTION,
|
|
28
|
+
DEFAULT_VALIDATOR_EXCEPTION,
|
|
29
|
+
REGEX_VALIDATOR_EXCEPTION,
|
|
30
|
+
TYPE_NOT_FOUND_EXCEPTION,
|
|
31
|
+
DEPRECATION_WARNING,
|
|
32
|
+
CONCERTO_DEPRECATION_001,
|
|
33
|
+
CONCERTO_DEPRECATION_002,
|
|
34
|
+
errorcodes_exports
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-NAP47VIV.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/errorcodes.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use strict';\n\n//default base exception\nexport const DEFAULT_BASE_EXCEPTION = 'DefaultBaseException';\n//default validator exception which is being used when there is no specified validator exception in introspect\nexport const DEFAULT_VALIDATOR_EXCEPTION = 'DefaultValidatorException';\n// exception code for regex validator format error\nexport const REGEX_VALIDATOR_EXCEPTION = 'RegexValidatorException';\n// base exception for Type not found\nexport const TYPE_NOT_FOUND_EXCEPTION = 'TypeNotFoundException';\n// deprecation warning type for process.emitWarning\nexport const DEPRECATION_WARNING = 'DeprecationWarning';\n\n\n//deprecation codes\nexport const CONCERTO_DEPRECATION_001 = 'concerto-dep:001';\nexport const CONCERTO_DEPRECATION_002 = 'concerto-dep:002';\n"],
|
|
5
|
+
"mappings": ";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,IAAM,yBAAyB;AAE/B,IAAM,8BAA8B;AAEpC,IAAM,4BAA4B;AAElC,IAAM,2BAA2B;AAEjC,IAAM,sBAAsB;AAI5B,IAAM,2BAA2B;AACjC,IAAM,2BAA2B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_browser_process_shim
|
|
3
|
+
} from "./chunk-NSJTBLWA.mjs";
|
|
4
|
+
|
|
5
|
+
// src/writer.ts
|
|
6
|
+
init_browser_process_shim();
|
|
7
|
+
var Writer = class {
|
|
8
|
+
/**
|
|
9
|
+
* Create a Writer.
|
|
10
|
+
*/
|
|
11
|
+
constructor() {
|
|
12
|
+
this.beforeBuffer = "";
|
|
13
|
+
this.buffer = "";
|
|
14
|
+
this.linesWritten = 0;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Writes text to the start of the buffer
|
|
18
|
+
* @param tabs - the number of tabs to use
|
|
19
|
+
* @param text - the text to write
|
|
20
|
+
*/
|
|
21
|
+
writeBeforeLine(tabs, text) {
|
|
22
|
+
for (let n = 0; n < tabs; n++) {
|
|
23
|
+
this.beforeBuffer += " ";
|
|
24
|
+
}
|
|
25
|
+
this.beforeBuffer += text;
|
|
26
|
+
this.beforeBuffer += "\n";
|
|
27
|
+
this.linesWritten++;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Append text to the buffer
|
|
31
|
+
* @param tabs - the number of tabs to use
|
|
32
|
+
* @param text - the text to write
|
|
33
|
+
*/
|
|
34
|
+
writeLine(tabs, text) {
|
|
35
|
+
for (let n = 0; n < tabs; n++) {
|
|
36
|
+
this.write(" ");
|
|
37
|
+
}
|
|
38
|
+
this.write(text);
|
|
39
|
+
this.write("\n");
|
|
40
|
+
this.linesWritten++;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns the number of lines that have been written to the buffer.
|
|
44
|
+
* @return the number of lines written to the buffer.
|
|
45
|
+
*/
|
|
46
|
+
getLineCount() {
|
|
47
|
+
return this.linesWritten;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Append text to the buffer, prepending tabs
|
|
51
|
+
* @param tabs - the number of tabs to use
|
|
52
|
+
* @param text - the text to write
|
|
53
|
+
*/
|
|
54
|
+
writeIndented(tabs, text) {
|
|
55
|
+
for (let n = 0; n < tabs; n++) {
|
|
56
|
+
this.write(" ");
|
|
57
|
+
}
|
|
58
|
+
this.write(text);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Append text to the buffer (no automatic newline). The
|
|
62
|
+
* text may contain newline, and these will increment the linesWritten
|
|
63
|
+
* counter.
|
|
64
|
+
* @param msg - the text to write
|
|
65
|
+
*/
|
|
66
|
+
write(msg) {
|
|
67
|
+
if (typeof msg !== "string") {
|
|
68
|
+
throw new Error("Can only append strings. Argument " + msg + " has type " + typeof msg);
|
|
69
|
+
}
|
|
70
|
+
this.buffer += msg;
|
|
71
|
+
this.linesWritten += msg.split(/\r\n|\r|\n/).length;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the text that has been buffered in this Writer.
|
|
75
|
+
* @return the buffered text.
|
|
76
|
+
*/
|
|
77
|
+
getBuffer() {
|
|
78
|
+
return this.beforeBuffer + this.buffer;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Empties the underyling buffer and resets the line count.
|
|
82
|
+
*/
|
|
83
|
+
clearBuffer() {
|
|
84
|
+
this.beforeBuffer = "";
|
|
85
|
+
this.buffer = "";
|
|
86
|
+
this.linesWritten = 0;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var writer_default = Writer;
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
Writer,
|
|
93
|
+
writer_default
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=chunk-NQ5PDAAD.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/writer.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Writer buffers text to be written in memory. It handles simple\n * indentation and tracks the number of lines written.\n * @private\n * @class\n * @memberof module:concerto-util\n */\nclass Writer {\n public beforeBuffer: string;\n public buffer: string;\n public linesWritten: number;\n\n /**\n * Create a Writer.\n */\n constructor() {\n this.beforeBuffer = '';\n this.buffer = '';\n this.linesWritten = 0;\n }\n\n /**\n * Writes text to the start of the buffer\n * @param tabs - the number of tabs to use\n * @param text - the text to write\n */\n writeBeforeLine(tabs: number, text: string): void {\n for(let n=0; n < tabs; n++) {\n this.beforeBuffer += ' ';\n }\n this.beforeBuffer += text;\n this.beforeBuffer += '\\n';\n this.linesWritten++;\n }\n\n /**\n * Append text to the buffer\n * @param tabs - the number of tabs to use\n * @param text - the text to write\n */\n writeLine(tabs: number, text: string): void {\n for(let n=0; n < tabs; n++) {\n this.write(' ');\n }\n this.write(text);\n this.write('\\n');\n this.linesWritten++;\n }\n\n /**\n * Returns the number of lines that have been written to the buffer.\n * @return the number of lines written to the buffer.\n */\n getLineCount(): number {\n return this.linesWritten;\n }\n\n\n /**\n * Append text to the buffer, prepending tabs\n * @param tabs - the number of tabs to use\n * @param text - the text to write\n */\n writeIndented(tabs: number, text: string): void {\n for(let n=0; n < tabs; n++) {\n this.write(' ');\n }\n this.write(text);\n }\n\n /**\n * Append text to the buffer (no automatic newline). The\n * text may contain newline, and these will increment the linesWritten\n * counter.\n * @param msg - the text to write\n */\n write(msg: string): void {\n if(typeof msg !== 'string' ) {\n throw new Error('Can only append strings. Argument ' + msg + ' has type ' + typeof msg);\n }\n\n this.buffer += msg;\n this.linesWritten += msg.split(/\\r\\n|\\r|\\n/).length;\n }\n\n /**\n * Returns the text that has been buffered in this Writer.\n * @return the buffered text.\n */\n getBuffer(): string {\n return this.beforeBuffer + this.buffer;\n }\n\n /**\n * Empties the underyling buffer and resets the line count.\n */\n clearBuffer(): void {\n this.beforeBuffer = '';\n this.buffer = '';\n this.linesWritten = 0;\n }\n}\n\nexport { Writer };\nexport default Writer;\n"],
|
|
5
|
+
"mappings": ";;;;;AAAA;AAqBA,IAAM,SAAN,MAAa;AAAA;AAAA;AAAA;AAAA,EAQT,cAAc;AACV,SAAK,eAAe;AACpB,SAAK,SAAS;AACd,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgB,MAAc,MAAoB;AAC9C,aAAQ,IAAE,GAAG,IAAI,MAAM,KAAK;AACxB,WAAK,gBAAgB;AAAA,IACzB;AACA,SAAK,gBAAgB;AACrB,SAAK,gBAAgB;AACrB,SAAK;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,UAAU,MAAc,MAAoB;AACxC,aAAQ,IAAE,GAAG,IAAI,MAAM,KAAK;AACxB,WAAK,MAAM,KAAK;AAAA,IACpB;AACA,SAAK,MAAM,IAAI;AACf,SAAK,MAAM,IAAI;AACf,SAAK;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,eAAuB;AACnB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,cAAc,MAAc,MAAoB;AAC5C,aAAQ,IAAE,GAAG,IAAI,MAAM,KAAK;AACxB,WAAK,MAAM,KAAK;AAAA,IACpB;AACA,SAAK,MAAM,IAAI;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,KAAmB;AACrB,QAAG,OAAO,QAAQ,UAAW;AACzB,YAAM,IAAI,MAAM,uCAAuC,MAAM,eAAe,OAAO,GAAG;AAAA,IAC1F;AAEA,SAAK,UAAU;AACf,SAAK,gBAAgB,IAAI,MAAM,YAAY,EAAE;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAoB;AAChB,WAAO,KAAK,eAAe,KAAK;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA,EAKA,cAAoB;AAChB,SAAK,eAAe;AACpB,SAAK,SAAS;AACd,SAAK,eAAe;AAAA,EACxB;AACJ;AAGA,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __esm = (fn, res) => function __init() {
|
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
+
};
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
33
|
+
|
|
34
|
+
// ../../scripts/browser-process-shim.js
|
|
35
|
+
var globals, fallback, process;
|
|
36
|
+
var init_browser_process_shim = __esm({
|
|
37
|
+
"../../scripts/browser-process-shim.js"() {
|
|
38
|
+
globals = typeof globalThis !== "undefined" ? globalThis : {};
|
|
39
|
+
fallback = {
|
|
40
|
+
env: {},
|
|
41
|
+
platform: "browser",
|
|
42
|
+
/**
|
|
43
|
+
* Stand-in for Node's process.emitWarning.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} message - the warning text
|
|
46
|
+
* @param {string} [type] - the warning type
|
|
47
|
+
*/
|
|
48
|
+
emitWarning(message, type) {
|
|
49
|
+
console.warn(type ? `${type}: ${message}` : message);
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* Stand-in for Node's process.cwd.
|
|
53
|
+
*
|
|
54
|
+
* @return {string} the notional working directory
|
|
55
|
+
*/
|
|
56
|
+
cwd() {
|
|
57
|
+
return "/";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
process = globals.process || fallback;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
__commonJS,
|
|
66
|
+
__export,
|
|
67
|
+
__toESM,
|
|
68
|
+
process,
|
|
69
|
+
init_browser_process_shim
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=chunk-NSJTBLWA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/browser-process-shim.js"],
|
|
4
|
+
"sourcesContent": ["/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Injected into the browser ESM build (see scripts/build-esm.js) to bind the\n * free `process` identifier the sources and their dependencies use \u2014\n * `process.env.TZ` in the serializer, `process.emitWarning` in warning.ts,\n * `process.env.NODE_ENV` inside bundled deps.\n *\n * Leaving it free pushes the problem onto every downstream browser bundler.\n * webpack consumers in particular inject `process: 'process/browser'` through\n * ProvidePlugin, and that extensionless request is rejected as not fully\n * specified when the module it lands in is a .mjs file:\n *\n * Module not found: Can't resolve 'process/browser'\n * BREAKING CHANGE: ... resolved as fully specified\n *\n * The shim defers to a real `globalThis.process` whenever the page has one, so\n * a consumer's own polyfill still wins; the fallback only covers what these\n * packages actually read.\n */\n\nconst globals = typeof globalThis !== 'undefined' ? globalThis : {};\n\nconst fallback = {\n env: {},\n platform: 'browser',\n /**\n * Stand-in for Node's process.emitWarning.\n *\n * @param {string} message - the warning text\n * @param {string} [type] - the warning type\n */\n emitWarning(message, type) {\n // eslint-disable-next-line no-console\n console.warn(type ? `${type}: ${message}` : message);\n },\n /**\n * Stand-in for Node's process.cwd.\n *\n * @return {string} the notional working directory\n */\n cwd() {\n return '/';\n },\n};\n\nexport const process = globals.process || fallback;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAiCM,SAEA,UAuBO;AA1Db;AAAA;AAiCA,IAAM,UAAU,OAAO,eAAe,cAAc,aAAa,CAAC;AAElE,IAAM,WAAW;AAAA,MACb,KAAK,CAAC;AAAA,MACN,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOV,YAAY,SAAS,MAAM;AAEvB,gBAAQ,KAAK,OAAO,GAAG,IAAI,KAAK,OAAO,KAAK,OAAO;AAAA,MACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMA,MAAM;AACF,eAAO;AAAA,MACX;AAAA,IACJ;AAEO,IAAM,UAAU,QAAQ,WAAW;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|