@zenstackhq/sdk 3.1.0 → 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 CHANGED
@@ -1406,25 +1406,22 @@ var TsSchemaGenerator = class {
1406
1406
  return ts.factory.createObjectLiteralExpression(procedures.map((proc) => ts.factory.createPropertyAssignment(proc.name, this.createProcedureObject(proc))), true);
1407
1407
  }
1408
1408
  createProcedureObject(proc) {
1409
- const params = ts.factory.createArrayLiteralExpression(proc.params.map((param) => ts.factory.createObjectLiteralExpression([
1409
+ const params = ts.factory.createObjectLiteralExpression(proc.params.map((param) => ts.factory.createPropertyAssignment(param.name, ts.factory.createObjectLiteralExpression([
1410
1410
  ts.factory.createPropertyAssignment("name", ts.factory.createStringLiteral(param.name)),
1411
1411
  ...param.optional ? [
1412
1412
  ts.factory.createPropertyAssignment("optional", ts.factory.createTrue())
1413
1413
  ] : [],
1414
+ ...param.type.array ? [
1415
+ ts.factory.createPropertyAssignment("array", ts.factory.createTrue())
1416
+ ] : [],
1414
1417
  ts.factory.createPropertyAssignment("type", ts.factory.createStringLiteral(param.type.type ?? param.type.reference.$refText))
1415
- ])), true);
1416
- const paramsType = ts.factory.createTupleTypeNode([
1417
- ...proc.params.map((param) => ts.factory.createNamedTupleMember(void 0, ts.factory.createIdentifier(param.name), void 0, ts.factory.createTypeLiteralNode([
1418
- ts.factory.createPropertySignature(void 0, ts.factory.createStringLiteral("name"), void 0, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(param.name))),
1419
- ts.factory.createPropertySignature(void 0, ts.factory.createStringLiteral("type"), void 0, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(param.type.type ?? param.type.reference.$refText))),
1420
- ...param.optional ? [
1421
- ts.factory.createPropertySignature(void 0, ts.factory.createStringLiteral("optional"), void 0, ts.factory.createLiteralTypeNode(ts.factory.createTrue()))
1422
- ] : []
1423
- ])))
1424
- ]);
1418
+ ]))), true);
1425
1419
  return ts.factory.createObjectLiteralExpression([
1426
- ts.factory.createPropertyAssignment("params", ts.factory.createAsExpression(params, paramsType)),
1420
+ ts.factory.createPropertyAssignment("params", params),
1427
1421
  ts.factory.createPropertyAssignment("returnType", ts.factory.createStringLiteral(proc.returnType.type ?? proc.returnType.reference.$refText)),
1422
+ ...proc.returnType.array ? [
1423
+ ts.factory.createPropertyAssignment("returnArray", ts.factory.createTrue())
1424
+ ] : [],
1428
1425
  ...proc.mutation ? [
1429
1426
  ts.factory.createPropertyAssignment("mutation", ts.factory.createTrue())
1430
1427
  ] : []
@@ -1622,6 +1619,7 @@ var TsSchemaGenerator = class {
1622
1619
  "FindManyArgs",
1623
1620
  "FindUniqueArgs",
1624
1621
  "FindFirstArgs",
1622
+ "ExistsArgs",
1625
1623
  "CreateArgs",
1626
1624
  "CreateManyArgs",
1627
1625
  "CreateManyAndReturnArgs",