diff --git a/.changeset/clever-dragons-make.md b/.changeset/clever-dragons-make.md new file mode 100644 index 000000000..c3ded58e5 --- /dev/null +++ b/.changeset/clever-dragons-make.md @@ -0,0 +1,19 @@ +--- +'@example/openapi-ts-tanstack-angular-query-experimental': patch +'@example/openapi-ts-tanstack-svelte-query': patch +'@example/openapi-ts-tanstack-react-query': patch +'@example/openapi-ts-tanstack-vue-query': patch +'@example/openapi-ts-angular-common': patch +'@example/openapi-ts-pinia-colada': patch +'@example/openapi-ts-angular': patch +'@example/openapi-ts-fastify': patch +'@example/openapi-ts-ofetch': patch +'@example/openapi-ts-openai': patch +'@example/openapi-ts-axios': patch +'@example/openapi-ts-fetch': patch +'@example/openapi-ts-next': patch +'@example/openapi-ts-ky': patch +'@hey-api/openapi-ts': patch +--- + +fix: return complete event in SSE async iterator (#2641) diff --git a/examples/openapi-ts-angular-common/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-angular-common/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-angular-common/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-angular-common/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-angular/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-angular/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-angular/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-angular/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-axios/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-axios/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-axios/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-axios/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-fastify/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-fastify/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-fastify/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-fastify/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-fetch/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-fetch/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-fetch/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-fetch/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-ky/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-ky/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-ky/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-ky/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-next/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-next/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-next/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-next/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-ofetch/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-ofetch/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-ofetch/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-ofetch/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-openai/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-openai/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-openai/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-openai/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-pinia-colada/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-pinia-colada/src/client/core/serverSentEvents.gen.ts index 372e50cc2..2061fc2fc 100644 --- a/examples/openapi-ts-pinia-colada/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-pinia-colada/src/client/core/serverSentEvents.gen.ts @@ -202,15 +202,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, - id: lastEventId, + id: lastEventId + } + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay }) if (dataLines.length) { - yield data as any + yield baseSseEvent as any } } } diff --git a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-tanstack-react-query/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-tanstack-react-query/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-tanstack-react-query/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-tanstack-react-query/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-tanstack-svelte-query/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-tanstack-svelte-query/src/client/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/examples/openapi-ts-tanstack-svelte-query/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-tanstack-svelte-query/src/client/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/examples/openapi-ts-tanstack-vue-query/src/client/core/serverSentEvents.gen.ts b/examples/openapi-ts-tanstack-vue-query/src/client/core/serverSentEvents.gen.ts index 372e50cc2..2061fc2fc 100644 --- a/examples/openapi-ts-tanstack-vue-query/src/client/core/serverSentEvents.gen.ts +++ b/examples/openapi-ts-tanstack-vue-query/src/client/core/serverSentEvents.gen.ts @@ -202,15 +202,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, - id: lastEventId, + id: lastEventId + } + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay }) if (dataLines.length) { - yield data as any + yield baseSseEvent as any } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/schema-unknown/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-api-key/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-basic/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/security-oauth2/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-base-path/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers-host/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/servers/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/transforms-read-write/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/body-response-text-plain/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/internal-name-conflict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-api-key/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-api-key/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-api-key/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-api-key/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-http-bearer/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-http-bearer/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-http-bearer/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-http-bearer/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-oauth2/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-oauth2/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-oauth2/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-oauth2/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-open-id-connect/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-open-id-connect/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-open-id-connect/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/security-open-id-connect/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/servers/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-all-of/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-any-of-null/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-array/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-array/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-array/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-array/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transformers-recursive/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transforms-read-write/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transforms-read-write/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transforms-read-write/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/transforms-read-write/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/body-response-text-plain/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/body-response-text-plain/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/body-response-text-plain/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/body-response-text-plain/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-number/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-strict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/base-url-string/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/clean-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/core/serverSentEvents.gen.ts index bed668ef7..59102673d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/import-file-extension-ts/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-optional/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/sdk-client-required/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts index d73aa0f30..6f32b3c8c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-angular/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-number/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-strict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/base-url-string/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/clean-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/core/serverSentEvents.gen.ts index bed668ef7..59102673d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/import-file-extension-ts/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-optional/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/sdk-client-required/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts index d73aa0f30..6f32b3c8c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-axios/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-number/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-strict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/base-url-string/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/clean-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/core/serverSentEvents.gen.ts index bed668ef7..59102673d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/import-file-extension-ts/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-optional/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/sdk-client-required/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts index d73aa0f30..6f32b3c8c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-fetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/core/serverSentEvents.gen.ts index bed668ef7..59102673d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts index d73aa0f30..6f32b3c8c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-number/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-strict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/base-url-string/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/clean-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/core/serverSentEvents.gen.ts index bed668ef7..59102673d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/import-file-extension-ts/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-optional/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/sdk-client-required/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts index d73aa0f30..6f32b3c8c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-next/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-number/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-strict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/base-url-string/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/clean-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/core/serverSentEvents.gen.ts index bed668ef7..59102673d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/import-file-extension-ts/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-optional/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/sdk-client-required/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts index d73aa0f30..6f32b3c8c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-nuxt/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-number/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-strict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/base-url-string/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/clean-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/core/serverSentEvents.gen.ts index bed668ef7..59102673d 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/import-file-extension-ts/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-optional/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/sdk-client-required/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts index d73aa0f30..6f32b3c8c 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ofetch/tsconfig-nodenext-sdk/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/content-types/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/content-types/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/content-types/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/content-types/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/headers/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/headers/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/headers/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/headers/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/internal-name-conflict/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/internal-name-conflict/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/internal-name-conflict/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/internal-name-conflict/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/pagination-ref/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/pagination-ref/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/pagination-ref/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/pagination-ref/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false-axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/parameter-explode-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default-class/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@angular/common/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes-instance/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/client-fetch/sdk-nested-classes/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/default/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/instance/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/sdk/throwOnError/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-custom-name/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/typescript/transforms-read-write-ignore/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@pinia/colada/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/angular-query-experimental/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/solid-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/svelte-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/asClass/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/vue-query/name-builder/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-api-key/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-api-key/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-api-key/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-api-key/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-false/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-false/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-false/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-false/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-http-bearer/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-http-bearer/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-http-bearer/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-http-bearer/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-oauth2/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-oauth2/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-oauth2/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-oauth2/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-open-id-connect/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-open-id-connect/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-open-id-connect/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/security-open-id-connect/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/servers/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-angular/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-angular/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-angular/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-angular/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-axios/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-axios/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-axios/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-axios/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-fetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-fetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-fetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-fetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-next/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-next/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-next/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-next/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-nuxt/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-nuxt/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-nuxt/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-nuxt/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-ofetch/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-ofetch/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-ofetch/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/sse-ofetch/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-all-of/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-any-of-null/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-array/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-array/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-array/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-array/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transformers-recursive/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transforms-read-write/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transforms-read-write/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transforms-read-write/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/transforms-read-write/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/main/test/__snapshots__/plugins/@tanstack/meta/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/class/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/class/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/class/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/class/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/flat/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/flat/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/flat/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/flat/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/instance/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/instance/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/instance/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/sdks/__snapshots__/method-class-conflict/instance/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/sdks/__snapshots__/opencode/flat/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/sdks/__snapshots__/opencode/flat/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/sdks/__snapshots__/opencode/flat/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/sdks/__snapshots__/opencode/flat/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts-tests/sdks/__snapshots__/opencode/grouped/core/serverSentEvents.gen.ts b/packages/openapi-ts-tests/sdks/__snapshots__/opencode/grouped/core/serverSentEvents.gen.ts index f8fd78e28..2d5209bc7 100644 --- a/packages/openapi-ts-tests/sdks/__snapshots__/opencode/grouped/core/serverSentEvents.gen.ts +++ b/packages/openapi-ts-tests/sdks/__snapshots__/opencode/grouped/core/serverSentEvents.gen.ts @@ -219,15 +219,19 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const baseSseEvent = { data, event: eventName, id: lastEventId, + }; + + onSseEvent?.({ + ...baseSseEvent, retry: retryDelay, }); if (dataLines.length) { - yield data as any; + yield baseSseEvent as any; } } } diff --git a/packages/openapi-ts/src/plugins/@hey-api/client-core/__tests__/serverSentEvents.test.ts b/packages/openapi-ts/src/plugins/@hey-api/client-core/__tests__/serverSentEvents.test.ts index 26802d936..213b39edb 100644 --- a/packages/openapi-ts/src/plugins/@hey-api/client-core/__tests__/serverSentEvents.test.ts +++ b/packages/openapi-ts/src/plugins/@hey-api/client-core/__tests__/serverSentEvents.test.ts @@ -54,13 +54,15 @@ describe('createSseClient', () => { const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual([{ foo: 'bar' }]); - expect(onEvent).toHaveBeenCalledWith({ + const expectedEvent = { data: { foo: 'bar' }, event: 'test', id: '1', retry: 3000, - }); + }; + + expect(result).toEqual([expectedEvent]); + expect(onEvent).toHaveBeenCalledWith(expectedEvent); }); it('falls back to raw string if not valid JSON', async () => { @@ -73,7 +75,9 @@ describe('createSseClient', () => { const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual(['hello']); + expect(result).toEqual([ + { data: 'hello', event: undefined, id: undefined, retry: 3000 }, + ]); }); it('calls onSseError when response not ok', async () => { @@ -137,7 +141,11 @@ describe('createSseClient', () => { const { stream } = createSseClient({ url: 'http://localhost/sse' }); const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual([1, 2, 3]); + expect(result).toEqual([ + { data: 1, event: undefined, id: undefined, retry: 3000 }, + { data: 2, event: undefined, id: undefined, retry: 3000 }, + { data: 3, event: undefined, id: undefined, retry: 3000 }, + ]); }); it('handles partial chunks correctly', async () => { @@ -149,7 +157,9 @@ describe('createSseClient', () => { const { stream } = createSseClient({ url: 'http://localhost/sse' }); const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual(['partial']); + expect(result).toEqual([ + { data: 'partial', event: undefined, id: undefined, retry: 3000 }, + ]); }); it('sets Last-Event-ID header on reconnect', async () => { @@ -196,7 +206,10 @@ describe('createSseClient', () => { const iter = stream[Symbol.asyncIterator](); const first = await iter.next(); - expect(first).toEqual({ done: false, value: 'stop' }); + expect(first).toEqual({ + done: false, + value: { data: 'stop', event: undefined, id: undefined, retry: 3000 }, + }); controller.abort(); const second = await iter.next(); @@ -216,7 +229,11 @@ describe('createSseClient', () => { const { stream } = createSseClient({ url: 'http://localhost/sse' }); const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual([{ foo: 1 }, 'bar', { baz: 2 }]); + expect(result).toEqual([ + { data: { foo: 1 }, event: undefined, id: undefined, retry: 3000 }, + { data: 'bar', event: undefined, id: undefined, retry: 3000 }, + { data: { baz: 2 }, event: undefined, id: undefined, retry: 3000 }, + ]); }); it('passes custom headers', async () => { @@ -253,7 +270,9 @@ describe('createSseClient', () => { const { stream } = createSseClient({ url: 'http://localhost/sse' }); const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual([{ foo: 'bar' }]); + expect(result).toEqual([ + { data: { foo: 'bar' }, event: undefined, id: undefined, retry: 3000 }, + ]); }); it('handles empty stream', async () => { @@ -286,7 +305,9 @@ describe('createSseClient', () => { for await (const ev of stream) result.push(ev); expect(onError).toHaveBeenCalled(); - expect(result).toEqual(['ok']); + expect(result).toEqual([ + { data: 'ok', event: undefined, id: undefined, retry: 0 }, + ]); }); it('ignores invalid retry values', async () => { @@ -302,7 +323,12 @@ describe('createSseClient', () => { }); const iter = stream[Symbol.asyncIterator](); const ev = await iter.next(); - expect(ev.value).toBe('x'); + expect(ev.value).toEqual({ + data: 'x', + event: undefined, + id: undefined, + retry: 3000, + }); expect(onEvent.mock.calls[0]![0].retry).toBe(3000); // default }); @@ -343,7 +369,12 @@ describe('createSseClient', () => { }); const iter = stream[Symbol.asyncIterator](); const ev = await iter.next(); - expect(ev.value).toBe('{"foo": unquoted}'); + expect(ev.value).toEqual({ + data: '{"foo": unquoted}', + event: undefined, + id: undefined, + retry: 3000, + }); expect(onError).not.toHaveBeenCalled(); }); @@ -428,7 +459,12 @@ describe('createSseClient', () => { const iter = stream[Symbol.asyncIterator](); const first = await iter.next(); - expect(first.value).toBe('x'); + expect(first.value).toEqual({ + data: 'x', + event: undefined, + id: undefined, + retry: 3000, + }); controller.abort(); const second = await iter.next(); @@ -507,7 +543,12 @@ describe('createSseClient', () => { const ev = await iter.next(); - expect(ev.value).toBe('ok'); + expect(ev.value).toEqual({ + data: 'ok', + event: undefined, + id: undefined, + retry: 10, + }); expect(onError).toHaveBeenCalledTimes(2); expect(attempt).toBe(3); }); @@ -552,7 +593,9 @@ describe('createSseClient', () => { const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual([{ foo: 'bar' }]); + expect(result).toEqual([ + { data: { foo: 'bar' }, event: undefined, id: undefined, retry: 3000 }, + ]); expect(validator).toHaveBeenCalledTimes(1); }); @@ -574,7 +617,9 @@ describe('createSseClient', () => { const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual([{ doubled: 4 }]); + expect(result).toEqual([ + { data: { doubled: 4 }, event: undefined, id: undefined, retry: 3000 }, + ]); expect(transformer).toHaveBeenCalledTimes(1); }); @@ -625,7 +670,9 @@ describe('createSseClient', () => { const result: any[] = []; for await (const ev of stream) result.push(ev); - expect(result).toEqual(['rawstring']); + expect(result).toEqual([ + { data: 'rawstring', event: undefined, id: undefined, retry: 3000 }, + ]); expect(validator).not.toHaveBeenCalled(); expect(transformer).not.toHaveBeenCalled(); }); diff --git a/packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/serverSentEvents.ts b/packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/serverSentEvents.ts index 07cff3c3f..01dcb7c85 100644 --- a/packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/serverSentEvents.ts +++ b/packages/openapi-ts/src/plugins/@hey-api/client-core/bundle/serverSentEvents.ts @@ -217,15 +217,17 @@ export const createSseClient = ({ } } - onSseEvent?.({ + const sseEvent = { data, event: eventName, id: lastEventId, retry: retryDelay, - }); + }; + + onSseEvent?.(sseEvent); if (dataLines.length) { - yield data as any; + yield sseEvent as any; } } }