@openapi-qraft/react 2.11.0 → 2.12.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @openapi-qraft/react
2
2
 
3
+ ## 2.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cdc4bf3: Resolve unmet peerDependencies.
8
+
9
+ ### Patch Changes
10
+
11
+ - @openapi-qraft/tanstack-query-react-types@2.12.0
12
+
3
13
  ## 2.11.0
4
14
 
5
15
  ### Minor Changes
@@ -25,5 +25,4 @@ function omitMutationPayload(params) {
25
25
  }
26
26
 
27
27
  exports.composeMutationKey = composeMutationKey;
28
- exports.omitMutationPayload = omitMutationPayload;
29
28
  //# sourceMappingURL=composeMutationKey.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"composeMutationKey.cjs","sources":["../../../src/lib/composeMutationKey.ts"],"sourcesContent":["import type { ServiceOperationMutationKey } from '@openapi-qraft/tanstack-query-react-types';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Omit `body` or `requestBody` from mutation parameters if exists\n * and return the rest of the parameters\n */\nexport function composeMutationKey<TSchema extends OperationSchema>(\n schema: TSchema,\n parameters: undefined\n): ServiceOperationMutationKey<TSchema, undefined>;\nexport function composeMutationKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams\n): ServiceOperationMutationKey<TSchema, TParams>;\nexport function composeMutationKey<\n TSchema extends OperationSchema,\n TParams = unknown,\n>(schema: TSchema, parameters: TParams | undefined) {\n return parameters === undefined\n ? [{ url: schema.url, method: schema.method }, {}]\n : [\n {\n url: schema.url,\n method: schema.method,\n },\n omitMutationPayload(parameters),\n ];\n}\n\nexport function omitMutationPayload<T>(params: T) {\n if (!params || typeof params !== 'object')\n throw new Error('`params` must be object');\n\n if ('body' in params || 'requestBody' in params) {\n const {\n body: _,\n requestBody: __,\n ...paramsRest\n } = params as Record<'body' | 'requestBody', unknown>;\n return paramsRest;\n }\n\n return params as Omit<T, 'body' | 'requestBody'>;\n}\n"],"names":["composeMutationKey","schema","parameters","undefined","url","method","omitMutationPayload","params","Error","body","_","requestBody","__","paramsRest"],"mappings":";;AAeO,SAASA,kBAAAA,CAGdC,MAAe,EAAEC,UAA+B,EAAA;AAChD,IAAA,OAAOA,eAAeC,SAClB,GAAA;AAAC,QAAA;AAAEC,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AAAEC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AAAC,SAAA;QAAG,EAAC;KAAE,GAChD;AACE,QAAA;AACED,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AACfC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AACvB,SAAA;QACAC,mBAAoBJ,CAAAA,UAAAA,CAAAA;AACrB,KAAA,CAAA;AACP,CAAA;AAEO,SAASI,oBAAuBC,MAAS,EAAA;AAC9C,IAAA,IAAI,CAACA,MAAU,IAAA,OAAOA,WAAW,QAC/B,EAAA,MAAM,IAAIC,KAAM,CAAA,yBAAA,CAAA,CAAA;IAElB,IAAI,MAAA,IAAUD,MAAU,IAAA,aAAA,IAAiBA,MAAQ,EAAA;QAC/C,MAAM,EACJE,MAAMC,CAAC,EACPC,aAAaC,EAAE,EACf,GAAGC,UAAAA,EACJ,GAAGN,MAAAA,CAAAA;QACJ,OAAOM,UAAAA,CAAAA;AACT,KAAA;IAEA,OAAON,MAAAA,CAAAA;AACT;;;;;"}
1
+ {"version":3,"file":"composeMutationKey.cjs","sources":["../../../src/lib/composeMutationKey.ts"],"sourcesContent":["import type { ServiceOperationMutationKey } from '@openapi-qraft/tanstack-query-react-types';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Omit `body` or `requestBody` from mutation parameters if exists\n * and return the rest of the parameters\n */\nexport function composeMutationKey<TSchema extends OperationSchema>(\n schema: TSchema,\n parameters: undefined\n): ServiceOperationMutationKey<TSchema, undefined>;\nexport function composeMutationKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams\n): ServiceOperationMutationKey<TSchema, TParams>;\nexport function composeMutationKey<\n TSchema extends OperationSchema,\n TParams = unknown,\n>(schema: TSchema, parameters: TParams | undefined) {\n return parameters === undefined\n ? [{ url: schema.url, method: schema.method }, {}]\n : [\n {\n url: schema.url,\n method: schema.method,\n },\n omitMutationPayload(parameters),\n ];\n}\n\nfunction omitMutationPayload<T>(params: T) {\n if (!params || typeof params !== 'object')\n throw new Error('`params` must be object');\n\n if ('body' in params || 'requestBody' in params) {\n const {\n body: _,\n requestBody: __,\n ...paramsRest\n } = params as Record<'body' | 'requestBody', unknown>;\n return paramsRest;\n }\n\n return params as Omit<T, 'body' | 'requestBody'>;\n}\n"],"names":["composeMutationKey","schema","parameters","undefined","url","method","omitMutationPayload","params","Error","body","_","requestBody","__","paramsRest"],"mappings":";;AAeO,SAASA,kBAAAA,CAGdC,MAAe,EAAEC,UAA+B,EAAA;AAChD,IAAA,OAAOA,eAAeC,SAClB,GAAA;AAAC,QAAA;AAAEC,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AAAEC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AAAC,SAAA;QAAG,EAAC;KAAE,GAChD;AACE,QAAA;AACED,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AACfC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AACvB,SAAA;QACAC,mBAAoBJ,CAAAA,UAAAA,CAAAA;AACrB,KAAA,CAAA;AACP,CAAA;AAEA,SAASI,oBAAuBC,MAAS,EAAA;AACvC,IAAA,IAAI,CAACA,MAAU,IAAA,OAAOA,WAAW,QAC/B,EAAA,MAAM,IAAIC,KAAM,CAAA,yBAAA,CAAA,CAAA;IAElB,IAAI,MAAA,IAAUD,MAAU,IAAA,aAAA,IAAiBA,MAAQ,EAAA;QAC/C,MAAM,EACJE,MAAMC,CAAC,EACPC,aAAaC,EAAE,EACf,GAAGC,UAAAA,EACJ,GAAGN,MAAAA,CAAAA;QACJ,OAAOM,UAAAA,CAAAA;AACT,KAAA;IAEA,OAAON,MAAAA,CAAAA;AACT;;;;"}
@@ -22,5 +22,5 @@ function omitMutationPayload(params) {
22
22
  return params;
23
23
  }
24
24
 
25
- export { composeMutationKey, omitMutationPayload };
25
+ export { composeMutationKey };
26
26
  //# sourceMappingURL=composeMutationKey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"composeMutationKey.js","sources":["../../../src/lib/composeMutationKey.ts"],"sourcesContent":["import type { ServiceOperationMutationKey } from '@openapi-qraft/tanstack-query-react-types';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Omit `body` or `requestBody` from mutation parameters if exists\n * and return the rest of the parameters\n */\nexport function composeMutationKey<TSchema extends OperationSchema>(\n schema: TSchema,\n parameters: undefined\n): ServiceOperationMutationKey<TSchema, undefined>;\nexport function composeMutationKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams\n): ServiceOperationMutationKey<TSchema, TParams>;\nexport function composeMutationKey<\n TSchema extends OperationSchema,\n TParams = unknown,\n>(schema: TSchema, parameters: TParams | undefined) {\n return parameters === undefined\n ? [{ url: schema.url, method: schema.method }, {}]\n : [\n {\n url: schema.url,\n method: schema.method,\n },\n omitMutationPayload(parameters),\n ];\n}\n\nexport function omitMutationPayload<T>(params: T) {\n if (!params || typeof params !== 'object')\n throw new Error('`params` must be object');\n\n if ('body' in params || 'requestBody' in params) {\n const {\n body: _,\n requestBody: __,\n ...paramsRest\n } = params as Record<'body' | 'requestBody', unknown>;\n return paramsRest;\n }\n\n return params as Omit<T, 'body' | 'requestBody'>;\n}\n"],"names":["composeMutationKey","schema","parameters","undefined","url","method","omitMutationPayload","params","Error","body","_","requestBody","__","paramsRest"],"mappings":"AAeO,SAASA,kBAAAA,CAGdC,MAAe,EAAEC,UAA+B,EAAA;AAChD,IAAA,OAAOA,eAAeC,SAClB,GAAA;AAAC,QAAA;AAAEC,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AAAEC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AAAC,SAAA;QAAG,EAAC;KAAE,GAChD;AACE,QAAA;AACED,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AACfC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AACvB,SAAA;QACAC,mBAAoBJ,CAAAA,UAAAA,CAAAA;AACrB,KAAA,CAAA;AACP,CAAA;AAEO,SAASI,oBAAuBC,MAAS,EAAA;AAC9C,IAAA,IAAI,CAACA,MAAU,IAAA,OAAOA,WAAW,QAC/B,EAAA,MAAM,IAAIC,KAAM,CAAA,yBAAA,CAAA,CAAA;IAElB,IAAI,MAAA,IAAUD,MAAU,IAAA,aAAA,IAAiBA,MAAQ,EAAA;QAC/C,MAAM,EACJE,MAAMC,CAAC,EACPC,aAAaC,EAAE,EACf,GAAGC,UAAAA,EACJ,GAAGN,MAAAA,CAAAA;QACJ,OAAOM,UAAAA,CAAAA;AACT,KAAA;IAEA,OAAON,MAAAA,CAAAA;AACT;;;;"}
1
+ {"version":3,"file":"composeMutationKey.js","sources":["../../../src/lib/composeMutationKey.ts"],"sourcesContent":["import type { ServiceOperationMutationKey } from '@openapi-qraft/tanstack-query-react-types';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Omit `body` or `requestBody` from mutation parameters if exists\n * and return the rest of the parameters\n */\nexport function composeMutationKey<TSchema extends OperationSchema>(\n schema: TSchema,\n parameters: undefined\n): ServiceOperationMutationKey<TSchema, undefined>;\nexport function composeMutationKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams\n): ServiceOperationMutationKey<TSchema, TParams>;\nexport function composeMutationKey<\n TSchema extends OperationSchema,\n TParams = unknown,\n>(schema: TSchema, parameters: TParams | undefined) {\n return parameters === undefined\n ? [{ url: schema.url, method: schema.method }, {}]\n : [\n {\n url: schema.url,\n method: schema.method,\n },\n omitMutationPayload(parameters),\n ];\n}\n\nfunction omitMutationPayload<T>(params: T) {\n if (!params || typeof params !== 'object')\n throw new Error('`params` must be object');\n\n if ('body' in params || 'requestBody' in params) {\n const {\n body: _,\n requestBody: __,\n ...paramsRest\n } = params as Record<'body' | 'requestBody', unknown>;\n return paramsRest;\n }\n\n return params as Omit<T, 'body' | 'requestBody'>;\n}\n"],"names":["composeMutationKey","schema","parameters","undefined","url","method","omitMutationPayload","params","Error","body","_","requestBody","__","paramsRest"],"mappings":"AAeO,SAASA,kBAAAA,CAGdC,MAAe,EAAEC,UAA+B,EAAA;AAChD,IAAA,OAAOA,eAAeC,SAClB,GAAA;AAAC,QAAA;AAAEC,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AAAEC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AAAC,SAAA;QAAG,EAAC;KAAE,GAChD;AACE,QAAA;AACED,YAAAA,GAAAA,EAAKH,OAAOG,GAAG;AACfC,YAAAA,MAAAA,EAAQJ,OAAOI,MAAM;AACvB,SAAA;QACAC,mBAAoBJ,CAAAA,UAAAA,CAAAA;AACrB,KAAA,CAAA;AACP,CAAA;AAEA,SAASI,oBAAuBC,MAAS,EAAA;AACvC,IAAA,IAAI,CAACA,MAAU,IAAA,OAAOA,WAAW,QAC/B,EAAA,MAAM,IAAIC,KAAM,CAAA,yBAAA,CAAA,CAAA;IAElB,IAAI,MAAA,IAAUD,MAAU,IAAA,aAAA,IAAiBA,MAAQ,EAAA;QAC/C,MAAM,EACJE,MAAMC,CAAC,EACPC,aAAaC,EAAE,EACf,GAAGC,UAAAA,EACJ,GAAGN,MAAAA,CAAAA;QACJ,OAAOM,UAAAA,CAAAA;AACT,KAAA;IAEA,OAAON,MAAAA,CAAAA;AACT;;;;"}
@@ -6,5 +6,4 @@ import type { OperationSchema } from './requestFn.js';
6
6
  */
7
7
  export declare function composeMutationKey<TSchema extends OperationSchema>(schema: TSchema, parameters: undefined): ServiceOperationMutationKey<TSchema, undefined>;
8
8
  export declare function composeMutationKey<TSchema extends OperationSchema, TParams>(schema: TSchema, parameters: TParams): ServiceOperationMutationKey<TSchema, TParams>;
9
- export declare function omitMutationPayload<T>(params: T): {};
10
9
  //# sourceMappingURL=composeMutationKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"composeMutationKey.d.ts","sourceRoot":"","sources":["../../../src/lib/composeMutationKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,eAAe,EAChE,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,SAAS,GACpB,2BAA2B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACnD,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,eAAe,EAAE,OAAO,EACzE,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,OAAO,GAClB,2BAA2B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAgBjD,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,MAc/C"}
1
+ {"version":3,"file":"composeMutationKey.d.ts","sourceRoot":"","sources":["../../../src/lib/composeMutationKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,eAAe,EAChE,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,SAAS,GACpB,2BAA2B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACnD,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,eAAe,EAAE,OAAO,EACzE,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,OAAO,GAClB,2BAA2B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openapi-qraft/react",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "description": "OpenAPI client for React, providing type-safe requests and dynamic TanStack Query React Hooks via a modular, Proxy-based architecture.",
5
5
  "scripts": {
6
6
  "build": "NODE_ENV=production rollup --config rollup.config.mjs && tsc --project tsconfig.build.json --emitDeclarationOnly",
@@ -15,18 +15,19 @@
15
15
  },
16
16
  "sideEffects": false,
17
17
  "dependencies": {
18
- "@openapi-qraft/tanstack-query-react-types": "2.11.0"
18
+ "@openapi-qraft/tanstack-query-react-types": "2.12.0"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@tanstack/react-query": "^5.80.0",
22
22
  "react": "^18 || ^19"
23
23
  },
24
24
  "devDependencies": {
25
- "@openapi-qraft/cli": "2.11.0",
25
+ "@openapi-qraft/cli": "2.12.0",
26
26
  "@openapi-qraft/eslint-config": "1.0.1",
27
- "@openapi-qraft/openapi-typescript-plugin": "^1.2.29",
27
+ "@openapi-qraft/eslint-plugin-query": "2.12.0",
28
+ "@openapi-qraft/openapi-typescript-plugin": "^2.12.0",
28
29
  "@openapi-qraft/rollup-config": "1.1.1",
29
- "@openapi-qraft/tanstack-query-react-plugin": "2.11.0",
30
+ "@openapi-qraft/tanstack-query-react-plugin": "2.12.0",
30
31
  "@openapi-qraft/test-fixtures": "1.1.1",
31
32
  "@tanstack/react-query": "^5.80.6",
32
33
  "@testing-library/dom": "^10.4.0",
@@ -28,7 +28,7 @@ export function composeMutationKey<
28
28
  ];
29
29
  }
30
30
 
31
- export function omitMutationPayload<T>(params: T) {
31
+ function omitMutationPayload<T>(params: T) {
32
32
  if (!params || typeof params !== 'object')
33
33
  throw new Error('`params` must be object');
34
34