@geekmidas/client 10.0.0-alpha.2 → 10.0.0-alpha.21

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 (103) hide show
  1. package/README.md +39 -57
  2. package/dist/auth-fetcher.cjs +78 -3
  3. package/dist/auth-fetcher.cjs.map +1 -0
  4. package/dist/auth-fetcher.d.cts +155 -3
  5. package/dist/auth-fetcher.d.cts.map +1 -0
  6. package/dist/auth-fetcher.d.mts +155 -3
  7. package/dist/auth-fetcher.d.mts.map +1 -0
  8. package/dist/auth-fetcher.mjs +77 -3
  9. package/dist/auth-fetcher.mjs.map +1 -0
  10. package/dist/endpoint-hooks.cjs +11 -15
  11. package/dist/endpoint-hooks.cjs.map +1 -1
  12. package/dist/endpoint-hooks.d.cts +4 -7
  13. package/dist/endpoint-hooks.d.cts.map +1 -1
  14. package/dist/endpoint-hooks.d.mts +4 -7
  15. package/dist/endpoint-hooks.d.mts.map +1 -1
  16. package/dist/endpoint-hooks.mjs +5 -9
  17. package/dist/endpoint-hooks.mjs.map +1 -1
  18. package/dist/fetcher.cjs +111 -3
  19. package/dist/fetcher.cjs.map +1 -0
  20. package/dist/fetcher.d.cts +23 -3
  21. package/dist/fetcher.d.cts.map +1 -0
  22. package/dist/fetcher.d.mts +23 -3
  23. package/dist/fetcher.d.mts.map +1 -0
  24. package/dist/fetcher.mjs +86 -2
  25. package/dist/fetcher.mjs.map +1 -0
  26. package/dist/index.cjs +9 -6
  27. package/dist/index.d.cts +6 -5
  28. package/dist/index.d.mts +6 -5
  29. package/dist/index.mjs +6 -6
  30. package/dist/infer.cjs +0 -1
  31. package/dist/infer.d.cts +130 -2
  32. package/dist/infer.d.cts.map +1 -0
  33. package/dist/infer.d.mts +130 -2
  34. package/dist/infer.d.mts.map +1 -0
  35. package/dist/infer.mjs +1 -1
  36. package/dist/methods.cjs +21 -0
  37. package/dist/methods.cjs.map +1 -0
  38. package/dist/methods.d.cts +23 -0
  39. package/dist/methods.d.cts.map +1 -0
  40. package/dist/methods.d.mts +23 -0
  41. package/dist/methods.d.mts.map +1 -0
  42. package/dist/methods.mjs +19 -0
  43. package/dist/methods.mjs.map +1 -0
  44. package/dist/openapi-hooks.cjs +13 -16
  45. package/dist/openapi-hooks.cjs.map +1 -1
  46. package/dist/openapi-hooks.d.cts +8 -11
  47. package/dist/openapi-hooks.d.cts.map +1 -1
  48. package/dist/openapi-hooks.d.mts +8 -11
  49. package/dist/openapi-hooks.d.mts.map +1 -1
  50. package/dist/openapi-hooks.mjs +9 -12
  51. package/dist/openapi-hooks.mjs.map +1 -1
  52. package/dist/openapi-types.d.cts +5 -6
  53. package/dist/openapi-types.d.cts.map +1 -1
  54. package/dist/openapi-types.d.mts +5 -6
  55. package/dist/openapi-types.d.mts.map +1 -1
  56. package/dist/react-query.cjs +17 -16
  57. package/dist/react-query.cjs.map +1 -1
  58. package/dist/react-query.d.cts +12 -17
  59. package/dist/react-query.d.cts.map +1 -1
  60. package/dist/react-query.d.mts +12 -17
  61. package/dist/react-query.d.mts.map +1 -1
  62. package/dist/react-query.mjs +10 -9
  63. package/dist/react-query.mjs.map +1 -1
  64. package/dist/types.cjs +0 -1
  65. package/dist/types.d.cts +114 -2
  66. package/dist/types.d.cts.map +1 -0
  67. package/dist/types.d.mts +114 -2
  68. package/dist/types.d.mts.map +1 -0
  69. package/dist/types.mjs +1 -1
  70. package/package.json +14 -14
  71. package/dist/auth-fetcher-CBYuL6rx.d.cts +0 -158
  72. package/dist/auth-fetcher-CBYuL6rx.d.cts.map +0 -1
  73. package/dist/auth-fetcher-DOj0iz21.mjs +0 -77
  74. package/dist/auth-fetcher-DOj0iz21.mjs.map +0 -1
  75. package/dist/auth-fetcher-DxS8zOLc.d.mts +0 -158
  76. package/dist/auth-fetcher-DxS8zOLc.d.mts.map +0 -1
  77. package/dist/auth-fetcher-HILABmws.cjs +0 -82
  78. package/dist/auth-fetcher-HILABmws.cjs.map +0 -1
  79. package/dist/chunk-CUT6urMc.cjs +0 -30
  80. package/dist/fetcher-C1xtCKpT.d.mts +0 -25
  81. package/dist/fetcher-C1xtCKpT.d.mts.map +0 -1
  82. package/dist/fetcher-CakjC9C7.mjs +0 -88
  83. package/dist/fetcher-CakjC9C7.mjs.map +0 -1
  84. package/dist/fetcher-CwnSqc4D.cjs +0 -100
  85. package/dist/fetcher-CwnSqc4D.cjs.map +0 -1
  86. package/dist/fetcher-cDrfwN-Y.d.cts +0 -25
  87. package/dist/fetcher-cDrfwN-Y.d.cts.map +0 -1
  88. package/dist/infer-6KKCgmg1.cjs +0 -0
  89. package/dist/infer-DfRq5kIb.d.cts +0 -133
  90. package/dist/infer-DfRq5kIb.d.cts.map +0 -1
  91. package/dist/infer-bTirNeNW.d.mts +0 -133
  92. package/dist/infer-bTirNeNW.d.mts.map +0 -1
  93. package/dist/infer-uCUq1whM.mjs +0 -0
  94. package/dist/openapi.cjs +0 -526
  95. package/dist/openapi.cjs.map +0 -1
  96. package/dist/openapi.mjs +0 -501
  97. package/dist/openapi.mjs.map +0 -1
  98. package/dist/types-BH8WgGrm.mjs +0 -0
  99. package/dist/types-BMGM6sZc.d.mts +0 -110
  100. package/dist/types-BMGM6sZc.d.mts.map +0 -1
  101. package/dist/types-DMQMHePI.d.cts +0 -110
  102. package/dist/types-DMQMHePI.d.cts.map +0 -1
  103. package/dist/types-a8gm_IaQ.cjs +0 -0
@@ -1,10 +1,9 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_fetcher = require('./fetcher-CwnSqc4D.cjs');
3
- const __tanstack_react_query = require_chunk.__toESM(require("@tanstack/react-query"));
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_fetcher = require("./fetcher.cjs");
3
+ let _tanstack_react_query = require("@tanstack/react-query");
5
4
  //#region src/openapi-hooks.ts
6
5
  function createOpenAPIHooks(options = {}) {
7
- const { operations,...fetcherOptions } = options;
6
+ const { operations, ...fetcherOptions } = options;
8
7
  const fetcher = require_fetcher.createTypedFetcher(fetcherOptions);
9
8
  function buildEndpoint(operationId) {
10
9
  const op = operations?.[operationId];
@@ -12,31 +11,29 @@ function createOpenAPIHooks(options = {}) {
12
11
  return operationId;
13
12
  }
14
13
  return {
15
- useQuery: (operationId, config, options$1) => {
14
+ useQuery: (operationId, config, options) => {
16
15
  const endpoint = buildEndpoint(operationId);
17
16
  const queryKey = [operationId, ...config ? [config] : []];
18
- return (0, __tanstack_react_query.useQuery)({
17
+ return (0, _tanstack_react_query.useQuery)({
19
18
  queryKey,
20
19
  queryFn: async () => {
21
- const response = await fetcher(endpoint, config);
22
- return response;
20
+ return await fetcher(endpoint, config);
23
21
  },
24
- ...options$1
22
+ ...options
25
23
  });
26
24
  },
27
- useMutation: (operationId, options$1) => {
25
+ useMutation: (operationId, options) => {
28
26
  const endpoint = buildEndpoint(operationId);
29
- return (0, __tanstack_react_query.useMutation)({
27
+ return (0, _tanstack_react_query.useMutation)({
30
28
  mutationFn: async (variables) => {
31
- const response = await fetcher(endpoint, variables);
32
- return response;
29
+ return await fetcher(endpoint, variables);
33
30
  },
34
- ...options$1
31
+ ...options
35
32
  });
36
33
  }
37
34
  };
38
35
  }
39
-
40
36
  //#endregion
41
37
  exports.createOpenAPIHooks = createOpenAPIHooks;
38
+
42
39
  //# sourceMappingURL=openapi-hooks.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-hooks.cjs","names":["options: FetcherOptions & { operations?: OperationRegistry }","operationId: OpId","config?: RemoveNever<OperationParams<Paths, OpId>>","options?: Omit<\n\t\t\t\tUseQueryOptions<OperationResponse<Paths, OpId>, Error>,\n\t\t\t\t'queryKey' | 'queryFn'\n\t\t\t>","options","options?: Omit<\n\t\t\t\tUseMutationOptions<\n\t\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\t\tError,\n\t\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t\t>,\n\t\t\t\t'mutationFn'\n\t\t\t>"],"sources":["../src/openapi-hooks.ts"],"sourcesContent":["import type {\n\tUseMutationOptions,\n\tUseQueryOptions,\n} from '@tanstack/react-query';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { createTypedFetcher } from './fetcher';\nimport type { FetcherOptions } from './types';\n\n// Simplified type helpers for OpenAPI paths\ntype HttpMethods = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n// Extract all operations from paths\ntype AllOperations<Paths> = {\n\t[Path in keyof Paths]: {\n\t\t[Method in keyof Paths[Path] & HttpMethods]: Paths[Path][Method] extends {\n\t\t\toperationId: infer OpId;\n\t\t}\n\t\t\t? OpId extends string\n\t\t\t\t? {\n\t\t\t\t\t\toperationId: OpId;\n\t\t\t\t\t\tpath: Path;\n\t\t\t\t\t\tmethod: Method;\n\t\t\t\t\t\tspec: Paths[Path][Method] & {\n\t\t\t\t\t\t\t_pathParams?: Paths[Path] extends {\n\t\t\t\t\t\t\t\tparameters: { path: infer P };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t? P\n\t\t\t\t\t\t\t\t: never;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t: never\n\t\t\t: never;\n\t}[keyof Paths[Path] & HttpMethods];\n}[keyof Paths];\n\n// Create operation map\ntype OperationMap<Paths> = {\n\t[Op in AllOperations<Paths> as Op extends {\n\t\toperationId: infer Id extends string;\n\t}\n\t\t? Id\n\t\t: never]: Op;\n};\n\n// Get operation IDs\ntype OperationId<Paths> = keyof OperationMap<Paths>;\n\n// Get operations by method\ntype OperationsByMethod<Paths, Method extends HttpMethods> = {\n\t[K in OperationId<Paths>]: OperationMap<Paths>[K] extends { method: Method }\n\t\t? K\n\t\t: never;\n}[OperationId<Paths>];\n\n// Extract parameter types\ntype OperationParams<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends {\n\tpath: infer Path extends keyof Paths;\n\tspec: infer Spec;\n}\n\t? {\n\t\t\tparams?: Paths[Path] extends { parameters: { path: infer P } }\n\t\t\t\t? P\n\t\t\t\t: Spec extends { parameters: { path: infer P } }\n\t\t\t\t\t? P\n\t\t\t\t\t: never;\n\t\t\tquery?: Spec extends { parameters?: { query?: infer Q } } ? Q : never;\n\t\t\tbody?: Spec extends {\n\t\t\t\trequestBody: { content: { 'application/json': infer Body } };\n\t\t\t}\n\t\t\t\t? Body\n\t\t\t\t: Spec extends {\n\t\t\t\t\t\t\trequestBody: {\n\t\t\t\t\t\t\t\trequired: true;\n\t\t\t\t\t\t\t\tcontent: { 'application/json': infer Body };\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t? Body\n\t\t\t\t\t: never;\n\t\t}\n\t: never;\n\n// Extract response type\ntype OperationResponse<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends { spec: infer Spec }\n\t? Spec extends {\n\t\t\tresponses: { 200: { content: { 'application/json': infer R } } };\n\t\t}\n\t\t? R\n\t\t: Spec extends {\n\t\t\t\t\tresponses: { 201: { content: { 'application/json': infer R } } };\n\t\t\t\t}\n\t\t\t? R\n\t\t\t: Spec extends { responses: { 204: any } }\n\t\t\t\t? undefined\n\t\t\t\t: unknown\n\t: never;\n\n// Remove never properties\ntype RemoveNever<T> = Pick<\n\tT,\n\t{\n\t\t[K in keyof T]: T[K] extends never ? never : K;\n\t}[keyof T]\n>;\n\n// Runtime operation registry (would be generated)\ninterface OperationRegistry {\n\t[operationId: string]: {\n\t\tpath: string;\n\t\tmethod: string;\n\t};\n}\n\nexport function createOpenAPIHooks<Paths>(\n\toptions: FetcherOptions & { operations?: OperationRegistry } = {},\n) {\n\tconst { operations, ...fetcherOptions } = options;\n\tconst fetcher = createTypedFetcher<Paths>(fetcherOptions);\n\n\tfunction buildEndpoint<OpId extends OperationId<Paths>>(\n\t\toperationId: OpId,\n\t): string {\n\t\t// Runtime lookup from registry\n\t\tconst op = operations?.[operationId as string];\n\t\tif (op) {\n\t\t\treturn `${op.method.toUpperCase()} ${op.path}`;\n\t\t}\n\t\t// Fallback for compile-time only usage\n\t\treturn operationId as string;\n\t}\n\n\treturn {\n\t\tuseQuery: <OpId extends OperationsByMethod<Paths, 'get'>>(\n\t\t\toperationId: OpId,\n\t\t\tconfig?: RemoveNever<OperationParams<Paths, OpId>>,\n\t\t\toptions?: Omit<\n\t\t\t\tUseQueryOptions<OperationResponse<Paths, OpId>, Error>,\n\t\t\t\t'queryKey' | 'queryFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\t\t\tconst queryKey = [operationId, ...(config ? [config] : [])];\n\n\t\t\treturn useQuery<OperationResponse<Paths, OpId>, Error>({\n\t\t\t\tqueryKey,\n\t\t\t\tqueryFn: async () => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, config as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\n\t\tuseMutation: <\n\t\t\tOpId extends Exclude<\n\t\t\t\tOperationId<Paths>,\n\t\t\t\tOperationsByMethod<Paths, 'get'>\n\t\t\t>,\n\t\t>(\n\t\t\toperationId: OpId,\n\t\t\toptions?: Omit<\n\t\t\t\tUseMutationOptions<\n\t\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\t\tError,\n\t\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t\t>,\n\t\t\t\t'mutationFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\n\t\t\treturn useMutation<\n\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\tError,\n\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t>({\n\t\t\t\tmutationFn: async (variables) => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, variables as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\t};\n}\n"],"mappings":";;;;;AAsHA,SAAgB,mBACfA,UAA+D,CAAE,GAChE;CACD,MAAM,EAAE,WAAY,GAAG,gBAAgB,GAAG;CAC1C,MAAM,UAAU,mCAA0B,eAAe;CAEzD,SAAS,cACRC,aACS;EAET,MAAM,KAAK,aAAa;AACxB,MAAI,GACH,SAAQ,EAAE,GAAG,OAAO,aAAa,CAAC,GAAG,GAAG,KAAK;AAG9C,SAAO;CACP;AAED,QAAO;EACN,UAAU,CACTA,aACAC,QACAC,cAII;GACJ,MAAM,WAAW,cAAc,YAAY;GAC3C,MAAM,WAAW,CAAC,aAAa,GAAI,SAAS,CAAC,MAAO,IAAG,CAAE,CAAE;AAE3D,UAAO,qCAAgD;IACtD;IACA,SAAS,YAAY;KACpB,MAAM,WAAW,MAAM,QAAQ,UAAiB,OAAc;AAC9D,YAAO;IACP;IACD,GAAGC;GACH,EAAC;EACF;EAED,aAAa,CAMZH,aACAI,cAQI;GACJ,MAAM,WAAW,cAAc,YAAY;AAE3C,UAAO,wCAIL;IACD,YAAY,OAAO,cAAc;KAChC,MAAM,WAAW,MAAM,QAAQ,UAAiB,UAAiB;AACjE,YAAO;IACP;IACD,GAAGD;GACH,EAAC;EACF;CACD;AACD"}
1
+ {"version":3,"file":"openapi-hooks.cjs","names":["createTypedFetcher","useQuery","useMutation"],"sources":["../src/openapi-hooks.ts"],"sourcesContent":["import type {\n\tUseMutationOptions,\n\tUseQueryOptions,\n} from '@tanstack/react-query';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { createTypedFetcher } from './fetcher';\nimport type { FetcherOptions } from './types';\n\n// Simplified type helpers for OpenAPI paths\ntype HttpMethods = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n// Extract all operations from paths\ntype AllOperations<Paths> = {\n\t[Path in keyof Paths]: {\n\t\t[Method in keyof Paths[Path] & HttpMethods]: Paths[Path][Method] extends {\n\t\t\toperationId: infer OpId;\n\t\t}\n\t\t\t? OpId extends string\n\t\t\t\t? {\n\t\t\t\t\t\toperationId: OpId;\n\t\t\t\t\t\tpath: Path;\n\t\t\t\t\t\tmethod: Method;\n\t\t\t\t\t\tspec: Paths[Path][Method] & {\n\t\t\t\t\t\t\t_pathParams?: Paths[Path] extends {\n\t\t\t\t\t\t\t\tparameters: { path: infer P };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t? P\n\t\t\t\t\t\t\t\t: never;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t: never\n\t\t\t: never;\n\t}[keyof Paths[Path] & HttpMethods];\n}[keyof Paths];\n\n// Create operation map\ntype OperationMap<Paths> = {\n\t[Op in AllOperations<Paths> as Op extends {\n\t\toperationId: infer Id extends string;\n\t}\n\t\t? Id\n\t\t: never]: Op;\n};\n\n// Get operation IDs\ntype OperationId<Paths> = keyof OperationMap<Paths>;\n\n// Get operations by method\ntype OperationsByMethod<Paths, Method extends HttpMethods> = {\n\t[K in OperationId<Paths>]: OperationMap<Paths>[K] extends { method: Method }\n\t\t? K\n\t\t: never;\n}[OperationId<Paths>];\n\n// Extract parameter types\ntype OperationParams<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends {\n\tpath: infer Path extends keyof Paths;\n\tspec: infer Spec;\n}\n\t? {\n\t\t\tparams?: Paths[Path] extends { parameters: { path: infer P } }\n\t\t\t\t? P\n\t\t\t\t: Spec extends { parameters: { path: infer P } }\n\t\t\t\t\t? P\n\t\t\t\t\t: never;\n\t\t\tquery?: Spec extends { parameters?: { query?: infer Q } } ? Q : never;\n\t\t\tbody?: Spec extends {\n\t\t\t\trequestBody: { content: { 'application/json': infer Body } };\n\t\t\t}\n\t\t\t\t? Body\n\t\t\t\t: Spec extends {\n\t\t\t\t\t\t\trequestBody: {\n\t\t\t\t\t\t\t\trequired: true;\n\t\t\t\t\t\t\t\tcontent: { 'application/json': infer Body };\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t? Body\n\t\t\t\t\t: never;\n\t\t}\n\t: never;\n\n// Extract response type\ntype OperationResponse<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends { spec: infer Spec }\n\t? Spec extends {\n\t\t\tresponses: { 200: { content: { 'application/json': infer R } } };\n\t\t}\n\t\t? R\n\t\t: Spec extends {\n\t\t\t\t\tresponses: { 201: { content: { 'application/json': infer R } } };\n\t\t\t\t}\n\t\t\t? R\n\t\t\t: Spec extends { responses: { 204: any } }\n\t\t\t\t? undefined\n\t\t\t\t: unknown\n\t: never;\n\n// Remove never properties\ntype RemoveNever<T> = Pick<\n\tT,\n\t{\n\t\t[K in keyof T]: T[K] extends never ? never : K;\n\t}[keyof T]\n>;\n\n// Runtime operation registry (would be generated)\ninterface OperationRegistry {\n\t[operationId: string]: {\n\t\tpath: string;\n\t\tmethod: string;\n\t};\n}\n\nexport function createOpenAPIHooks<Paths>(\n\toptions: FetcherOptions & { operations?: OperationRegistry } = {},\n) {\n\tconst { operations, ...fetcherOptions } = options;\n\tconst fetcher = createTypedFetcher<Paths>(fetcherOptions);\n\n\tfunction buildEndpoint<OpId extends OperationId<Paths>>(\n\t\toperationId: OpId,\n\t): string {\n\t\t// Runtime lookup from registry\n\t\tconst op = operations?.[operationId as string];\n\t\tif (op) {\n\t\t\treturn `${op.method.toUpperCase()} ${op.path}`;\n\t\t}\n\t\t// Fallback for compile-time only usage\n\t\treturn operationId as string;\n\t}\n\n\treturn {\n\t\tuseQuery: <OpId extends OperationsByMethod<Paths, 'get'>>(\n\t\t\toperationId: OpId,\n\t\t\tconfig?: RemoveNever<OperationParams<Paths, OpId>>,\n\t\t\toptions?: Omit<\n\t\t\t\tUseQueryOptions<OperationResponse<Paths, OpId>, Error>,\n\t\t\t\t'queryKey' | 'queryFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\t\t\tconst queryKey = [operationId, ...(config ? [config] : [])];\n\n\t\t\treturn useQuery<OperationResponse<Paths, OpId>, Error>({\n\t\t\t\tqueryKey,\n\t\t\t\tqueryFn: async () => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, config as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\n\t\tuseMutation: <\n\t\t\tOpId extends Exclude<\n\t\t\t\tOperationId<Paths>,\n\t\t\t\tOperationsByMethod<Paths, 'get'>\n\t\t\t>,\n\t\t>(\n\t\t\toperationId: OpId,\n\t\t\toptions?: Omit<\n\t\t\t\tUseMutationOptions<\n\t\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\t\tError,\n\t\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t\t>,\n\t\t\t\t'mutationFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\n\t\t\treturn useMutation<\n\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\tError,\n\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t>({\n\t\t\t\tmutationFn: async (variables) => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, variables as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\t};\n}\n"],"mappings":";;;;AAsHA,SAAgB,mBACf,UAA+D,CAAC,GAC/D;CACD,MAAM,EAAE,YAAY,GAAG,mBAAmB;CAC1C,MAAM,UAAUA,gBAAAA,mBAA0B,cAAc;CAExD,SAAS,cACR,aACS;EAET,MAAM,KAAK,aAAa;EACxB,IAAI,IACH,OAAO,GAAG,GAAG,OAAO,YAAY,EAAE,GAAG,GAAG;EAGzC,OAAO;CACR;CAEA,OAAO;EACN,WACC,aACA,QACA,YAII;GACJ,MAAM,WAAW,cAAc,WAAW;GAC1C,MAAM,WAAW,CAAC,aAAa,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;GAE1D,QAAA,GAAOC,sBAAAA,SAAAA,CAAgD;IACtD;IACA,SAAS,YAAY;KAEpB,OAAO,MADgB,QAAQ,UAAiB,MAAa;IAE9D;IACA,GAAG;GACJ,CAAC;EACF;EAEA,cAMC,aACA,YAQI;GACJ,MAAM,WAAW,cAAc,WAAW;GAE1C,QAAA,GAAOC,sBAAAA,YAAAA,CAIL;IACD,YAAY,OAAO,cAAc;KAEhC,OAAO,MADgB,QAAQ,UAAiB,SAAgB;IAEjE;IACA,GAAG;GACJ,CAAC;EACF;CACD;AACD"}
@@ -1,7 +1,5 @@
1
- import { FetcherOptions } from "./types-DMQMHePI.cjs";
2
- import * as _tanstack_react_query8 from "@tanstack/react-query";
1
+ import { FetcherOptions } from "./types.cjs";
3
2
  import { UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
4
-
5
3
  //#region src/openapi-hooks.d.ts
6
4
  type HttpMethods = 'get' | 'post' | 'put' | 'patch' | 'delete';
7
5
  type AllOperations<Paths> = { [Path in keyof Paths]: { [Method in keyof Paths[Path] & HttpMethods]: Paths[Path][Method] extends {
@@ -17,14 +15,14 @@ type AllOperations<Paths> = { [Path in keyof Paths]: { [Method in keyof Paths[Pa
17
15
  };
18
16
  } ? P : never;
19
17
  };
20
- } : never : never }[keyof Paths[Path] & HttpMethods] }[keyof Paths];
18
+ } : never : never; }[keyof Paths[Path] & HttpMethods]; }[keyof Paths];
21
19
  type OperationMap<Paths> = { [Op in AllOperations<Paths> as Op extends {
22
20
  operationId: infer Id extends string;
23
- } ? Id : never]: Op };
21
+ } ? Id : never]: Op; };
24
22
  type OperationId<Paths> = keyof OperationMap<Paths>;
25
23
  type OperationsByMethod<Paths, Method extends HttpMethods> = { [K in OperationId<Paths>]: OperationMap<Paths>[K] extends {
26
24
  method: Method;
27
- } ? K : never }[OperationId<Paths>];
25
+ } ? K : never; }[OperationId<Paths>];
28
26
  type OperationParams<Paths, OpId extends OperationId<Paths>> = OperationMap<Paths>[OpId] extends {
29
27
  path: infer Path extends keyof Paths;
30
28
  spec: infer Spec;
@@ -81,19 +79,18 @@ type OperationResponse<Paths, OpId extends OperationId<Paths>> = OperationMap<Pa
81
79
  204: any;
82
80
  };
83
81
  } ? undefined : unknown : never;
84
- type RemoveNever<T> = Pick<T, { [K in keyof T]: T[K] extends never ? never : K }[keyof T]>;
82
+ type RemoveNever<T> = Pick<T, { [K in keyof T]: T[K] extends never ? never : K; }[keyof T]>;
85
83
  interface OperationRegistry {
86
84
  [operationId: string]: {
87
85
  path: string;
88
86
  method: string;
89
87
  };
90
88
  }
91
- declare function createOpenAPIHooks<Paths>(options?: FetcherOptions & {
89
+ export declare function createOpenAPIHooks<Paths>(options?: FetcherOptions & {
92
90
  operations?: OperationRegistry;
93
91
  }): {
94
- useQuery: <OpId extends OperationsByMethod<Paths, "get">>(operationId: OpId, config?: RemoveNever<OperationParams<Paths, OpId>>, options?: Omit<UseQueryOptions<OperationResponse<Paths, OpId>, Error>, "queryKey" | "queryFn">) => _tanstack_react_query8.UseQueryResult<_tanstack_react_query8.NoInfer<OperationResponse<Paths, OpId>>, Error>;
95
- useMutation: <OpId extends Exclude<OperationId<Paths>, OperationsByMethod<Paths, "get">>>(operationId: OpId, options?: Omit<UseMutationOptions<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>>, "mutationFn">) => _tanstack_react_query8.UseMutationResult<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>, unknown>;
92
+ useQuery: <OpId extends OperationsByMethod<Paths, 'get'>>(operationId: OpId, config?: RemoveNever<OperationParams<Paths, OpId>>, options?: Omit<UseQueryOptions<OperationResponse<Paths, OpId>, Error>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<OperationResponse<Paths, OpId>, Error>;
93
+ useMutation: <OpId extends Exclude<OperationId<Paths>, OperationsByMethod<Paths, 'get'>>>(operationId: OpId, options?: Omit<UseMutationOptions<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>>, 'mutationFn'>) => import("@tanstack/react-query").UseMutationResult<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>, unknown>;
96
94
  };
97
95
  //#endregion
98
- export { createOpenAPIHooks };
99
96
  //# sourceMappingURL=openapi-hooks.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-hooks.d.cts","names":[],"sources":["../src/openapi-hooks.ts"],"sourcesContent":[],"mappings":";;;;;KASK,WAAA;KAGA,wCACW,qBAJA,MAKG,KALH,CAKS,IALT,CAAA,GAKiB,WALjB,GAK+B,KAL/B,CAKqC,IALrC,CAAA,CAK2C,MAL3C,CAAA,SAAA;EAGX,WAAa,EAAA,KAAA,KAAA;AAAA,CAAA,GAKb,IALa,SAAA,MAAA,GAAA;EACF,WAAA,EAMG,IANH;EACG,IAAA,EAMP,IANO;EAAM,MAAA,EAOX,MAPW;EAAQ,IAAA,EAQrB,KARqB,CAQf,IARe,CAAA,CAQT,MARS,CAAA,GAAA;IAAc,WAAA,CAAA,EAS1B,KAT0B,CASpB,IAToB,CAAA,SAAA;MAAM,UAAA,EAAA;QAAM,IAAA,EAAA,KAAA,EAAA;MAGtD,CAAA;IAEc,CAAA,GAOT,CAPS,GAAA,KAAA;EACP,CAAA;AACE,CAAA,GAAA,KAAA,GAAA,KAAA,EAAM,CAAA,MAWX,KAVG,CAUG,IAVH,CAAA,GAUW,WAVX,CAAA,EAAK,CAAA,MAWT,KAXU,CAAA;KAcb,YAdmB,CAAA,KAAA,CAAA,GAAA,SAehB,aAda,CAcC,KAdD,CAAA,IAcW,EAdX,SAAA;EAAM,WAAA,EAAA,KAAA,YAAA,MAAA;AAAI,CAAA,GAiB3B,EAdM,GAAA,KAAA,GAeE,EAfF,EAAC;KAmBN,WAbU,CAAA,KAAA,CAAA,GAAA,MAaiB,YAbjB,CAa8B,KAb9B,CAAA;KAgBV,kBAhBkB,CAAA,KAAA,EAAA,eAgBuB,WAhBvB,CAAA,GAAA,QAiBhB,WAhBC,C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a,YAChB,MAAM,cAAc,UAAU;EAC9B,mBAAmB;IAEjB,aACQ;KAIP,YAAY,eAAe,aAAa;KAGxC,mBAAmB,OAAO,eAAe,kBAC5C,KAAK,YAAY,SAAS,aAAa,OAAO;EAAa,QAAQ;IACjE,aAEF,YAAY;KAGT,gBACJ,OACA,aAAa,YAAY,UACtB,aAAa,OAAO;EACvB,YAAY,mBAAmB;EAC/B,YAAY;;EAGV,SAAS,MAAM;IAAgB;MAAc,YAAY;;MACtD,IACA;IAAe;MAAc,YAAY;;MACxC;EAEJ,QAAQ;IAAe;MAAe,cAAc;;MAAQ;EAC5D,OAAO;IACN;MAAe;QAAW,0BAA0B;;;MAElD,OACA;IACC;MACC;MACA;QAAW,0BAA0B;;;MAGtC;;KAMF,kBACJ,OACA,aAAa,YAAY,UACtB,aAAa,OAAO;EAAgB,YAAY;IACjD;EACA;IAAa;MAAO;QAAW,0BAA0B;;;;IAExD,IACA;EACC;IAAa;MAAO;QAAW,0BAA0B;;;;IAEzD,IACA;EAAe;IAAa;;;KAM5B,YAAY,KAAK,KACrB,MAEE,WAAW,IAAI,EAAE,2BAA2B,WACtC;UAIC;GACR;IACA;IACA;;;wBAIc,mBAAmB,OAClC,UAAS;EAAmB,aAAa;;EAkBxC,WAAW,aAAa,mBAAmB,eAAa,aAC1C,MAAI,SACR,YAAY,gBAAgB,OAAO,QAAM,UACxC,KACT,gBAAgB,kBAAkB,OAAO,OAAO,oEAEhD,eAAA,kBAAA,OAAA,OAAA;EAeF,cACC,aAAa,QACZ,YAAY,QACZ,mBAAmB,gBACnB,aAEY,MAAI,UACP,KACT,mBACC,kBAAkB,OAAO,OACzB,OACA,YAAY,gBAAgB,OAAO,2DAGpC,kBAAA,kBAAA,OAAA,OAAA,OAAA,YAAA,gBAAA,OAAA"}
@@ -1,7 +1,5 @@
1
- import { FetcherOptions } from "./types-BMGM6sZc.mjs";
2
- import * as _tanstack_react_query0 from "@tanstack/react-query";
1
+ import { FetcherOptions } from "./types.mjs";
3
2
  import { UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
4
-
5
3
  //#region src/openapi-hooks.d.ts
6
4
  type HttpMethods = 'get' | 'post' | 'put' | 'patch' | 'delete';
7
5
  type AllOperations<Paths> = { [Path in keyof Paths]: { [Method in keyof Paths[Path] & HttpMethods]: Paths[Path][Method] extends {
@@ -17,14 +15,14 @@ type AllOperations<Paths> = { [Path in keyof Paths]: { [Method in keyof Paths[Pa
17
15
  };
18
16
  } ? P : never;
19
17
  };
20
- } : never : never }[keyof Paths[Path] & HttpMethods] }[keyof Paths];
18
+ } : never : never; }[keyof Paths[Path] & HttpMethods]; }[keyof Paths];
21
19
  type OperationMap<Paths> = { [Op in AllOperations<Paths> as Op extends {
22
20
  operationId: infer Id extends string;
23
- } ? Id : never]: Op };
21
+ } ? Id : never]: Op; };
24
22
  type OperationId<Paths> = keyof OperationMap<Paths>;
25
23
  type OperationsByMethod<Paths, Method extends HttpMethods> = { [K in OperationId<Paths>]: OperationMap<Paths>[K] extends {
26
24
  method: Method;
27
- } ? K : never }[OperationId<Paths>];
25
+ } ? K : never; }[OperationId<Paths>];
28
26
  type OperationParams<Paths, OpId extends OperationId<Paths>> = OperationMap<Paths>[OpId] extends {
29
27
  path: infer Path extends keyof Paths;
30
28
  spec: infer Spec;
@@ -81,19 +79,18 @@ type OperationResponse<Paths, OpId extends OperationId<Paths>> = OperationMap<Pa
81
79
  204: any;
82
80
  };
83
81
  } ? undefined : unknown : never;
84
- type RemoveNever<T> = Pick<T, { [K in keyof T]: T[K] extends never ? never : K }[keyof T]>;
82
+ type RemoveNever<T> = Pick<T, { [K in keyof T]: T[K] extends never ? never : K; }[keyof T]>;
85
83
  interface OperationRegistry {
86
84
  [operationId: string]: {
87
85
  path: string;
88
86
  method: string;
89
87
  };
90
88
  }
91
- declare function createOpenAPIHooks<Paths>(options?: FetcherOptions & {
89
+ export declare function createOpenAPIHooks<Paths>(options?: FetcherOptions & {
92
90
  operations?: OperationRegistry;
93
91
  }): {
94
- useQuery: <OpId extends OperationsByMethod<Paths, "get">>(operationId: OpId, config?: RemoveNever<OperationParams<Paths, OpId>>, options?: Omit<UseQueryOptions<OperationResponse<Paths, OpId>, Error>, "queryKey" | "queryFn">) => _tanstack_react_query0.UseQueryResult<_tanstack_react_query0.NoInfer<OperationResponse<Paths, OpId>>, Error>;
95
- useMutation: <OpId extends Exclude<OperationId<Paths>, OperationsByMethod<Paths, "get">>>(operationId: OpId, options?: Omit<UseMutationOptions<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>>, "mutationFn">) => _tanstack_react_query0.UseMutationResult<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>, unknown>;
92
+ useQuery: <OpId extends OperationsByMethod<Paths, 'get'>>(operationId: OpId, config?: RemoveNever<OperationParams<Paths, OpId>>, options?: Omit<UseQueryOptions<OperationResponse<Paths, OpId>, Error>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query").UseQueryResult<OperationResponse<Paths, OpId>, Error>;
93
+ useMutation: <OpId extends Exclude<OperationId<Paths>, OperationsByMethod<Paths, 'get'>>>(operationId: OpId, options?: Omit<UseMutationOptions<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>>, 'mutationFn'>) => import("@tanstack/react-query").UseMutationResult<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>, unknown>;
96
94
  };
97
95
  //#endregion
98
- export { createOpenAPIHooks };
99
96
  //# sourceMappingURL=openapi-hooks.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-hooks.d.mts","names":[],"sources":["../src/openapi-hooks.ts"],"sourcesContent":[],"mappings":";;;;;KASK,WAAA;KAGA,wCACW,qBAJA,MAKG,KALH,CAKS,IALT,CAAA,GAKiB,WALjB,GAK+B,KAL/B,CAKqC,IALrC,CAAA,CAK2C,MAL3C,CAAA,SAAA;EAGX,WAAa,EAAA,KAAA,KAAA;AAAA,CAAA,GAKb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;;;MAGtC;;KAMF,kBACJ,OACA,aAAa,YAAY,UACtB,aAAa,OAAO;EAAgB,YAAY;IACjD;EACA;IAAa;MAAO;QAAW,0BAA0B;;;;IAExD,IACA;EACC;IAAa;MAAO;QAAW,0BAA0B;;;;IAEzD,IACA;EAAe;IAAa;;;KAM5B,YAAY,KAAK,KACrB,MAEE,WAAW,IAAI,EAAE,2BAA2B,WACtC;UAIC;GACR;IACA;IACA;;;wBAIc,mBAAmB,OAClC,UAAS;EAAmB,aAAa;;EAkBxC,WAAW,aAAa,mBAAmB,eAAa,aAC1C,MAAI,SACR,YAAY,gBAAgB,OAAO,QAAM,UACxC,KACT,gBAAgB,kBAAkB,OAAO,OAAO,oEAEhD,eAAA,kBAAA,OAAA,OAAA;EAeF,cACC,aAAa,QACZ,YAAY,QACZ,mBAAmB,gBACnB,aAEY,MAAI,UACP,KACT,mBACC,kBAAkB,OAAO,OACzB,OACA,YAAY,gBAAgB,OAAO,2DAGpC,kBAAA,kBAAA,OAAA,OAAA,OAAA,YAAA,gBAAA,OAAA"}
@@ -1,9 +1,8 @@
1
- import { createTypedFetcher } from "./fetcher-CakjC9C7.mjs";
1
+ import { createTypedFetcher } from "./fetcher.mjs";
2
2
  import { useMutation, useQuery } from "@tanstack/react-query";
3
-
4
3
  //#region src/openapi-hooks.ts
5
4
  function createOpenAPIHooks(options = {}) {
6
- const { operations,...fetcherOptions } = options;
5
+ const { operations, ...fetcherOptions } = options;
7
6
  const fetcher = createTypedFetcher(fetcherOptions);
8
7
  function buildEndpoint(operationId) {
9
8
  const op = operations?.[operationId];
@@ -11,31 +10,29 @@ function createOpenAPIHooks(options = {}) {
11
10
  return operationId;
12
11
  }
13
12
  return {
14
- useQuery: (operationId, config, options$1) => {
13
+ useQuery: (operationId, config, options) => {
15
14
  const endpoint = buildEndpoint(operationId);
16
15
  const queryKey = [operationId, ...config ? [config] : []];
17
16
  return useQuery({
18
17
  queryKey,
19
18
  queryFn: async () => {
20
- const response = await fetcher(endpoint, config);
21
- return response;
19
+ return await fetcher(endpoint, config);
22
20
  },
23
- ...options$1
21
+ ...options
24
22
  });
25
23
  },
26
- useMutation: (operationId, options$1) => {
24
+ useMutation: (operationId, options) => {
27
25
  const endpoint = buildEndpoint(operationId);
28
26
  return useMutation({
29
27
  mutationFn: async (variables) => {
30
- const response = await fetcher(endpoint, variables);
31
- return response;
28
+ return await fetcher(endpoint, variables);
32
29
  },
33
- ...options$1
30
+ ...options
34
31
  });
35
32
  }
36
33
  };
37
34
  }
38
-
39
35
  //#endregion
40
36
  export { createOpenAPIHooks };
37
+
41
38
  //# sourceMappingURL=openapi-hooks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-hooks.mjs","names":["options: FetcherOptions & { operations?: OperationRegistry }","operationId: OpId","config?: RemoveNever<OperationParams<Paths, OpId>>","options?: Omit<\n\t\t\t\tUseQueryOptions<OperationResponse<Paths, OpId>, Error>,\n\t\t\t\t'queryKey' | 'queryFn'\n\t\t\t>","options","options?: Omit<\n\t\t\t\tUseMutationOptions<\n\t\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\t\tError,\n\t\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t\t>,\n\t\t\t\t'mutationFn'\n\t\t\t>"],"sources":["../src/openapi-hooks.ts"],"sourcesContent":["import type {\n\tUseMutationOptions,\n\tUseQueryOptions,\n} from '@tanstack/react-query';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { createTypedFetcher } from './fetcher';\nimport type { FetcherOptions } from './types';\n\n// Simplified type helpers for OpenAPI paths\ntype HttpMethods = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n// Extract all operations from paths\ntype AllOperations<Paths> = {\n\t[Path in keyof Paths]: {\n\t\t[Method in keyof Paths[Path] & HttpMethods]: Paths[Path][Method] extends {\n\t\t\toperationId: infer OpId;\n\t\t}\n\t\t\t? OpId extends string\n\t\t\t\t? {\n\t\t\t\t\t\toperationId: OpId;\n\t\t\t\t\t\tpath: Path;\n\t\t\t\t\t\tmethod: Method;\n\t\t\t\t\t\tspec: Paths[Path][Method] & {\n\t\t\t\t\t\t\t_pathParams?: Paths[Path] extends {\n\t\t\t\t\t\t\t\tparameters: { path: infer P };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t? P\n\t\t\t\t\t\t\t\t: never;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t: never\n\t\t\t: never;\n\t}[keyof Paths[Path] & HttpMethods];\n}[keyof Paths];\n\n// Create operation map\ntype OperationMap<Paths> = {\n\t[Op in AllOperations<Paths> as Op extends {\n\t\toperationId: infer Id extends string;\n\t}\n\t\t? Id\n\t\t: never]: Op;\n};\n\n// Get operation IDs\ntype OperationId<Paths> = keyof OperationMap<Paths>;\n\n// Get operations by method\ntype OperationsByMethod<Paths, Method extends HttpMethods> = {\n\t[K in OperationId<Paths>]: OperationMap<Paths>[K] extends { method: Method }\n\t\t? K\n\t\t: never;\n}[OperationId<Paths>];\n\n// Extract parameter types\ntype OperationParams<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends {\n\tpath: infer Path extends keyof Paths;\n\tspec: infer Spec;\n}\n\t? {\n\t\t\tparams?: Paths[Path] extends { parameters: { path: infer P } }\n\t\t\t\t? P\n\t\t\t\t: Spec extends { parameters: { path: infer P } }\n\t\t\t\t\t? P\n\t\t\t\t\t: never;\n\t\t\tquery?: Spec extends { parameters?: { query?: infer Q } } ? Q : never;\n\t\t\tbody?: Spec extends {\n\t\t\t\trequestBody: { content: { 'application/json': infer Body } };\n\t\t\t}\n\t\t\t\t? Body\n\t\t\t\t: Spec extends {\n\t\t\t\t\t\t\trequestBody: {\n\t\t\t\t\t\t\t\trequired: true;\n\t\t\t\t\t\t\t\tcontent: { 'application/json': infer Body };\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t? Body\n\t\t\t\t\t: never;\n\t\t}\n\t: never;\n\n// Extract response type\ntype OperationResponse<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends { spec: infer Spec }\n\t? Spec extends {\n\t\t\tresponses: { 200: { content: { 'application/json': infer R } } };\n\t\t}\n\t\t? R\n\t\t: Spec extends {\n\t\t\t\t\tresponses: { 201: { content: { 'application/json': infer R } } };\n\t\t\t\t}\n\t\t\t? R\n\t\t\t: Spec extends { responses: { 204: any } }\n\t\t\t\t? undefined\n\t\t\t\t: unknown\n\t: never;\n\n// Remove never properties\ntype RemoveNever<T> = Pick<\n\tT,\n\t{\n\t\t[K in keyof T]: T[K] extends never ? never : K;\n\t}[keyof T]\n>;\n\n// Runtime operation registry (would be generated)\ninterface OperationRegistry {\n\t[operationId: string]: {\n\t\tpath: string;\n\t\tmethod: string;\n\t};\n}\n\nexport function createOpenAPIHooks<Paths>(\n\toptions: FetcherOptions & { operations?: OperationRegistry } = {},\n) {\n\tconst { operations, ...fetcherOptions } = options;\n\tconst fetcher = createTypedFetcher<Paths>(fetcherOptions);\n\n\tfunction buildEndpoint<OpId extends OperationId<Paths>>(\n\t\toperationId: OpId,\n\t): string {\n\t\t// Runtime lookup from registry\n\t\tconst op = operations?.[operationId as string];\n\t\tif (op) {\n\t\t\treturn `${op.method.toUpperCase()} ${op.path}`;\n\t\t}\n\t\t// Fallback for compile-time only usage\n\t\treturn operationId as string;\n\t}\n\n\treturn {\n\t\tuseQuery: <OpId extends OperationsByMethod<Paths, 'get'>>(\n\t\t\toperationId: OpId,\n\t\t\tconfig?: RemoveNever<OperationParams<Paths, OpId>>,\n\t\t\toptions?: Omit<\n\t\t\t\tUseQueryOptions<OperationResponse<Paths, OpId>, Error>,\n\t\t\t\t'queryKey' | 'queryFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\t\t\tconst queryKey = [operationId, ...(config ? [config] : [])];\n\n\t\t\treturn useQuery<OperationResponse<Paths, OpId>, Error>({\n\t\t\t\tqueryKey,\n\t\t\t\tqueryFn: async () => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, config as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\n\t\tuseMutation: <\n\t\t\tOpId extends Exclude<\n\t\t\t\tOperationId<Paths>,\n\t\t\t\tOperationsByMethod<Paths, 'get'>\n\t\t\t>,\n\t\t>(\n\t\t\toperationId: OpId,\n\t\t\toptions?: Omit<\n\t\t\t\tUseMutationOptions<\n\t\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\t\tError,\n\t\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t\t>,\n\t\t\t\t'mutationFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\n\t\t\treturn useMutation<\n\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\tError,\n\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t>({\n\t\t\t\tmutationFn: async (variables) => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, variables as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\t};\n}\n"],"mappings":";;;;AAsHA,SAAgB,mBACfA,UAA+D,CAAE,GAChE;CACD,MAAM,EAAE,WAAY,GAAG,gBAAgB,GAAG;CAC1C,MAAM,UAAU,mBAA0B,eAAe;CAEzD,SAAS,cACRC,aACS;EAET,MAAM,KAAK,aAAa;AACxB,MAAI,GACH,SAAQ,EAAE,GAAG,OAAO,aAAa,CAAC,GAAG,GAAG,KAAK;AAG9C,SAAO;CACP;AAED,QAAO;EACN,UAAU,CACTA,aACAC,QACAC,cAII;GACJ,MAAM,WAAW,cAAc,YAAY;GAC3C,MAAM,WAAW,CAAC,aAAa,GAAI,SAAS,CAAC,MAAO,IAAG,CAAE,CAAE;AAE3D,UAAO,SAAgD;IACtD;IACA,SAAS,YAAY;KACpB,MAAM,WAAW,MAAM,QAAQ,UAAiB,OAAc;AAC9D,YAAO;IACP;IACD,GAAGC;GACH,EAAC;EACF;EAED,aAAa,CAMZH,aACAI,cAQI;GACJ,MAAM,WAAW,cAAc,YAAY;AAE3C,UAAO,YAIL;IACD,YAAY,OAAO,cAAc;KAChC,MAAM,WAAW,MAAM,QAAQ,UAAiB,UAAiB;AACjE,YAAO;IACP;IACD,GAAGD;GACH,EAAC;EACF;CACD;AACD"}
1
+ {"version":3,"file":"openapi-hooks.mjs","names":[],"sources":["../src/openapi-hooks.ts"],"sourcesContent":["import type {\n\tUseMutationOptions,\n\tUseQueryOptions,\n} from '@tanstack/react-query';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { createTypedFetcher } from './fetcher';\nimport type { FetcherOptions } from './types';\n\n// Simplified type helpers for OpenAPI paths\ntype HttpMethods = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n// Extract all operations from paths\ntype AllOperations<Paths> = {\n\t[Path in keyof Paths]: {\n\t\t[Method in keyof Paths[Path] & HttpMethods]: Paths[Path][Method] extends {\n\t\t\toperationId: infer OpId;\n\t\t}\n\t\t\t? OpId extends string\n\t\t\t\t? {\n\t\t\t\t\t\toperationId: OpId;\n\t\t\t\t\t\tpath: Path;\n\t\t\t\t\t\tmethod: Method;\n\t\t\t\t\t\tspec: Paths[Path][Method] & {\n\t\t\t\t\t\t\t_pathParams?: Paths[Path] extends {\n\t\t\t\t\t\t\t\tparameters: { path: infer P };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t? P\n\t\t\t\t\t\t\t\t: never;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t: never\n\t\t\t: never;\n\t}[keyof Paths[Path] & HttpMethods];\n}[keyof Paths];\n\n// Create operation map\ntype OperationMap<Paths> = {\n\t[Op in AllOperations<Paths> as Op extends {\n\t\toperationId: infer Id extends string;\n\t}\n\t\t? Id\n\t\t: never]: Op;\n};\n\n// Get operation IDs\ntype OperationId<Paths> = keyof OperationMap<Paths>;\n\n// Get operations by method\ntype OperationsByMethod<Paths, Method extends HttpMethods> = {\n\t[K in OperationId<Paths>]: OperationMap<Paths>[K] extends { method: Method }\n\t\t? K\n\t\t: never;\n}[OperationId<Paths>];\n\n// Extract parameter types\ntype OperationParams<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends {\n\tpath: infer Path extends keyof Paths;\n\tspec: infer Spec;\n}\n\t? {\n\t\t\tparams?: Paths[Path] extends { parameters: { path: infer P } }\n\t\t\t\t? P\n\t\t\t\t: Spec extends { parameters: { path: infer P } }\n\t\t\t\t\t? P\n\t\t\t\t\t: never;\n\t\t\tquery?: Spec extends { parameters?: { query?: infer Q } } ? Q : never;\n\t\t\tbody?: Spec extends {\n\t\t\t\trequestBody: { content: { 'application/json': infer Body } };\n\t\t\t}\n\t\t\t\t? Body\n\t\t\t\t: Spec extends {\n\t\t\t\t\t\t\trequestBody: {\n\t\t\t\t\t\t\t\trequired: true;\n\t\t\t\t\t\t\t\tcontent: { 'application/json': infer Body };\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t? Body\n\t\t\t\t\t: never;\n\t\t}\n\t: never;\n\n// Extract response type\ntype OperationResponse<\n\tPaths,\n\tOpId extends OperationId<Paths>,\n> = OperationMap<Paths>[OpId] extends { spec: infer Spec }\n\t? Spec extends {\n\t\t\tresponses: { 200: { content: { 'application/json': infer R } } };\n\t\t}\n\t\t? R\n\t\t: Spec extends {\n\t\t\t\t\tresponses: { 201: { content: { 'application/json': infer R } } };\n\t\t\t\t}\n\t\t\t? R\n\t\t\t: Spec extends { responses: { 204: any } }\n\t\t\t\t? undefined\n\t\t\t\t: unknown\n\t: never;\n\n// Remove never properties\ntype RemoveNever<T> = Pick<\n\tT,\n\t{\n\t\t[K in keyof T]: T[K] extends never ? never : K;\n\t}[keyof T]\n>;\n\n// Runtime operation registry (would be generated)\ninterface OperationRegistry {\n\t[operationId: string]: {\n\t\tpath: string;\n\t\tmethod: string;\n\t};\n}\n\nexport function createOpenAPIHooks<Paths>(\n\toptions: FetcherOptions & { operations?: OperationRegistry } = {},\n) {\n\tconst { operations, ...fetcherOptions } = options;\n\tconst fetcher = createTypedFetcher<Paths>(fetcherOptions);\n\n\tfunction buildEndpoint<OpId extends OperationId<Paths>>(\n\t\toperationId: OpId,\n\t): string {\n\t\t// Runtime lookup from registry\n\t\tconst op = operations?.[operationId as string];\n\t\tif (op) {\n\t\t\treturn `${op.method.toUpperCase()} ${op.path}`;\n\t\t}\n\t\t// Fallback for compile-time only usage\n\t\treturn operationId as string;\n\t}\n\n\treturn {\n\t\tuseQuery: <OpId extends OperationsByMethod<Paths, 'get'>>(\n\t\t\toperationId: OpId,\n\t\t\tconfig?: RemoveNever<OperationParams<Paths, OpId>>,\n\t\t\toptions?: Omit<\n\t\t\t\tUseQueryOptions<OperationResponse<Paths, OpId>, Error>,\n\t\t\t\t'queryKey' | 'queryFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\t\t\tconst queryKey = [operationId, ...(config ? [config] : [])];\n\n\t\t\treturn useQuery<OperationResponse<Paths, OpId>, Error>({\n\t\t\t\tqueryKey,\n\t\t\t\tqueryFn: async () => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, config as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\n\t\tuseMutation: <\n\t\t\tOpId extends Exclude<\n\t\t\t\tOperationId<Paths>,\n\t\t\t\tOperationsByMethod<Paths, 'get'>\n\t\t\t>,\n\t\t>(\n\t\t\toperationId: OpId,\n\t\t\toptions?: Omit<\n\t\t\t\tUseMutationOptions<\n\t\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\t\tError,\n\t\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t\t>,\n\t\t\t\t'mutationFn'\n\t\t\t>,\n\t\t) => {\n\t\t\tconst endpoint = buildEndpoint(operationId);\n\n\t\t\treturn useMutation<\n\t\t\t\tOperationResponse<Paths, OpId>,\n\t\t\t\tError,\n\t\t\t\tRemoveNever<OperationParams<Paths, OpId>>\n\t\t\t>({\n\t\t\t\tmutationFn: async (variables) => {\n\t\t\t\t\tconst response = await fetcher(endpoint as any, variables as any);\n\t\t\t\t\treturn response as OperationResponse<Paths, OpId>;\n\t\t\t\t},\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\t};\n}\n"],"mappings":";;;AAsHA,SAAgB,mBACf,UAA+D,CAAC,GAC/D;CACD,MAAM,EAAE,YAAY,GAAG,mBAAmB;CAC1C,MAAM,UAAU,mBAA0B,cAAc;CAExD,SAAS,cACR,aACS;EAET,MAAM,KAAK,aAAa;EACxB,IAAI,IACH,OAAO,GAAG,GAAG,OAAO,YAAY,EAAE,GAAG,GAAG;EAGzC,OAAO;CACR;CAEA,OAAO;EACN,WACC,aACA,QACA,YAII;GACJ,MAAM,WAAW,cAAc,WAAW;GAC1C,MAAM,WAAW,CAAC,aAAa,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;GAE1D,OAAO,SAAgD;IACtD;IACA,SAAS,YAAY;KAEpB,OAAO,MADgB,QAAQ,UAAiB,MAAa;IAE9D;IACA,GAAG;GACJ,CAAC;EACF;EAEA,cAMC,aACA,YAQI;GACJ,MAAM,WAAW,cAAc,WAAW;GAE1C,OAAO,YAIL;IACD,YAAY,OAAO,cAAc;KAEhC,OAAO,MADgB,QAAQ,UAAiB,SAAgB;IAEjE;IACA,GAAG;GACJ,CAAC;EACF;CACD;AACD"}
@@ -1,12 +1,12 @@
1
1
  //#region src/openapi-types.d.ts
2
2
  /**
3
- * This file should be auto-generated by openapi-typescript.
4
- * Run: npx openapi-typescript <your-openapi-spec> -o ./openapi-types.d.ts
3
+ * A hand-written `paths` fixture in openapi-typescript's shape, for the
4
+ * client's own tests. Applications get theirs from `gkm build`, which writes
5
+ * a typed client per surface to `.gkm/openapi/<surface>.ts`.
5
6
  *
6
7
  * This is a placeholder file showing the expected structure.
7
8
  */
8
-
9
- interface paths {
9
+ export interface paths {
10
10
  '/job/{id}': {
11
11
  parameters: {
12
12
  query?: never;
@@ -422,7 +422,7 @@ interface paths {
422
422
  };
423
423
  };
424
424
  }
425
- interface components {
425
+ export interface components {
426
426
  schemas: {
427
427
  User: {
428
428
  id: string;
@@ -439,5 +439,4 @@ interface components {
439
439
  };
440
440
  }
441
441
  //#endregion
442
- export { components, paths };
443
442
  //# sourceMappingURL=openapi-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-types.d.cts","names":["paths","Array","Record","components"],"sources":["../src/openapi-types.d.ts"],"sourcesContent":["/**\n * This file should be auto-generated by openapi-typescript.\n * Run: npx openapi-typescript <your-openapi-spec> -o ./openapi-types.d.ts\n *\n * This is a placeholder file showing the expected structure.\n */\n\nexport interface paths {\n\t'/job/{id}': {\n\t\tparameters: {\n\t\t\tquery?: never;\n\t\t\theader?: never;\n\t\t\tpath?: never;\n\t\t\tcookie?: never;\n\t\t};\n\t\tget: {\n\t\t\toperationId: 'getJob';\n\t\t\tparameters: {\n\t\t\t\tquery?: never;\n\t\t\t\theader?: never;\n\t\t\t\tpath: {\n\t\t\t\t\tid: string;\n\t\t\t\t};\n\t\t\t\tcookie?: never;\n\t\t\t};\n\t\t\trequestBody?: never;\n\t\t\tresponses: {\n\t\t\t\t/** @description Successful response */\n\t\t\t\t200: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t[name: string]: unknown;\n\t\t\t\t\t};\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\trole: string;\n\t\t\t\t\t\t\toverview: string;\n\t\t\t\t\t\t\tqualifications: string;\n\t\t\t\t\t\t\thourlyRate: {\n\t\t\t\t\t\t\t\tmax: number;\n\t\t\t\t\t\t\t\tmin: number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdateNeeded: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tshiftHours: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tcreatedAt: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tupdatedAt: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tbusinessId: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tcreatorId: string;\n\t\t\t\t\t\t\t/** @enum {string} */\n\t\t\t\t\t\t\tstatus: 'Draft' | 'Active' | 'Closed' | 'Filled';\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tput: {\n\t\t\toperationId: 'updateJob';\n\t\t\tparameters: {\n\t\t\t\tquery?: never;\n\t\t\t\theader?: never;\n\t\t\t\tpath: {\n\t\t\t\t\tid: string;\n\t\t\t\t};\n\t\t\t\tcookie?: never;\n\t\t\t};\n\t\t\trequestBody: {\n\t\t\t\tcontent: {\n\t\t\t\t\t'application/json': {\n\t\t\t\t\t\trole?: string;\n\t\t\t\t\t\toverview?: string;\n\t\t\t\t\t\tqualifications?: string;\n\t\t\t\t\t\thourlyRate?: {\n\t\t\t\t\t\t\tmax: number;\n\t\t\t\t\t\t\tmin: number;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tdateNeeded?: {\n\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tshiftHours?: {\n\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t\t/** @enum {string} */\n\t\t\t\t\t\tstatus?: 'Draft' | 'Active' | 'Closed' | 'Filled';\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t/** @description Successful response */\n\t\t\t\t200: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t[name: string]: unknown;\n\t\t\t\t\t};\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\trole: string;\n\t\t\t\t\t\t\toverview: string;\n\t\t\t\t\t\t\tqualifications: string;\n\t\t\t\t\t\t\thourlyRate: {\n\t\t\t\t\t\t\t\tmax: number;\n\t\t\t\t\t\t\t\tmin: number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdateNeeded: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tshiftHours: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tcreatedAt: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tupdatedAt: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tbusinessId: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tcreatorId: string;\n\t\t\t\t\t\t\t/** @enum {string} */\n\t\t\t\t\t\t\tstatus: 'Draft' | 'Active' | 'Closed' | 'Filled';\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tpost?: never;\n\t\tdelete: {\n\t\t\toperationId: 'deleteJob';\n\t\t\tparameters: {\n\t\t\t\tquery?: never;\n\t\t\t\theader?: never;\n\t\t\t\tpath: {\n\t\t\t\t\tid: string;\n\t\t\t\t};\n\t\t\t\tcookie?: never;\n\t\t\t};\n\t\t\trequestBody?: never;\n\t\t\tresponses: {\n\t\t\t\t/** @description Successful response */\n\t\t\t\t200: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t[name: string]: unknown;\n\t\t\t\t\t};\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\toptions?: never;\n\t\thead?: never;\n\t\tpatch?: never;\n\t\ttrace?: never;\n\t};\n\t'/users': {\n\t\tget: {\n\t\t\toperationId: 'listUsers';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tpage?: number;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t\tsort?: 'asc' | 'desc';\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tusers: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tpost: {\n\t\t\toperationId: 'createUser';\n\t\t\trequestBody: {\n\t\t\t\tcontent: {\n\t\t\t\t\t'application/json': {\n\t\t\t\t\t\tname: string;\n\t\t\t\t\t\temail: string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t201: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/users/{id}': {\n\t\tparameters: {\n\t\t\tpath: {\n\t\t\t\tid: string;\n\t\t\t};\n\t\t};\n\t\tget: {\n\t\t\toperationId: 'getUser';\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tput: {\n\t\t\toperationId: 'updateUser';\n\t\t\trequestBody: {\n\t\t\t\tcontent: {\n\t\t\t\t\t'application/json': {\n\t\t\t\t\t\tname?: string;\n\t\t\t\t\t\temail?: string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tdelete: {\n\t\t\toperationId: 'deleteUser';\n\t\t\tresponses: {\n\t\t\t\t204: {\n\t\t\t\t\tcontent: never;\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/posts': {\n\t\tget: {\n\t\t\toperationId: 'listPosts';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tpage?: number;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t\tsort?: 'asc' | 'desc';\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tposts: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\ttitle: string;\n\t\t\t\t\t\t\t\tcontent: string;\n\t\t\t\t\t\t\t\tauthorId: string;\n\t\t\t\t\t\t\t\tcreatedAt: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tpagination: {\n\t\t\t\t\t\t\t\tpage: number;\n\t\t\t\t\t\t\t\tlimit: number;\n\t\t\t\t\t\t\t\ttotal: number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsort: 'asc' | 'desc';\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/protected': {\n\t\tget: {\n\t\t\toperationId: 'getProtected';\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\t401: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/error': {\n\t\tget: {\n\t\t\toperationId: 'getError';\n\t\t\tresponses: {\n\t\t\t\t500: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/users/paginated': {\n\t\tget: {\n\t\t\toperationId: 'getUsersPaginated';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tpage?: number;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tusers: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tpagination: {\n\t\t\t\t\t\t\t\tpage: number;\n\t\t\t\t\t\t\t\tlimit: number;\n\t\t\t\t\t\t\t\ttotal: number;\n\t\t\t\t\t\t\t\thasMore: boolean;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/messages': {\n\t\tget: {\n\t\t\toperationId: 'getMessages';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tcursor?: string;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessages: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\ttext: string;\n\t\t\t\t\t\t\t\ttimestamp: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tnextCursor: string | null;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/echo': {\n\t\tget: {\n\t\t\toperationId: 'echo';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\t[key: string]: string | number | boolean;\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tqueryParams: Record<string, string>;\n\t\t\t\t\t\t\tdata: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\tvalue: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tpagination: {\n\t\t\t\t\t\t\t\tpage: number;\n\t\t\t\t\t\t\t\tlimit: number;\n\t\t\t\t\t\t\t\ttotal: number;\n\t\t\t\t\t\t\t\thasMore: boolean;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n}\n\nexport interface components {\n\tschemas: {\n\t\tUser: {\n\t\t\tid: string;\n\t\t\tname: string;\n\t\t\temail: string;\n\t\t};\n\t\tPost: {\n\t\t\tid: string;\n\t\t\ttitle: string;\n\t\t\tcontent: string;\n\t\t\tauthorId: string;\n\t\t\tcreatedAt: string;\n\t\t};\n\t};\n}\n"],"mappings":";;AAOA;;;;;;AA8YoBE,UA9YHF,KAAAA,CA8YGE;EAAM,WACbD,EAAAA;IAAK,UAAA,EAAA;MAkBlB,KAAiBE,CAAAA,EAAAA,KAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA9OHF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkGAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BGA;;;;;;;;;;;;;;;;;;;;;;;;2BAwBGC;oBACPD;;;;;;;;;;;;;;;;;UAkBIE,UAAAA"}
1
+ {"version":3,"file":"openapi-types.d.cts","names":[],"sources":["../src/openapi-types.d.ts"],"mappings":";;;;;;;;iBAQiB;EAChB;IACC;MACC;MACA;MACA;MACA;;IAED;MACC;MACA;QACC;QACA;QACA;UACC;;QAED;;MAED;MACA;;QAEC;UACC;aACE;;UAEF;YACC;cACC;cACA;cACA;cACA;gBACC;gBACA;;cAED;gBACC;gBACA;;cAED;gBACC;gBACA;;;cAGD;;cAEA;;cAEA;;cAEA;;cAEA;;cAEA;;;;;;IAML;MACC;MACA;QACC;QACA;QACA;UACC;;QAED;;MAED;QACC;UACC;YACC;YACA;YACA;YACA;cACC;cACA;;YAED;cACC;cACA;;YAED;cACC;cACA;;;YAGD;;;;MAIH;;QAEC;UACC;aACE;;UAEF;YACC;cACC;cACA;cACA;cACA;gBACC;gBACA;;cAED;gBACC;gBACA;;cAED;gBACC;gBACA;;;cAGD;;cAEA;;cAEA;;cAEA;;cAEA;;cAEA;;;;;;IAML;IACA;MACC;MACA;QACC;QACA;QACA;UACC;;QAED;;MAED;MACA;;QAEC;UACC;aACE;;UAEF;YACC;cACC;;cAEA;;;;;;IAML;IACA;IACA;IACA;;EAED;IACC;MACC;MACA;QACC;UACC;UACA;UACA;;;MAGF;QACC;UACC;YACC;cACC,OAAO;gBACN;gBACA;gBACA;;;;;;;IAON;MACC;MACA;QACC;UACC;YACC;YACA;;;;MAIH;QACC;UACC;YACC;cACC;cACA;cACA;;;;;;;EAON;IACC;MACC;QACC;;;IAGF;MACC;MACA;QACC;UACC;YACC;cACC;cACA;cACA;;;;;;IAML;MACC;MACA;QACC;UACC;YACC;YACA;;;;MAIH;QACC;UACC;YACC;cACC;cACA;cACA;;;;;;IAML;MACC;MACA;QACC;UACC;;;;;EAKJ;IACC;MACC;MACA;QACC;UACC;UACA;UACA;;;MAGF;QACC;UACC;YACC;cACC,OAAO;gBACN;gBACA;gBACA;gBACA;gBACA;;cAED;gBACC;gBACA;gBACA;;cAED;;;;;;;EAON;IACC;MACC;MACA;QACC;UACC;YACC;cACC;;;;QAIH;UACC;YACC;cACC;;;;;;;EAON;IACC;MACC;MACA;QACC;UACC;YACC;cACC;;;;;;;EAON;IACC;MACC;MACA;QACC;UACC;UACA;;;MAGF;QACC;UACC;YACC;cACC,OAAO;gBACN;gBACA;gBACA;;cAED;gBACC;gBACA;gBACA;gBACA;;;;;;;;EAQP;IACC;MACC;MACA;QACC;UACC;UACA;;;MAGF;QACC;UACC;YACC;cACC,UAAU;gBACT;gBACA;gBACA;;cAED;;;;;;;EAON;IACC;MACC;MACA;QACC;WACE;;;MAGH;QACC;UACC;YACC;cACC,aAAa;cACb,MAAM;gBACL;gBACA;;cAED;gBACC;gBACA;gBACA;gBACA;;;;;;;;;iBAUS;EAChB;IACC;MACC;MACA;MACA;;IAED;MACC;MACA;MACA;MACA;MACA"}
@@ -1,12 +1,12 @@
1
1
  //#region src/openapi-types.d.ts
2
2
  /**
3
- * This file should be auto-generated by openapi-typescript.
4
- * Run: npx openapi-typescript <your-openapi-spec> -o ./openapi-types.d.ts
3
+ * A hand-written `paths` fixture in openapi-typescript's shape, for the
4
+ * client's own tests. Applications get theirs from `gkm build`, which writes
5
+ * a typed client per surface to `.gkm/openapi/<surface>.ts`.
5
6
  *
6
7
  * This is a placeholder file showing the expected structure.
7
8
  */
8
-
9
- interface paths {
9
+ export interface paths {
10
10
  '/job/{id}': {
11
11
  parameters: {
12
12
  query?: never;
@@ -422,7 +422,7 @@ interface paths {
422
422
  };
423
423
  };
424
424
  }
425
- interface components {
425
+ export interface components {
426
426
  schemas: {
427
427
  User: {
428
428
  id: string;
@@ -439,5 +439,4 @@ interface components {
439
439
  };
440
440
  }
441
441
  //#endregion
442
- export { components, paths };
443
442
  //# sourceMappingURL=openapi-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-types.d.mts","names":["paths","Array","Record","components"],"sources":["../src/openapi-types.d.ts"],"sourcesContent":["/**\n * This file should be auto-generated by openapi-typescript.\n * Run: npx openapi-typescript <your-openapi-spec> -o ./openapi-types.d.ts\n *\n * This is a placeholder file showing the expected structure.\n */\n\nexport interface paths {\n\t'/job/{id}': {\n\t\tparameters: {\n\t\t\tquery?: never;\n\t\t\theader?: never;\n\t\t\tpath?: never;\n\t\t\tcookie?: never;\n\t\t};\n\t\tget: {\n\t\t\toperationId: 'getJob';\n\t\t\tparameters: {\n\t\t\t\tquery?: never;\n\t\t\t\theader?: never;\n\t\t\t\tpath: {\n\t\t\t\t\tid: string;\n\t\t\t\t};\n\t\t\t\tcookie?: never;\n\t\t\t};\n\t\t\trequestBody?: never;\n\t\t\tresponses: {\n\t\t\t\t/** @description Successful response */\n\t\t\t\t200: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t[name: string]: unknown;\n\t\t\t\t\t};\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\trole: string;\n\t\t\t\t\t\t\toverview: string;\n\t\t\t\t\t\t\tqualifications: string;\n\t\t\t\t\t\t\thourlyRate: {\n\t\t\t\t\t\t\t\tmax: number;\n\t\t\t\t\t\t\t\tmin: number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdateNeeded: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tshiftHours: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tcreatedAt: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tupdatedAt: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tbusinessId: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tcreatorId: string;\n\t\t\t\t\t\t\t/** @enum {string} */\n\t\t\t\t\t\t\tstatus: 'Draft' | 'Active' | 'Closed' | 'Filled';\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tput: {\n\t\t\toperationId: 'updateJob';\n\t\t\tparameters: {\n\t\t\t\tquery?: never;\n\t\t\t\theader?: never;\n\t\t\t\tpath: {\n\t\t\t\t\tid: string;\n\t\t\t\t};\n\t\t\t\tcookie?: never;\n\t\t\t};\n\t\t\trequestBody: {\n\t\t\t\tcontent: {\n\t\t\t\t\t'application/json': {\n\t\t\t\t\t\trole?: string;\n\t\t\t\t\t\toverview?: string;\n\t\t\t\t\t\tqualifications?: string;\n\t\t\t\t\t\thourlyRate?: {\n\t\t\t\t\t\t\tmax: number;\n\t\t\t\t\t\t\tmin: number;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tdateNeeded?: {\n\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t\tshiftHours?: {\n\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t\t/** @enum {string} */\n\t\t\t\t\t\tstatus?: 'Draft' | 'Active' | 'Closed' | 'Filled';\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t/** @description Successful response */\n\t\t\t\t200: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t[name: string]: unknown;\n\t\t\t\t\t};\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\trole: string;\n\t\t\t\t\t\t\toverview: string;\n\t\t\t\t\t\t\tqualifications: string;\n\t\t\t\t\t\t\thourlyRate: {\n\t\t\t\t\t\t\t\tmax: number;\n\t\t\t\t\t\t\t\tmin: number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tdateNeeded: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tshiftHours: {\n\t\t\t\t\t\t\t\tfrom: string;\n\t\t\t\t\t\t\t\tto: string;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tcreatedAt: string;\n\t\t\t\t\t\t\t/** Format: date-time */\n\t\t\t\t\t\t\tupdatedAt: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tbusinessId: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tcreatorId: string;\n\t\t\t\t\t\t\t/** @enum {string} */\n\t\t\t\t\t\t\tstatus: 'Draft' | 'Active' | 'Closed' | 'Filled';\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tpost?: never;\n\t\tdelete: {\n\t\t\toperationId: 'deleteJob';\n\t\t\tparameters: {\n\t\t\t\tquery?: never;\n\t\t\t\theader?: never;\n\t\t\t\tpath: {\n\t\t\t\t\tid: string;\n\t\t\t\t};\n\t\t\t\tcookie?: never;\n\t\t\t};\n\t\t\trequestBody?: never;\n\t\t\tresponses: {\n\t\t\t\t/** @description Successful response */\n\t\t\t\t200: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t[name: string]: unknown;\n\t\t\t\t\t};\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t\t/** Format: uuid */\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\toptions?: never;\n\t\thead?: never;\n\t\tpatch?: never;\n\t\ttrace?: never;\n\t};\n\t'/users': {\n\t\tget: {\n\t\t\toperationId: 'listUsers';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tpage?: number;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t\tsort?: 'asc' | 'desc';\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tusers: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tpost: {\n\t\t\toperationId: 'createUser';\n\t\t\trequestBody: {\n\t\t\t\tcontent: {\n\t\t\t\t\t'application/json': {\n\t\t\t\t\t\tname: string;\n\t\t\t\t\t\temail: string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t201: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/users/{id}': {\n\t\tparameters: {\n\t\t\tpath: {\n\t\t\t\tid: string;\n\t\t\t};\n\t\t};\n\t\tget: {\n\t\t\toperationId: 'getUser';\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tput: {\n\t\t\toperationId: 'updateUser';\n\t\t\trequestBody: {\n\t\t\t\tcontent: {\n\t\t\t\t\t'application/json': {\n\t\t\t\t\t\tname?: string;\n\t\t\t\t\t\temail?: string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\tdelete: {\n\t\t\toperationId: 'deleteUser';\n\t\t\tresponses: {\n\t\t\t\t204: {\n\t\t\t\t\tcontent: never;\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/posts': {\n\t\tget: {\n\t\t\toperationId: 'listPosts';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tpage?: number;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t\tsort?: 'asc' | 'desc';\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tposts: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\ttitle: string;\n\t\t\t\t\t\t\t\tcontent: string;\n\t\t\t\t\t\t\t\tauthorId: string;\n\t\t\t\t\t\t\t\tcreatedAt: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tpagination: {\n\t\t\t\t\t\t\t\tpage: number;\n\t\t\t\t\t\t\t\tlimit: number;\n\t\t\t\t\t\t\t\ttotal: number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsort: 'asc' | 'desc';\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/protected': {\n\t\tget: {\n\t\t\toperationId: 'getProtected';\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\t401: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/error': {\n\t\tget: {\n\t\t\toperationId: 'getError';\n\t\t\tresponses: {\n\t\t\t\t500: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessage: string;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/users/paginated': {\n\t\tget: {\n\t\t\toperationId: 'getUsersPaginated';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tpage?: number;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tusers: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\tname: string;\n\t\t\t\t\t\t\t\temail: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tpagination: {\n\t\t\t\t\t\t\t\tpage: number;\n\t\t\t\t\t\t\t\tlimit: number;\n\t\t\t\t\t\t\t\ttotal: number;\n\t\t\t\t\t\t\t\thasMore: boolean;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/messages': {\n\t\tget: {\n\t\t\toperationId: 'getMessages';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\tcursor?: string;\n\t\t\t\t\tlimit?: number;\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tmessages: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\ttext: string;\n\t\t\t\t\t\t\t\ttimestamp: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tnextCursor: string | null;\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n\t'/echo': {\n\t\tget: {\n\t\t\toperationId: 'echo';\n\t\t\tparameters: {\n\t\t\t\tquery: {\n\t\t\t\t\t[key: string]: string | number | boolean;\n\t\t\t\t};\n\t\t\t};\n\t\t\tresponses: {\n\t\t\t\t200: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\t'application/json': {\n\t\t\t\t\t\t\tqueryParams: Record<string, string>;\n\t\t\t\t\t\t\tdata: Array<{\n\t\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\t\tvalue: string;\n\t\t\t\t\t\t\t}>;\n\t\t\t\t\t\t\tpagination: {\n\t\t\t\t\t\t\t\tpage: number;\n\t\t\t\t\t\t\t\tlimit: number;\n\t\t\t\t\t\t\t\ttotal: number;\n\t\t\t\t\t\t\t\thasMore: boolean;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n}\n\nexport interface components {\n\tschemas: {\n\t\tUser: {\n\t\t\tid: string;\n\t\t\tname: string;\n\t\t\temail: string;\n\t\t};\n\t\tPost: {\n\t\t\tid: string;\n\t\t\ttitle: string;\n\t\t\tcontent: string;\n\t\t\tauthorId: string;\n\t\t\tcreatedAt: string;\n\t\t};\n\t};\n}\n"],"mappings":";;AAOA;;;;;;AA8YoBE,UA9YHF,KAAAA,CA8YGE;EAAM,WACbD,EAAAA;IAAK,UAAA,EAAA;MAkBlB,KAAiBE,CAAAA,EAAAA,KAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA9OHF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkGAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmEAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BGA;;;;;;;;;;;;;;;;;;;;;;;;2BAwBGC;oBACPD;;;;;;;;;;;;;;;;;UAkBIE,UAAAA"}
1
+ {"version":3,"file":"openapi-types.d.mts","names":[],"sources":["../src/openapi-types.d.ts"],"mappings":";;;;;;;;iBAQiB;EAChB;IACC;MACC;MACA;MACA;MACA;;IAED;MACC;MACA;QACC;QACA;QACA;UACC;;QAED;;MAED;MACA;;QAEC;UACC;aACE;;UAEF;YACC;cACC;cACA;cACA;cACA;gBACC;gBACA;;cAED;gBACC;gBACA;;cAED;gBACC;gBACA;;;cAGD;;cAEA;;cAEA;;cAEA;;cAEA;;cAEA;;;;;;IAML;MACC;MACA;QACC;QACA;QACA;UACC;;QAED;;MAED;QACC;UACC;YACC;YACA;YACA;YACA;cACC;cACA;;YAED;cACC;cACA;;YAED;cACC;cACA;;;YAGD;;;;MAIH;;QAEC;UACC;aACE;;UAEF;YACC;cACC;cACA;cACA;cACA;gBACC;gBACA;;cAED;gBACC;gBACA;;cAED;gBACC;gBACA;;;cAGD;;cAEA;;cAEA;;cAEA;;cAEA;;cAEA;;;;;;IAML;IACA;MACC;MACA;QACC;QACA;QACA;UACC;;QAED;;MAED;MACA;;QAEC;UACC;aACE;;UAEF;YACC;cACC;;cAEA;;;;;;IAML;IACA;IACA;IACA;;EAED;IACC;MACC;MACA;QACC;UACC;UACA;UACA;;;MAGF;QACC;UACC;YACC;cACC,OAAO;gBACN;gBACA;gBACA;;;;;;;IAON;MACC;MACA;QACC;UACC;YACC;YACA;;;;MAIH;QACC;UACC;YACC;cACC;cACA;cACA;;;;;;;EAON;IACC;MACC;QACC;;;IAGF;MACC;MACA;QACC;UACC;YACC;cACC;cACA;cACA;;;;;;IAML;MACC;MACA;QACC;UACC;YACC;YACA;;;;MAIH;QACC;UACC;YACC;cACC;cACA;cACA;;;;;;IAML;MACC;MACA;QACC;UACC;;;;;EAKJ;IACC;MACC;MACA;QACC;UACC;UACA;UACA;;;MAGF;QACC;UACC;YACC;cACC,OAAO;gBACN;gBACA;gBACA;gBACA;gBACA;;cAED;gBACC;gBACA;gBACA;;cAED;;;;;;;EAON;IACC;MACC;MACA;QACC;UACC;YACC;cACC;;;;QAIH;UACC;YACC;cACC;;;;;;;EAON;IACC;MACC;MACA;QACC;UACC;YACC;cACC;;;;;;;EAON;IACC;MACC;MACA;QACC;UACC;UACA;;;MAGF;QACC;UACC;YACC;cACC,OAAO;gBACN;gBACA;gBACA;;cAED;gBACC;gBACA;gBACA;gBACA;;;;;;;;EAQP;IACC;MACC;MACA;QACC;UACC;UACA;;;MAGF;QACC;UACC;YACC;cACC,UAAU;gBACT;gBACA;gBACA;;cAED;;;;;;;EAON;IACC;MACC;MACA;QACC;WACE;;;MAGH;QACC;UACC;YACC;cACC,aAAa;cACb,MAAM;gBACL;gBACA;;cAED;gBACC;gBACA;gBACA;gBACA;;;;;;;;;iBAUS;EAChB;IACC;MACC;MACA;MACA;;IAED;MACC;MACA;MACA;MACA;MACA"}
@@ -1,8 +1,7 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_fetcher = require('./fetcher-CwnSqc4D.cjs');
3
- const __tanstack_react_query = require_chunk.__toESM(require("@tanstack/react-query"));
4
- const react = require_chunk.__toESM(require("react"));
5
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_fetcher = require("./fetcher.cjs");
3
+ let _tanstack_react_query = require("@tanstack/react-query");
4
+ let react = require("react");
6
5
  //#region src/react-query.ts
7
6
  var TypedQueryClient = class {
8
7
  fetcher;
@@ -23,14 +22,14 @@ var TypedQueryClient = class {
23
22
  JSON.stringify(config),
24
23
  JSON.stringify(options)
25
24
  ]);
26
- return (0, __tanstack_react_query.useQuery)(memoizedOptions);
25
+ return (0, _tanstack_react_query.useQuery)(memoizedOptions);
27
26
  }
28
27
  useMutation(endpoint, options) {
29
28
  const memoizedOptions = (0, react.useMemo)(() => ({
30
29
  mutationFn: (config) => this.fetcher(endpoint, config),
31
30
  ...options
32
31
  }), [endpoint, JSON.stringify(options)]);
33
- return (0, __tanstack_react_query.useMutation)(memoizedOptions);
32
+ return (0, _tanstack_react_query.useMutation)(memoizedOptions);
34
33
  }
35
34
  useInfiniteQuery(endpoint, options, config) {
36
35
  const queryKey = this.buildQueryKey(endpoint, config);
@@ -47,10 +46,7 @@ var TypedQueryClient = class {
47
46
  ...pageQuery
48
47
  }
49
48
  };
50
- } else if (pageParam !== void 0 && !config) {
51
- const pageQuery = typeof pageParam === "object" ? pageParam : { page: pageParam };
52
- mergedConfig = { query: pageQuery };
53
- }
49
+ } else if (pageParam !== void 0 && !config) mergedConfig = { query: typeof pageParam === "object" ? pageParam : { page: pageParam } };
54
50
  return this.fetcher(endpoint, mergedConfig);
55
51
  },
56
52
  ...options
@@ -60,7 +56,7 @@ var TypedQueryClient = class {
60
56
  JSON.stringify(config),
61
57
  JSON.stringify(options)
62
58
  ]);
63
- return (0, __tanstack_react_query.useInfiniteQuery)(memoizedOptions);
59
+ return (0, _tanstack_react_query.useInfiniteQuery)(memoizedOptions);
64
60
  }
65
61
  buildQueryKey(endpoint, config) {
66
62
  const key = [endpoint];
@@ -87,8 +83,7 @@ var TypedQueryClient = class {
87
83
  * @returns Promise that resolves when invalidation is complete
88
84
  */
89
85
  invalidateAllQueries() {
90
- const queryClient = this.getQueryClient();
91
- return queryClient.invalidateQueries();
86
+ return this.getQueryClient().invalidateQueries();
92
87
  }
93
88
  /**
94
89
  * Get the underlying QueryClient instance
@@ -122,8 +117,11 @@ function useTypedInfiniteQuery(client, endpoint, options, config) {
122
117
  * Hook to invalidate queries using the current QueryClient from context
123
118
  */
124
119
  function useTypedInvalidateQueries(client) {
125
- const queryClient = (0, __tanstack_react_query.useQueryClient)();
120
+ const queryClient = (0, _tanstack_react_query.useQueryClient)();
126
121
  return {
122
+ /**
123
+ * Invalidate queries for a specific endpoint
124
+ */
127
125
  invalidateQueries: (endpoint, config) => {
128
126
  const queryKey = client.buildQueryKey(endpoint, config);
129
127
  return queryClient.invalidateQueries({
@@ -131,12 +129,14 @@ function useTypedInvalidateQueries(client) {
131
129
  exact: !!config
132
130
  });
133
131
  },
132
+ /**
133
+ * Invalidate all queries
134
+ */
134
135
  invalidateAllQueries: () => {
135
136
  return queryClient.invalidateQueries();
136
137
  }
137
138
  };
138
139
  }
139
-
140
140
  //#endregion
141
141
  exports.TypedQueryClient = TypedQueryClient;
142
142
  exports.createTypedQueryClient = createTypedQueryClient;
@@ -144,4 +144,5 @@ exports.useTypedInfiniteQuery = useTypedInfiniteQuery;
144
144
  exports.useTypedInvalidateQueries = useTypedInvalidateQueries;
145
145
  exports.useTypedMutation = useTypedMutation;
146
146
  exports.useTypedQuery = useTypedQuery;
147
+
147
148
  //# sourceMappingURL=react-query.cjs.map