diff --git a/src/Actions/GenerateCliOutput.php b/src/Actions/GenerateCliOutput.php index d1fa30d..9ee99ff 100644 --- a/src/Actions/GenerateCliOutput.php +++ b/src/Actions/GenerateCliOutput.php @@ -99,8 +99,9 @@ public function __invoke(Collection $models, bool $global = false): string $plural = Str::plural($name); $entry .= "{$this->indent}export type $plural = {$name}[]\n"; $entry .= "{$this->indent}export interface {$name}Results extends api.MetApiResults { data: $plural }\n"; + $entry .= "{$this->indent}export interface {$name}Result extends api.MetApiResults { data: $name }\n"; $entry .= "{$this->indent}export interface {$name}MetApiData extends api.MetApiData { data: $name }\n"; - $entry .= "{$this->indent}export interface {$name}Response extends MetApiResponse { data: {$name}MetApiData }\n\n"; + $entry .= "{$this->indent}export interface {$name}Response extends api.MetApiResponse { data: {$name}MetApiData }\n\n"; $this->output .= $entry; }); diff --git a/src/ModelInterface.php b/src/ModelInterface.php index 95b0937..31ba651 100644 --- a/src/ModelInterface.php +++ b/src/ModelInterface.php @@ -270,8 +270,9 @@ private function getCode(TypescriptInterface $interface): string $plural = Str::plural($interface->name); $code .= "{$this->space}export type $plural = {$interface->name}[]\n"; $code .= "{$this->space}export interface {$interface->name}Results extends api.MetApiResults { data: $plural }\n"; + $code .= "{$this->space}export interface {$interface->name}Result extends api.MetApiResults { data: {$interface->name} }\n"; $code .= "{$this->space}export interface {$interface->name}MetApiData extends api.MetApiData { data: {$interface->name} }\n"; - $code .= "{$this->space}export interface {$interface->name}Response extends MetApiResponse { data: {$interface->name}MetApiData }\n\n"; + $code .= "{$this->space}export interface {$interface->name}Response extends api.MetApiResponse { data: {$interface->name}MetApiData }\n\n"; return $code; }