1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "sourceFormat": "json-schema",
10 "targetFormats": [
11 "typescript",
12 "zod",
13 ],
14 "schemaSource": "direct",
15 "conversionOptions": {
16 "typescript": {
17 "bannerComment": "/* Auto-generated types */",
18 "style": {
19 "semi": True,
20 "singleQuote": True,
21 },
22 "strictIndexSignatures": False,
23 },
24 "zod": {
25 "strict": True,
26 "errorMessages": True,
27 },
28 "openapi": {
29 "version": "3.0.0",
30 "includeExamples": True,
31 },
32 "graphql": {
33 "includeDescriptions": True,
34 "nullableArrayItems": False,
35 },
36 },
37 "validateSchema": True,
38 "generateExamples": False,
39}
40
41
42run = client.actor("fiery_dream/schema-universal-converter").call(run_input=run_input)
43
44
45print("πΎ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
46for item in client.dataset(run["defaultDatasetId"]).iterate_items():
47 print(item)
48
49