@geekmidas/client 10.0.0-alpha.16 → 10.0.0-alpha.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +53 -14
  2. package/dist/auth-fetcher.cjs +3 -1
  3. package/dist/auth-fetcher.cjs.map +1 -1
  4. package/dist/auth-fetcher.d.cts +2 -1
  5. package/dist/auth-fetcher.d.cts.map +1 -1
  6. package/dist/auth-fetcher.d.mts +2 -1
  7. package/dist/auth-fetcher.d.mts.map +1 -1
  8. package/dist/auth-fetcher.mjs +3 -1
  9. package/dist/auth-fetcher.mjs.map +1 -1
  10. package/dist/fetcher.cjs +6 -1
  11. package/dist/fetcher.cjs.map +1 -1
  12. package/dist/fetcher.d.cts +3 -1
  13. package/dist/fetcher.d.cts.map +1 -1
  14. package/dist/fetcher.d.mts +3 -1
  15. package/dist/fetcher.d.mts.map +1 -1
  16. package/dist/fetcher.mjs +6 -1
  17. package/dist/fetcher.mjs.map +1 -1
  18. package/dist/index.cjs +7 -0
  19. package/dist/index.d.cts +3 -1
  20. package/dist/index.d.mts +3 -1
  21. package/dist/index.mjs +3 -1
  22. package/dist/infer.d.cts +2 -2
  23. package/dist/infer.d.cts.map +1 -1
  24. package/dist/infer.d.mts +2 -2
  25. package/dist/infer.d.mts.map +1 -1
  26. package/dist/methods.cjs +21 -0
  27. package/dist/methods.cjs.map +1 -0
  28. package/dist/methods.d.cts +23 -0
  29. package/dist/methods.d.cts.map +1 -0
  30. package/dist/methods.d.mts +23 -0
  31. package/dist/methods.d.mts.map +1 -0
  32. package/dist/methods.mjs +19 -0
  33. package/dist/methods.mjs.map +1 -0
  34. package/dist/openapi-types.d.cts +1 -1
  35. package/dist/openapi-types.d.mts +1 -1
  36. package/dist/telemetry-g3BE86Wd.d.cts +68 -0
  37. package/dist/telemetry-g3BE86Wd.d.cts.map +1 -0
  38. package/dist/telemetry-g3BE86Wd.d.mts +68 -0
  39. package/dist/telemetry-g3BE86Wd.d.mts.map +1 -0
  40. package/dist/telemetry.cjs +128 -0
  41. package/dist/telemetry.cjs.map +1 -0
  42. package/dist/telemetry.d.cts +2 -0
  43. package/dist/telemetry.d.mts +2 -0
  44. package/dist/telemetry.mjs +125 -0
  45. package/dist/telemetry.mjs.map +1 -0
  46. package/dist/types.d.cts +21 -8
  47. package/dist/types.d.cts.map +1 -1
  48. package/dist/types.d.mts +21 -8
  49. package/dist/types.d.mts.map +1 -1
  50. package/package.json +19 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.mjs","names":[],"sources":["../src/telemetry.ts"],"sourcesContent":["/**\n * W3C trace context on the requests a client makes to its own API, so a user\n * action in the browser and the API request it causes are one trace.\n *\n * Two levels, chosen per request:\n *\n * - **An OpenTelemetry context is active** — a browser SDK has a span open, or\n * this runs on a server (a Next.js server component, an API calling another\n * API) inside a request span. The globally registered propagator writes the\n * headers, so the current span is the parent: `traceparent`, `tracestate`,\n * and whatever else that propagator carries.\n * - **Otherwise** (level 1): one trace id per page view — per page load in a\n * browser, per client in Node — a fresh span id per request, and a sampled\n * flag decided once per page view from {@link ClientTelemetryOptions.sampleRate}.\n *\n * Nothing is sent to any origin but the API's own: a trace id is an identifier,\n * and a third party has no business correlating a user's requests by it. And\n * nothing at all where a `fetch` instrumentation is listening (a server with\n * OpenTelemetry's undici instrumentation): it writes the request's own\n * context, and two `traceparent` headers would be read as none.\n *\n * `@opentelemetry/api` is not imported. Every copy of it — whichever version\n * an app bundles — registers its globals on `globalThis` under\n * `Symbol.for('opentelemetry.js.api.1')`, which is how two copies in one page\n * already share a provider. Reading the propagator and context manager from\n * there costs a browser bundle nothing when no SDK is loaded, and still finds\n * the SDK when one is.\n */\n\n/** Telemetry on a client: `true` for the defaults, or these options. */\nexport interface ClientTelemetryOptions {\n\t/**\n\t * The fraction of page views whose requests are sampled, from 0 to 1, when\n\t * no OpenTelemetry context is active. Decided once per page view, so a\n\t * page's requests are all kept or all dropped together.\n\t *\n\t * Use the stage's rate. The API caps an incoming sampled flag at its own\n\t * rate anyway, and decides from the trace id the same way this does, so a\n\t * page view sampled here at the API's rate is sampled there too.\n\t * @default 1\n\t */\n\tsampleRate?: number;\n}\n\n/** A `sampleRate` outside 0–1, which no sampler can honour. */\nexport class InvalidClientSampleRate extends Error {\n\tconstructor(readonly sampleRate: number) {\n\t\tsuper(\n\t\t\t`telemetry.sampleRate must be a number from 0 (no page views) to 1 (every page view), got ${sampleRate}. Pass the stage's sample rate, such as 0.1.`,\n\t\t);\n\t\tthis.name = 'InvalidClientSampleRate';\n\t}\n}\n\n/** Adds trace headers to a request to `url`, when it is the API's own. */\nexport type TraceContextInjector = (\n\turl: string,\n\theaders: Record<string, string>,\n) => void;\n\n/** The slice of `@opentelemetry/api`'s global registry this reads. */\ninterface OtelGlobal {\n\tcontext?: { active(): unknown };\n\tpropagation?: {\n\t\tinject(\n\t\t\tcontext: unknown,\n\t\t\tcarrier: Record<string, string>,\n\t\t\tsetter: {\n\t\t\t\tset(carrier: Record<string, string>, key: string, value: string): void;\n\t\t\t},\n\t\t): void;\n\t};\n}\n\nconst OTEL_GLOBAL = Symbol.for('opentelemetry.js.api.1');\n\nconst setter = {\n\tset(carrier: Record<string, string>, key: string, value: string) {\n\t\tcarrier[key] = value;\n\t},\n};\n\n/**\n * The headers the registered propagator writes for the active context, or\n * undefined when there is no SDK or no span to continue.\n */\nfunction fromActiveContext(): Record<string, string> | undefined {\n\tconst api = (globalThis as Record<symbol, OtelGlobal | undefined>)[\n\t\tOTEL_GLOBAL\n\t];\n\tif (!api?.propagation || !api.context) return undefined;\n\n\tconst carrier: Record<string, string> = {};\n\ttry {\n\t\tapi.propagation.inject(api.context.active(), carrier, setter);\n\t} catch {\n\t\treturn undefined;\n\t}\n\t// The W3C propagator writes nothing without a valid, unsuppressed span.\n\treturn carrier.traceparent ? carrier : undefined;\n}\n\n/** `bytes` crypto-random bytes as lowercase hex, never all zeros. */\nfunction randomHex(bytes: number): string {\n\tconst buffer = new Uint8Array(bytes);\n\tdo {\n\t\tglobalThis.crypto.getRandomValues(buffer);\n\t} while (buffer.every((byte) => byte === 0));\n\tlet hex = '';\n\tfor (const byte of buffer) hex += byte.toString(16).padStart(2, '0');\n\treturn hex;\n}\n\n/**\n * Whether a trace is sampled at `rate`, from its id.\n *\n * The same rule as OpenTelemetry's `TraceIdRatioBasedSampler`: the id's four\n * 32-bit words XORed together, under `rate` of the 32-bit range. The trace id\n * is random, so this samples `rate` of page views — and the API, applying the\n * same rule to the same id at the same rate, keeps exactly the page views kept\n * here rather than a random `rate` of them.\n */\nexport function sampledAt(traceId: string, rate: number): boolean {\n\tif (rate >= 1) return true;\n\tif (rate <= 0) return false;\n\tlet accumulation = 0;\n\tfor (let i = 0; i < traceId.length; i += 8) {\n\t\taccumulation = (accumulation ^ parseInt(traceId.slice(i, i + 8), 16)) >>> 0;\n\t}\n\treturn accumulation < Math.floor(rate * 0xffffffff);\n}\n\n/** A page view: one trace id for every request made during it. */\ninterface PageView {\n\ttraceId: string;\n}\n\nlet browserPageView: PageView | undefined;\n\n/**\n * The page view a request belongs to: the page load's in a browser, shared by\n * every client on the page, or this client's own elsewhere — a server process\n * outlives any one user action, so one trace for all of it would mean nothing.\n */\nfunction pageViewFor(own: () => PageView): PageView {\n\tconst browser =\n\t\ttypeof window !== 'undefined' && typeof document !== 'undefined';\n\tif (!browser) return own();\n\tbrowserPageView ??= { traceId: randomHex(16) };\n\treturn browserPageView;\n}\n\n/** The origin of `url`, resolved the way `fetch` would, or undefined. */\nfunction originOf(url: string): string | undefined {\n\ttry {\n\t\tconst base = (globalThis as { location?: { href?: string } }).location\n\t\t\t?.href;\n\t\treturn new URL(url, base).origin;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/** The slice of `node:diagnostics_channel` this reads. */\ninterface DiagnosticsChannels {\n\tchannel(name: string): { hasSubscribers: boolean };\n}\n\nlet fetchRequests: { hasSubscribers: boolean } | null | undefined;\n\n/**\n * Whether something instruments `fetch` in this process: OpenTelemetry's\n * undici instrumentation, or an APM built on it, listening on undici's\n * diagnostics channel. It opens each request's CLIENT span and appends that\n * span's `traceparent` itself, so one written here as well would reach the API\n * as two values joined — `a, b` — which no propagator reads.\n *\n * Asked through `process.getBuiltinModule`, so a browser bundle imports no\n * Node module; anywhere without it, nothing is listening.\n */\nfunction fetchIsInstrumented(): boolean {\n\tif (fetchRequests === undefined) {\n\t\tconst getBuiltinModule = (\n\t\t\tglobalThis as {\n\t\t\t\tprocess?: { getBuiltinModule?: (id: string) => unknown };\n\t\t\t}\n\t\t).process?.getBuiltinModule;\n\t\tconst channels = getBuiltinModule?.('node:diagnostics_channel') as\n\t\t\t| DiagnosticsChannels\n\t\t\t| undefined;\n\t\tfetchRequests = channels?.channel('undici:request:create') ?? null;\n\t}\n\treturn fetchRequests?.hasSubscribers === true;\n}\n\n/**\n * An injector for a client whose API is at `baseURL`, or undefined when\n * telemetry is off.\n */\nexport function traceContextInjector(\n\tbaseURL: string,\n\ttelemetry: boolean | ClientTelemetryOptions | undefined,\n): TraceContextInjector | undefined {\n\tif (!telemetry) return undefined;\n\n\tconst sampleRate = telemetry === true ? 1 : (telemetry.sampleRate ?? 1);\n\tif (!Number.isFinite(sampleRate) || sampleRate < 0 || sampleRate > 1) {\n\t\tthrow new InvalidClientSampleRate(sampleRate);\n\t}\n\n\tconst apiOrigin = originOf(baseURL || '/');\n\tlet own: PageView | undefined;\n\tconst ownPageView = () => {\n\t\town ??= { traceId: randomHex(16) };\n\t\treturn own;\n\t};\n\n\treturn (url, headers) => {\n\t\t// Only the API's own origin: never a third party, and never anything\n\t\t// whose origin cannot be told.\n\t\tif (!apiOrigin || originOf(url) !== apiOrigin) return;\n\t\t// A caller that set its own context keeps it.\n\t\tif (Object.keys(headers).some((h) => h.toLowerCase() === 'traceparent'))\n\t\t\treturn;\n\t\t// A fetch instrumentation writes the request's own context.\n\t\tif (fetchIsInstrumented()) return;\n\n\t\tconst active = fromActiveContext();\n\t\tif (active) {\n\t\t\tObject.assign(headers, active);\n\t\t\treturn;\n\t\t}\n\n\t\tconst { traceId } = pageViewFor(ownPageView);\n\t\tconst flags = sampledAt(traceId, sampleRate) ? '01' : '00';\n\t\theaders.traceparent = `00-${traceId}-${randomHex(8)}-${flags}`;\n\t};\n}\n"],"mappings":";;AA6CA,IAAa,0BAAb,cAA6C,MAAM;CAC7B;CAArB,YAAY,YAA6B;EACxC,MACC,4FAA4F,WAAW,6CACxG;EAHoB,KAAA,aAAA;EAIpB,KAAK,OAAO;CACb;AACD;AAsBA,MAAM,cAAc,OAAO,IAAI,wBAAwB;AAEvD,MAAM,SAAS,EACd,IAAI,SAAiC,KAAa,OAAe;CAChE,QAAQ,OAAO;AAChB,EACD;;;;;AAMA,SAAS,oBAAwD;CAChE,MAAM,MAAO,WACZ;CAED,IAAI,CAAC,KAAK,eAAe,CAAC,IAAI,SAAS,OAAO,KAAA;CAE9C,MAAM,UAAkC,CAAC;CACzC,IAAI;EACH,IAAI,YAAY,OAAO,IAAI,QAAQ,OAAO,GAAG,SAAS,MAAM;CAC7D,QAAQ;EACP;CACD;CAEA,OAAO,QAAQ,cAAc,UAAU,KAAA;AACxC;;AAGA,SAAS,UAAU,OAAuB;CACzC,MAAM,SAAS,IAAI,WAAW,KAAK;CACnC;EACC,WAAW,OAAO,gBAAgB,MAAM;QAChC,OAAO,OAAO,SAAS,SAAS,CAAC;CAC1C,IAAI,MAAM;CACV,KAAK,MAAM,QAAQ,QAAQ,OAAO,KAAK,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CACnE,OAAO;AACR;;;;;;;;;;AAWA,SAAgB,UAAU,SAAiB,MAAuB;CACjE,IAAI,QAAQ,GAAG,OAAO;CACtB,IAAI,QAAQ,GAAG,OAAO;CACtB,IAAI,eAAe;CACnB,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK,GACxC,gBAAgB,eAAe,SAAS,QAAQ,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE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AAY,WAAW;EAC3C,MAAM,QAAQ,UAAU,SAAS,UAAU,IAAI,OAAO;EACtD,QAAQ,cAAc,MAAM,QAAQ,GAAG,UAAU,CAAC,EAAE,GAAG;CACxD;AACD"}
package/dist/types.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import { t as ClientTelemetryOptions } from "./telemetry-g3BE86Wd.cjs";
1
2
  //#region src/types.d.ts
2
3
  export type OpenAPIRoutes<Paths> = keyof Paths;
3
4
  type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options';
@@ -13,12 +14,12 @@ export type ExtractQueryParams<Paths, Route extends OpenAPIRoutes<Paths>, Method
13
14
  };
14
15
  } ? Q : never;
15
16
  export type ExtractRequestBody<Paths, Route extends OpenAPIRoutes<Paths>, Method extends ExtractMethod<Paths, Route>> = Paths[Route][Method] extends {
16
- requestBody?: {
17
- content?: {
18
- 'application/json'?: infer B;
19
- };
17
+ requestBody?: infer RB;
18
+ } ? [NonNullable<RB>] extends [never] ? never : NonNullable<RB> extends {
19
+ content?: {
20
+ 'application/json'?: infer B;
20
21
  };
21
- } ? B : never;
22
+ } ? B : never : never;
22
23
  export type ExtractResponse<Paths, Route extends OpenAPIRoutes<Paths>, Method extends ExtractMethod<Paths, Route>> = Paths[Route][Method] extends {
23
24
  responses?: {
24
25
  200?: {
@@ -58,7 +59,8 @@ export type ExtractEndpointConfig<Paths, T extends EndpointString> = T extends `
58
59
  * Build a request config type where:
59
60
  * - `params` is required if the endpoint has path parameters
60
61
  * - `body` is required if the endpoint has a request body
61
- * - `query` and `headers` are always optional
62
+ * - `query` is required if it has a required key, optional otherwise
63
+ * - `headers` is always optional
62
64
  */
63
65
  export type FilteredRequestConfig<Paths, T extends EndpointString> = T extends `${infer Method} ${infer Route}` ? Route extends OpenAPIRoutes<Paths> ? Lowercase<Method> extends ExtractMethod<Paths, Route> ? BuildRequestConfig<ExtractPathParams<Paths, Route>, ExtractQueryParams<Paths, Route, Lowercase<Method>>, ExtractRequestBody<Paths, Route, Lowercase<Method>>> : never : never : never;
64
66
  /**
@@ -70,8 +72,10 @@ type BuildRequestConfig<TParams, TQuery, TBody> = SimplifyIntersection<([TParams
70
72
  params: TParams;
71
73
  }) & ([TBody] extends [never] ? {} : {
72
74
  body: TBody;
73
- }) & ([TQuery] extends [never] ? {} : {
75
+ }) & ([TQuery] extends [never] ? {} : {} extends TQuery ? {
74
76
  query?: TQuery;
77
+ } : {
78
+ query: TQuery;
75
79
  }) & {
76
80
  headers?: Record<string, string>;
77
81
  }>;
@@ -79,10 +83,12 @@ type BuildRequestConfig<TParams, TQuery, TBody> = SimplifyIntersection<([TParams
79
83
  * Simplify intersection types for better IDE display
80
84
  */
81
85
  type SimplifyIntersection<T> = { [K in keyof T]: T[K]; };
86
+ /** Whether a query has a key the caller must supply. */
87
+ type HasRequiredQuery<TQuery> = [TQuery] extends [never] ? false : {} extends TQuery ? false : true;
82
88
  /**
83
89
  * Check if the config object is required (has any required fields)
84
90
  */
85
- export type IsConfigRequired<Paths, T extends EndpointString> = T extends `${infer Method} ${infer Route}` ? Route extends OpenAPIRoutes<Paths> ? Lowercase<Method> extends ExtractMethod<Paths, Route> ? ExtractPathParams<Paths, Route> extends never ? ExtractRequestBody<Paths, Route, Lowercase<Method>> extends never ? false : true : true : false : false : false;
91
+ export type IsConfigRequired<Paths, T extends EndpointString> = T extends `${infer Method} ${infer Route}` ? Route extends OpenAPIRoutes<Paths> ? Lowercase<Method> extends ExtractMethod<Paths, Route> ? ExtractPathParams<Paths, Route> extends never ? ExtractRequestBody<Paths, Route, Lowercase<Method>> extends never ? HasRequiredQuery<ExtractQueryParams<Paths, Route, Lowercase<Method>>> : true : true : false : false : false;
86
92
  /**
87
93
  * Typed function signature for the API client.
88
94
  * Config is required when endpoint has path params or body.
@@ -95,6 +101,13 @@ export interface FetcherOptions {
95
101
  onResponse?: (response: Response) => Response | Promise<Response>;
96
102
  onError?: (error: Error) => void | Promise<void>;
97
103
  fetch?: typeof fetch;
104
+ /**
105
+ * W3C trace context (`traceparent`, `tracestate`) on every request to
106
+ * `baseURL`'s origin — never another. Continues the active OpenTelemetry
107
+ * span when there is one; otherwise a trace per page view, sampled at
108
+ * `sampleRate`. Off unless set.
109
+ */
110
+ telemetry?: boolean | ClientTelemetryOptions;
98
111
  }
99
112
  export type WrappedResult<T, E = unknown> = {
100
113
  ok: true;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";YAAY,cAAc,eAAe;KAEpC;YASO,cAAc,OAAO,cAAc,cAAc,UAAU,cAChE,MAAM,QACZ;YAGW,kBACX,OACA,cAAc,cAAc,UACzB,MAAM;EACT;IAAe,aAAa;;IAE1B;YAGS,mBACX,OACA,cAAc,cAAc,QAC5B,eAAe,cAAc,OAAO,UACjC,MAAM,OAAO;EAAkB;IAAe,cAAc;;IAC7D;YAGS,mBACX,OACA,cAAc,cAAc,QAC5B,eAAe,cAAc,OAAO,UACjC,MAAM,OAAO;EAChB;IAAgB;MAAY,2BAA2B;;;IAErD;YAGS,gBACX,OACA,cAAc,cAAc,QAC5B,eAAe,cAAc,OAAO,UACjC,MAAM,OAAO;EAChB;IAAc;MAAQ;QAAY,2BAA2B;;;;IAE3D,IACA,MAAM,OAAO;EACZ;IAAc;MAAQ;QAAY,2BAA2B;;;;IAE7D;YAGQ,cACX,OACA,cAAc,cAAc,QAC5B,eAAe,cAAc,OAAO;EAEpC,SAAS,kBAAkB,OAAO;EAClC,QAAQ,mBAAmB,OAAO,OAAO;EACzC,OAAO,mBAAmB,OAAO,OAAO;EACxC,UAAU;;YAGC,oBAAoB;YAIpB,cAAc,YACxB,eAAe,WACd,UAAU,cAAc,MAAM,QAAQ,iBAAiB,mBAC9C,oBACI,WACb,cAAc,MAAM,QAAQ,sBACvB;YAGI,cAAc,SACzB,cAAc,sBAAqB,MAAK,mBAAmB;YAGhD,uBACX,OACA,yBACG,cAAc,sBAAqB,KACpC,aAAa,qBACZ;YAKQ,cAAc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AsB,OAAO,OACrC,SAAS,sBAAsB,OAAO,QACtC,QAAQ,wBAAwB,OAAO;iBAE3B;EAChB;EACA,UAAU;EACV,aAAa,QAAQ,gBAAgB,cAAc,QAAQ;EAC3D,cAAc,UAAU,aAAa,WAAW,QAAQ;EACxD,WAAW,OAAO,iBAAiB;EACnC,eAAe;;;;;;;EAOf,sBAAsB;;YAGX,cAAc,GAAG;EACxB;EAAU,MAAM;;EAChB;EAAW,OAAO;;YAEX,iBAAiB,MAAM,mBAAmB,IAAI,QAAQ;YAEtD,mBAAmB,OAAO,gBACrC,UAAU,cAAc,QAExB,UAAU,MACP,MAAM,iBAAiB,OAAO,mBAC7B,QAAQ,sBAAsB,OAAO,OACrC,SAAS,sBAAsB,OAAO,QACtC,QAAQ,cAAc,wBAAwB,OAAO,IAAI"}
package/dist/types.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import { t as ClientTelemetryOptions } from "./telemetry-g3BE86Wd.mjs";
1
2
  //#region src/types.d.ts
2
3
  export type OpenAPIRoutes<Paths> = keyof Paths;
3
4
  type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options';
@@ -13,12 +14,12 @@ export type ExtractQueryParams<Paths, Route extends OpenAPIRoutes<Paths>, Method
13
14
  };
14
15
  } ? Q : never;
15
16
  export type ExtractRequestBody<Paths, Route extends OpenAPIRoutes<Paths>, Method extends ExtractMethod<Paths, Route>> = Paths[Route][Method] extends {
16
- requestBody?: {
17
- content?: {
18
- 'application/json'?: infer B;
19
- };
17
+ requestBody?: infer RB;
18
+ } ? [NonNullable<RB>] extends [never] ? never : NonNullable<RB> extends {
19
+ content?: {
20
+ 'application/json'?: infer B;
20
21
  };
21
- } ? B : never;
22
+ } ? B : never : never;
22
23
  export type ExtractResponse<Paths, Route extends OpenAPIRoutes<Paths>, Method extends ExtractMethod<Paths, Route>> = Paths[Route][Method] extends {
23
24
  responses?: {
24
25
  200?: {
@@ -58,7 +59,8 @@ export type ExtractEndpointConfig<Paths, T extends EndpointString> = T extends `
58
59
  * Build a request config type where:
59
60
  * - `params` is required if the endpoint has path parameters
60
61
  * - `body` is required if the endpoint has a request body
61
- * - `query` and `headers` are always optional
62
+ * - `query` is required if it has a required key, optional otherwise
63
+ * - `headers` is always optional
62
64
  */
63
65
  export type FilteredRequestConfig<Paths, T extends EndpointString> = T extends `${infer Method} ${infer Route}` ? Route extends OpenAPIRoutes<Paths> ? Lowercase<Method> extends ExtractMethod<Paths, Route> ? BuildRequestConfig<ExtractPathParams<Paths, Route>, ExtractQueryParams<Paths, Route, Lowercase<Method>>, ExtractRequestBody<Paths, Route, Lowercase<Method>>> : never : never : never;
64
66
  /**
@@ -70,8 +72,10 @@ type BuildRequestConfig<TParams, TQuery, TBody> = SimplifyIntersection<([TParams
70
72
  params: TParams;
71
73
  }) & ([TBody] extends [never] ? {} : {
72
74
  body: TBody;
73
- }) & ([TQuery] extends [never] ? {} : {
75
+ }) & ([TQuery] extends [never] ? {} : {} extends TQuery ? {
74
76
  query?: TQuery;
77
+ } : {
78
+ query: TQuery;
75
79
  }) & {
76
80
  headers?: Record<string, string>;
77
81
  }>;
@@ -79,10 +83,12 @@ type BuildRequestConfig<TParams, TQuery, TBody> = SimplifyIntersection<([TParams
79
83
  * Simplify intersection types for better IDE display
80
84
  */
81
85
  type SimplifyIntersection<T> = { [K in keyof T]: T[K]; };
86
+ /** Whether a query has a key the caller must supply. */
87
+ type HasRequiredQuery<TQuery> = [TQuery] extends [never] ? false : {} extends TQuery ? false : true;
82
88
  /**
83
89
  * Check if the config object is required (has any required fields)
84
90
  */
85
- export type IsConfigRequired<Paths, T extends EndpointString> = T extends `${infer Method} ${infer Route}` ? Route extends OpenAPIRoutes<Paths> ? Lowercase<Method> extends ExtractMethod<Paths, Route> ? ExtractPathParams<Paths, Route> extends never ? ExtractRequestBody<Paths, Route, Lowercase<Method>> extends never ? false : true : true : false : false : false;
91
+ export type IsConfigRequired<Paths, T extends EndpointString> = T extends `${infer Method} ${infer Route}` ? Route extends OpenAPIRoutes<Paths> ? Lowercase<Method> extends ExtractMethod<Paths, Route> ? ExtractPathParams<Paths, Route> extends never ? ExtractRequestBody<Paths, Route, Lowercase<Method>> extends never ? HasRequiredQuery<ExtractQueryParams<Paths, Route, Lowercase<Method>>> : true : true : false : false : false;
86
92
  /**
87
93
  * Typed function signature for the API client.
88
94
  * Config is required when endpoint has path params or body.
@@ -95,6 +101,13 @@ export interface FetcherOptions {
95
101
  onResponse?: (response: Response) => Response | Promise<Response>;
96
102
  onError?: (error: Error) => void | Promise<void>;
97
103
  fetch?: typeof fetch;
104
+ /**
105
+ * W3C trace context (`traceparent`, `tracestate`) on every request to
106
+ * `baseURL`'s origin — never another. Continues the active OpenTelemetry
107
+ * span when there is one; otherwise a trace per page view, sampled at
108
+ * `sampleRate`. Off unless set.
109
+ */
110
+ telemetry?: boolean | ClientTelemetryOptions;
98
111
  }
99
112
  export type WrappedResult<T, E = unknown> = {
100
113
  ok: true;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";YAAY,cAAc,eAAe;KAEpC;YASO,cAAc,OAAO,cAAc,cAAc,UAAU,cAChE,MAAM,QACZ;YAGW,kBACX,OACA,cAAc,cAAc,UACzB,MAAM;EACT;IAAe,aAAa;;IAE1B;YAGS,mBACX,OACA,cAAc,cAAc,QAC5B,eAAe,cAAc,OAAO,UACjC,MAAM,OAAO;EAAkB;IAAe,cAAc;;IAC7D;YAGS,mBACX,OACA,cAAc,cAAc,QAC5B,eAAe,cAAc,OAAO,UACjC,MAAM,OAAO;EAChB;IAAgB;MAAY,2BAA2B;;;IAErD;YAGS,gBACX,OACA,cAAc,cAAc,QAC5B,eAAe,cAAc,OAAO,UACjC,MAAM,OAAO;EAChB;IAAc;MAAQ;QAAY,2BAA2B;;;;IAE3D,IACA,MAAM,OAAO;EACZ;IAAc;MAAQ;QAAY,2BAA2B;;;;IAE7D;YAGQ,cACX,OACA,cAAc,cAAc,QAC5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;;;KAOR,qBAAqB,QAAQ,WAAW,IAAI,EAAE;;KAG9C,iBAAiB,WAAW,6CAEnB;;;;YAOF,iBACX,OACA,UAAU,kBACP,mBAAmB,gBAAgB,UACpC,cAAc,cAAc,SAC3B,UAAU,gBAAgB,cAAc,OAAO,SAC9C,kBAAkB,OAAO,uBACxB,mBAAmB,OAAO,OAAO,UAAU,yBAC1C,iBACA,mBAAmB,OAAO,OAAO,UAAU;;;;;YAYtC,iBAAiB,UAAU,UAAU,cAAc,QAC9D,UAAU,MACP,MAAM,iBAAiB,OAAO,mBAC7B,QAAQ,sBAAsB,OAAO,OACrC,SAAS,sBAAsB,OAAO,QACtC,QAAQ,wBAAwB,OAAO;iBAE3B;EAChB;EACA,UAAU;EACV,aAAa,QAAQ,gBAAgB,cAAc,QAAQ;EAC3D,cAAc,UAAU,aAAa,WAAW,QAAQ;EACxD,WAAW,OAAO,iBAAiB;EACnC,eAAe;;;;;;;EAOf,sBAAsB;;YAGX,cAAc,GAAG;EACxB;EAAU,MAAM;;EAChB;EAAW,OAAO;;YAEX,iBAAiB,MAAM,mBAAmB,IAAI,QAAQ;YAEtD,mBAAmB,OAAO,gBACrC,UAAU,cAAc,QAExB,UAAU,MACP,MAAM,iBAAiB,OAAO,mBAC7B,QAAQ,sBAAsB,OAAO,OACrC,SAAS,sBAAsB,OAAO,QACtC,QAAQ,cAAc,wBAAwB,OAAO,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/client",
3
- "version": "10.0.0-alpha.16",
3
+ "version": "10.0.0-alpha.161",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -83,6 +83,16 @@
83
83
  "types": "./dist/endpoint-hooks.d.cts",
84
84
  "default": "./dist/endpoint-hooks.cjs"
85
85
  }
86
+ },
87
+ "./telemetry": {
88
+ "import": {
89
+ "types": "./dist/telemetry.d.mts",
90
+ "default": "./dist/telemetry.mjs"
91
+ },
92
+ "require": {
93
+ "types": "./dist/telemetry.d.cts",
94
+ "default": "./dist/telemetry.cjs"
95
+ }
86
96
  }
87
97
  },
88
98
  "files": [
@@ -101,6 +111,8 @@
101
111
  "qs": "~6.16.0"
102
112
  },
103
113
  "devDependencies": {
114
+ "@opentelemetry/api": "~1.9.1",
115
+ "@opentelemetry/sdk-trace-node": "~2.11.0",
104
116
  "@tanstack/react-query": "~5.104.0",
105
117
  "@testing-library/dom": "~10.4.2",
106
118
  "@testing-library/jest-dom": "~6.6.3",
@@ -111,16 +123,16 @@
111
123
  "@types/react-dom": "~19.3.0",
112
124
  "jsdom": "~26.1.0",
113
125
  "msw": "~2.15.0",
114
- "@geekmidas/constructs": "^10.0.0-alpha.16",
115
- "@geekmidas/schema": "^10.0.0-alpha.16"
126
+ "@geekmidas/constructs": ">=10.0.0-alpha.161 <10.0.0",
127
+ "@geekmidas/schema": ">=10.0.0-alpha.161 <10.0.0"
116
128
  },
117
129
  "peerDependencies": {
118
130
  "@tanstack/react-query": ">=5.0.0",
119
131
  "react": ">=18.0.0",
120
132
  "react-dom": ">=18.0.0",
121
133
  "zod": ">=4.6.5",
122
- "@geekmidas/constructs": "^10.0.0-alpha.16",
123
- "@geekmidas/schema": "^10.0.0-alpha.16"
134
+ "@geekmidas/constructs": ">=10.0.0-alpha.161 <10.0.0",
135
+ "@geekmidas/schema": ">=10.0.0-alpha.161 <10.0.0"
124
136
  },
125
137
  "peerDependenciesMeta": {
126
138
  "@geekmidas/constructs": {
@@ -140,6 +152,7 @@
140
152
  }
141
153
  },
142
154
  "scripts": {
143
- "ts": "tsc --noEmit --skipLibCheck src/**/*.ts"
155
+ "ts": "tsc --noEmit --skipLibCheck src/**/*.ts",
156
+ "build": "tsdown --config ../../tsdown.config.ts --filter ."
144
157
  }
145
158
  }