UncountablePythonSDK 0.0.20__py3-none-any.whl → 0.0.22__py3-none-any.whl

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.

Potentially problematic release.


This version of UncountablePythonSDK might be problematic. Click here for more details.

Files changed (55) hide show
  1. {UncountablePythonSDK-0.0.20.dist-info → UncountablePythonSDK-0.0.22.dist-info}/METADATA +3 -1
  2. {UncountablePythonSDK-0.0.20.dist-info → UncountablePythonSDK-0.0.22.dist-info}/RECORD +55 -34
  3. examples/async_batch.py +36 -0
  4. examples/upload_files.py +19 -0
  5. pkgs/type_spec/actions_registry/__main__.py +35 -23
  6. pkgs/type_spec/actions_registry/emit_typescript.py +71 -9
  7. pkgs/type_spec/builder.py +125 -8
  8. pkgs/type_spec/config.py +1 -0
  9. pkgs/type_spec/emit_open_api.py +197 -16
  10. pkgs/type_spec/emit_open_api_util.py +18 -0
  11. pkgs/type_spec/emit_python.py +241 -55
  12. pkgs/type_spec/load_types.py +48 -5
  13. pkgs/type_spec/open_api_util.py +13 -33
  14. pkgs/type_spec/type_info/emit_type_info.py +129 -8
  15. type_spec/external/api/entity/create_entities.yaml +13 -1
  16. type_spec/external/api/entity/create_entity.yaml +13 -1
  17. type_spec/external/api/entity/transition_entity_phase.yaml +44 -0
  18. type_spec/external/api/permissions/set_core_permissions.yaml +69 -0
  19. type_spec/external/api/recipes/associate_recipe_as_input.yaml +4 -4
  20. type_spec/external/api/recipes/create_recipe.yaml +2 -1
  21. type_spec/external/api/recipes/disassociate_recipe_as_input.yaml +16 -0
  22. type_spec/external/api/recipes/edit_recipe_inputs.yaml +86 -0
  23. type_spec/external/api/recipes/get_curve.yaml +4 -1
  24. type_spec/external/api/recipes/get_recipes_data.yaml +6 -0
  25. type_spec/external/api/recipes/set_recipe_metadata.yaml +1 -0
  26. type_spec/external/api/recipes/set_recipe_tags.yaml +62 -0
  27. uncountable/core/__init__.py +3 -1
  28. uncountable/core/async_batch.py +22 -0
  29. uncountable/core/client.py +84 -10
  30. uncountable/core/file_upload.py +95 -0
  31. uncountable/core/types.py +22 -0
  32. uncountable/types/__init__.py +18 -0
  33. uncountable/types/api/entity/create_entities.py +1 -1
  34. uncountable/types/api/entity/create_entity.py +1 -1
  35. uncountable/types/api/entity/transition_entity_phase.py +66 -0
  36. uncountable/types/api/permissions/__init__.py +1 -0
  37. uncountable/types/api/permissions/set_core_permissions.py +89 -0
  38. uncountable/types/api/recipes/associate_recipe_as_input.py +4 -3
  39. uncountable/types/api/recipes/create_recipe.py +1 -1
  40. uncountable/types/api/recipes/disassociate_recipe_as_input.py +35 -0
  41. uncountable/types/api/recipes/edit_recipe_inputs.py +106 -0
  42. uncountable/types/api/recipes/get_curve.py +2 -1
  43. uncountable/types/api/recipes/get_recipes_data.py +2 -0
  44. uncountable/types/api/recipes/set_recipe_tags.py +91 -0
  45. uncountable/types/async_batch.py +10 -0
  46. uncountable/types/async_batch_processor.py +154 -0
  47. uncountable/types/client_base.py +113 -48
  48. uncountable/types/identifier.py +3 -3
  49. uncountable/types/permissions.py +46 -0
  50. uncountable/types/post_base.py +30 -0
  51. uncountable/types/recipe_inputs.py +30 -0
  52. uncountable/types/recipe_metadata.py +2 -0
  53. uncountable/types/recipe_workflow_steps.py +77 -0
  54. {UncountablePythonSDK-0.0.20.dist-info → UncountablePythonSDK-0.0.22.dist-info}/WHEEL +0 -0
  55. {UncountablePythonSDK-0.0.20.dist-info → UncountablePythonSDK-0.0.22.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.20
3
+ Version: 0.0.22
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -16,6 +16,8 @@ Classifier: Topic :: Utilities
16
16
  Classifier: Typing :: Typed
17
17
  Requires-Python: >=3.11
18
18
  Description-Content-Type: text/markdown
19
+ Requires-Dist: aiotus ==0.1.15
20
+ Requires-Dist: aiohttp ==3.9.5
19
21
  Requires-Dist: requests ==2.31.0
20
22
  Requires-Dist: SQLAlchemy ==1.4.52
21
23
  Requires-Dist: APScheduler ==3.10.4
@@ -14,7 +14,9 @@ docs/static/favicons/favicon-32x32.png,sha256=U4UU652zGnSeU3P9kUqxPeEnVf6zhtdNdN
14
14
  docs/static/favicons/manifest.json,sha256=6q_3nZkcg_x0xut4eE-xpdeMY1TydwiZIcbXlLAq9X8,437
15
15
  docs/static/favicons/mstile-150x150.png,sha256=eAK4QdEofhdLtfmjuPTpnX3MJqYnvGXsHYUjlcQekyY,1035
16
16
  docs/static/favicons/safari-pinned-tab.svg,sha256=S84fRnz0ZxLnQrKtmmFZytiRyu1xLtMR_RVy5jmwU7k,1926
17
+ examples/async_batch.py,sha256=wpf_3P547375vTIO4pKv5vw6WCkUnzqvw_S3idfhjvM,1122
17
18
  examples/create_entity.py,sha256=54AmZt83EpypxGcYZSIMmWlGz2oAgHFOsKuLSZOcHsI,625
19
+ examples/upload_files.py,sha256=ZsMChgOioraVHv207YREpivAOf4dq3IxGIBoROoDX_4,482
18
20
  examples/recipe-import/importer.py,sha256=baD71xuNibxDTe3bGHsMEIZEf9Xtb-IumBNpCEV0RZU,1134
19
21
  pkgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
22
  pkgs/argument_parser/__init__.py,sha256=CsQ6QoPKSLLRVl-z6URAmPkiUL9ZPZoV4rJHgy_-RjA,385
@@ -33,25 +35,25 @@ pkgs/strenum_compat/__init__.py,sha256=wXRFeNvBm8RU6dy1PFJ5sRLgUIEeH_DVR95Sv5qpG
33
35
  pkgs/strenum_compat/strenum_compat.py,sha256=uOUAgpYTjHs1MX8dG81jRlyTkt3KNbkV_25zp7xTX2s,36
34
36
  pkgs/type_spec/__init__.py,sha256=h5DmJTca4QVV10sZR1x0-MlkZfuGYDfapR3zHvXfzto,19
35
37
  pkgs/type_spec/__main__.py,sha256=5bJaX9Y_-FavP0qwzhk-z-V97UY7uaezJTa1zhO_HHQ,1048
36
- pkgs/type_spec/builder.py,sha256=vzJdNkv5kqvbpho9Lb3JpcRyabxSIU7crTwulksAUFY,39127
37
- pkgs/type_spec/config.py,sha256=TOcXjq9Yp8nYXAVgGz_qOBjqsxQLAO5YqHIYiCpdkr4,4955
38
+ pkgs/type_spec/builder.py,sha256=kLiTjVVbtctRfSStI15IZYbyQ4n2KPmvtJIWbizux40,43002
39
+ pkgs/type_spec/config.py,sha256=INfEiDcUsZFUKasHprsE6i33siPB0RnfmTKOsWcGnQ8,5043
38
40
  pkgs/type_spec/emit_io_ts.py,sha256=gCEfS81w_ifqjLVJ3_cpy9Gq03o6H5nEsh35WAkqGGE,5606
39
- pkgs/type_spec/emit_open_api.py,sha256=dnGazdVBjdEWQ4WK8Ujq966quRZY2TyQ05PGR48Md2I,17461
40
- pkgs/type_spec/emit_open_api_util.py,sha256=xnzPOuPO8Pbhf6xf1tkHUKgXs1n-jH-lWFac8pOtd4I,1882
41
- pkgs/type_spec/emit_python.py,sha256=bJMiz_OEeTklFxEuBjDIg-E_g6vVKx30b-JKSudAi5g,36719
41
+ pkgs/type_spec/emit_open_api.py,sha256=xy-nXjkqAZMDd-0qU5eDubRz1Hf8IwZSZj5bZyPSvX4,23328
42
+ pkgs/type_spec/emit_open_api_util.py,sha256=F6qouGVm2-WGYkoubbBtRu00V4e30bWJ0fDBhigBEfg,2248
43
+ pkgs/type_spec/emit_python.py,sha256=hj_5RUnJzjI6W9SmOh8ZUJTWB6F7PB1UFsg3OGSXZg0,42416
42
44
  pkgs/type_spec/emit_typescript.py,sha256=KOCcPuwSLRSt3pIp06Nq9exledq-kWtrA4RnUpeGMi8,17505
43
45
  pkgs/type_spec/emit_typescript_util.py,sha256=93FzJnpYse4PKFzgdw4DGV4zFTi5tF4WR-CIi7cW498,873
44
- pkgs/type_spec/load_types.py,sha256=AB334CF-368dpMNXE2QIFT7WxESvuew2RK_GG2MREng,2211
45
- pkgs/type_spec/open_api_util.py,sha256=88zgI_lHi6SjCaNfKpoiCjd1o0Npysjk-7iCXw0a3Hs,7463
46
+ pkgs/type_spec/load_types.py,sha256=xEHwdB_miR3vNs161Oy1luafE0VC-yk9-utAyCJmbEo,3629
47
+ pkgs/type_spec/open_api_util.py,sha256=TFbK2bkYT6S4qPQGO3_G2mfVgtNB26d31kwaHQ9y99E,6730
46
48
  pkgs/type_spec/test.py,sha256=4ueujBq-pEgnX3Z69HyPmD-bullFXmpixcpVzfOkhP4,489
47
49
  pkgs/type_spec/util.py,sha256=6m6MPfY-SwjyZf2FWQKclswWB5o7gcdd-3tdpViPYOQ,4844
48
50
  pkgs/type_spec/actions_registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
- pkgs/type_spec/actions_registry/__main__.py,sha256=3VPSxW6MfnOXhsSGpsbeswdsLHHuD1nOt3IYuXkb6ME,3809
50
- pkgs/type_spec/actions_registry/emit_typescript.py,sha256=Tt-XQVaCHE1bQIGBYzzurdMqOZSUyrL4qttMyW7MYD4,4229
51
+ pkgs/type_spec/actions_registry/__main__.py,sha256=JGwKxcAmrQdbpVR2vwknoimN1Q-r5h4SADw1cYLYzgk,4331
52
+ pkgs/type_spec/actions_registry/emit_typescript.py,sha256=ben0W7qwaVCzLO-t3NEJPPNGEE_6sKLdJMuAh8aMBnw,6044
51
53
  pkgs/type_spec/parts/base.py.prepart,sha256=wGNoDyQnLolHRZGRwHQX5TrPfKnu558NXCocYvqyroc,2174
52
54
  pkgs/type_spec/parts/base.ts.prepart,sha256=2FJJvpg2olCcavxj0nbYWdwKl6KeScour2JjSvN42l8,1001
53
55
  pkgs/type_spec/type_info/__main__.py,sha256=pmVjVqXyVh8vKTNCTFgz80Sg74C5BKToP3E6GS-X_So,857
54
- pkgs/type_spec/type_info/emit_type_info.py,sha256=xWcZsgdEwApqqvtinZXyyBM61FZ9rmP9oybKapz8xN4,7692
56
+ pkgs/type_spec/type_info/emit_type_info.py,sha256=nk1pKa0drccGvzPKSpub3GVctsbu70reh3_yhhJzKAo,12052
55
57
  pkgs/type_spec/value_spec/__init__.py,sha256=Z-grlcZtxAfEXhPHsK0nD7PFLGsv4eqvunaPN7_TA84,83
56
58
  pkgs/type_spec/value_spec/__main__.py,sha256=-9L5pXYx02plnTetqNknaUZPieLRtzbyWdZDT6B-cWA,8294
57
59
  pkgs/type_spec/value_spec/convert_type.py,sha256=SAYyEV6orQJJbkXSE4hhtOQJ2vKUXJCKPeYPrB8G9oA,2272
@@ -60,12 +62,13 @@ pkgs/type_spec/value_spec/types.py,sha256=a2zxbbCRWepY1l8OtjeCDKgBKFPFHVgV99oP6p
60
62
  type_spec/external/api/batch/execute_batch.yaml,sha256=gpdSev3sLEC_cMVSZdj-9bc_XDFDqdPdOII9Ojme2N8,1170
61
63
  type_spec/external/api/batch/execute_batch_load_async.yaml,sha256=gcn51NWLiSvlytz8k3_pDOVJLCGfdivKJPG4I9Q8CZc,435
62
64
  type_spec/external/api/chemical/convert_chemical_formats.yaml,sha256=EidTxMCRs-ko5yMFDptJPyAEWYZVruP41OG3cwyBLQQ,1069
63
- type_spec/external/api/entity/create_entities.yaml,sha256=l24aCHcKD3rnCOIREL3B1th0NXUahSO-thWWBvTEx3Y,1144
64
- type_spec/external/api/entity/create_entity.yaml,sha256=BjnJC7U_RW063B4E2tg6aXXLpLredrtSHMBNnJobkxE,1339
65
+ type_spec/external/api/entity/create_entities.yaml,sha256=RKjmb_iY4dVHf3aQUCU-OrlbTLLsCkULQ9uEfa8BMFY,1506
66
+ type_spec/external/api/entity/create_entity.yaml,sha256=Orz-3RZsNy5cWXlA3BKVQDYGnGGXlCXOtsOxDSm_nRY,1701
65
67
  type_spec/external/api/entity/get_entities_data.yaml,sha256=3XujG7bOpuBQlfFrYtG3L4fBk7LsmdSekmP9iU0zjF0,796
66
68
  type_spec/external/api/entity/list_entities.yaml,sha256=H2YVv6il-XVKd_7IipZqauTDvWCrvHok7z47bDH2sI4,1798
67
69
  type_spec/external/api/entity/resolve_entity_ids.yaml,sha256=Zf3OhAohwLJO7wWj0e-sK5lhIsXlD8A5Bu3OGjY4-tA,732
68
70
  type_spec/external/api/entity/set_values.yaml,sha256=_UDxSk09Ke0KDABt8ldOScC2CLrbAhBPArZvno5iD4I,422
71
+ type_spec/external/api/entity/transition_entity_phase.yaml,sha256=2JyaP-5Kn75mnBMy58plJsbQnVH2ildcMWcy6nRD6yY,1013
69
72
  type_spec/external/api/id_source/list_id_source.yaml,sha256=BuobTXCJJLp-ogkhkLXluJPQCvUBQ7O2E7Z20Sm1BK8,1020
70
73
  type_spec/external/api/id_source/match_id_source.yaml,sha256=j4jDdmElYyY_ZLJQrx66ddy4JYV_9GMWQNi0G8SwY08,837
71
74
  type_spec/external/api/input_groups/get_input_group_names.yaml,sha256=LYgnm2Or7ZWCzDGjl53Y1PcHvej8G7Mpp5H96Z4UZCg,913
@@ -77,28 +80,35 @@ type_spec/external/api/inputs/set_input_attribute_values.yaml,sha256=RpOtVIWBlOp
77
80
  type_spec/external/api/outputs/get_output_data.yaml,sha256=ABaKme64kFCZ-A11AUM5ARQs0Pb9f71atWx-QMYFNZs,3485
78
81
  type_spec/external/api/outputs/get_output_names.yaml,sha256=IqEYCOHeyHIu45Lf37sfzn-o_0VFk0u_Bqsb0NKHPzw,1334
79
82
  type_spec/external/api/outputs/resolve_output_conditions.yaml,sha256=lGrG6XPGiQtHx24GccPcO18xxAoMynTSC_2WwxCjFrc,1640
83
+ type_spec/external/api/permissions/set_core_permissions.yaml,sha256=SDM_3FE-ur00dv6Na9HlaJBIvSPgnfqRieGDKnBR1UY,1632
80
84
  type_spec/external/api/project/get_projects.yaml,sha256=pQXGGPHenmFWYUuzEmZ-ORf0_d6lpQkTrXXMRrEqvDI,1676
81
85
  type_spec/external/api/project/get_projects_data.yaml,sha256=8xQoyL8HlAropfZPYYcQ-W4fO4yuqueAWTKxRzTXAa0,1981
82
86
  type_spec/external/api/recipe_links/create_recipe_link.yaml,sha256=7b2p7Ei4LnQXqccHsOVAfYyNK4WXm0n1IqxPG-qQDh0,941
83
87
  type_spec/external/api/recipe_metadata/get_recipe_metadata_data.yaml,sha256=mJs82Ci8XSp2ng0W9MKqoeYwIjjgaVYmC5MWFmWFkR8,1759
84
- type_spec/external/api/recipes/associate_recipe_as_input.yaml,sha256=pX6XCiBlsCiGPHTLW3GP1FkB2NLnLBqZlp6W8hKuym4,486
88
+ type_spec/external/api/recipes/associate_recipe_as_input.yaml,sha256=7t0jto37RyLjl63-GK3mLC2uFiX1gd8vPwTwnobxkeI,654
85
89
  type_spec/external/api/recipes/associate_recipe_as_lot.yaml,sha256=8wzeJg5njt4qG2kavA6Jpo9PkWE6rIbuA4IPNdhcwEg,605
86
- type_spec/external/api/recipes/create_recipe.yaml,sha256=kORnb2yaShePpme259kXYkclQ7JLCxMStPZIMHK77CQ,1285
90
+ type_spec/external/api/recipes/create_recipe.yaml,sha256=mGLyKJI3pN_7nU4rcSqCO3WjuKhO_odZ2pewVgYcMUU,1322
87
91
  type_spec/external/api/recipes/create_recipes.yaml,sha256=eXMlXRpB5TFt1mUTECBa4aAIG3KrxYT2mJ5vxmZ9Q3A,1503
88
- type_spec/external/api/recipes/get_curve.yaml,sha256=QFRFst1EJ6T13G9R07kTiz-wvfxgDKbwHbmjgcvEaNc,568
92
+ type_spec/external/api/recipes/disassociate_recipe_as_input.yaml,sha256=qTKQCNBNwLnbr22DQVLA6b80BdBhwnDbX1c4KoCKUm8,477
93
+ type_spec/external/api/recipes/edit_recipe_inputs.yaml,sha256=mmRcep8It4UIUmABtLKxwH5fuax_9yb0vvF8_6ROLjY,2591
94
+ type_spec/external/api/recipes/get_curve.yaml,sha256=zQpPwOYqojY-YwmTjbqoGtUxpYm3vne2sYpglWbPnpw,779
89
95
  type_spec/external/api/recipes/get_recipe_calculations.yaml,sha256=ZE7PzfWrjS7TiO4q7iyCwEj5In8GwO6fFIYGqUlTEXo,1240
90
96
  type_spec/external/api/recipes/get_recipe_links.yaml,sha256=Vwm0OVWl3VvDaI7chY_oZQqD8xZ1u09iFWKkZKn1ITo,766
91
97
  type_spec/external/api/recipes/get_recipe_names.yaml,sha256=4tqcVj-xLeEu0lhdm8NpLYmAvfkmq08GZ0Mr59I5nLI,896
92
98
  type_spec/external/api/recipes/get_recipe_output_metadata.yaml,sha256=YImW94JXVKR6Wz_7R7sRbhD9Ul51Ba-j-x9vJB__AAU,1216
93
- type_spec/external/api/recipes/get_recipes_data.yaml,sha256=3Mq0y8cX9SPFkr78Tj-wPf3BUzyd8g9ObOxp9mkkpXE,11283
99
+ type_spec/external/api/recipes/get_recipes_data.yaml,sha256=elCYKyxjw3Sbi66BuG92exn4gRPF6LagiSe1alAEOjo,11538
94
100
  type_spec/external/api/recipes/set_recipe_inputs.yaml,sha256=MvnHuzI9JKfkYZb-pC4jeE7FRpGeacJKXd5_GImsDiY,1747
95
- type_spec/external/api/recipes/set_recipe_metadata.yaml,sha256=XLVwhBSkhbomXYD4AboBEVQt4vBhibvjmWQsDFS10sc,543
101
+ type_spec/external/api/recipes/set_recipe_metadata.yaml,sha256=5N9AIY9x3pZhDXyzpM__e7pyKNTI2RS7OeBmwmj5nEs,585
96
102
  type_spec/external/api/recipes/set_recipe_outputs.yaml,sha256=Oe8XGYXbPNmrbEDXk3qucfS1L3P9TnXI5cxaNAl6x5A,1875
103
+ type_spec/external/api/recipes/set_recipe_tags.yaml,sha256=IrdkbryxZjNy8n4aMNLRTYbm27cRDfXxItk_kFgDaMM,1399
97
104
  type_spec/external/api/triggers/run_trigger.yaml,sha256=c8xDV3bQRjcRRDG4Y7kdQmMMu1fj3ae5eUi-Sdbsi54,405
98
105
  uncountable/__init__.py,sha256=281cC2hs8pbrD0jVKMol-tbWSh7Zcsc8oRT42dKteyE,102
99
106
  uncountable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
- uncountable/core/__init__.py,sha256=GCXRRhhYv-yKzqKjAij7GcNiOr90BBbgdhhpusWtmUc,100
101
- uncountable/core/client.py,sha256=PWHdiUmLzwxZkw8Refh2ArFi-o4rADJyHSsJdNX7_N4,4113
107
+ uncountable/core/__init__.py,sha256=7xUnbSWJzS31sWg0jCe5nIksn5s0PVdwUrUmDttHfCY,258
108
+ uncountable/core/async_batch.py,sha256=0cRmCr6Z9sNxZyfY9Dl8wlCA4anISVZuHGgBegHhUbc,749
109
+ uncountable/core/client.py,sha256=7bLuACxMJZsckSfL2j-p-XThYdvDAUAwm5nND9s-v1o,6946
110
+ uncountable/core/file_upload.py,sha256=zTpAFSd7_-TmEVWxOn1rDznyWE6_AdZyuDQC3LP34iI,2667
111
+ uncountable/core/types.py,sha256=gQtCw1-WSRak_ypFlGI1Ea9iZBP9zDeFq6XQtiXBlZA,459
102
112
  uncountable/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
113
  uncountable/integration/construct_client.py,sha256=r6M5pnIO0fKcjf5d_AREPtWZ6AkWgcjkdu_jHQEYlT8,1084
104
114
  uncountable/integration/cron.py,sha256=TIPqMPMSMtMJTu4aXwLf6QY-OLrpmyITLDp48UIr4Ok,919
@@ -110,28 +120,33 @@ uncountable/integration/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
110
120
  uncountable/integration/db/connect.py,sha256=iI9e8a2hfbFP-dvH0MGLsrG-RpM0dHKCL-oCLkah9hs,181
111
121
  uncountable/integration/executors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
122
  uncountable/integration/executors/script_executor.py,sha256=6oMPAFe0PUdqt76e8jMi4vXszGVsVHLULob7Qbl3o38,816
113
- uncountable/types/__init__.py,sha256=vN7ogAcLNJbeCkDjr0Y9R_4UAbjonBbDLWo3AZ9L5Mg,5213
114
- uncountable/types/async_batch.py,sha256=ukbVKXk8j1QMHqiaOpQdVmfwZSPZVmAYjFn4awBItyE,1253
123
+ uncountable/types/__init__.py,sha256=fTNNsvFFkjp4acdBA8eS00OZVnDo_Zn7aRwPs8SFnrs,6024
124
+ uncountable/types/async_batch.py,sha256=FtIoDCeyt9rF5hknQs6Sw-vjiYBMJbe1re0-4bk_6VY,1578
125
+ uncountable/types/async_batch_processor.py,sha256=YksvTyJaZ3rqpZx4UXofUf7XU1Br4aNBNPZXB3LLtkA,5940
115
126
  uncountable/types/base.py,sha256=w3BRf8SAvYPlKrcJtJcQ_WhCU3A9zy0VuRTRWRFKVUA,2709
116
127
  uncountable/types/calculations.py,sha256=16J-KKMp-I8ZQUkYNmKCHfAn6DGb99cFinALcDIdGHY,562
117
128
  uncountable/types/chemical_structure.py,sha256=zQKl53DGtQQONIUHFXuwjWLQaG7FPZY7x6SBSOzkGV0,758
118
- uncountable/types/client_base.py,sha256=lkVyXgLrCfGh5eRc5glYCxamHl4yPqv3WRznOFFbOdQ,41267
129
+ uncountable/types/client_base.py,sha256=eAgmDRoHhpsswgqI1q8-eg8joya7qaaFJKH1fyE50PE,46075
119
130
  uncountable/types/curves.py,sha256=qYyRntMmFNonEwTrGhquMLbgMqjyP1moQflNTP0FMec,1308
120
131
  uncountable/types/entity.py,sha256=NjMZrqBwQ7sZe_oUuJqy9IEG7dWZmFMkQQXJ0_odcnA,11637
121
132
  uncountable/types/experiment_groups.py,sha256=ZBEk06F4n98Jz3oEA09WaDmw5rqPs7iVAm_Ysr4gc_o,599
122
133
  uncountable/types/field_values.py,sha256=2unBAeBqQPqLQKaL6nGpnDDksZ-5MZepgEF3sgy6oOk,1670
123
134
  uncountable/types/fields.py,sha256=eGtZ6axTYGFxLmPAyri2LwlcR4SZ2sX2c6QDX0ybKz0,570
124
135
  uncountable/types/id_source.py,sha256=Y3suURq3L1SahZ2oHPD986SU0l3Ik-ZzH38aQKgc1Fg,1341
125
- uncountable/types/identifier.py,sha256=O_J3sHsG3pFeSIxUKmgIK97FZl6f4qkRDwsNLvY7ymE,1389
136
+ uncountable/types/identifier.py,sha256=94-O3H_qNrA48tf3srwPwdu8HURkLl7_-88kUnwElZg,1455
126
137
  uncountable/types/input_attributes.py,sha256=u-JABoZ-Ij1Ynq5g6MxOgRdQeYbM7OnGP2q_N7KuVdw,826
127
138
  uncountable/types/inputs.py,sha256=q7fNGaSKIk3R6uXCEhSQpiHvXu82YcK3oZHDI7bxE88,1597
128
139
  uncountable/types/outputs.py,sha256=hSUlu41sisYKIZpPrj1G1DRfKm6hsKNcd1eNKFYb-4w,671
140
+ uncountable/types/permissions.py,sha256=VVLnukQ4RbApFdE0sgWDZxnrRCV6gOtXxq6yM5GxQlk,1620
129
141
  uncountable/types/phases.py,sha256=eaqwQlSRC2Ug7YFL0gqLbg3wDDHeRvBOhcABG7khW8c,550
142
+ uncountable/types/post_base.py,sha256=xLBoQAQouP1kKq7RNYt6XHLeCT-y-cJscR6HfPMdquU,765
130
143
  uncountable/types/recipe_identifiers.py,sha256=uJ_1xRSYa02AwGi0gxDHqoQoI0tu1KW5AzTAXwnr9Nc,1768
144
+ uncountable/types/recipe_inputs.py,sha256=OPEZUa1PUcQidcvRygHZguK199V7KfRF1IMwj3Vw9N4,741
131
145
  uncountable/types/recipe_links.py,sha256=RldSV7SdeBYa0bx02DzMg4jfPdgrlMRE40T16Fdy8u4,1406
132
- uncountable/types/recipe_metadata.py,sha256=NpRnz9QO2t21eTyf-M9_HBdQzcd55OgFM1dx6ZEg22w,1341
146
+ uncountable/types/recipe_metadata.py,sha256=cebGg_lJzqZzGnKnDgmuQFrw4Xhoz6HEiGM6G0az120,1437
133
147
  uncountable/types/recipe_output_metadata.py,sha256=XJA8R1r4NTzyR_DhMkmH4ZtYD-vqpvBMji9Be8OcFmo,613
134
148
  uncountable/types/recipe_tags.py,sha256=lYpksHAxXCcIjZKR7JoZOTH2cBSovwxZaHwjZy_yqiQ,581
149
+ uncountable/types/recipe_workflow_steps.py,sha256=LmyFwWWwJv30vuaQ4qtd0hzDdeJaIxHQZqwRb1Wi_6A,2626
135
150
  uncountable/types/response.py,sha256=ZI0CG7ZxBM2k5_W-6mNMU3UlB0p1i-0nrwOvsMaS-vU,620
136
151
  uncountable/types/units.py,sha256=_kZ7KkXIbRiY2fOdkTsbJBpWRah5TCC2WWiG05e-1DA,565
137
152
  uncountable/types/users.py,sha256=SUjNHBDcImKnnE7IN096Wfr1fmjNjCkQ7yQgKUPffz8,588
@@ -143,12 +158,13 @@ uncountable/types/api/batch/execute_batch_load_async.py,sha256=dcdGFibO8fUDpC__X
143
158
  uncountable/types/api/chemical/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
144
159
  uncountable/types/api/chemical/convert_chemical_formats.py,sha256=COGzkfpTL_Ermg2cbasoVKGAxDAtJaTFay18IZtrWCA,1305
145
160
  uncountable/types/api/entity/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
146
- uncountable/types/api/entity/create_entities.py,sha256=fJn6mgRfPjmt_fFd4IjsaxnXJtbP6fyxVSidprC3zxE,1550
147
- uncountable/types/api/entity/create_entity.py,sha256=KT-V2ePz-V1aPrKbkVhuR7tb0G2SfAn7ug6C3ZJCJAs,1720
161
+ uncountable/types/api/entity/create_entities.py,sha256=vzo5hS1qcmjQdfyCMarSu8MRcRGSiholOVSCfjXlA1k,1703
162
+ uncountable/types/api/entity/create_entity.py,sha256=ausozCQ3qPM9YUQ87bOTCKOm-zkhn4CSLJr9jLc9n2U,1873
148
163
  uncountable/types/api/entity/get_entities_data.py,sha256=XjrJGZucIn1TYUlDLRnRA0JTQw-vXHIAT-m0H9hk37A,1170
149
164
  uncountable/types/api/entity/list_entities.py,sha256=_bIIZJj3N0E6YiHgqzfCOKxD1fQW6biWJQMp5wIVbBw,1514
150
165
  uncountable/types/api/entity/resolve_entity_ids.py,sha256=AidGpPmI9ATDv0E7vd9LDOl3n3beGxUlRojh5uZrkl4,1086
151
166
  uncountable/types/api/entity/set_values.py,sha256=LcYrKQm5ItYLK1Vx7rRq5i6jkMLDhfEBhF0FD1GowQs,958
167
+ uncountable/types/api/entity/transition_entity_phase.py,sha256=kSRtj7aCReXnS1mWecd0W8N9aC_ahZZxdiQNC6taqF4,1803
152
168
  uncountable/types/api/id_source/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
153
169
  uncountable/types/api/id_source/list_id_source.py,sha256=S_NdAd1FIgMtCfpRK9bs4ZIJH7HdyHWImD1qiPuAKMg,1157
154
170
  uncountable/types/api/id_source/match_id_source.py,sha256=1Mlw0XGBw7UeWxmwelUEi7Co8Oy15jyhetfKG1BFpIM,1145
@@ -164,6 +180,8 @@ uncountable/types/api/outputs/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8
164
180
  uncountable/types/api/outputs/get_output_data.py,sha256=CpYlXNGWWNTiMgDPBRwucSseSrX4gnLuLIp2ljiONrI,2216
165
181
  uncountable/types/api/outputs/get_output_names.py,sha256=Id_ApombSzzFdq5rD4uOfWIKzthic6KBAeyqcrhsx18,1086
166
182
  uncountable/types/api/outputs/resolve_output_conditions.py,sha256=XZqUseXcGhApHmPm-2u7a37Y4blLRxoPoLhvYlBfCpI,1799
183
+ uncountable/types/api/permissions/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
184
+ uncountable/types/api/permissions/set_core_permissions.py,sha256=jn70a4sWf45cv1OPkrNb1UBSv4atifL-VTCZB8DK3zY,2550
167
185
  uncountable/types/api/project/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
168
186
  uncountable/types/api/project/get_projects.py,sha256=dMPq8CHxE4k1Vs42TmC4dp9b1jYp0TPlkICacAqrwXQ,1235
169
187
  uncountable/types/api/project/get_projects_data.py,sha256=HtUI5YN7S24v7o2VvNBWZkYFnGjFqJzBNoV0ojRx39E,1491
@@ -172,22 +190,25 @@ uncountable/types/api/recipe_links/create_recipe_link.py,sha256=1Ok6XMGFKBIPV-uR
172
190
  uncountable/types/api/recipe_metadata/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
173
191
  uncountable/types/api/recipe_metadata/get_recipe_metadata_data.py,sha256=el6Pn5XqExX66ZEEHM8CHPxnyXSMZPdfdvLBz86sAVY,1267
174
192
  uncountable/types/api/recipes/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
175
- uncountable/types/api/recipes/associate_recipe_as_input.py,sha256=Mo-J2DgwZpbzjS-8pOBvX2VuRfGqnboJXMvFyIzwiPs,880
193
+ uncountable/types/api/recipes/associate_recipe_as_input.py,sha256=88a2lirEgrodyyE6og0oYtkGAWih2uJCZRmy45kTBow,976
176
194
  uncountable/types/api/recipes/associate_recipe_as_lot.py,sha256=bTYjbnY3B7GKz4MV4UGn7vPjaqMkAfUTio8872d4iws,955
177
- uncountable/types/api/recipes/create_recipe.py,sha256=L45JexXNo8iUxBI081lz6K1GGLFL3OSo-QPg1EejL-g,1340
195
+ uncountable/types/api/recipes/create_recipe.py,sha256=Ni00efkcPkQ3WTIgDHzkfu1qoc52ReV9VT0wwwPOT4g,1364
178
196
  uncountable/types/api/recipes/create_recipes.py,sha256=qwIYa8hfcjY7_VOFt9lxmVtJ-HOJqQN3GDNSbZsRCZU,1544
179
- uncountable/types/api/recipes/get_curve.py,sha256=lF8MDmBfxm_cIuDxhE80viSFNbcPEkgYkadNFeuI5e4,854
197
+ uncountable/types/api/recipes/disassociate_recipe_as_input.py,sha256=L25fpiK1Y5PByPVVgsZy9t4podz3xSSLIwKHj8CUrSg,913
198
+ uncountable/types/api/recipes/edit_recipe_inputs.py,sha256=pTw606AgLhb-oJjfj1WPyEcJ4B0tgZsvEKeqP5VZ1gY,3281
199
+ uncountable/types/api/recipes/get_curve.py,sha256=UIWfpqtU5sQokaxwYfQFNFl6HMyzWEF_Sjd8UMz0U88,939
180
200
  uncountable/types/api/recipes/get_recipe_calculations.py,sha256=eQmkdZzCEuq8S2f_kf_7GPvDLX1pTnY1CRmkK0SkMCI,1472
181
201
  uncountable/types/api/recipes/get_recipe_links.py,sha256=hk5dfQjv7yU2r-S9b8vwWEJLPHqU0-M6SFiTLMR3fVk,985
182
202
  uncountable/types/api/recipes/get_recipe_names.py,sha256=uCpXZq5oWjr9a_Vf-yYPaVS72XOlLHgAlju6KHeQ3UA,986
183
203
  uncountable/types/api/recipes/get_recipe_output_metadata.py,sha256=L9s2ykPP4pd02Pc98LDisY8bgV8CToS6t6fXKTWqGRw,1464
184
- uncountable/types/api/recipes/get_recipes_data.py,sha256=dOKokz6rJp3AiqNrF8rAZFlmJSs3ejdNIJhwKw0Utr0,5317
204
+ uncountable/types/api/recipes/get_recipes_data.py,sha256=wAmS28Nmc_tlP72XgrFMaj1y_yhvfgYbGw55wwERG_w,5388
185
205
  uncountable/types/api/recipes/set_recipe_inputs.py,sha256=lFVfv-o_O5wHuMZdH63qlG4exFTlJM078oSAtb3XNxA,1426
186
206
  uncountable/types/api/recipes/set_recipe_metadata.py,sha256=Ba6ttd1JuS_Ypt-KpckSviWtOcQ-OTdTEJiaSYyoQL8,933
187
207
  uncountable/types/api/recipes/set_recipe_outputs.py,sha256=QYq39TNchQ80ET1C77OE9fwhbu_HmIoEDmrQJHkkCu0,1609
208
+ uncountable/types/api/recipes/set_recipe_tags.py,sha256=U710hgq9-t6QZGRB-ZGHskpt4iXwYEjIRb67eh3P518,2453
188
209
  uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
189
210
  uncountable/types/api/triggers/run_trigger.py,sha256=9m9M8-nlGB_sAU2Qm2lWugp4h4Osqj6QpjNfU8osd1U,901
190
- UncountablePythonSDK-0.0.20.dist-info/METADATA,sha256=f4wrIC_HXVhzfDHlYgdFRiVdRwHtvNxie_Q91iYHhDU,1551
191
- UncountablePythonSDK-0.0.20.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
192
- UncountablePythonSDK-0.0.20.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
193
- UncountablePythonSDK-0.0.20.dist-info/RECORD,,
211
+ UncountablePythonSDK-0.0.22.dist-info/METADATA,sha256=o1sddgkTqesJ-3NQ_fm1xSgW1vj8bV-PAXnFW7g6-Hs,1613
212
+ UncountablePythonSDK-0.0.22.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
213
+ UncountablePythonSDK-0.0.22.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
214
+ UncountablePythonSDK-0.0.22.dist-info/RECORD,,
@@ -0,0 +1,36 @@
1
+ from decimal import Decimal
2
+ from uncountable.core import AuthDetailsApiKey, Client
3
+ from uncountable.core import AsyncBatchProcessor
4
+ from uncountable.types import (
5
+ recipe_metadata,
6
+ )
7
+ from uncountable.types.identifier import IdentifierKeyBatchReference
8
+ from uncountable.types.recipe_identifiers import (
9
+ RecipeIdentifierEditableName,
10
+ RecipeIdentifiers,
11
+ )
12
+
13
+
14
+ client = Client(
15
+ base_url="https://app.uncountable.com",
16
+ auth_details=AuthDetailsApiKey(
17
+ api_id="X",
18
+ api_secret_key="X",
19
+ ),
20
+ )
21
+ batch_loader = AsyncBatchProcessor(client=client)
22
+ recipe_identifiers: RecipeIdentifiers = []
23
+ recipe_identifiers.append(
24
+ RecipeIdentifierEditableName(editable_name="My recipe from API")
25
+ )
26
+ req = batch_loader.create_recipe(
27
+ material_family_id=1, workflow_id=1, identifiers=recipe_identifiers
28
+ )
29
+ created_recipe_reference = req.batch_reference
30
+ batch_loader.set_recipe_metadata(
31
+ recipe_key=IdentifierKeyBatchReference(reference=created_recipe_reference),
32
+ recipe_metadata=[
33
+ recipe_metadata.MetadataValue(metadata_id=7, value_numeric=Decimal(38))
34
+ ],
35
+ )
36
+ job_id = batch_loader.send()
@@ -0,0 +1,19 @@
1
+ import os
2
+ from pprint import pprint
3
+
4
+ from uncountable import AuthDetailsApiKey, Client, MediaFileUpload
5
+
6
+ client = Client(
7
+ base_url="http://localhost:5000",
8
+ auth_details=AuthDetailsApiKey(
9
+ api_id=os.environ["UNC_API_ID"],
10
+ api_secret_key=os.environ["UNC_API_SECRET_KEY"],
11
+ ),
12
+ )
13
+ uploaded = client.upload_files(
14
+ file_uploads=[
15
+ MediaFileUpload(path="/my/file/path.doc"),
16
+ MediaFileUpload(path="/my/file/path2.doc"),
17
+ ]
18
+ )
19
+ pprint(uploaded)
@@ -14,7 +14,7 @@ from pkgs.type_spec import builder
14
14
  from ...argument_parser import CachedParser
15
15
  from ..emit_typescript_util import ts_name
16
16
  from ..util import rewrite_file
17
- from .emit_typescript import emit_action_definitions
17
+ from .emit_typescript import ActionDefinitionWithArgument, emit_action_definitions
18
18
 
19
19
  key_name = "name"
20
20
  key_icon = "icon"
@@ -61,11 +61,11 @@ def get_action_registry_files_info() -> list[ActionRegistryFileInfo]:
61
61
 
62
62
  def main() -> None:
63
63
  files_info = get_action_registry_files_info()
64
- action_definitions: defaultdict[str, list[actions_registry_t.ActionDefinition]] = (
64
+ action_definitions: defaultdict[str, list[ActionDefinitionWithArgument]] = (
65
65
  defaultdict(list)
66
66
  )
67
- all_action_definitions: list[actions_registry_t.ActionDefinition] = []
68
-
67
+ all_action_definitions: list[actions_registry_t.ActionDefinitionInternal] = []
68
+ action_definitions_with_arguments_list: list[ActionDefinitionWithArgument] = []
69
69
  for file_info in files_info:
70
70
  in_action_definitions = action_definition_parser.parse_yaml_file(
71
71
  file_info.filepath
@@ -79,29 +79,41 @@ def main() -> None:
79
79
  modules.append(file_info.filename)
80
80
 
81
81
  module_str = "_".join(modules)
82
- all_action_definitions.append(
83
- actions_registry_t.ActionDefinition(
84
- name=definition.name,
85
- short_description=definition.short_description,
86
- description=definition.description,
87
- icon=definition.icon,
82
+ action_definition = actions_registry_t.ActionDefinitionInternal(
83
+ name=definition.name,
84
+ short_description=definition.short_description,
85
+ description=definition.description,
86
+ icon=definition.icon,
87
+ ref_name=ref_name,
88
+ module=actions_registry_t.ActionsRegistryModule(
89
+ ts_name(module_str, name_case=builder.NameCase.convert)
90
+ ),
91
+ visibility_scope=[
92
+ actions_registry_t.ActionDefinitionVisibilityScope(item)
93
+ for item in definition.visibility_scope
94
+ ]
95
+ if definition.visibility_scope is not None
96
+ else None,
97
+ )
98
+ action_definitions_with_arguments_list.append(
99
+ ActionDefinitionWithArgument(
100
+ module=module_str,
88
101
  ref_name=ref_name,
89
- module=actions_registry_t.ActionsRegistryModule(
90
- ts_name(module_str, name_case=builder.NameCase.convert)
91
- ),
92
- visibility_scope=[
93
- actions_registry_t.ActionDefinitionVisibilityScope(item)
94
- for item in definition.visibility_scope
95
- ]
96
- if definition.visibility_scope is not None
97
- else None,
102
+ arguments=definition.arguments,
103
+ definition=action_definition,
98
104
  )
99
105
  )
100
- all_action_definitions = sorted(
101
- all_action_definitions, key=lambda item: (item.module, item.ref_name)
106
+ all_action_definitions.append(action_definition)
107
+ action_definitions_with_arguments_list = sorted(
108
+ action_definitions_with_arguments_list,
109
+ key=lambda item: (item.module, item.ref_name),
102
110
  )
103
- for action_definition in all_action_definitions:
104
- action_definitions[action_definition.module].append(action_definition)
111
+
112
+ for action_definition_with_argument in action_definitions_with_arguments_list:
113
+ action_definitions[action_definition_with_argument.module].append(
114
+ action_definition_with_argument
115
+ )
116
+
105
117
  ts_content = emit_action_definitions(action_definitions)
106
118
  rewrite_file(
107
119
  "main/site/js/materials/base/actions_registry/action_definitions.tsx",
@@ -1,17 +1,34 @@
1
1
  import io
2
2
  from collections import defaultdict
3
+ from dataclasses import dataclass
3
4
 
4
5
  from main.base.types import actions_registry_t
5
6
 
6
7
  from ...type_spec import builder
7
- from ..emit_typescript_util import INDENT, MODIFY_NOTICE, ts_name
8
+ from ..emit_typescript_util import (
9
+ INDENT,
10
+ MODIFY_NOTICE,
11
+ resolve_namespace_ref,
12
+ ts_name,
13
+ ts_type_name,
14
+ )
8
15
  from ..util import encode_common_string
9
16
 
10
17
 
11
- def _action_symbol_name(action_definition: actions_registry_t.ActionDefinition) -> str:
18
+ def _action_symbol_name(
19
+ action_definition: actions_registry_t.ActionDefinitionInternal,
20
+ ) -> str:
12
21
  return f"{ts_name(action_definition.ref_name, name_case=builder.NameCase.convert)}"
13
22
 
14
23
 
24
+ def _action_type_name(ref_name: str) -> str:
25
+ return f"{ts_type_name(ref_name)}"
26
+
27
+
28
+ def _action_namespace_name(name: str) -> str:
29
+ return f"{resolve_namespace_ref(builder.SpecNamespace(name=name))}"
30
+
31
+
15
32
  def _action_module_name_base(module: str) -> str:
16
33
  return f"{ts_name(module, name_case=builder.NameCase.convert)}"
17
34
 
@@ -24,24 +41,54 @@ def _action_module_name(module: str) -> str:
24
41
  return f"ActionsRegistryT.ActionsRegistryModule.{_action_module_name_base(module)}"
25
42
 
26
43
 
44
+ @dataclass(kw_only=True)
45
+ class ActionDefinitionWithArgument:
46
+ module: str
47
+ ref_name: str
48
+ arguments: str | None
49
+ definition: actions_registry_t.ActionDefinitionInternal
50
+
51
+
52
+ def _emit_imports(
53
+ action_definitions: defaultdict[str, list[ActionDefinitionWithArgument]],
54
+ ) -> str:
55
+ out = io.StringIO()
56
+ namespaces = set()
57
+ for definitions in action_definitions.values():
58
+ for definition in definitions:
59
+ if definition.arguments is not None:
60
+ argument_parts = definition.arguments.split(".")
61
+ namespace = argument_parts[0]
62
+ namespaces.add(namespace)
63
+ namespaces_to_import = ", ".join(
64
+ sorted([f"type {_action_namespace_name(item)}" for item in list(namespaces)])
65
+ )
66
+ out.write(
67
+ f'import {{ ActionsRegistryT, {namespaces_to_import} }} from "unc_mat/types"\n\n'
68
+ )
69
+ out.write(MODIFY_NOTICE)
70
+ return out.getvalue()
71
+
72
+
27
73
  def emit_action_definitions(
28
- action_definitions: defaultdict[str, list[actions_registry_t.ActionDefinition]],
74
+ action_definitions: defaultdict[str, list[ActionDefinitionWithArgument]],
29
75
  ) -> str:
30
76
  out = io.StringIO()
31
77
  out.write(MODIFY_NOTICE)
32
78
  out.write("\n")
33
- out.write('import { ActionsRegistryT } from "unc_mat/types"\n\n')
34
- out.write(MODIFY_NOTICE)
79
+ out.write(_emit_imports(action_definitions))
35
80
  modules = []
36
81
  for key, values in action_definitions.items():
37
82
  out.write(MODIFY_NOTICE)
38
83
  modules.append(key)
39
84
  out.write(f"export const {_action_module_name_obj(key)} = {{\n")
40
- for action_definition in values:
85
+ for item in values:
41
86
  out.write(MODIFY_NOTICE)
42
- out.write(_emit_action_definition(action_definition, INDENT))
87
+ out.write(_emit_action_definition(item.definition, item.arguments, INDENT))
43
88
  out.write("}\n")
44
89
 
90
+ out.write(MODIFY_NOTICE)
91
+ out.write("\n")
45
92
  out.write(MODIFY_NOTICE)
46
93
  out.write("\n")
47
94
  out.write("export const actionDefinitions = {\n")
@@ -58,12 +105,27 @@ def emit_action_definitions(
58
105
  return out.getvalue()
59
106
 
60
107
 
108
+ def _get_argument_type(arguments: str | None) -> str | None:
109
+ if arguments is None:
110
+ return None
111
+ argument_parts = arguments.split(".")
112
+ namespace = argument_parts[0]
113
+ type_name = argument_parts[1]
114
+ if namespace is not None and type_name is not None:
115
+ return f"{_action_namespace_name(namespace)}.{type_name}"
116
+ return None
117
+
118
+
61
119
  def _emit_action_definition(
62
- action_definition: actions_registry_t.ActionDefinition, indent: str
120
+ action_definition: actions_registry_t.ActionDefinitionInternal,
121
+ arguments: str | None,
122
+ indent: str,
63
123
  ) -> str:
64
124
  out = io.StringIO()
65
125
 
66
126
  sub_indent = indent + INDENT
127
+ argument_type = _get_argument_type(arguments)
128
+ argument_type = f"<{argument_type}>" if argument_type is not None else ""
67
129
  out.write(f"{indent}{_action_symbol_name(action_definition)}: {{\n")
68
130
  out.write(f"{sub_indent}name: {encode_common_string(action_definition.name)},\n")
69
131
  if action_definition.icon is not None:
@@ -85,7 +147,7 @@ def _emit_action_definition(
85
147
  out.write(
86
148
  f"{sub_indent}visibilityScope: {_emit_visibility_scope(action_definition.visibility_scope)},\n"
87
149
  )
88
- out.write(f"{indent}}},\n")
150
+ out.write(f"{indent}}} as ActionsRegistryT.ActionDefinition{argument_type},\n")
89
151
  return out.getvalue()
90
152
 
91
153