@zenstackhq/sdk 3.0.0-beta.19 → 3.0.0-beta.20
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/index.cjs +4 -505
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -66
- package/dist/index.d.ts +1 -66
- package/dist/index.js +2 -502
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -33,8 +33,7 @@ var src_exports = {};
|
|
|
33
33
|
__export(src_exports, {
|
|
34
34
|
ModelUtils: () => model_utils_exports,
|
|
35
35
|
PrismaSchemaGenerator: () => PrismaSchemaGenerator,
|
|
36
|
-
TsSchemaGenerator: () => TsSchemaGenerator
|
|
37
|
-
ZModelCodeGenerator: () => ZModelCodeGenerator
|
|
36
|
+
TsSchemaGenerator: () => TsSchemaGenerator
|
|
38
37
|
});
|
|
39
38
|
module.exports = __toCommonJS(src_exports);
|
|
40
39
|
|
|
@@ -136,6 +135,7 @@ var DELEGATE_AUX_RELATION_PREFIX = "delegate_aux";
|
|
|
136
135
|
|
|
137
136
|
// src/prisma/prisma-schema-generator.ts
|
|
138
137
|
var import_common_helpers = require("@zenstackhq/common-helpers");
|
|
138
|
+
var import_language = require("@zenstackhq/language");
|
|
139
139
|
var import_ast2 = require("@zenstackhq/language/ast");
|
|
140
140
|
var import_utils2 = require("@zenstackhq/language/utils");
|
|
141
141
|
var import_langium = require("langium");
|
|
@@ -723,7 +723,7 @@ var PrismaSchemaGenerator = class {
|
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
exprToText(expr) {
|
|
726
|
-
return new ZModelCodeGenerator({
|
|
726
|
+
return new import_language.ZModelCodeGenerator({
|
|
727
727
|
quote: "double"
|
|
728
728
|
}).generate(expr);
|
|
729
729
|
}
|
|
@@ -1596,511 +1596,10 @@ var TsSchemaGenerator = class {
|
|
|
1596
1596
|
import_node_fs.default.writeFileSync(outputFile, result);
|
|
1597
1597
|
}
|
|
1598
1598
|
};
|
|
1599
|
-
|
|
1600
|
-
// src/zmodel-code-generator.ts
|
|
1601
|
-
var import_ast4 = require("@zenstackhq/language/ast");
|
|
1602
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
1603
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1604
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1605
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1606
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1607
|
-
}
|
|
1608
|
-
__name(_ts_decorate, "_ts_decorate");
|
|
1609
|
-
function _ts_metadata(k, v) {
|
|
1610
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
1611
|
-
}
|
|
1612
|
-
__name(_ts_metadata, "_ts_metadata");
|
|
1613
|
-
var generationHandlers = /* @__PURE__ */ new Map();
|
|
1614
|
-
function gen(name) {
|
|
1615
|
-
return function(_target, _propertyKey, descriptor) {
|
|
1616
|
-
if (!generationHandlers.get(name)) {
|
|
1617
|
-
generationHandlers.set(name, descriptor);
|
|
1618
|
-
}
|
|
1619
|
-
return descriptor;
|
|
1620
|
-
};
|
|
1621
|
-
}
|
|
1622
|
-
__name(gen, "gen");
|
|
1623
|
-
var ZModelCodeGenerator = class {
|
|
1624
|
-
static {
|
|
1625
|
-
__name(this, "ZModelCodeGenerator");
|
|
1626
|
-
}
|
|
1627
|
-
options;
|
|
1628
|
-
constructor(options) {
|
|
1629
|
-
this.options = {
|
|
1630
|
-
binaryExprNumberOfSpaces: options?.binaryExprNumberOfSpaces ?? 1,
|
|
1631
|
-
unaryExprNumberOfSpaces: options?.unaryExprNumberOfSpaces ?? 0,
|
|
1632
|
-
indent: options?.indent ?? 4,
|
|
1633
|
-
quote: options?.quote ?? "single"
|
|
1634
|
-
};
|
|
1635
|
-
}
|
|
1636
|
-
/**
|
|
1637
|
-
* Generates ZModel source code from AST.
|
|
1638
|
-
*/
|
|
1639
|
-
generate(ast) {
|
|
1640
|
-
const handler = generationHandlers.get(ast.$type);
|
|
1641
|
-
if (!handler) {
|
|
1642
|
-
throw new Error(`No generation handler found for ${ast.$type}`);
|
|
1643
|
-
}
|
|
1644
|
-
return handler.value.call(this, ast);
|
|
1645
|
-
}
|
|
1646
|
-
_generateModel(ast) {
|
|
1647
|
-
return ast.declarations.map((d) => this.generate(d)).join("\n\n");
|
|
1648
|
-
}
|
|
1649
|
-
_generateDataSource(ast) {
|
|
1650
|
-
return `datasource ${ast.name} {
|
|
1651
|
-
${ast.fields.map((x) => this.indent + this.generate(x)).join("\n")}
|
|
1652
|
-
}`;
|
|
1653
|
-
}
|
|
1654
|
-
_generateEnum(ast) {
|
|
1655
|
-
return `enum ${ast.name} {
|
|
1656
|
-
${ast.fields.map((x) => this.indent + this.generate(x)).join("\n")}
|
|
1657
|
-
}`;
|
|
1658
|
-
}
|
|
1659
|
-
_generateEnumField(ast) {
|
|
1660
|
-
return `${ast.name}${ast.attributes.length > 0 ? " " + ast.attributes.map((x) => this.generate(x)).join(" ") : ""}`;
|
|
1661
|
-
}
|
|
1662
|
-
_generateGenerator(ast) {
|
|
1663
|
-
return `generator ${ast.name} {
|
|
1664
|
-
${ast.fields.map((x) => this.indent + this.generate(x)).join("\n")}
|
|
1665
|
-
}`;
|
|
1666
|
-
}
|
|
1667
|
-
_generateConfigField(ast) {
|
|
1668
|
-
return `${ast.name} = ${this.generate(ast.value)}`;
|
|
1669
|
-
}
|
|
1670
|
-
_generateConfigArrayExpr(ast) {
|
|
1671
|
-
return `[${ast.items.map((x) => this.generate(x)).join(", ")}]`;
|
|
1672
|
-
}
|
|
1673
|
-
_generateConfigInvocationExpr(ast) {
|
|
1674
|
-
if (ast.args.length === 0) {
|
|
1675
|
-
return ast.name;
|
|
1676
|
-
} else {
|
|
1677
|
-
return `${ast.name}(${ast.args.map((x) => (x.name ? x.name + ": " : "") + this.generate(x.value)).join(", ")})`;
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
_generatePlugin(ast) {
|
|
1681
|
-
return `plugin ${ast.name} {
|
|
1682
|
-
${ast.fields.map((x) => this.indent + this.generate(x)).join("\n")}
|
|
1683
|
-
}`;
|
|
1684
|
-
}
|
|
1685
|
-
_generatePluginField(ast) {
|
|
1686
|
-
return `${ast.name} = ${this.generate(ast.value)}`;
|
|
1687
|
-
}
|
|
1688
|
-
_generateDataModel(ast) {
|
|
1689
|
-
return `${ast.isView ? "view" : "model"} ${ast.name}${ast.mixins.length > 0 ? " mixes " + ast.mixins.map((x) => x.ref?.name).join(", ") : ""} {
|
|
1690
|
-
${ast.fields.map((x) => this.indent + this.generate(x)).join("\n")}${ast.attributes.length > 0 ? "\n\n" + ast.attributes.map((x) => this.indent + this.generate(x)).join("\n") : ""}
|
|
1691
|
-
}`;
|
|
1692
|
-
}
|
|
1693
|
-
_generateDataField(ast) {
|
|
1694
|
-
return `${ast.name} ${this.fieldType(ast.type)}${ast.attributes.length > 0 ? " " + ast.attributes.map((x) => this.generate(x)).join(" ") : ""}`;
|
|
1695
|
-
}
|
|
1696
|
-
fieldType(type) {
|
|
1697
|
-
const baseType = type.type ? type.type : type.$type == "DataFieldType" && type.unsupported ? "Unsupported(" + this.generate(type.unsupported.value) + ")" : type.reference?.$refText;
|
|
1698
|
-
return `${baseType}${type.array ? "[]" : ""}${type.optional ? "?" : ""}`;
|
|
1699
|
-
}
|
|
1700
|
-
_generateDataModelAttribute(ast) {
|
|
1701
|
-
return this.attribute(ast);
|
|
1702
|
-
}
|
|
1703
|
-
_generateDataFieldAttribute(ast) {
|
|
1704
|
-
return this.attribute(ast);
|
|
1705
|
-
}
|
|
1706
|
-
attribute(ast) {
|
|
1707
|
-
const args = ast.args.length ? `(${ast.args.map((x) => this.generate(x)).join(", ")})` : "";
|
|
1708
|
-
return `${resolved(ast.decl).name}${args}`;
|
|
1709
|
-
}
|
|
1710
|
-
_generateAttributeArg(ast) {
|
|
1711
|
-
if (ast.name) {
|
|
1712
|
-
return `${ast.name}: ${this.generate(ast.value)}`;
|
|
1713
|
-
} else {
|
|
1714
|
-
return this.generate(ast.value);
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
_generateObjectExpr(ast) {
|
|
1718
|
-
return `{ ${ast.fields.map((field) => this.objectField(field)).join(", ")} }`;
|
|
1719
|
-
}
|
|
1720
|
-
objectField(field) {
|
|
1721
|
-
return `${field.name}: ${this.generate(field.value)}`;
|
|
1722
|
-
}
|
|
1723
|
-
_generateArrayExpr(ast) {
|
|
1724
|
-
return `[${ast.items.map((item) => this.generate(item)).join(", ")}]`;
|
|
1725
|
-
}
|
|
1726
|
-
_generateLiteralExpr(ast) {
|
|
1727
|
-
return this.options.quote === "single" ? `'${ast.value}'` : `"${ast.value}"`;
|
|
1728
|
-
}
|
|
1729
|
-
_generateNumberLiteral(ast) {
|
|
1730
|
-
return ast.value.toString();
|
|
1731
|
-
}
|
|
1732
|
-
_generateBooleanLiteral(ast) {
|
|
1733
|
-
return ast.value.toString();
|
|
1734
|
-
}
|
|
1735
|
-
_generateUnaryExpr(ast) {
|
|
1736
|
-
return `${ast.operator}${this.unaryExprSpace}${this.generate(ast.operand)}`;
|
|
1737
|
-
}
|
|
1738
|
-
_generateBinaryExpr(ast) {
|
|
1739
|
-
const operator = ast.operator;
|
|
1740
|
-
const isCollectionPredicate = this.isCollectionPredicateOperator(operator);
|
|
1741
|
-
const rightExpr = this.generate(ast.right);
|
|
1742
|
-
const { left: isLeftParenthesis, right: isRightParenthesis } = this.isParenthesesNeededForBinaryExpr(ast);
|
|
1743
|
-
return `${isLeftParenthesis ? "(" : ""}${this.generate(ast.left)}${isLeftParenthesis ? ")" : ""}${isCollectionPredicate ? "" : this.binaryExprSpace}${operator}${isCollectionPredicate ? "" : this.binaryExprSpace}${isRightParenthesis ? "(" : ""}${isCollectionPredicate ? `[${rightExpr}]` : rightExpr}${isRightParenthesis ? ")" : ""}`;
|
|
1744
|
-
}
|
|
1745
|
-
_generateReferenceExpr(ast) {
|
|
1746
|
-
const args = ast.args.length ? `(${ast.args.map((x) => this.generate(x)).join(", ")})` : "";
|
|
1747
|
-
return `${ast.target.ref?.name}${args}`;
|
|
1748
|
-
}
|
|
1749
|
-
_generateReferenceArg(ast) {
|
|
1750
|
-
return `${ast.name}:${this.generate(ast.value)}`;
|
|
1751
|
-
}
|
|
1752
|
-
_generateMemberExpr(ast) {
|
|
1753
|
-
return `${this.generate(ast.operand)}.${ast.member.ref?.name}`;
|
|
1754
|
-
}
|
|
1755
|
-
_generateInvocationExpr(ast) {
|
|
1756
|
-
return `${ast.function.ref?.name}(${ast.args.map((x) => this.argument(x)).join(", ")})`;
|
|
1757
|
-
}
|
|
1758
|
-
_generateNullExpr() {
|
|
1759
|
-
return "null";
|
|
1760
|
-
}
|
|
1761
|
-
_generateThisExpr() {
|
|
1762
|
-
return "this";
|
|
1763
|
-
}
|
|
1764
|
-
_generateAttribute(ast) {
|
|
1765
|
-
return `attribute ${ast.name}(${ast.params.map((x) => this.generate(x)).join(", ")})`;
|
|
1766
|
-
}
|
|
1767
|
-
_generateAttributeParam(ast) {
|
|
1768
|
-
return `${ast.default ? "_ " : ""}${ast.name}: ${this.generate(ast.type)}`;
|
|
1769
|
-
}
|
|
1770
|
-
_generateAttributeParamType(ast) {
|
|
1771
|
-
return `${ast.type ?? ast.reference?.$refText}${ast.array ? "[]" : ""}${ast.optional ? "?" : ""}`;
|
|
1772
|
-
}
|
|
1773
|
-
_generateFunctionDecl(ast) {
|
|
1774
|
-
return `function ${ast.name}(${ast.params.map((x) => this.generate(x)).join(", ")}) ${ast.returnType ? ": " + this.generate(ast.returnType) : ""} {}`;
|
|
1775
|
-
}
|
|
1776
|
-
_generateFunctionParam(ast) {
|
|
1777
|
-
return `${ast.name}: ${this.generate(ast.type)}`;
|
|
1778
|
-
}
|
|
1779
|
-
_generateFunctionParamType(ast) {
|
|
1780
|
-
return `${ast.type ?? ast.reference?.$refText}${ast.array ? "[]" : ""}`;
|
|
1781
|
-
}
|
|
1782
|
-
_generateTypeDef(ast) {
|
|
1783
|
-
return `type ${ast.name} {
|
|
1784
|
-
${ast.fields.map((x) => this.indent + this.generate(x)).join("\n")}${ast.attributes.length > 0 ? "\n\n" + ast.attributes.map((x) => this.indent + this.generate(x)).join("\n") : ""}
|
|
1785
|
-
}`;
|
|
1786
|
-
}
|
|
1787
|
-
argument(ast) {
|
|
1788
|
-
return this.generate(ast.value);
|
|
1789
|
-
}
|
|
1790
|
-
get binaryExprSpace() {
|
|
1791
|
-
return " ".repeat(this.options.binaryExprNumberOfSpaces);
|
|
1792
|
-
}
|
|
1793
|
-
get unaryExprSpace() {
|
|
1794
|
-
return " ".repeat(this.options.unaryExprNumberOfSpaces);
|
|
1795
|
-
}
|
|
1796
|
-
get indent() {
|
|
1797
|
-
return " ".repeat(this.options.indent);
|
|
1798
|
-
}
|
|
1799
|
-
isParenthesesNeededForBinaryExpr(ast) {
|
|
1800
|
-
const result = {
|
|
1801
|
-
left: false,
|
|
1802
|
-
right: false
|
|
1803
|
-
};
|
|
1804
|
-
const operator = ast.operator;
|
|
1805
|
-
const isCollectionPredicate = this.isCollectionPredicateOperator(operator);
|
|
1806
|
-
const currentPriority = import_ast4.BinaryExprOperatorPriority[operator];
|
|
1807
|
-
if (ast.left.$type === import_ast4.BinaryExpr && import_ast4.BinaryExprOperatorPriority[ast.left["operator"]] < currentPriority) {
|
|
1808
|
-
result.left = true;
|
|
1809
|
-
}
|
|
1810
|
-
if (!isCollectionPredicate && ast.right.$type === import_ast4.BinaryExpr && import_ast4.BinaryExprOperatorPriority[ast.right["operator"]] <= currentPriority) {
|
|
1811
|
-
result.right = true;
|
|
1812
|
-
}
|
|
1813
|
-
return result;
|
|
1814
|
-
}
|
|
1815
|
-
isCollectionPredicateOperator(op) {
|
|
1816
|
-
return [
|
|
1817
|
-
"?",
|
|
1818
|
-
"!",
|
|
1819
|
-
"^"
|
|
1820
|
-
].includes(op);
|
|
1821
|
-
}
|
|
1822
|
-
};
|
|
1823
|
-
_ts_decorate([
|
|
1824
|
-
gen(import_ast4.Model),
|
|
1825
|
-
_ts_metadata("design:type", Function),
|
|
1826
|
-
_ts_metadata("design:paramtypes", [
|
|
1827
|
-
typeof import_ast4.Model === "undefined" ? Object : import_ast4.Model
|
|
1828
|
-
]),
|
|
1829
|
-
_ts_metadata("design:returntype", void 0)
|
|
1830
|
-
], ZModelCodeGenerator.prototype, "_generateModel", null);
|
|
1831
|
-
_ts_decorate([
|
|
1832
|
-
gen(import_ast4.DataSource),
|
|
1833
|
-
_ts_metadata("design:type", Function),
|
|
1834
|
-
_ts_metadata("design:paramtypes", [
|
|
1835
|
-
typeof import_ast4.DataSource === "undefined" ? Object : import_ast4.DataSource
|
|
1836
|
-
]),
|
|
1837
|
-
_ts_metadata("design:returntype", void 0)
|
|
1838
|
-
], ZModelCodeGenerator.prototype, "_generateDataSource", null);
|
|
1839
|
-
_ts_decorate([
|
|
1840
|
-
gen(import_ast4.Enum),
|
|
1841
|
-
_ts_metadata("design:type", Function),
|
|
1842
|
-
_ts_metadata("design:paramtypes", [
|
|
1843
|
-
typeof import_ast4.Enum === "undefined" ? Object : import_ast4.Enum
|
|
1844
|
-
]),
|
|
1845
|
-
_ts_metadata("design:returntype", void 0)
|
|
1846
|
-
], ZModelCodeGenerator.prototype, "_generateEnum", null);
|
|
1847
|
-
_ts_decorate([
|
|
1848
|
-
gen(import_ast4.EnumField),
|
|
1849
|
-
_ts_metadata("design:type", Function),
|
|
1850
|
-
_ts_metadata("design:paramtypes", [
|
|
1851
|
-
typeof import_ast4.EnumField === "undefined" ? Object : import_ast4.EnumField
|
|
1852
|
-
]),
|
|
1853
|
-
_ts_metadata("design:returntype", void 0)
|
|
1854
|
-
], ZModelCodeGenerator.prototype, "_generateEnumField", null);
|
|
1855
|
-
_ts_decorate([
|
|
1856
|
-
gen(import_ast4.GeneratorDecl),
|
|
1857
|
-
_ts_metadata("design:type", Function),
|
|
1858
|
-
_ts_metadata("design:paramtypes", [
|
|
1859
|
-
typeof import_ast4.GeneratorDecl === "undefined" ? Object : import_ast4.GeneratorDecl
|
|
1860
|
-
]),
|
|
1861
|
-
_ts_metadata("design:returntype", void 0)
|
|
1862
|
-
], ZModelCodeGenerator.prototype, "_generateGenerator", null);
|
|
1863
|
-
_ts_decorate([
|
|
1864
|
-
gen(import_ast4.ConfigField),
|
|
1865
|
-
_ts_metadata("design:type", Function),
|
|
1866
|
-
_ts_metadata("design:paramtypes", [
|
|
1867
|
-
typeof import_ast4.ConfigField === "undefined" ? Object : import_ast4.ConfigField
|
|
1868
|
-
]),
|
|
1869
|
-
_ts_metadata("design:returntype", void 0)
|
|
1870
|
-
], ZModelCodeGenerator.prototype, "_generateConfigField", null);
|
|
1871
|
-
_ts_decorate([
|
|
1872
|
-
gen(import_ast4.ConfigArrayExpr),
|
|
1873
|
-
_ts_metadata("design:type", Function),
|
|
1874
|
-
_ts_metadata("design:paramtypes", [
|
|
1875
|
-
typeof import_ast4.ConfigArrayExpr === "undefined" ? Object : import_ast4.ConfigArrayExpr
|
|
1876
|
-
]),
|
|
1877
|
-
_ts_metadata("design:returntype", void 0)
|
|
1878
|
-
], ZModelCodeGenerator.prototype, "_generateConfigArrayExpr", null);
|
|
1879
|
-
_ts_decorate([
|
|
1880
|
-
gen(import_ast4.ConfigInvocationExpr),
|
|
1881
|
-
_ts_metadata("design:type", Function),
|
|
1882
|
-
_ts_metadata("design:paramtypes", [
|
|
1883
|
-
typeof import_ast4.ConfigInvocationExpr === "undefined" ? Object : import_ast4.ConfigInvocationExpr
|
|
1884
|
-
]),
|
|
1885
|
-
_ts_metadata("design:returntype", void 0)
|
|
1886
|
-
], ZModelCodeGenerator.prototype, "_generateConfigInvocationExpr", null);
|
|
1887
|
-
_ts_decorate([
|
|
1888
|
-
gen(import_ast4.Plugin),
|
|
1889
|
-
_ts_metadata("design:type", Function),
|
|
1890
|
-
_ts_metadata("design:paramtypes", [
|
|
1891
|
-
typeof import_ast4.Plugin === "undefined" ? Object : import_ast4.Plugin
|
|
1892
|
-
]),
|
|
1893
|
-
_ts_metadata("design:returntype", void 0)
|
|
1894
|
-
], ZModelCodeGenerator.prototype, "_generatePlugin", null);
|
|
1895
|
-
_ts_decorate([
|
|
1896
|
-
gen(import_ast4.PluginField),
|
|
1897
|
-
_ts_metadata("design:type", Function),
|
|
1898
|
-
_ts_metadata("design:paramtypes", [
|
|
1899
|
-
typeof import_ast4.PluginField === "undefined" ? Object : import_ast4.PluginField
|
|
1900
|
-
]),
|
|
1901
|
-
_ts_metadata("design:returntype", void 0)
|
|
1902
|
-
], ZModelCodeGenerator.prototype, "_generatePluginField", null);
|
|
1903
|
-
_ts_decorate([
|
|
1904
|
-
gen(import_ast4.DataModel),
|
|
1905
|
-
_ts_metadata("design:type", Function),
|
|
1906
|
-
_ts_metadata("design:paramtypes", [
|
|
1907
|
-
typeof import_ast4.DataModel === "undefined" ? Object : import_ast4.DataModel
|
|
1908
|
-
]),
|
|
1909
|
-
_ts_metadata("design:returntype", void 0)
|
|
1910
|
-
], ZModelCodeGenerator.prototype, "_generateDataModel", null);
|
|
1911
|
-
_ts_decorate([
|
|
1912
|
-
gen(import_ast4.DataField),
|
|
1913
|
-
_ts_metadata("design:type", Function),
|
|
1914
|
-
_ts_metadata("design:paramtypes", [
|
|
1915
|
-
typeof import_ast4.DataField === "undefined" ? Object : import_ast4.DataField
|
|
1916
|
-
]),
|
|
1917
|
-
_ts_metadata("design:returntype", void 0)
|
|
1918
|
-
], ZModelCodeGenerator.prototype, "_generateDataField", null);
|
|
1919
|
-
_ts_decorate([
|
|
1920
|
-
gen(import_ast4.DataModelAttribute),
|
|
1921
|
-
_ts_metadata("design:type", Function),
|
|
1922
|
-
_ts_metadata("design:paramtypes", [
|
|
1923
|
-
typeof import_ast4.DataModelAttribute === "undefined" ? Object : import_ast4.DataModelAttribute
|
|
1924
|
-
]),
|
|
1925
|
-
_ts_metadata("design:returntype", void 0)
|
|
1926
|
-
], ZModelCodeGenerator.prototype, "_generateDataModelAttribute", null);
|
|
1927
|
-
_ts_decorate([
|
|
1928
|
-
gen(import_ast4.DataFieldAttribute),
|
|
1929
|
-
_ts_metadata("design:type", Function),
|
|
1930
|
-
_ts_metadata("design:paramtypes", [
|
|
1931
|
-
typeof import_ast4.DataFieldAttribute === "undefined" ? Object : import_ast4.DataFieldAttribute
|
|
1932
|
-
]),
|
|
1933
|
-
_ts_metadata("design:returntype", void 0)
|
|
1934
|
-
], ZModelCodeGenerator.prototype, "_generateDataFieldAttribute", null);
|
|
1935
|
-
_ts_decorate([
|
|
1936
|
-
gen(import_ast4.AttributeArg),
|
|
1937
|
-
_ts_metadata("design:type", Function),
|
|
1938
|
-
_ts_metadata("design:paramtypes", [
|
|
1939
|
-
typeof import_ast4.AttributeArg === "undefined" ? Object : import_ast4.AttributeArg
|
|
1940
|
-
]),
|
|
1941
|
-
_ts_metadata("design:returntype", void 0)
|
|
1942
|
-
], ZModelCodeGenerator.prototype, "_generateAttributeArg", null);
|
|
1943
|
-
_ts_decorate([
|
|
1944
|
-
gen(import_ast4.ObjectExpr),
|
|
1945
|
-
_ts_metadata("design:type", Function),
|
|
1946
|
-
_ts_metadata("design:paramtypes", [
|
|
1947
|
-
typeof import_ast4.ObjectExpr === "undefined" ? Object : import_ast4.ObjectExpr
|
|
1948
|
-
]),
|
|
1949
|
-
_ts_metadata("design:returntype", void 0)
|
|
1950
|
-
], ZModelCodeGenerator.prototype, "_generateObjectExpr", null);
|
|
1951
|
-
_ts_decorate([
|
|
1952
|
-
gen(import_ast4.ArrayExpr),
|
|
1953
|
-
_ts_metadata("design:type", Function),
|
|
1954
|
-
_ts_metadata("design:paramtypes", [
|
|
1955
|
-
typeof import_ast4.ArrayExpr === "undefined" ? Object : import_ast4.ArrayExpr
|
|
1956
|
-
]),
|
|
1957
|
-
_ts_metadata("design:returntype", void 0)
|
|
1958
|
-
], ZModelCodeGenerator.prototype, "_generateArrayExpr", null);
|
|
1959
|
-
_ts_decorate([
|
|
1960
|
-
gen(import_ast4.StringLiteral),
|
|
1961
|
-
_ts_metadata("design:type", Function),
|
|
1962
|
-
_ts_metadata("design:paramtypes", [
|
|
1963
|
-
typeof import_ast4.LiteralExpr === "undefined" ? Object : import_ast4.LiteralExpr
|
|
1964
|
-
]),
|
|
1965
|
-
_ts_metadata("design:returntype", void 0)
|
|
1966
|
-
], ZModelCodeGenerator.prototype, "_generateLiteralExpr", null);
|
|
1967
|
-
_ts_decorate([
|
|
1968
|
-
gen(import_ast4.NumberLiteral),
|
|
1969
|
-
_ts_metadata("design:type", Function),
|
|
1970
|
-
_ts_metadata("design:paramtypes", [
|
|
1971
|
-
typeof import_ast4.NumberLiteral === "undefined" ? Object : import_ast4.NumberLiteral
|
|
1972
|
-
]),
|
|
1973
|
-
_ts_metadata("design:returntype", void 0)
|
|
1974
|
-
], ZModelCodeGenerator.prototype, "_generateNumberLiteral", null);
|
|
1975
|
-
_ts_decorate([
|
|
1976
|
-
gen(import_ast4.BooleanLiteral),
|
|
1977
|
-
_ts_metadata("design:type", Function),
|
|
1978
|
-
_ts_metadata("design:paramtypes", [
|
|
1979
|
-
typeof import_ast4.BooleanLiteral === "undefined" ? Object : import_ast4.BooleanLiteral
|
|
1980
|
-
]),
|
|
1981
|
-
_ts_metadata("design:returntype", void 0)
|
|
1982
|
-
], ZModelCodeGenerator.prototype, "_generateBooleanLiteral", null);
|
|
1983
|
-
_ts_decorate([
|
|
1984
|
-
gen(import_ast4.UnaryExpr),
|
|
1985
|
-
_ts_metadata("design:type", Function),
|
|
1986
|
-
_ts_metadata("design:paramtypes", [
|
|
1987
|
-
typeof import_ast4.UnaryExpr === "undefined" ? Object : import_ast4.UnaryExpr
|
|
1988
|
-
]),
|
|
1989
|
-
_ts_metadata("design:returntype", void 0)
|
|
1990
|
-
], ZModelCodeGenerator.prototype, "_generateUnaryExpr", null);
|
|
1991
|
-
_ts_decorate([
|
|
1992
|
-
gen(import_ast4.BinaryExpr),
|
|
1993
|
-
_ts_metadata("design:type", Function),
|
|
1994
|
-
_ts_metadata("design:paramtypes", [
|
|
1995
|
-
typeof import_ast4.BinaryExpr === "undefined" ? Object : import_ast4.BinaryExpr
|
|
1996
|
-
]),
|
|
1997
|
-
_ts_metadata("design:returntype", void 0)
|
|
1998
|
-
], ZModelCodeGenerator.prototype, "_generateBinaryExpr", null);
|
|
1999
|
-
_ts_decorate([
|
|
2000
|
-
gen(import_ast4.ReferenceExpr),
|
|
2001
|
-
_ts_metadata("design:type", Function),
|
|
2002
|
-
_ts_metadata("design:paramtypes", [
|
|
2003
|
-
typeof import_ast4.ReferenceExpr === "undefined" ? Object : import_ast4.ReferenceExpr
|
|
2004
|
-
]),
|
|
2005
|
-
_ts_metadata("design:returntype", void 0)
|
|
2006
|
-
], ZModelCodeGenerator.prototype, "_generateReferenceExpr", null);
|
|
2007
|
-
_ts_decorate([
|
|
2008
|
-
gen(import_ast4.ReferenceArg),
|
|
2009
|
-
_ts_metadata("design:type", Function),
|
|
2010
|
-
_ts_metadata("design:paramtypes", [
|
|
2011
|
-
typeof import_ast4.ReferenceArg === "undefined" ? Object : import_ast4.ReferenceArg
|
|
2012
|
-
]),
|
|
2013
|
-
_ts_metadata("design:returntype", void 0)
|
|
2014
|
-
], ZModelCodeGenerator.prototype, "_generateReferenceArg", null);
|
|
2015
|
-
_ts_decorate([
|
|
2016
|
-
gen(import_ast4.MemberAccessExpr),
|
|
2017
|
-
_ts_metadata("design:type", Function),
|
|
2018
|
-
_ts_metadata("design:paramtypes", [
|
|
2019
|
-
typeof import_ast4.MemberAccessExpr === "undefined" ? Object : import_ast4.MemberAccessExpr
|
|
2020
|
-
]),
|
|
2021
|
-
_ts_metadata("design:returntype", void 0)
|
|
2022
|
-
], ZModelCodeGenerator.prototype, "_generateMemberExpr", null);
|
|
2023
|
-
_ts_decorate([
|
|
2024
|
-
gen(import_ast4.InvocationExpr),
|
|
2025
|
-
_ts_metadata("design:type", Function),
|
|
2026
|
-
_ts_metadata("design:paramtypes", [
|
|
2027
|
-
typeof import_ast4.InvocationExpr === "undefined" ? Object : import_ast4.InvocationExpr
|
|
2028
|
-
]),
|
|
2029
|
-
_ts_metadata("design:returntype", void 0)
|
|
2030
|
-
], ZModelCodeGenerator.prototype, "_generateInvocationExpr", null);
|
|
2031
|
-
_ts_decorate([
|
|
2032
|
-
gen(import_ast4.NullExpr),
|
|
2033
|
-
_ts_metadata("design:type", Function),
|
|
2034
|
-
_ts_metadata("design:paramtypes", []),
|
|
2035
|
-
_ts_metadata("design:returntype", void 0)
|
|
2036
|
-
], ZModelCodeGenerator.prototype, "_generateNullExpr", null);
|
|
2037
|
-
_ts_decorate([
|
|
2038
|
-
gen(import_ast4.ThisExpr),
|
|
2039
|
-
_ts_metadata("design:type", Function),
|
|
2040
|
-
_ts_metadata("design:paramtypes", []),
|
|
2041
|
-
_ts_metadata("design:returntype", void 0)
|
|
2042
|
-
], ZModelCodeGenerator.prototype, "_generateThisExpr", null);
|
|
2043
|
-
_ts_decorate([
|
|
2044
|
-
gen(import_ast4.Attribute),
|
|
2045
|
-
_ts_metadata("design:type", Function),
|
|
2046
|
-
_ts_metadata("design:paramtypes", [
|
|
2047
|
-
typeof import_ast4.Attribute === "undefined" ? Object : import_ast4.Attribute
|
|
2048
|
-
]),
|
|
2049
|
-
_ts_metadata("design:returntype", void 0)
|
|
2050
|
-
], ZModelCodeGenerator.prototype, "_generateAttribute", null);
|
|
2051
|
-
_ts_decorate([
|
|
2052
|
-
gen(import_ast4.AttributeParam),
|
|
2053
|
-
_ts_metadata("design:type", Function),
|
|
2054
|
-
_ts_metadata("design:paramtypes", [
|
|
2055
|
-
typeof import_ast4.AttributeParam === "undefined" ? Object : import_ast4.AttributeParam
|
|
2056
|
-
]),
|
|
2057
|
-
_ts_metadata("design:returntype", void 0)
|
|
2058
|
-
], ZModelCodeGenerator.prototype, "_generateAttributeParam", null);
|
|
2059
|
-
_ts_decorate([
|
|
2060
|
-
gen(import_ast4.AttributeParamType),
|
|
2061
|
-
_ts_metadata("design:type", Function),
|
|
2062
|
-
_ts_metadata("design:paramtypes", [
|
|
2063
|
-
typeof import_ast4.AttributeParamType === "undefined" ? Object : import_ast4.AttributeParamType
|
|
2064
|
-
]),
|
|
2065
|
-
_ts_metadata("design:returntype", void 0)
|
|
2066
|
-
], ZModelCodeGenerator.prototype, "_generateAttributeParamType", null);
|
|
2067
|
-
_ts_decorate([
|
|
2068
|
-
gen(import_ast4.FunctionDecl),
|
|
2069
|
-
_ts_metadata("design:type", Function),
|
|
2070
|
-
_ts_metadata("design:paramtypes", [
|
|
2071
|
-
typeof import_ast4.FunctionDecl === "undefined" ? Object : import_ast4.FunctionDecl
|
|
2072
|
-
]),
|
|
2073
|
-
_ts_metadata("design:returntype", void 0)
|
|
2074
|
-
], ZModelCodeGenerator.prototype, "_generateFunctionDecl", null);
|
|
2075
|
-
_ts_decorate([
|
|
2076
|
-
gen(import_ast4.FunctionParam),
|
|
2077
|
-
_ts_metadata("design:type", Function),
|
|
2078
|
-
_ts_metadata("design:paramtypes", [
|
|
2079
|
-
typeof import_ast4.FunctionParam === "undefined" ? Object : import_ast4.FunctionParam
|
|
2080
|
-
]),
|
|
2081
|
-
_ts_metadata("design:returntype", void 0)
|
|
2082
|
-
], ZModelCodeGenerator.prototype, "_generateFunctionParam", null);
|
|
2083
|
-
_ts_decorate([
|
|
2084
|
-
gen(import_ast4.FunctionParamType),
|
|
2085
|
-
_ts_metadata("design:type", Function),
|
|
2086
|
-
_ts_metadata("design:paramtypes", [
|
|
2087
|
-
typeof import_ast4.FunctionParamType === "undefined" ? Object : import_ast4.FunctionParamType
|
|
2088
|
-
]),
|
|
2089
|
-
_ts_metadata("design:returntype", void 0)
|
|
2090
|
-
], ZModelCodeGenerator.prototype, "_generateFunctionParamType", null);
|
|
2091
|
-
_ts_decorate([
|
|
2092
|
-
gen(import_ast4.TypeDef),
|
|
2093
|
-
_ts_metadata("design:type", Function),
|
|
2094
|
-
_ts_metadata("design:paramtypes", [
|
|
2095
|
-
typeof import_ast4.TypeDef === "undefined" ? Object : import_ast4.TypeDef
|
|
2096
|
-
]),
|
|
2097
|
-
_ts_metadata("design:returntype", void 0)
|
|
2098
|
-
], ZModelCodeGenerator.prototype, "_generateTypeDef", null);
|
|
2099
1599
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2100
1600
|
0 && (module.exports = {
|
|
2101
1601
|
ModelUtils,
|
|
2102
1602
|
PrismaSchemaGenerator,
|
|
2103
|
-
TsSchemaGenerator
|
|
2104
|
-
ZModelCodeGenerator
|
|
1603
|
+
TsSchemaGenerator
|
|
2105
1604
|
});
|
|
2106
1605
|
//# sourceMappingURL=index.cjs.map
|