@hapaul/api 0.1.1 → 0.1.2

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 (2) hide show
  1. package/dist/index.d.ts +7 -13
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Client, MaybeOptionalInit, ParseAsResponse } from "openapi-fetch";
2
- import { ResponseObjectMap, SuccessResponse } from "openapi-typescript-helpers";
1
+ import { MaybeOptionalInit, ParseAsResponse } from "openapi-fetch";
2
+ import { PathsWithMethod, ResponseObjectMap, SuccessResponse } from "openapi-typescript-helpers";
3
3
 
4
4
  //#region schema.d.ts
5
5
 
@@ -2199,17 +2199,11 @@ type InitParam<Init> = RequiredKeysOf<Init> extends never ? [(Init & {
2199
2199
  })?] : [Init & {
2200
2200
  [key: string]: unknown;
2201
2201
  }];
2202
- type IClient = Client<paths>;
2203
- type IGetParams = Parameters<IClient['GET']>;
2204
- type IPostParams = Parameters<IClient['POST']>;
2205
- type IPutParams = Parameters<IClient['PUT']>;
2206
- type IPatchParams = Parameters<IClient['PATCH']>;
2207
- type IDeleteParams = Parameters<IClient['DELETE']>;
2208
- type GetPaths = IGetParams[0];
2209
- type PostPaths = IPostParams[0];
2210
- type PutPaths = IPutParams[0];
2211
- type PatchPaths = IPatchParams[0];
2212
- type DeletePaths = IDeleteParams[0];
2202
+ type GetPaths = PathsWithMethod<paths, 'get'>;
2203
+ type PostPaths = PathsWithMethod<paths, 'post'>;
2204
+ type PutPaths = PathsWithMethod<paths, 'put'>;
2205
+ type PatchPaths = PathsWithMethod<paths, 'patch'>;
2206
+ type DeletePaths = PathsWithMethod<paths, 'delete'>;
2213
2207
  type GetParams<T extends GetPaths> = InitParam<MaybeOptionalInit<paths[T], 'get'>>;
2214
2208
  type PostParams<T extends PostPaths> = InitParam<MaybeOptionalInit<paths[T], 'post'>>;
2215
2209
  type PutParams<T extends PutPaths> = InitParam<MaybeOptionalInit<paths[T], 'put'>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hapaul/api",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [