@zenstackhq/sdk 3.1.1 → 3.2.0
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 +10 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -12
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1374,25 +1374,22 @@ var TsSchemaGenerator = class {
|
|
|
1374
1374
|
return ts.factory.createObjectLiteralExpression(procedures.map((proc) => ts.factory.createPropertyAssignment(proc.name, this.createProcedureObject(proc))), true);
|
|
1375
1375
|
}
|
|
1376
1376
|
createProcedureObject(proc) {
|
|
1377
|
-
const params = ts.factory.
|
|
1377
|
+
const params = ts.factory.createObjectLiteralExpression(proc.params.map((param) => ts.factory.createPropertyAssignment(param.name, ts.factory.createObjectLiteralExpression([
|
|
1378
1378
|
ts.factory.createPropertyAssignment("name", ts.factory.createStringLiteral(param.name)),
|
|
1379
1379
|
...param.optional ? [
|
|
1380
1380
|
ts.factory.createPropertyAssignment("optional", ts.factory.createTrue())
|
|
1381
1381
|
] : [],
|
|
1382
|
+
...param.type.array ? [
|
|
1383
|
+
ts.factory.createPropertyAssignment("array", ts.factory.createTrue())
|
|
1384
|
+
] : [],
|
|
1382
1385
|
ts.factory.createPropertyAssignment("type", ts.factory.createStringLiteral(param.type.type ?? param.type.reference.$refText))
|
|
1383
|
-
])), true);
|
|
1384
|
-
const paramsType = ts.factory.createTupleTypeNode([
|
|
1385
|
-
...proc.params.map((param) => ts.factory.createNamedTupleMember(void 0, ts.factory.createIdentifier(param.name), void 0, ts.factory.createTypeLiteralNode([
|
|
1386
|
-
ts.factory.createPropertySignature(void 0, ts.factory.createStringLiteral("name"), void 0, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(param.name))),
|
|
1387
|
-
ts.factory.createPropertySignature(void 0, ts.factory.createStringLiteral("type"), void 0, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(param.type.type ?? param.type.reference.$refText))),
|
|
1388
|
-
...param.optional ? [
|
|
1389
|
-
ts.factory.createPropertySignature(void 0, ts.factory.createStringLiteral("optional"), void 0, ts.factory.createLiteralTypeNode(ts.factory.createTrue()))
|
|
1390
|
-
] : []
|
|
1391
|
-
])))
|
|
1392
|
-
]);
|
|
1386
|
+
]))), true);
|
|
1393
1387
|
return ts.factory.createObjectLiteralExpression([
|
|
1394
|
-
ts.factory.createPropertyAssignment("params",
|
|
1388
|
+
ts.factory.createPropertyAssignment("params", params),
|
|
1395
1389
|
ts.factory.createPropertyAssignment("returnType", ts.factory.createStringLiteral(proc.returnType.type ?? proc.returnType.reference.$refText)),
|
|
1390
|
+
...proc.returnType.array ? [
|
|
1391
|
+
ts.factory.createPropertyAssignment("returnArray", ts.factory.createTrue())
|
|
1392
|
+
] : [],
|
|
1396
1393
|
...proc.mutation ? [
|
|
1397
1394
|
ts.factory.createPropertyAssignment("mutation", ts.factory.createTrue())
|
|
1398
1395
|
] : []
|
|
@@ -1590,6 +1587,7 @@ var TsSchemaGenerator = class {
|
|
|
1590
1587
|
"FindManyArgs",
|
|
1591
1588
|
"FindUniqueArgs",
|
|
1592
1589
|
"FindFirstArgs",
|
|
1590
|
+
"ExistsArgs",
|
|
1593
1591
|
"CreateArgs",
|
|
1594
1592
|
"CreateManyArgs",
|
|
1595
1593
|
"CreateManyAndReturnArgs",
|