@emeryld/rrroutes-client 1.2.7 → 1.3.0

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.
@@ -53,16 +53,27 @@ export type RouteClientDebugEvent = (RouteClientDebugEventBase & {
53
53
  });
54
54
  /** Logger signature invoked when debug logging is enabled. */
55
55
  export type RouteClientDebugLogger = (event: RouteClientDebugEvent) => void;
56
- /** Toggle-specific configuration controlling which events log and whether verbose details are included. */
56
+ /**
57
+ * Toggle-specific configuration controlling which debug events log, whether verbose details
58
+ * are emitted, and which named endpoints are allowed to log.
59
+ */
57
60
  export type RouteClientDebugToggleOptions<Names extends string = string> = Partial<Record<RouteClientDebugEvent['type'], boolean>> & {
58
61
  /** When true, include verbose metadata (same as `mode === 'complete'`). */
59
62
  verbose?: boolean;
60
63
  /** Optional logger override used instead of the default console logger. */
61
64
  logger?: RouteClientDebugLogger;
62
- /** Limit logs to endpoints whose debug name is contained in this allow-list. */
65
+ /**
66
+ * Limit logs to endpoints whose debug name is contained in this allow-list.
67
+ * Provide the counterpart by passing `meta: { name: '<value>' }` as the third argument to `client.build`.
68
+ */
63
69
  only?: Names[];
64
70
  };
65
- /** Toggle or customize debug logging produced by the client. */
71
+ /**
72
+ * Toggle or customize debug logging produced by the client.
73
+ * - Pass `true`/`'minimal'`/`'complete'` for simple modes.
74
+ * - Provide a custom logger function to redirect events.
75
+ * - Supply an object to enable individual event types, flip verbose mode, and/or limit logs via `only`.
76
+ */
66
77
  export type RouteClientDebugOptions<Names extends string = string> = boolean | RouteClientDebugLogger | RouteClientDebugMode | RouteClientDebugToggleOptions<Names>;
67
78
  /** Optional runtime environment; when set to 'production' logging is disabled. */
68
79
  export type RouteClientEnvironment = 'development' | 'production' | (string & {});
@@ -80,7 +91,10 @@ export type RouteClientOptions<Names extends string = string> = {
80
91
  getNextCursor?: (page: unknown) => Cursor;
81
92
  /** Optional debug logger for verbose insights (supports minimal/complete modes). */
82
93
  debug?: RouteClientDebugOptions<Names>;
83
- /** Optional environment hint used to silence logging in production. */
94
+ /**
95
+ * Optional environment hint used to silence logging in production.
96
+ * When set to `'production'`, all debug logging is disabled regardless of the `debug` option.
97
+ */
84
98
  environment?: RouteClientEnvironment;
85
99
  };
86
100
  type OutputOf<L extends AnyLeaf> = InferOutput<L>;
@@ -93,6 +107,10 @@ export type MutationFetchArgs<L extends AnyLeaf> = [...ArgsTuple<L>, BodyOf<L>];
93
107
  export type MutationFetcher<L extends AnyLeaf> = (...args: MutationFetchArgs<L>) => Promise<OutputOf<L>>;
94
108
  /** Optional metadata provided when building a helper (used for debug filtering). */
95
109
  export type BuildMeta<Names extends string = string> = {
110
+ /**
111
+ * Logical name assigned to the built endpoint (e.g., the screen or feature name).
112
+ * Combine with `debug.only` to limit which endpoints emit logs.
113
+ */
96
114
  name?: Names;
97
115
  };
98
116
  /** Object shape the user passes to hooks and helpers (params/query are optional). */
@@ -177,16 +195,22 @@ export type RouteClient<Names extends string = string> = {
177
195
  cfg: {
178
196
  feed: true;
179
197
  };
180
- }>(leaf: L, opts?: InfiniteBuildOptionsFor<L>, meta?: BuildMeta<Names>): BuiltInfinite<L>;
198
+ }>(leaf: L, opts?: InfiniteBuildOptionsFor<L>,
199
+ /** Optional metadata (third arg) to assign a debug name for filtering via `debug.only`. */
200
+ meta?: BuildMeta<Names>): BuiltInfinite<L>;
181
201
  <L extends AnyLeaf & {
182
202
  method: 'get';
183
203
  cfg: {
184
204
  feed?: false | undefined;
185
205
  };
186
- }>(leaf: L, opts?: QueryBuildOptionsFor<L>, meta?: BuildMeta<Names>): BuiltQuery<L>;
206
+ }>(leaf: L, opts?: QueryBuildOptionsFor<L>,
207
+ /** Optional metadata (third arg) to assign a debug name for filtering via `debug.only`. */
208
+ meta?: BuildMeta<Names>): BuiltQuery<L>;
187
209
  <L extends AnyLeaf & {
188
210
  method: Exclude<HttpMethod, 'get'>;
189
- }>(leaf: L, opts?: MutationBuildOptionsFor<L>, meta?: BuildMeta<Names>): BuiltMutation<L>;
211
+ }>(leaf: L, opts?: MutationBuildOptionsFor<L>,
212
+ /** Optional metadata (third arg) to assign a debug name for filtering via `debug.only`. */
213
+ meta?: BuildMeta<Names>): BuiltMutation<L>;
190
214
  };
191
215
  /** Underlying React Query client (exposed for advanced scenarios). */
192
216
  queryClient: QueryClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-client",
3
- "version": "1.2.7",
3
+ "version": "1.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",