diff --git a/api-client/deno.json b/api-client/deno.json index 7a4db86..7935f8a 100644 --- a/api-client/deno.json +++ b/api-client/deno.json @@ -3,7 +3,7 @@ "@preact/signals": "npm:@preact/signals@^2.5.1" }, "name": "@01edu/api-client", - "version": "0.1.6", + "version": "0.1.7", "license": "MIT", "exports": { ".": "./mod.ts" }, "compilerOptions": { diff --git a/api-client/mod.ts b/api-client/mod.ts index 60b6f1c..059f09c 100644 --- a/api-client/mod.ts +++ b/api-client/mod.ts @@ -168,7 +168,7 @@ export const makeClient = (baseUrl = ''): { reset: () => void fetch: ( input?: HandlerIO[0] | undefined, - options?: Options | undefined, + headers?: HeadersInit | undefined, ) => Promise at: number } @@ -232,7 +232,7 @@ export const makeClient = (baseUrl = ''): { $.peek().controller?.abort() $.value = { pending: 0 } }, - fetch: async (input, opt) => { + fetch: async (input, headers) => { const prev = $.peek() try { const controller = new AbortController() @@ -242,7 +242,7 @@ export const makeClient = (baseUrl = ''): { const promise = fetcher(input, { replacer, signal, - headers: opt?.headers, + headers, }) $.value = { pending: Date.now(), @@ -279,7 +279,10 @@ export const makeClient = (baseUrl = ''): { } as RequestState & { $: Signal> reset: () => void - fetch: (input?: Input, options?: Options | undefined) => Promise + fetch: ( + input?: Input, + headers?: HeadersInit | undefined, + ) => Promise at: number } } diff --git a/api/deno.json b/api/deno.json index 9a89c8d..ed534c3 100644 --- a/api/deno.json +++ b/api/deno.json @@ -4,7 +4,7 @@ "@std/http": "jsr:@std/http@^1.0.22" }, "name": "@01edu/api", - "version": "0.1.4", + "version": "0.1.5", "license": "MIT", "exports": { "./context": "./context.ts", diff --git a/api/log.ts b/api/log.ts index ca3afa9..f31be9b 100644 --- a/api/log.ts +++ b/api/log.ts @@ -229,7 +229,7 @@ export const logger = async ({ span_id: span, event_name: event, attributes: props, - timestamp: now(), + timestamp: now() * 1000, service_version: version, service_instance_id: startTime.toString(), }