@bluemarble/bm-components 2.1.4 → 2.2.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/dist/index.d.cts CHANGED
@@ -5,9 +5,12 @@ import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, Sele
5
5
  import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
6
6
  import { FactoryOpts } from 'imask';
7
7
  import { IconType } from 'react-icons';
8
+ import * as next from 'next';
8
9
  import { NextApiRequest, NextApiResponse, GetServerSidePropsContext } from 'next';
9
10
  import { ZodSchema } from 'zod';
10
11
  import { AxiosInstance } from 'axios';
12
+ import * as cookie from 'cookie';
13
+ import * as express from 'express';
11
14
 
12
15
  interface ColumnTitleProps {
13
16
  name: string;
@@ -643,4 +646,46 @@ declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provid
643
646
  sessionTokenName: string;
644
647
  }): React__default.JSX.Element;
645
648
 
646
- export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, filterData, getTabProps, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
649
+ /**
650
+ * Parses cookies.
651
+ *
652
+ * @param ctx NextJS page or API context, express context, null or undefined.
653
+ * @param options Options that we pass down to `cookie` library.
654
+ */
655
+ declare function parseCookies(ctx?: Pick<next.NextPageContext, 'req'> | {
656
+ req: next.NextApiRequest;
657
+ } | {
658
+ req: express.Request;
659
+ } | null | undefined, options?: cookie.ParseOptions): cookie.Cookies;
660
+ /**
661
+ * Sets a cookie.
662
+ *
663
+ * @param ctx NextJS page or API context, express context, null or undefined.
664
+ * @param name The name of your cookie.
665
+ * @param value The value of your cookie.
666
+ * @param options Options that we pass down to `cookie` library.
667
+ */
668
+ declare function setCookie(ctx: Pick<next.NextPageContext, 'res'> | {
669
+ res: next.NextApiResponse;
670
+ } | {
671
+ res: express.Response;
672
+ } | null | undefined, name: string, value: string, options?: cookie.SerializeOptions): {};
673
+ /**
674
+ * Destroys a cookie with a particular name.
675
+ *
676
+ * @param ctx NextJS page or API context, express context, null or undefined.
677
+ * @param name Cookie name.
678
+ * @param options Options that we pass down to `cookie` library.
679
+ */
680
+ declare function destroyCookie(ctx: Pick<next.NextPageContext, 'res'> | {
681
+ res: next.NextApiResponse;
682
+ } | {
683
+ res: express.Response;
684
+ } | null | undefined, name: string, options?: cookie.SerializeOptions): {};
685
+ declare const nookies: {
686
+ set: typeof setCookie;
687
+ get: typeof parseCookies;
688
+ destroy: typeof destroyCookie;
689
+ };
690
+
691
+ export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, destroyCookie, filterData, getTabProps, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
package/dist/index.d.ts CHANGED
@@ -5,9 +5,12 @@ import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, Sele
5
5
  import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
6
6
  import { FactoryOpts } from 'imask';
7
7
  import { IconType } from 'react-icons';
8
+ import * as next from 'next';
8
9
  import { NextApiRequest, NextApiResponse, GetServerSidePropsContext } from 'next';
9
10
  import { ZodSchema } from 'zod';
10
11
  import { AxiosInstance } from 'axios';
12
+ import * as cookie from 'cookie';
13
+ import * as express from 'express';
11
14
 
12
15
  interface ColumnTitleProps {
13
16
  name: string;
@@ -643,4 +646,46 @@ declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provid
643
646
  sessionTokenName: string;
644
647
  }): React__default.JSX.Element;
645
648
 
646
- export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, filterData, getTabProps, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
649
+ /**
650
+ * Parses cookies.
651
+ *
652
+ * @param ctx NextJS page or API context, express context, null or undefined.
653
+ * @param options Options that we pass down to `cookie` library.
654
+ */
655
+ declare function parseCookies(ctx?: Pick<next.NextPageContext, 'req'> | {
656
+ req: next.NextApiRequest;
657
+ } | {
658
+ req: express.Request;
659
+ } | null | undefined, options?: cookie.ParseOptions): cookie.Cookies;
660
+ /**
661
+ * Sets a cookie.
662
+ *
663
+ * @param ctx NextJS page or API context, express context, null or undefined.
664
+ * @param name The name of your cookie.
665
+ * @param value The value of your cookie.
666
+ * @param options Options that we pass down to `cookie` library.
667
+ */
668
+ declare function setCookie(ctx: Pick<next.NextPageContext, 'res'> | {
669
+ res: next.NextApiResponse;
670
+ } | {
671
+ res: express.Response;
672
+ } | null | undefined, name: string, value: string, options?: cookie.SerializeOptions): {};
673
+ /**
674
+ * Destroys a cookie with a particular name.
675
+ *
676
+ * @param ctx NextJS page or API context, express context, null or undefined.
677
+ * @param name Cookie name.
678
+ * @param options Options that we pass down to `cookie` library.
679
+ */
680
+ declare function destroyCookie(ctx: Pick<next.NextPageContext, 'res'> | {
681
+ res: next.NextApiResponse;
682
+ } | {
683
+ res: express.Response;
684
+ } | null | undefined, name: string, options?: cookie.SerializeOptions): {};
685
+ declare const nookies: {
686
+ set: typeof setCookie;
687
+ get: typeof parseCookies;
688
+ destroy: typeof destroyCookie;
689
+ };
690
+
691
+ export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, destroyCookie, filterData, getTabProps, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
package/dist/index.js CHANGED
@@ -4856,6 +4856,14 @@ function setCookie(ctx, name, value, options = {}) {
4856
4856
  }
4857
4857
  return {};
4858
4858
  }
4859
+ function destroyCookie(ctx, name, options) {
4860
+ return setCookie(ctx, name, "", { ...options || {}, maxAge: -1 });
4861
+ }
4862
+ var nookies = {
4863
+ set: setCookie,
4864
+ get: parseCookies,
4865
+ destroy: destroyCookie
4866
+ };
4859
4867
 
4860
4868
  // src/helpers/authHelper.ts
4861
4869
  function decodeSessionToken({
@@ -5705,8 +5713,12 @@ export {
5705
5713
  UseDialogConfirm,
5706
5714
  createAuthContext,
5707
5715
  createFilter,
5716
+ destroyCookie,
5708
5717
  filterData,
5709
5718
  getTabProps,
5719
+ nookies,
5720
+ parseCookies,
5721
+ setCookie,
5710
5722
  useAlert,
5711
5723
  useAsyncGrid,
5712
5724
  useBaseDialog,