@osdk/maker 0.14.0-beta.10 → 0.14.0-beta.12

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.
@@ -10,6 +10,7 @@ var yargs = require('yargs');
10
10
  var helpers = require('yargs/helpers');
11
11
  var fs2 = require('fs');
12
12
  var typescriptSdkDocs = require('@osdk/typescript-sdk-docs');
13
+ var Mustache = require('mustache');
13
14
  var crypto = require('crypto');
14
15
 
15
16
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -37,6 +38,7 @@ var path3__namespace = /*#__PURE__*/_interopNamespace(path3);
37
38
  var invariant7__default = /*#__PURE__*/_interopDefault(invariant7);
38
39
  var yargs__default = /*#__PURE__*/_interopDefault(yargs);
39
40
  var fs2__namespace = /*#__PURE__*/_interopNamespace(fs2);
41
+ var Mustache__default = /*#__PURE__*/_interopDefault(Mustache);
40
42
 
41
43
  // src/cli/main.ts
42
44
 
@@ -783,14 +785,14 @@ function distributeTypeHelper(type) {
783
785
  // src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts
784
786
  function propertyTypeTypeToOntologyIrType(type) {
785
787
  switch (true) {
786
- case (typeof type === "object" && "markingType" in type):
788
+ case (typeof type === "object" && type.type === "marking"):
787
789
  return {
788
790
  "type": "marking",
789
791
  marking: {
790
792
  markingType: type.markingType
791
793
  }
792
794
  };
793
- case (typeof type === "object" && "structDefinition" in type):
795
+ case (typeof type === "object" && type.type === "struct"):
794
796
  const structFields = new Array();
795
797
  for (const key in type.structDefinition) {
796
798
  const fieldTypeDefinition = type.structDefinition[key];
@@ -836,15 +838,24 @@ function propertyTypeTypeToOntologyIrType(type) {
836
838
  structFields
837
839
  }
838
840
  };
839
- case (typeof type === "object" && "isLongText" in type):
841
+ case (typeof type === "object" && type.type === "string"):
840
842
  return {
841
843
  "type": "string",
842
844
  "string": {
843
845
  analyzerOverride: void 0,
844
- enableAsciiFolding: void 0,
845
- isLongText: type.isLongText,
846
- supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard,
847
- supportsExactMatching: type.supportsExactMatching
846
+ enableAsciiFolding: type.enableAsciiFolding,
847
+ isLongText: type.isLongText ?? false,
848
+ supportsEfficientLeadingWildcard: type.supportsEfficientLeadingWildcard ?? false,
849
+ supportsExactMatching: type.supportsExactMatching ?? true,
850
+ supportsFullTextRegex: type.supportsFullTextRegex
851
+ }
852
+ };
853
+ case (typeof type === "object" && type.type === "decimal"):
854
+ return {
855
+ "type": "decimal",
856
+ "decimal": {
857
+ precision: type.precision,
858
+ scale: type.scale
848
859
  }
849
860
  };
850
861
  case type === "geopoint":
@@ -882,6 +893,9 @@ function propertyTypeTypeToOntologyIrType(type) {
882
893
  geotimeSeriesReference: {}
883
894
  };
884
895
  default:
896
+ if (typeof type === "object") {
897
+ throw new Error(`Unhandled exotic type: ${JSON.stringify(type)}`);
898
+ }
885
899
  return distributeTypeHelper(type);
886
900
  }
887
901
  }
@@ -1444,444 +1458,6 @@ function getFormContentOrdering(action, parameterOrdering) {
1444
1458
  return formContentOrdering;
1445
1459
  }
1446
1460
 
1447
- // ../../node_modules/.pnpm/mustache@4.2.0/node_modules/mustache/mustache.mjs
1448
- var objectToString = Object.prototype.toString;
1449
- var isArray = Array.isArray || function isArrayPolyfill(object) {
1450
- return objectToString.call(object) === "[object Array]";
1451
- };
1452
- function isFunction(object) {
1453
- return typeof object === "function";
1454
- }
1455
- function typeStr(obj) {
1456
- return isArray(obj) ? "array" : typeof obj;
1457
- }
1458
- function escapeRegExp(string) {
1459
- return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
1460
- }
1461
- function hasProperty(obj, propName) {
1462
- return obj != null && typeof obj === "object" && propName in obj;
1463
- }
1464
- function primitiveHasOwnProperty(primitive, propName) {
1465
- return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);
1466
- }
1467
- var regExpTest = RegExp.prototype.test;
1468
- function testRegExp(re, string) {
1469
- return regExpTest.call(re, string);
1470
- }
1471
- var nonSpaceRe = /\S/;
1472
- function isWhitespace(string) {
1473
- return !testRegExp(nonSpaceRe, string);
1474
- }
1475
- var entityMap = {
1476
- "&": "&",
1477
- "<": "&lt;",
1478
- ">": "&gt;",
1479
- '"': "&quot;",
1480
- "'": "&#39;",
1481
- "/": "&#x2F;",
1482
- "`": "&#x60;",
1483
- "=": "&#x3D;"
1484
- };
1485
- function escapeHtml(string) {
1486
- return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
1487
- return entityMap[s];
1488
- });
1489
- }
1490
- var whiteRe = /\s*/;
1491
- var spaceRe = /\s+/;
1492
- var equalsRe = /\s*=/;
1493
- var curlyRe = /\s*\}/;
1494
- var tagRe = /#|\^|\/|>|\{|&|=|!/;
1495
- function parseTemplate(template, tags) {
1496
- if (!template) return [];
1497
- var lineHasNonSpace = false;
1498
- var sections = [];
1499
- var tokens = [];
1500
- var spaces = [];
1501
- var hasTag = false;
1502
- var nonSpace = false;
1503
- var indentation = "";
1504
- var tagIndex = 0;
1505
- function stripSpace() {
1506
- if (hasTag && !nonSpace) {
1507
- while (spaces.length) delete tokens[spaces.pop()];
1508
- } else {
1509
- spaces = [];
1510
- }
1511
- hasTag = false;
1512
- nonSpace = false;
1513
- }
1514
- var openingTagRe, closingTagRe, closingCurlyRe;
1515
- function compileTags(tagsToCompile) {
1516
- if (typeof tagsToCompile === "string") tagsToCompile = tagsToCompile.split(spaceRe, 2);
1517
- if (!isArray(tagsToCompile) || tagsToCompile.length !== 2) throw new Error("Invalid tags: " + tagsToCompile);
1518
- openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
1519
- closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
1520
- closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
1521
- }
1522
- compileTags(tags || mustache.tags);
1523
- var scanner = new Scanner(template);
1524
- var start, type, value, chr, token, openSection;
1525
- while (!scanner.eos()) {
1526
- start = scanner.pos;
1527
- value = scanner.scanUntil(openingTagRe);
1528
- if (value) {
1529
- for (var i = 0, valueLength = value.length; i < valueLength; ++i) {
1530
- chr = value.charAt(i);
1531
- if (isWhitespace(chr)) {
1532
- spaces.push(tokens.length);
1533
- indentation += chr;
1534
- } else {
1535
- nonSpace = true;
1536
- lineHasNonSpace = true;
1537
- indentation += " ";
1538
- }
1539
- tokens.push(["text", chr, start, start + 1]);
1540
- start += 1;
1541
- if (chr === "\n") {
1542
- stripSpace();
1543
- indentation = "";
1544
- tagIndex = 0;
1545
- lineHasNonSpace = false;
1546
- }
1547
- }
1548
- }
1549
- if (!scanner.scan(openingTagRe)) break;
1550
- hasTag = true;
1551
- type = scanner.scan(tagRe) || "name";
1552
- scanner.scan(whiteRe);
1553
- if (type === "=") {
1554
- value = scanner.scanUntil(equalsRe);
1555
- scanner.scan(equalsRe);
1556
- scanner.scanUntil(closingTagRe);
1557
- } else if (type === "{") {
1558
- value = scanner.scanUntil(closingCurlyRe);
1559
- scanner.scan(curlyRe);
1560
- scanner.scanUntil(closingTagRe);
1561
- type = "&";
1562
- } else {
1563
- value = scanner.scanUntil(closingTagRe);
1564
- }
1565
- if (!scanner.scan(closingTagRe)) throw new Error("Unclosed tag at " + scanner.pos);
1566
- if (type == ">") {
1567
- token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];
1568
- } else {
1569
- token = [type, value, start, scanner.pos];
1570
- }
1571
- tagIndex++;
1572
- tokens.push(token);
1573
- if (type === "#" || type === "^") {
1574
- sections.push(token);
1575
- } else if (type === "/") {
1576
- openSection = sections.pop();
1577
- if (!openSection) throw new Error('Unopened section "' + value + '" at ' + start);
1578
- if (openSection[1] !== value) throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
1579
- } else if (type === "name" || type === "{" || type === "&") {
1580
- nonSpace = true;
1581
- } else if (type === "=") {
1582
- compileTags(value);
1583
- }
1584
- }
1585
- stripSpace();
1586
- openSection = sections.pop();
1587
- if (openSection) throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
1588
- return nestTokens(squashTokens(tokens));
1589
- }
1590
- function squashTokens(tokens) {
1591
- var squashedTokens = [];
1592
- var token, lastToken;
1593
- for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
1594
- token = tokens[i];
1595
- if (token) {
1596
- if (token[0] === "text" && lastToken && lastToken[0] === "text") {
1597
- lastToken[1] += token[1];
1598
- lastToken[3] = token[3];
1599
- } else {
1600
- squashedTokens.push(token);
1601
- lastToken = token;
1602
- }
1603
- }
1604
- }
1605
- return squashedTokens;
1606
- }
1607
- function nestTokens(tokens) {
1608
- var nestedTokens = [];
1609
- var collector = nestedTokens;
1610
- var sections = [];
1611
- var token, section;
1612
- for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
1613
- token = tokens[i];
1614
- switch (token[0]) {
1615
- case "#":
1616
- case "^":
1617
- collector.push(token);
1618
- sections.push(token);
1619
- collector = token[4] = [];
1620
- break;
1621
- case "/":
1622
- section = sections.pop();
1623
- section[5] = token[2];
1624
- collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
1625
- break;
1626
- default:
1627
- collector.push(token);
1628
- }
1629
- }
1630
- return nestedTokens;
1631
- }
1632
- function Scanner(string) {
1633
- this.string = string;
1634
- this.tail = string;
1635
- this.pos = 0;
1636
- }
1637
- Scanner.prototype.eos = function eos() {
1638
- return this.tail === "";
1639
- };
1640
- Scanner.prototype.scan = function scan(re) {
1641
- var match = this.tail.match(re);
1642
- if (!match || match.index !== 0) return "";
1643
- var string = match[0];
1644
- this.tail = this.tail.substring(string.length);
1645
- this.pos += string.length;
1646
- return string;
1647
- };
1648
- Scanner.prototype.scanUntil = function scanUntil(re) {
1649
- var index = this.tail.search(re), match;
1650
- switch (index) {
1651
- case -1:
1652
- match = this.tail;
1653
- this.tail = "";
1654
- break;
1655
- case 0:
1656
- match = "";
1657
- break;
1658
- default:
1659
- match = this.tail.substring(0, index);
1660
- this.tail = this.tail.substring(index);
1661
- }
1662
- this.pos += match.length;
1663
- return match;
1664
- };
1665
- function Context(view, parentContext) {
1666
- this.view = view;
1667
- this.cache = {
1668
- ".": this.view
1669
- };
1670
- this.parent = parentContext;
1671
- }
1672
- Context.prototype.push = function push(view) {
1673
- return new Context(view, this);
1674
- };
1675
- Context.prototype.lookup = function lookup(name) {
1676
- var cache = this.cache;
1677
- var value;
1678
- if (cache.hasOwnProperty(name)) {
1679
- value = cache[name];
1680
- } else {
1681
- var context = this, intermediateValue, names, index, lookupHit = false;
1682
- while (context) {
1683
- if (name.indexOf(".") > 0) {
1684
- intermediateValue = context.view;
1685
- names = name.split(".");
1686
- index = 0;
1687
- while (intermediateValue != null && index < names.length) {
1688
- if (index === names.length - 1) lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
1689
- intermediateValue = intermediateValue[names[index++]];
1690
- }
1691
- } else {
1692
- intermediateValue = context.view[name];
1693
- lookupHit = hasProperty(context.view, name);
1694
- }
1695
- if (lookupHit) {
1696
- value = intermediateValue;
1697
- break;
1698
- }
1699
- context = context.parent;
1700
- }
1701
- cache[name] = value;
1702
- }
1703
- if (isFunction(value)) value = value.call(this.view);
1704
- return value;
1705
- };
1706
- function Writer() {
1707
- this.templateCache = {
1708
- _cache: {},
1709
- set: function set(key, value) {
1710
- this._cache[key] = value;
1711
- },
1712
- get: function get(key) {
1713
- return this._cache[key];
1714
- },
1715
- clear: function clear() {
1716
- this._cache = {};
1717
- }
1718
- };
1719
- }
1720
- Writer.prototype.clearCache = function clearCache() {
1721
- if (typeof this.templateCache !== "undefined") {
1722
- this.templateCache.clear();
1723
- }
1724
- };
1725
- Writer.prototype.parse = function parse(template, tags) {
1726
- var cache = this.templateCache;
1727
- var cacheKey = template + ":" + (tags || mustache.tags).join(":");
1728
- var isCacheEnabled = typeof cache !== "undefined";
1729
- var tokens = isCacheEnabled ? cache.get(cacheKey) : void 0;
1730
- if (tokens == void 0) {
1731
- tokens = parseTemplate(template, tags);
1732
- isCacheEnabled && cache.set(cacheKey, tokens);
1733
- }
1734
- return tokens;
1735
- };
1736
- Writer.prototype.render = function render(template, view, partials, config) {
1737
- var tags = this.getConfigTags(config);
1738
- var tokens = this.parse(template, tags);
1739
- var context = view instanceof Context ? view : new Context(view, void 0);
1740
- return this.renderTokens(tokens, context, partials, template, config);
1741
- };
1742
- Writer.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate, config) {
1743
- var buffer = "";
1744
- var token, symbol, value;
1745
- for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
1746
- value = void 0;
1747
- token = tokens[i];
1748
- symbol = token[0];
1749
- if (symbol === "#") value = this.renderSection(token, context, partials, originalTemplate, config);
1750
- else if (symbol === "^") value = this.renderInverted(token, context, partials, originalTemplate, config);
1751
- else if (symbol === ">") value = this.renderPartial(token, context, partials, config);
1752
- else if (symbol === "&") value = this.unescapedValue(token, context);
1753
- else if (symbol === "name") value = this.escapedValue(token, context, config);
1754
- else if (symbol === "text") value = this.rawValue(token);
1755
- if (value !== void 0) buffer += value;
1756
- }
1757
- return buffer;
1758
- };
1759
- Writer.prototype.renderSection = function renderSection(token, context, partials, originalTemplate, config) {
1760
- var self = this;
1761
- var buffer = "";
1762
- var value = context.lookup(token[1]);
1763
- function subRender(template) {
1764
- return self.render(template, context, partials, config);
1765
- }
1766
- if (!value) return;
1767
- if (isArray(value)) {
1768
- for (var j = 0, valueLength = value.length; j < valueLength; ++j) {
1769
- buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);
1770
- }
1771
- } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
1772
- buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);
1773
- } else if (isFunction(value)) {
1774
- if (typeof originalTemplate !== "string") throw new Error("Cannot use higher-order sections without the original template");
1775
- value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
1776
- if (value != null) buffer += value;
1777
- } else {
1778
- buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);
1779
- }
1780
- return buffer;
1781
- };
1782
- Writer.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate, config) {
1783
- var value = context.lookup(token[1]);
1784
- if (!value || isArray(value) && value.length === 0) return this.renderTokens(token[4], context, partials, originalTemplate, config);
1785
- };
1786
- Writer.prototype.indentPartial = function indentPartial(partial, indentation, lineHasNonSpace) {
1787
- var filteredIndentation = indentation.replace(/[^ \t]/g, "");
1788
- var partialByNl = partial.split("\n");
1789
- for (var i = 0; i < partialByNl.length; i++) {
1790
- if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {
1791
- partialByNl[i] = filteredIndentation + partialByNl[i];
1792
- }
1793
- }
1794
- return partialByNl.join("\n");
1795
- };
1796
- Writer.prototype.renderPartial = function renderPartial(token, context, partials, config) {
1797
- if (!partials) return;
1798
- var tags = this.getConfigTags(config);
1799
- var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
1800
- if (value != null) {
1801
- var lineHasNonSpace = token[6];
1802
- var tagIndex = token[5];
1803
- var indentation = token[4];
1804
- var indentedValue = value;
1805
- if (tagIndex == 0 && indentation) {
1806
- indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);
1807
- }
1808
- var tokens = this.parse(indentedValue, tags);
1809
- return this.renderTokens(tokens, context, partials, indentedValue, config);
1810
- }
1811
- };
1812
- Writer.prototype.unescapedValue = function unescapedValue(token, context) {
1813
- var value = context.lookup(token[1]);
1814
- if (value != null) return value;
1815
- };
1816
- Writer.prototype.escapedValue = function escapedValue(token, context, config) {
1817
- var escape = this.getConfigEscape(config) || mustache.escape;
1818
- var value = context.lookup(token[1]);
1819
- if (value != null) return typeof value === "number" && escape === mustache.escape ? String(value) : escape(value);
1820
- };
1821
- Writer.prototype.rawValue = function rawValue(token) {
1822
- return token[1];
1823
- };
1824
- Writer.prototype.getConfigTags = function getConfigTags(config) {
1825
- if (isArray(config)) {
1826
- return config;
1827
- } else if (config && typeof config === "object") {
1828
- return config.tags;
1829
- } else {
1830
- return void 0;
1831
- }
1832
- };
1833
- Writer.prototype.getConfigEscape = function getConfigEscape(config) {
1834
- if (config && typeof config === "object" && !isArray(config)) {
1835
- return config.escape;
1836
- } else {
1837
- return void 0;
1838
- }
1839
- };
1840
- var mustache = {
1841
- name: "mustache.js",
1842
- version: "4.2.0",
1843
- tags: ["{{", "}}"],
1844
- clearCache: void 0,
1845
- escape: void 0,
1846
- parse: void 0,
1847
- render: void 0,
1848
- Scanner: void 0,
1849
- Context: void 0,
1850
- Writer: void 0,
1851
- /**
1852
- * Allows a user to override the default caching strategy, by providing an
1853
- * object with set, get and clear methods. This can also be used to disable
1854
- * the cache by setting it to the literal `undefined`.
1855
- */
1856
- set templateCache(cache) {
1857
- defaultWriter.templateCache = cache;
1858
- },
1859
- /**
1860
- * Gets the default or overridden caching object from the default writer.
1861
- */
1862
- get templateCache() {
1863
- return defaultWriter.templateCache;
1864
- }
1865
- };
1866
- var defaultWriter = new Writer();
1867
- mustache.clearCache = function clearCache2() {
1868
- return defaultWriter.clearCache();
1869
- };
1870
- mustache.parse = function parse2(template, tags) {
1871
- return defaultWriter.parse(template, tags);
1872
- };
1873
- mustache.render = function render2(template, view, partials, config) {
1874
- if (typeof template !== "string") {
1875
- throw new TypeError('Invalid template! Template should be a "string" but "' + typeStr(template) + '" was given as the first argument for mustache#render(template, view, partials)');
1876
- }
1877
- return defaultWriter.render(template, view, partials, config);
1878
- };
1879
- mustache.escape = escapeHtml;
1880
- mustache.Scanner = Scanner;
1881
- mustache.Context = Context;
1882
- mustache.Writer = Writer;
1883
- var mustache_default = mustache;
1884
-
1885
1461
  // src/api/code-snippets/snippetTypes.ts
1886
1462
  var interfaceSnippets = /* @__PURE__ */ (function(interfaceSnippets2) {
1887
1463
  interfaceSnippets2[interfaceSnippets2["loadInterfacesReference"] = 0] = "loadInterfacesReference";
@@ -1973,7 +1549,7 @@ function getSnippets(snippetType, context) {
1973
1549
  const allSnippets = {};
1974
1550
  for (const templateName of Object.keys(snippetType).filter((key) => isNaN(Number(key)))) {
1975
1551
  const latestTemplate = Object.values(typescriptSdkDocs.TYPESCRIPT_OSDK_SNIPPETS.versions).find((v) => v.snippets[templateName])?.snippets[templateName][0].template ?? "";
1976
- const renderedTemplate = mustache_default.render(latestTemplate, context);
1552
+ const renderedTemplate = Mustache__default.default.render(latestTemplate, context);
1977
1553
  allSnippets[templateName] = renderedTemplate;
1978
1554
  }
1979
1555
  return allSnippets;
@@ -2461,7 +2037,7 @@ function addNamespaceIfNone(apiName) {
2461
2037
  var apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
2462
2038
  var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
2463
2039
  async function main(args = process.argv) {
2464
- const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.14.0-beta.10").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
2040
+ const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.14.0-beta.12").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
2465
2041
  input: {
2466
2042
  alias: "i",
2467
2043
  describe: "Input file",
@@ -3946,14 +3522,6 @@ function wrapWithProxy(entity) {
3946
3522
  }
3947
3523
  });
3948
3524
  }
3949
- /*! Bundled license information:
3950
-
3951
- mustache/mustache.mjs:
3952
- (*!
3953
- * mustache.js - Logic-less {{mustache}} templates with JavaScript
3954
- * http://github.com/janl/mustache.js
3955
- *)
3956
- */
3957
3525
 
3958
3526
  exports.CREATE_INTERFACE_OBJECT_PARAMETER = CREATE_INTERFACE_OBJECT_PARAMETER;
3959
3527
  exports.CREATE_OR_MODIFY_OBJECT_PARAMETER = CREATE_OR_MODIFY_OBJECT_PARAMETER;