From 6a79ac8f3863c2492ef5f2baa103a5f40ff303a5 Mon Sep 17 00:00:00 2001 From: Kevin Franklin Kim Date: Fri, 8 Nov 2024 14:22:22 +0100 Subject: [PATCH] fix: string union type --- example/basic/client/src/service-vo.ts | 1 + example/errors/client/src/service-vo.ts | 4 +++- example/nullable/client/src/service-vo.ts | 1 + example/time/client/src/service-client.ts | 1 - example/time/client/src/service-vo-service.ts | 3 +-- example/time/client/src/service-vo-time.ts | 2 +- example/union/client/src/app.ts | 2 +- example/union/client/src/service-vo.ts | 4 +++- typescript.go | 8 +------- 9 files changed, 12 insertions(+), 14 deletions(-) diff --git a/example/basic/client/src/service-vo.ts b/example/basic/client/src/service-vo.ts index 9e0a900..260a987 100644 --- a/example/basic/client/src/service-vo.ts +++ b/example/basic/client/src/service-vo.ts @@ -1,6 +1,7 @@ /* eslint:disable */ // Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. import * as github_com_foomo_gotsrpc_v2_example_basic_service from './service-vo'; // ./client/src/service-vo.ts to ./client/src/service-vo.ts + // github.com/foomo/gotsrpc/v2/example/basic/service.Float32Type export enum Float32Type { Float32AType = 1, diff --git a/example/errors/client/src/service-vo.ts b/example/errors/client/src/service-vo.ts index 7d8988a..bd5fb2d 100644 --- a/example/errors/client/src/service-vo.ts +++ b/example/errors/client/src/service-vo.ts @@ -1,8 +1,10 @@ /* eslint:disable */ // Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. import * as github_com_foomo_gotsrpc_v2_example_errors_service_frontend from './service-vo'; // ./client/src/service-vo.ts to ./client/src/service-vo.ts + // github.com/foomo/gotsrpc/v2/example/errors/service/frontend.ErrMulti -export type ErrMulti = (typeof github_com_foomo_gotsrpc_v2_example_errors_service_frontend.ErrMultiA) & (typeof github_com_foomo_gotsrpc_v2_example_errors_service_frontend.ErrMultiB) +export const ErrMulti = { ...github_com_foomo_gotsrpc_v2_example_errors_service_frontend.ErrMultiA, ...github_com_foomo_gotsrpc_v2_example_errors_service_frontend.ErrMultiB } +export type ErrMulti = typeof ErrMulti // github.com/foomo/gotsrpc/v2/example/errors/service/frontend.ErrMultiA export enum ErrMultiA { One = "one", diff --git a/example/nullable/client/src/service-vo.ts b/example/nullable/client/src/service-vo.ts index 35504d5..70e1b15 100644 --- a/example/nullable/client/src/service-vo.ts +++ b/example/nullable/client/src/service-vo.ts @@ -1,6 +1,7 @@ /* eslint:disable */ // Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. import * as github_com_foomo_gotsrpc_v2_example_nullable_service from './service-vo'; // ./client/src/service-vo.ts to ./client/src/service-vo.ts + // github.com/foomo/gotsrpc/v2/example/nullable/service.ACustomType export enum ACustomType { One = "one", diff --git a/example/time/client/src/service-client.ts b/example/time/client/src/service-client.ts index be01655..2d9f803 100644 --- a/example/time/client/src/service-client.ts +++ b/example/time/client/src/service-client.ts @@ -1,7 +1,6 @@ /* eslint:disable */ // Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. import * as github_com_foomo_gotsrpc_v2_example_time_service from './service-vo-service'; // ./client/src/service-client.ts to ./client/src/service-vo-service.ts -import * as time from './service-vo-time'; // ./client/src/service-client.ts to ./client/src/service-vo-time.ts export class ServiceClient { public static defaultEndpoint = "/service"; diff --git a/example/time/client/src/service-vo-service.ts b/example/time/client/src/service-vo-service.ts index a3fdbde..ac60638 100644 --- a/example/time/client/src/service-vo-service.ts +++ b/example/time/client/src/service-vo-service.ts @@ -1,7 +1,6 @@ /* eslint:disable */ // Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. -import * as github_com_foomo_gotsrpc_v2_example_time_service from './service-vo-service'; // ./client/src/service-vo-service.ts to ./client/src/service-vo-service.ts -import * as time from './service-vo-time'; // ./client/src/service-vo-service.ts to ./client/src/service-vo-time.ts + // github.com/foomo/gotsrpc/v2/example/time/service.TimeStruct export interface TimeStruct { time:number; diff --git a/example/time/client/src/service-vo-time.ts b/example/time/client/src/service-vo-time.ts index e771808..ad43eae 100644 --- a/example/time/client/src/service-vo-time.ts +++ b/example/time/client/src/service-vo-time.ts @@ -1,7 +1,7 @@ /* eslint:disable */ // Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. -import * as github_com_foomo_gotsrpc_v2_example_time_service from './service-vo-service'; // ./client/src/service-vo-time.ts to ./client/src/service-vo-service.ts import * as time from './service-vo-time'; // ./client/src/service-vo-time.ts to ./client/src/service-vo-time.ts + // time.Time export interface Time { } diff --git a/example/union/client/src/app.ts b/example/union/client/src/app.ts index 76db3c4..81cd79d 100644 --- a/example/union/client/src/app.ts +++ b/example/union/client/src/app.ts @@ -47,4 +47,4 @@ function assertExhaustive( message: string = 'msg' ): never { throw new Error(message); -} \ No newline at end of file +} diff --git a/example/union/client/src/service-vo.ts b/example/union/client/src/service-vo.ts index fd268f7..f198091 100644 --- a/example/union/client/src/service-vo.ts +++ b/example/union/client/src/service-vo.ts @@ -1,6 +1,7 @@ /* eslint:disable */ // Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT. import * as github_com_foomo_gotsrpc_v2_example_union_service from './service-vo'; // ./client/src/service-vo.ts to ./client/src/service-vo.ts + // github.com/foomo/gotsrpc/v2/example/union/service.InlineStruct export interface InlineStruct extends github_com_foomo_gotsrpc_v2_example_union_service.InlineStructA , github_com_foomo_gotsrpc_v2_example_union_service.InlineStructB { value:string; @@ -19,7 +20,8 @@ export interface InlineStructPtr extends Partial