Register the module and its types with the Dagger API.
(self)
| 114 | await dag.current_function_call().return_value(dagger.JSON(output)) |
| 115 | |
| 116 | async def register(self): |
| 117 | """Register the module and its types with the Dagger API.""" |
| 118 | try: |
| 119 | result = await self._typedefs() |
| 120 | output = json.dumps(result) |
| 121 | except TypeError as e: |
| 122 | raise RegistrationError(str(e), e) from e |
| 123 | await anyio.Path(TYPE_DEF_FILE).write_text(output) |
| 124 | |
| 125 | async def _typedefs(self) -> str: # noqa: C901, PLR0912, PLR0915 |
| 126 | if not self._main_name: |