@accordproject/template-engine 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/Common.d.ts +20 -0
  2. package/dist/Common.js +59 -0
  3. package/dist/Common.js.map +1 -0
  4. package/dist/TemplateMarkInterpreter.d.ts +34 -0
  5. package/dist/TemplateMarkInterpreter.js +432 -0
  6. package/dist/TemplateMarkInterpreter.js.map +1 -0
  7. package/dist/TemplateMarkToJavaScriptCompiler.d.ts +19 -0
  8. package/dist/TemplateMarkToJavaScriptCompiler.js +90 -0
  9. package/dist/TemplateMarkToJavaScriptCompiler.js.map +1 -0
  10. package/dist/TemplateMarkToTypeScriptCompiler.d.ts +69 -0
  11. package/dist/TemplateMarkToTypeScriptCompiler.js +239 -0
  12. package/dist/TemplateMarkToTypeScriptCompiler.js.map +1 -0
  13. package/dist/TypeScriptCompilationContext.d.ts +15 -0
  14. package/dist/TypeScriptCompilationContext.js +45 -0
  15. package/dist/TypeScriptCompilationContext.js.map +1 -0
  16. package/dist/TypeScriptRuntime.d.ts +5 -0
  17. package/dist/TypeScriptRuntime.js +67 -0
  18. package/dist/TypeScriptRuntime.js.map +1 -0
  19. package/dist/TypeScriptToJavaScriptCompiler.d.ts +14 -0
  20. package/dist/TypeScriptToJavaScriptCompiler.js +57 -0
  21. package/dist/TypeScriptToJavaScriptCompiler.js.map +1 -0
  22. package/dist/compilers/Clause.d.ts +14 -0
  23. package/dist/compilers/Clause.js +60 -0
  24. package/dist/compilers/Clause.js.map +1 -0
  25. package/dist/compilers/Common.d.ts +66 -0
  26. package/dist/compilers/Common.js +206 -0
  27. package/dist/compilers/Common.js.map +1 -0
  28. package/dist/compilers/Conditional.d.ts +12 -0
  29. package/dist/compilers/Conditional.js +53 -0
  30. package/dist/compilers/Conditional.js.map +1 -0
  31. package/dist/compilers/ContractDefinition.d.ts +8 -0
  32. package/dist/compilers/ContractDefinition.js +50 -0
  33. package/dist/compilers/ContractDefinition.js.map +1 -0
  34. package/dist/compilers/FormattedVariable.d.ts +8 -0
  35. package/dist/compilers/FormattedVariable.js +46 -0
  36. package/dist/compilers/FormattedVariable.js.map +1 -0
  37. package/dist/compilers/Formula.d.ts +8 -0
  38. package/dist/compilers/Formula.js +41 -0
  39. package/dist/compilers/Formula.js.map +1 -0
  40. package/dist/compilers/Join.d.ts +8 -0
  41. package/dist/compilers/Join.js +39 -0
  42. package/dist/compilers/Join.js.map +1 -0
  43. package/dist/compilers/ListBlock.d.ts +11 -0
  44. package/dist/compilers/ListBlock.js +57 -0
  45. package/dist/compilers/ListBlock.js.map +1 -0
  46. package/dist/compilers/NodeCompilers.d.ts +7 -0
  47. package/dist/compilers/NodeCompilers.js +87 -0
  48. package/dist/compilers/NodeCompilers.js.map +1 -0
  49. package/dist/compilers/Optional.d.ts +11 -0
  50. package/dist/compilers/Optional.js +65 -0
  51. package/dist/compilers/Optional.js.map +1 -0
  52. package/dist/compilers/Variable.d.ts +8 -0
  53. package/dist/compilers/Variable.js +45 -0
  54. package/dist/compilers/Variable.js.map +1 -0
  55. package/dist/compilers/With.d.ts +10 -0
  56. package/dist/compilers/With.js +40 -0
  57. package/dist/compilers/With.js.map +1 -0
  58. package/dist/drafting/Boolean/index.d.ts +6 -0
  59. package/dist/drafting/Boolean/index.js +30 -0
  60. package/dist/drafting/Boolean/index.js.map +1 -0
  61. package/dist/drafting/DateTime/index.d.ts +7 -0
  62. package/dist/drafting/DateTime/index.js +33 -0
  63. package/dist/drafting/DateTime/index.js.map +1 -0
  64. package/dist/drafting/Double/format.d.ts +13 -0
  65. package/dist/drafting/Double/format.js +55 -0
  66. package/dist/drafting/Double/format.js.map +1 -0
  67. package/dist/drafting/Double/index.d.ts +7 -0
  68. package/dist/drafting/Double/index.js +33 -0
  69. package/dist/drafting/Double/index.js.map +1 -0
  70. package/dist/drafting/Integer/format.d.ts +13 -0
  71. package/dist/drafting/Integer/format.js +45 -0
  72. package/dist/drafting/Integer/format.js.map +1 -0
  73. package/dist/drafting/Integer/index.d.ts +7 -0
  74. package/dist/drafting/Integer/index.js +33 -0
  75. package/dist/drafting/Integer/index.js.map +1 -0
  76. package/dist/drafting/Long/index.d.ts +7 -0
  77. package/dist/drafting/Long/index.js +33 -0
  78. package/dist/drafting/Long/index.js.map +1 -0
  79. package/dist/drafting/MonetaryAmount/currencycode.d.ts +35 -0
  80. package/dist/drafting/MonetaryAmount/currencycode.js +53 -0
  81. package/dist/drafting/MonetaryAmount/currencycode.js.map +1 -0
  82. package/dist/drafting/MonetaryAmount/index.d.ts +12 -0
  83. package/dist/drafting/MonetaryAmount/index.js +67 -0
  84. package/dist/drafting/MonetaryAmount/index.js.map +1 -0
  85. package/dist/drafting/String/index.d.ts +6 -0
  86. package/dist/drafting/String/index.js +25 -0
  87. package/dist/drafting/String/index.js.map +1 -0
  88. package/dist/drafting/index.d.ts +1 -0
  89. package/dist/drafting/index.js +36 -0
  90. package/dist/drafting/index.js.map +1 -0
  91. package/dist/index.d.ts +2 -0
  92. package/dist/index.js +21 -0
  93. package/dist/index.js.map +1 -0
  94. package/dist/model-gen/concerto.metamodel@1.0.0.d.ts +173 -0
  95. package/dist/model-gen/concerto.metamodel@1.0.0.js +5 -0
  96. package/dist/model-gen/concerto.metamodel@1.0.0.js.map +1 -0
  97. package/dist/model-gen/concerto@1.0.0.d.ts +18 -0
  98. package/dist/model-gen/concerto@1.0.0.js +5 -0
  99. package/dist/model-gen/concerto@1.0.0.js.map +1 -0
  100. package/dist/model-gen/org.accordproject.ciceromark@0.6.0.d.ts +49 -0
  101. package/dist/model-gen/org.accordproject.ciceromark@0.6.0.js +5 -0
  102. package/dist/model-gen/org.accordproject.ciceromark@0.6.0.js.map +1 -0
  103. package/dist/model-gen/org.accordproject.commonmark@0.5.0.d.ts +89 -0
  104. package/dist/model-gen/org.accordproject.commonmark@0.5.0.js +5 -0
  105. package/dist/model-gen/org.accordproject.commonmark@0.5.0.js.map +1 -0
  106. package/dist/model-gen/org.accordproject.templatemark@0.4.0.d.ts +72 -0
  107. package/dist/model-gen/org.accordproject.templatemark@0.4.0.js +11 -0
  108. package/dist/model-gen/org.accordproject.templatemark@0.4.0.js.map +1 -0
  109. package/package.json +3 -5
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var format_1 = require("./format");
17
+ var format_2 = require("./format");
18
+ /**
19
+ * Creates a drafter for a double
20
+ * @param {number} value - the Double
21
+ * @param {string} format - the format
22
+ * @returns {string} the text
23
+ */
24
+ function doubleDrafter(value, format) {
25
+ if (format) {
26
+ return (0, format_2.draftDoubleFormat)(value, format);
27
+ }
28
+ else {
29
+ return (0, format_1.draftDoubleIEEE)(value);
30
+ }
31
+ }
32
+ exports.default = doubleDrafter;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/Double/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAEH,mCAA2C;AAC3C,mCAA6C;AAE7C;;;;;GAKG;AACH,SAAwB,aAAa,CAAC,KAAY,EAAC,MAAa;IAC5D,IAAI,MAAM,EAAE;QACR,OAAO,IAAA,0BAAiB,EAAC,KAAK,EAAC,MAAM,CAAC,CAAC;KAC1C;SAAM;QACH,OAAO,IAAA,wBAAe,EAAC,KAAK,CAAC,CAAC;KACjC;AACL,CAAC;AAND,gCAMC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Creates a drafter for Integer
3
+ * @param {number} value - the integer
4
+ * @returns {string} the text
5
+ */
6
+ export declare function draftInteger(value: number): string;
7
+ /**
8
+ * Creates a drafter for a formatted Integer
9
+ * @param {number} value - the Integer
10
+ * @param {string} format - the format
11
+ * @returns {object} the parser
12
+ */
13
+ export declare function draftIntegerFormat(value: number, format: string): string;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.draftIntegerFormat = exports.draftInteger = void 0;
17
+ /**
18
+ * Creates a drafter for Integer
19
+ * @param {number} value - the integer
20
+ * @returns {string} the text
21
+ */
22
+ function draftInteger(value) {
23
+ return '' + value;
24
+ }
25
+ exports.draftInteger = draftInteger;
26
+ /**
27
+ * Creates a drafter for a formatted Integer
28
+ * @param {number} value - the Integer
29
+ * @param {string} format - the format
30
+ * @returns {object} the parser
31
+ */
32
+ function draftIntegerFormat(value, format) {
33
+ return format.replace(/0(.)0/gi, function (_a, sep1) {
34
+ var vs = value.toFixed(0);
35
+ var res = '';
36
+ var i = vs.substring(0, vs.length);
37
+ while (i.length > 3) {
38
+ res = sep1 + i.substring(i.length - 3) + res;
39
+ i = i.substring(0, i.length - 3);
40
+ }
41
+ return i + res;
42
+ });
43
+ }
44
+ exports.draftIntegerFormat = draftIntegerFormat;
45
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/drafting/Integer/format.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAY;IACrC,OAAO,EAAE,GAAG,KAAK,CAAC;AACtB,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,KAAY,EAAC,MAAa;IACzD,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,UAAS,EAAE,EAAC,IAAI;QAC7C,IAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,EAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YACjB,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YAC7C,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACpC;QACD,OAAO,CAAC,GAAG,GAAG,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC;AAXD,gDAWC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Creates a drafter for an Integer
3
+ * @param {number} value - the integer
4
+ * @param {string} format - the format
5
+ * @returns {string} the text
6
+ */
7
+ export default function integerDrafter(value: number, format: string): string;
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Licensed under the Apache License, Version 2.0 (the "License");
3
+ * you may not use this file except in compliance with the License.
4
+ * You may obtain a copy of the License at
5
+ *
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software
9
+ * distributed under the License is distributed on an "AS IS" BASIS,
10
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ * See the License for the specific language governing permissions and
12
+ * limitations under the License.
13
+ */
14
+ 'use strict';
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var format_1 = require("./format");
17
+ var format_2 = require("./format");
18
+ /**
19
+ * Creates a drafter for an Integer
20
+ * @param {number} value - the integer
21
+ * @param {string} format - the format
22
+ * @returns {string} the text
23
+ */
24
+ function integerDrafter(value, format) {
25
+ if (format) {
26
+ return (0, format_2.draftIntegerFormat)(value, format);
27
+ }
28
+ else {
29
+ return (0, format_1.draftInteger)(value);
30
+ }
31
+ }
32
+ exports.default = integerDrafter;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/Integer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,YAAY,CAAC;;AAEb,mCAAwC;AACxC,mCAA8C;AAE9C;;;;;GAKG;AACH,SAAwB,cAAc,CAAC,KAAY,EAAC,MAAa;IAC7D,IAAI,MAAM,EAAE;QACR,OAAO,IAAA,2BAAkB,EAAC,KAAK,EAAC,MAAM,CAAC,CAAC;KAC3C;SAAM;QACH,OAAO,IAAA,qBAAY,EAAC,KAAK,CAAC,CAAC;KAC9B;AACL,CAAC;AAND,iCAMC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Creates a drafter for a long
3
+ * @param {number} value - the Long
4
+ * @param {string} format - the format
5
+ * @returns {string} the text
6
+ */
7
+ export default function longDrafter(value: number, format: string): string;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var format_1 = require("../Integer/format");
17
+ var format_2 = require("../Integer/format");
18
+ /**
19
+ * Creates a drafter for a long
20
+ * @param {number} value - the Long
21
+ * @param {string} format - the format
22
+ * @returns {string} the text
23
+ */
24
+ function longDrafter(value, format) {
25
+ if (format) {
26
+ return (0, format_2.draftIntegerFormat)(value, format);
27
+ }
28
+ else {
29
+ return (0, format_1.draftInteger)(value);
30
+ }
31
+ }
32
+ exports.default = longDrafter;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/Long/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAEH,4CAA8D;AAC9D,4CAA0E;AAE1E;;;;;GAKG;AACH,SAAwB,WAAW,CAAC,KAAY,EAAC,MAAa;IAC1D,IAAI,MAAM,EAAE;QACR,OAAO,IAAA,2BAAe,EAAC,KAAK,EAAC,MAAM,CAAC,CAAC;KACxC;SAAM;QACH,OAAO,IAAA,qBAAS,EAAC,KAAK,CAAC,CAAC;KAC3B;AACL,CAAC;AAND,8BAMC"}
@@ -0,0 +1,35 @@
1
+ export declare enum CurrencyCode {
2
+ 'USD' = "$",
3
+ 'EUR' = "\u20AC",
4
+ 'JPY' = "\u00A5",
5
+ 'GBP' = "\u00A3",
6
+ 'AUD' = "A$",
7
+ 'CAD' = "C$",
8
+ 'CHF' = "CHF",
9
+ 'CNY' = "\u5143",
10
+ 'HKD' = "HK$",
11
+ 'NZD' = "NZ$",
12
+ 'KRW' = "\u20A9",
13
+ 'SGD' = "S$",
14
+ 'MXN' = "MEX$",
15
+ 'INR' = "\u20B9",
16
+ 'RUB' = "\u20BD",
17
+ 'ZAR' = "R",
18
+ 'TRY' = "\u20BA",
19
+ 'BRL' = "R$",
20
+ 'TWD' = "NT$",
21
+ 'PLN' = "z\u0142",
22
+ 'THB' = "\u0E3F",
23
+ 'IDR' = "Rp",
24
+ 'HUF' = "Ft",
25
+ 'CZK' = "K\u010D",
26
+ 'ILS' = "\u20AA",
27
+ 'CLP' = "CLP$",
28
+ 'PHP' = "\u20B1",
29
+ 'AED' = "\u062F.\u0625",
30
+ 'COP' = "COL$",
31
+ 'SAR' = "\uFDFC",
32
+ 'MYR' = "RM",
33
+ 'RON' = "L",
34
+ 'BGN' = "\u043B\u0432."
35
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CurrencyCode = void 0;
17
+ var CurrencyCode;
18
+ (function (CurrencyCode) {
19
+ CurrencyCode["USD"] = "$";
20
+ CurrencyCode["EUR"] = "\u20AC";
21
+ CurrencyCode["JPY"] = "\u00A5";
22
+ CurrencyCode["GBP"] = "\u00A3";
23
+ CurrencyCode["AUD"] = "A$";
24
+ CurrencyCode["CAD"] = "C$";
25
+ CurrencyCode["CHF"] = "CHF";
26
+ CurrencyCode["CNY"] = "\u5143";
27
+ CurrencyCode["HKD"] = "HK$";
28
+ CurrencyCode["NZD"] = "NZ$";
29
+ CurrencyCode["KRW"] = "\u20A9";
30
+ CurrencyCode["SGD"] = "S$";
31
+ CurrencyCode["MXN"] = "MEX$";
32
+ CurrencyCode["INR"] = "\u20B9";
33
+ CurrencyCode["RUB"] = "\u20BD";
34
+ CurrencyCode["ZAR"] = "R";
35
+ CurrencyCode["TRY"] = "\u20BA";
36
+ CurrencyCode["BRL"] = "R$";
37
+ CurrencyCode["TWD"] = "NT$";
38
+ CurrencyCode["PLN"] = "z\u0142";
39
+ CurrencyCode["THB"] = "\u0E3F";
40
+ CurrencyCode["IDR"] = "Rp";
41
+ CurrencyCode["HUF"] = "Ft";
42
+ CurrencyCode["CZK"] = "K\u010D";
43
+ CurrencyCode["ILS"] = "\u20AA";
44
+ CurrencyCode["CLP"] = "CLP$";
45
+ CurrencyCode["PHP"] = "\u20B1";
46
+ CurrencyCode["AED"] = "\u062F.\u0625";
47
+ CurrencyCode["COP"] = "COL$";
48
+ CurrencyCode["SAR"] = "\uFDFC";
49
+ CurrencyCode["MYR"] = "RM";
50
+ CurrencyCode["RON"] = "L";
51
+ CurrencyCode["BGN"] = "\u043B\u0432.";
52
+ })(CurrencyCode = exports.CurrencyCode || (exports.CurrencyCode = {}));
53
+ //# sourceMappingURL=currencycode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencycode.js","sourceRoot":"","sources":["../../../src/drafting/MonetaryAmount/currencycode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,IAAY,YAkCX;AAlCD,WAAY,YAAY;IACpB,yBAAW,CAAA;IACX,8BAAU,CAAA;IACV,8BAAU,CAAA;IACV,8BAAU,CAAA;IACV,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,2BAAY,CAAA;IACZ,8BAAU,CAAA;IACV,2BAAY,CAAA;IACZ,2BAAY,CAAA;IACZ,8BAAU,CAAA;IACV,0BAAW,CAAA;IACX,4BAAa,CAAA;IACb,8BAAU,CAAA;IACV,8BAAU,CAAA;IACV,yBAAU,CAAA;IACV,8BAAU,CAAA;IACV,0BAAW,CAAA;IACX,2BAAY,CAAA;IACZ,+BAAW,CAAA;IACX,8BAAU,CAAA;IACV,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,+BAAW,CAAA;IACX,8BAAU,CAAA;IACV,4BAAa,CAAA;IACb,8BAAU,CAAA;IACV,qCAAY,CAAA;IACZ,4BAAa,CAAA;IACb,8BAAU,CAAA;IACV,0BAAW,CAAA;IACX,yBAAU,CAAA;IACV,qCAAY,CAAA;AAChB,CAAC,EAlCW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAkCvB"}
@@ -0,0 +1,12 @@
1
+ declare type MonetaryAmount = {
2
+ doubleValue: number;
3
+ currencyCode: string;
4
+ };
5
+ /**
6
+ * Creates a drafter for a monetary amount
7
+ * @param {object} value the monetary amount
8
+ * @param {string} format the format
9
+ * @returns {string} the text
10
+ */
11
+ export default function monetaryAmountDrafter(value: MonetaryAmount, format: string): string;
12
+ export {};
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var format_1 = require("../Double/format");
17
+ var format_2 = require("../Double/format");
18
+ var currencycode_1 = require("./currencycode");
19
+ /**
20
+ * Creates a drafter for monetary amount with no format
21
+ * @param {object} value the monetary amount
22
+ * @returns {string} the text
23
+ */
24
+ function monetaryAmountDefaultDrafter(value) {
25
+ return '' + (0, format_1.draftDoubleIEEE)(value.doubleValue) + ' ' + value.currencyCode;
26
+ }
27
+ /**
28
+ * Symbol from a currency code
29
+ * @param {string} c - the currency code
30
+ * @returns {string} the symbol
31
+ */
32
+ function codeSymbol(c) {
33
+ var index = Object.keys(currencycode_1.CurrencyCode).indexOf(c);
34
+ if (index >= 0) {
35
+ return Object.values(currencycode_1.CurrencyCode)[index];
36
+ }
37
+ else {
38
+ return c;
39
+ }
40
+ }
41
+ /**
42
+ * Creates a drafter for monetary amount with a given format
43
+ * @param {object} value the monetary amount
44
+ * @param {string} format the format
45
+ * @returns {string} the text
46
+ */
47
+ function monetaryAmountFormatDrafter(value, format) {
48
+ return (0, format_2.draftDoubleFormat)(value.doubleValue, format
49
+ .replace(/K/gi, codeSymbol(value.currencyCode))
50
+ .replace(/CCC/gi, value.currencyCode));
51
+ }
52
+ /**
53
+ * Creates a drafter for a monetary amount
54
+ * @param {object} value the monetary amount
55
+ * @param {string} format the format
56
+ * @returns {string} the text
57
+ */
58
+ function monetaryAmountDrafter(value, format) {
59
+ if (format) {
60
+ return monetaryAmountFormatDrafter(value, format);
61
+ }
62
+ else {
63
+ return monetaryAmountDefaultDrafter(value);
64
+ }
65
+ }
66
+ exports.default = monetaryAmountDrafter;
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/MonetaryAmount/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAEH,2CAAmD;AACnD,2CAAqD;AACrD,+CAA8C;AAO9C;;;;GAIG;AACH,SAAS,4BAA4B,CAAC,KAAoB;IACtD,OAAO,EAAE,GAAG,IAAA,wBAAe,EAAC,KAAK,CAAC,WAAW,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC;AAC9E,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,CAAQ;IACxB,IAAM,KAAK,GAAW,MAAM,CAAC,IAAI,CAAC,2BAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAG,KAAK,IAAG,CAAC,EAAE;QACV,OAAO,MAAM,CAAC,MAAM,CAAC,2BAAY,CAAC,CAAC,KAAK,CAAC,CAAC;KAC7C;SACI;QACD,OAAO,CAAC,CAAC;KACZ;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,2BAA2B,CAAC,KAAoB,EAAC,MAAa;IACnE,OAAO,IAAA,0BAAiB,EAAC,KAAK,CAAC,WAAW,EACtC,MAAM;SACD,OAAO,CAAC,KAAK,EAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;SAC7C,OAAO,CAAC,OAAO,EAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,SAAwB,qBAAqB,CAAC,KAAoB,EAAC,MAAa;IAC5E,IAAI,MAAM,EAAE;QACR,OAAO,2BAA2B,CAAC,KAAK,EAAC,MAAM,CAAC,CAAC;KACpD;SAAM;QACH,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;KAC9C;AACL,CAAC;AAND,wCAMC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Creates a drafter for String
3
+ * @param {object} value the String
4
+ * @returns {string} the text
5
+ */
6
+ export default function stringDrafter(value: string): string;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ /**
17
+ * Creates a drafter for String
18
+ * @param {object} value the String
19
+ * @returns {string} the text
20
+ */
21
+ function stringDrafter(value) {
22
+ return value;
23
+ }
24
+ exports.default = stringDrafter;
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drafting/String/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAEH;;;;GAIG;AACH,SAAwB,aAAa,CAAC,KAAY;IAC9C,OAAO,KAAK,CAAC;AACjB,CAAC;AAFD,gCAEC"}
@@ -0,0 +1 @@
1
+ export declare const draftingMap: Map<string, (value: any, format: string) => string>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.draftingMap = void 0;
20
+ var Boolean_1 = __importDefault(require("./Boolean"));
21
+ var DateTime_1 = __importDefault(require("./DateTime"));
22
+ var Double_1 = __importDefault(require("./Double"));
23
+ var Integer_1 = __importDefault(require("./Integer"));
24
+ var Long_1 = __importDefault(require("./Long"));
25
+ var MonetaryAmount_1 = __importDefault(require("./MonetaryAmount"));
26
+ var String_1 = __importDefault(require("./String"));
27
+ exports.draftingMap = new Map([
28
+ ['Boolean', Boolean_1.default],
29
+ ['DateTime', DateTime_1.default],
30
+ ['Double', Double_1.default],
31
+ ['Integer', Integer_1.default],
32
+ ['Long', Long_1.default],
33
+ ['MonetaryAmount', MonetaryAmount_1.default],
34
+ ['String', String_1.default],
35
+ ]);
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/drafting/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;AAEH,sDAAuC;AACvC,wDAAyC;AACzC,oDAAqC;AACrC,sDAAuC;AACvC,gDAAiC;AACjC,oEAAqD;AACrD,oDAAqC;AAExB,QAAA,WAAW,GAAG,IAAI,GAAG,CAAiD;IAC/E,CAAC,SAAS,EAAE,iBAAc,CAAC;IAC3B,CAAC,UAAU,EAAE,kBAAe,CAAC;IAC7B,CAAC,QAAQ,EAAE,gBAAa,CAAC;IACzB,CAAC,SAAS,EAAE,iBAAc,CAAC;IAC3B,CAAC,MAAM,EAAE,cAAW,CAAC;IACrB,CAAC,gBAAgB,EAAE,wBAAqB,CAAC;IACzC,CAAC,QAAQ,EAAE,gBAAa,CAAC;CAC5B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { TemplateMarkInterpreter } from './TemplateMarkInterpreter';
2
+ export { TemplateMarkToTypeScriptCompiler } from './TemplateMarkToTypeScriptCompiler';
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /*
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.TemplateMarkToTypeScriptCompiler = exports.TemplateMarkInterpreter = void 0;
17
+ var TemplateMarkInterpreter_1 = require("./TemplateMarkInterpreter");
18
+ Object.defineProperty(exports, "TemplateMarkInterpreter", { enumerable: true, get: function () { return TemplateMarkInterpreter_1.TemplateMarkInterpreter; } });
19
+ var TemplateMarkToTypeScriptCompiler_1 = require("./TemplateMarkToTypeScriptCompiler");
20
+ Object.defineProperty(exports, "TemplateMarkToTypeScriptCompiler", { enumerable: true, get: function () { return TemplateMarkToTypeScriptCompiler_1.TemplateMarkToTypeScriptCompiler; } });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,uFAAsF;AAA7E,oJAAA,gCAAgC,OAAA"}
@@ -0,0 +1,173 @@
1
+ import { IConcept } from './concerto@1.0.0';
2
+ export interface IPosition extends IConcept {
3
+ line: number;
4
+ column: number;
5
+ offset: number;
6
+ }
7
+ export interface IRange extends IConcept {
8
+ start: IPosition;
9
+ end: IPosition;
10
+ source?: string;
11
+ }
12
+ export interface ITypeIdentifier extends IConcept {
13
+ name: string;
14
+ namespace?: string;
15
+ }
16
+ export interface IDecoratorLiteral extends IConcept {
17
+ location?: IRange;
18
+ }
19
+ export declare type DecoratorLiteralUnion = IDecoratorString | IDecoratorNumber | IDecoratorBoolean | IDecoratorTypeReference;
20
+ export interface IDecoratorString extends IDecoratorLiteral {
21
+ value: string;
22
+ }
23
+ export interface IDecoratorNumber extends IDecoratorLiteral {
24
+ value: number;
25
+ }
26
+ export interface IDecoratorBoolean extends IDecoratorLiteral {
27
+ value: boolean;
28
+ }
29
+ export interface IDecoratorTypeReference extends IDecoratorLiteral {
30
+ type: ITypeIdentifier;
31
+ isArray: boolean;
32
+ }
33
+ export interface IDecorator extends IConcept {
34
+ name: string;
35
+ arguments?: IDecoratorLiteral[];
36
+ location?: IRange;
37
+ }
38
+ export interface IIdentified extends IConcept {
39
+ }
40
+ export declare type IdentifiedUnion = IIdentifiedBy;
41
+ export interface IIdentifiedBy extends IIdentified {
42
+ name: string;
43
+ }
44
+ export interface IDeclaration extends IConcept {
45
+ name: string;
46
+ decorators?: IDecorator[];
47
+ location?: IRange;
48
+ }
49
+ export declare type DeclarationUnion = IEnumDeclaration | IConceptDeclaration | IScalarDeclaration;
50
+ export interface IEnumDeclaration extends IDeclaration {
51
+ properties: IEnumProperty[];
52
+ }
53
+ export interface IEnumProperty extends IConcept {
54
+ name: string;
55
+ decorators?: IDecorator[];
56
+ location?: IRange;
57
+ }
58
+ export interface IConceptDeclaration extends IDeclaration {
59
+ isAbstract: boolean;
60
+ identified?: IIdentified;
61
+ superType?: ITypeIdentifier;
62
+ properties: IProperty[];
63
+ }
64
+ export declare type ConceptDeclarationUnion = IAssetDeclaration | IParticipantDeclaration | ITransactionDeclaration | IEventDeclaration;
65
+ export interface IAssetDeclaration extends IConceptDeclaration {
66
+ }
67
+ export interface IParticipantDeclaration extends IConceptDeclaration {
68
+ }
69
+ export interface ITransactionDeclaration extends IConceptDeclaration {
70
+ }
71
+ export interface IEventDeclaration extends IConceptDeclaration {
72
+ }
73
+ export interface IProperty extends IConcept {
74
+ name: string;
75
+ isArray: boolean;
76
+ isOptional: boolean;
77
+ decorators?: IDecorator[];
78
+ location?: IRange;
79
+ }
80
+ export declare type PropertyUnion = IRelationshipProperty | IObjectProperty | IBooleanProperty | IDateTimeProperty | IStringProperty | IDoubleProperty | IIntegerProperty | ILongProperty;
81
+ export interface IRelationshipProperty extends IProperty {
82
+ type: ITypeIdentifier;
83
+ }
84
+ export interface IObjectProperty extends IProperty {
85
+ defaultValue?: string;
86
+ type: ITypeIdentifier;
87
+ }
88
+ export interface IBooleanProperty extends IProperty {
89
+ defaultValue?: boolean;
90
+ }
91
+ export interface IDateTimeProperty extends IProperty {
92
+ }
93
+ export interface IStringProperty extends IProperty {
94
+ defaultValue?: string;
95
+ validator?: IStringRegexValidator;
96
+ }
97
+ export interface IStringRegexValidator extends IConcept {
98
+ pattern: string;
99
+ flags: string;
100
+ }
101
+ export interface IDoubleProperty extends IProperty {
102
+ defaultValue?: number;
103
+ validator?: IDoubleDomainValidator;
104
+ }
105
+ export interface IDoubleDomainValidator extends IConcept {
106
+ lower?: number;
107
+ upper?: number;
108
+ }
109
+ export interface IIntegerProperty extends IProperty {
110
+ defaultValue?: number;
111
+ validator?: IIntegerDomainValidator;
112
+ }
113
+ export interface IIntegerDomainValidator extends IConcept {
114
+ lower?: number;
115
+ upper?: number;
116
+ }
117
+ export interface ILongProperty extends IProperty {
118
+ defaultValue?: number;
119
+ validator?: ILongDomainValidator;
120
+ }
121
+ export interface ILongDomainValidator extends IConcept {
122
+ lower?: number;
123
+ upper?: number;
124
+ }
125
+ export interface IImport extends IConcept {
126
+ namespace: string;
127
+ uri?: string;
128
+ }
129
+ export declare type ImportUnion = IImportAll | IImportType | IImportTypes;
130
+ export interface IImportAll extends IImport {
131
+ }
132
+ export interface IImportType extends IImport {
133
+ name: string;
134
+ }
135
+ export interface IImportTypes extends IImport {
136
+ types: string[];
137
+ }
138
+ export interface IModel extends IConcept {
139
+ namespace: string;
140
+ sourceUri?: string;
141
+ concertoVersion?: string;
142
+ imports?: IImport[];
143
+ declarations?: IDeclaration[];
144
+ decorators?: IDecorator[];
145
+ }
146
+ export interface IModels extends IConcept {
147
+ models: IModel[];
148
+ }
149
+ export interface IScalarDeclaration extends IDeclaration {
150
+ }
151
+ export declare type ScalarDeclarationUnion = IBooleanScalar | IIntegerScalar | ILongScalar | IDoubleScalar | IStringScalar | IDateTimeScalar;
152
+ export interface IBooleanScalar extends IScalarDeclaration {
153
+ defaultValue: boolean;
154
+ }
155
+ export interface IIntegerScalar extends IScalarDeclaration {
156
+ defaultValue?: number;
157
+ validator?: IIntegerDomainValidator;
158
+ }
159
+ export interface ILongScalar extends IScalarDeclaration {
160
+ defaultValue?: number;
161
+ validator?: ILongDomainValidator;
162
+ }
163
+ export interface IDoubleScalar extends IScalarDeclaration {
164
+ defaultValue?: number;
165
+ validator?: IDoubleDomainValidator;
166
+ }
167
+ export interface IStringScalar extends IScalarDeclaration {
168
+ defaultValue?: string;
169
+ validator?: IStringRegexValidator;
170
+ }
171
+ export interface IDateTimeScalar extends IScalarDeclaration {
172
+ defaultValue?: string;
173
+ }