|
| 1 | +import type { IR } from '../../../ir/types'; |
1 | 2 | import type { StringCase, StringName } from '../../../types/case';
|
2 | 3 | import type { DefinePlugin, Plugin } from '../../types';
|
3 | 4 |
|
@@ -92,6 +93,28 @@ export type UserConfig = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
92 | 93 | * @default true
|
93 | 94 | */
|
94 | 95 | enabled?: boolean;
|
| 96 | + /** |
| 97 | + * Custom function to generate metadata for the operation. |
| 98 | + * Can return any valid meta object that will be included in the generated infinite query options. |
| 99 | + * @param operation - The operation object containing all available metadata |
| 100 | + * @returns A meta object with any properties you want to include |
| 101 | + * |
| 102 | + * @example |
| 103 | + * ```typescript |
| 104 | + * meta: (operation) => ({ |
| 105 | + * customField: operation.id, |
| 106 | + * isDeprecated: operation.deprecated, |
| 107 | + * tags: operation.tags, |
| 108 | + * customObject: { |
| 109 | + * method: operation.method, |
| 110 | + * path: operation.path |
| 111 | + * } |
| 112 | + * }) |
| 113 | + * ``` |
| 114 | + * |
| 115 | + * @default false |
| 116 | + */ |
| 117 | + meta?: false | ((operation: IR.OperationObject) => Record<string, any>); |
95 | 118 | /**
|
96 | 119 | * Custom naming pattern for generated infinite query options names. The name variable is
|
97 | 120 | * obtained from the SDK function name.
|
@@ -129,6 +152,28 @@ export type UserConfig = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
129 | 152 | * @default true
|
130 | 153 | */
|
131 | 154 | enabled?: boolean;
|
| 155 | + /** |
| 156 | + * Custom function to generate metadata for the operation. |
| 157 | + * Can return any valid meta object that will be included in the generated mutation options. |
| 158 | + * @param operation - The operation object containing all available metadata |
| 159 | + * @returns A meta object with any properties you want to include |
| 160 | + * |
| 161 | + * @example |
| 162 | + * ```typescript |
| 163 | + * meta: (operation) => ({ |
| 164 | + * customField: operation.id, |
| 165 | + * isDeprecated: operation.deprecated, |
| 166 | + * tags: operation.tags, |
| 167 | + * customObject: { |
| 168 | + * method: operation.method, |
| 169 | + * path: operation.path |
| 170 | + * } |
| 171 | + * }) |
| 172 | + * ``` |
| 173 | + * |
| 174 | + * @default false |
| 175 | + */ |
| 176 | + meta?: false | ((operation: IR.OperationObject) => Record<string, any>); |
132 | 177 | /**
|
133 | 178 | * Custom naming pattern for generated mutation options names. The name variable is
|
134 | 179 | * obtained from the SDK function name.
|
@@ -216,6 +261,28 @@ export type UserConfig = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
216 | 261 | * @default true
|
217 | 262 | */
|
218 | 263 | enabled?: boolean;
|
| 264 | + /** |
| 265 | + * Custom function to generate metadata for the operation. |
| 266 | + * Can return any valid meta object that will be included in the generated query options. |
| 267 | + * @param operation - The operation object containing all available metadata |
| 268 | + * @returns A meta object with any properties you want to include |
| 269 | + * |
| 270 | + * @example |
| 271 | + * ```typescript |
| 272 | + * meta: (operation) => ({ |
| 273 | + * customField: operation.id, |
| 274 | + * isDeprecated: operation.deprecated, |
| 275 | + * tags: operation.tags, |
| 276 | + * customObject: { |
| 277 | + * method: operation.method, |
| 278 | + * path: operation.path |
| 279 | + * } |
| 280 | + * }) |
| 281 | + * ``` |
| 282 | + * |
| 283 | + * @default false |
| 284 | + */ |
| 285 | + meta?: false | ((operation: IR.OperationObject) => Record<string, any>); |
219 | 286 | /**
|
220 | 287 | * Custom naming pattern for generated query options names. The name variable is
|
221 | 288 | * obtained from the SDK function name.
|
@@ -298,6 +365,28 @@ export type Config = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
298 | 365 | * @default true
|
299 | 366 | */
|
300 | 367 | enabled: boolean;
|
| 368 | + /** |
| 369 | + * Custom function to generate metadata for the operation. |
| 370 | + * Can return any valid meta object that will be included in the generated infinite query options. |
| 371 | + * @param operation - The operation object containing all available metadata |
| 372 | + * @returns A meta object with any properties you want to include |
| 373 | + * |
| 374 | + * @example |
| 375 | + * ```typescript |
| 376 | + * meta: (operation) => ({ |
| 377 | + * customField: operation.id, |
| 378 | + * isDeprecated: operation.deprecated, |
| 379 | + * tags: operation.tags, |
| 380 | + * customObject: { |
| 381 | + * method: operation.method, |
| 382 | + * path: operation.path |
| 383 | + * } |
| 384 | + * }) |
| 385 | + * ``` |
| 386 | + * |
| 387 | + * @default false |
| 388 | + */ |
| 389 | + meta?: false | ((operation: IR.OperationObject) => Record<string, any>); |
301 | 390 | /**
|
302 | 391 | * Custom naming pattern for generated infinite query options names. The name variable is
|
303 | 392 | * obtained from the SDK function name.
|
@@ -325,6 +414,28 @@ export type Config = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
325 | 414 | * @default true
|
326 | 415 | */
|
327 | 416 | enabled: boolean;
|
| 417 | + /** |
| 418 | + * Custom function to generate metadata for the operation. |
| 419 | + * Can return any valid meta object that will be included in the generated mutation options. |
| 420 | + * @param operation - The operation object containing all available metadata |
| 421 | + * @returns A meta object with any properties you want to include |
| 422 | + * |
| 423 | + * @example |
| 424 | + * ```typescript |
| 425 | + * meta: (operation) => ({ |
| 426 | + * customField: operation.id, |
| 427 | + * isDeprecated: operation.deprecated, |
| 428 | + * tags: operation.tags, |
| 429 | + * customObject: { |
| 430 | + * method: operation.method, |
| 431 | + * path: operation.path |
| 432 | + * } |
| 433 | + * }) |
| 434 | + * ``` |
| 435 | + * |
| 436 | + * @default false |
| 437 | + */ |
| 438 | + meta?: false | ((operation: IR.OperationObject) => Record<string, any>); |
328 | 439 | /**
|
329 | 440 | * Custom naming pattern for generated mutation options names. The name variable is
|
330 | 441 | * obtained from the SDK function name.
|
@@ -392,6 +503,28 @@ export type Config = Plugin.Name<'@tanstack/angular-query-experimental'> & {
|
392 | 503 | * @default true
|
393 | 504 | */
|
394 | 505 | enabled: boolean;
|
| 506 | + /** |
| 507 | + * Custom function to generate metadata for the operation. |
| 508 | + * Can return any valid meta object that will be included in the generated query options. |
| 509 | + * @param operation - The operation object containing all available metadata |
| 510 | + * @returns A meta object with any properties you want to include |
| 511 | + * |
| 512 | + * @example |
| 513 | + * ```typescript |
| 514 | + * meta: (operation) => ({ |
| 515 | + * customField: operation.id, |
| 516 | + * isDeprecated: operation.deprecated, |
| 517 | + * tags: operation.tags, |
| 518 | + * customObject: { |
| 519 | + * method: operation.method, |
| 520 | + * path: operation.path |
| 521 | + * } |
| 522 | + * }) |
| 523 | + * ``` |
| 524 | + * |
| 525 | + * @default false |
| 526 | + */ |
| 527 | + meta?: false | ((operation: IR.OperationObject) => Record<string, any>); |
395 | 528 | /**
|
396 | 529 | * Custom naming pattern for generated query options names. The name variable is
|
397 | 530 | * obtained from the SDK function name.
|
|
0 commit comments