@bluemarble/bm-components 2.0.0 → 2.0.1

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/dist/index.d.mts CHANGED
@@ -6,7 +6,7 @@ import * as _mui_material_OverridableComponent from '@mui/material/OverridableCo
6
6
  import { FactoryOpts } from 'imask';
7
7
  import { IconType } from 'react-icons';
8
8
  import { NextApiRequest, NextApiResponse, GetServerSidePropsContext } from 'next';
9
- import { ZodType, ZodSchema } from 'zod';
9
+ import { ZodSchema } from 'zod';
10
10
  import { AxiosInstance } from 'axios';
11
11
 
12
12
  interface ColumnTitleProps {
@@ -448,8 +448,8 @@ declare class ApiHelper<T> {
448
448
  constructor(props?: ConstructorProps$1<T>);
449
449
  setMiddlewares(middlewares: any[]): this;
450
450
  createMethods(methods: MethodProps<T>): (req: NextApiRequest, res: NextApiResponse) => Promise<void | NextApiResponse<any>>;
451
- static parserErrorWrapper<Output, Def extends ZodType>(body: Record<string, any>, parser: ZodSchema<Output, Def>): Output;
452
- static parseQueyFilters<T extends Record<string, any>>(filters: T): T;
451
+ static parse: typeof ApiHelper.parserErrorWrapper;
452
+ static parserErrorWrapper<Output, Def>(body: Record<string, any>, parser: ZodSchema<Output, Def>): Output;
453
453
  static create({ onFinally }: {
454
454
  onFinally: any;
455
455
  }): ApiHelper<unknown>;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import * as _mui_material_OverridableComponent from '@mui/material/OverridableCo
6
6
  import { FactoryOpts } from 'imask';
7
7
  import { IconType } from 'react-icons';
8
8
  import { NextApiRequest, NextApiResponse, GetServerSidePropsContext } from 'next';
9
- import { ZodType, ZodSchema } from 'zod';
9
+ import { ZodSchema } from 'zod';
10
10
  import { AxiosInstance } from 'axios';
11
11
 
12
12
  interface ColumnTitleProps {
@@ -448,8 +448,8 @@ declare class ApiHelper<T> {
448
448
  constructor(props?: ConstructorProps$1<T>);
449
449
  setMiddlewares(middlewares: any[]): this;
450
450
  createMethods(methods: MethodProps<T>): (req: NextApiRequest, res: NextApiResponse) => Promise<void | NextApiResponse<any>>;
451
- static parserErrorWrapper<Output, Def extends ZodType>(body: Record<string, any>, parser: ZodSchema<Output, Def>): Output;
452
- static parseQueyFilters<T extends Record<string, any>>(filters: T): T;
451
+ static parse: typeof ApiHelper.parserErrorWrapper;
452
+ static parserErrorWrapper<Output, Def>(body: Record<string, any>, parser: ZodSchema<Output, Def>): Output;
453
453
  static create({ onFinally }: {
454
454
  onFinally: any;
455
455
  }): ApiHelper<unknown>;
package/dist/index.js CHANGED
@@ -4607,7 +4607,7 @@ var VALID_METHODS = [
4607
4607
  "TRACE",
4608
4608
  "PATCH"
4609
4609
  ];
4610
- var ApiHelper = class _ApiHelper {
4610
+ var _ApiHelper = class _ApiHelper {
4611
4611
  onFinally(req, res) {
4612
4612
  return __async(this, null, function* () {
4613
4613
  });
@@ -4672,18 +4672,14 @@ var ApiHelper = class _ApiHelper {
4672
4672
  });
4673
4673
  }
4674
4674
  }
4675
- static parseQueyFilters(filters) {
4676
- return Object.entries(filters).reduce((acc, [key, value]) => {
4677
- if (value) acc[key] = value;
4678
- return acc;
4679
- }, {});
4680
- }
4681
4675
  static create({ onFinally }) {
4682
4676
  return new _ApiHelper({
4683
4677
  onFinally
4684
4678
  });
4685
4679
  }
4686
4680
  };
4681
+ _ApiHelper.parse = _ApiHelper.parserErrorWrapper;
4682
+ var ApiHelper = _ApiHelper;
4687
4683
 
4688
4684
  // src/hooks/useFormHelper.ts
4689
4685