@@ -275,6 +275,12 @@ async function postJSON(
275275 } ;
276276}
277277
278+ /**
279+ * Creates authorization headers for Firebase Functions requests.
280+ * @param functionsInstance The Firebase Functions service instance.
281+ * @param options Options for the callable function, including AppCheck token settings.
282+ * @return A Promise that resolves a headers map to include in outgoing fetch request.
283+ */
278284async function makeAuthHeaders (
279285 functionsInstance : FunctionsService ,
280286 options : HttpsCallableOptions
@@ -493,6 +499,21 @@ async function streamAtURL(
493499 } ;
494500}
495501
502+ /**
503+ * Creates a ReadableStream that processes a streaming response from a streaming
504+ * callable function that returns data in server-sent event format.
505+ *
506+ * @param reader The underlying reader providing raw response data
507+ * @param resultResolver Callback to resolve the final result when received
508+ * @param resultRejecter Callback to reject with an error if encountered
509+ * @param signal Optional AbortSignal to cancel the stream processing
510+ * @returns A ReadableStream that emits decoded messages from the response
511+ *
512+ * The returned ReadableStream:
513+ * 1. Emits individual messages when "message" data is received
514+ * 2. Resolves with the final result when a "result" message is received
515+ * 3. Rejects with an error if an "error" message is received
516+ */
496517function createResponseStream (
497518 reader : ReadableStreamDefaultReader < Uint8Array > ,
498519 resultResolver : ( value : unknown ) => void ,
0 commit comments