ag-common 0.0.254 → 0.0.255

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 (43) hide show
  1. package/dist/api/helpers/api.d.ts +1 -1
  2. package/dist/api/helpers/openApiHelpers.js +1 -1
  3. package/dist/common/helpers/date.d.ts +1 -1
  4. package/dist/ui/components/Chevron/index.d.ts +0 -1
  5. package/dist/ui/components/Confirm/Modal.d.ts +0 -1
  6. package/dist/ui/components/DropdownList/index.d.ts +0 -1
  7. package/dist/ui/components/DropdownList/types.d.ts +0 -1
  8. package/dist/ui/components/HeadersRaw/index.d.ts +0 -1
  9. package/dist/ui/components/KebabDots/index.d.ts +0 -1
  10. package/dist/ui/components/Loader/index.d.ts +0 -1
  11. package/dist/ui/components/LoginButton/index.d.ts +0 -1
  12. package/dist/ui/components/LogoutButton/index.d.ts +0 -1
  13. package/dist/ui/components/Modal/index.d.ts +0 -1
  14. package/dist/ui/components/OpenApiCodeBlock/OpenApiCodeBlock.d.ts +0 -1
  15. package/dist/ui/components/OpenApiCodeBlock/curl/helpers/body.d.ts +0 -1
  16. package/dist/ui/components/OpenApiCodeBlock/curl/helpers/security.d.ts +0 -1
  17. package/dist/ui/components/OpenApiCodeBlock/curl/index.d.ts +0 -1
  18. package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/call.d.ts +0 -1
  19. package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/req.d.ts +0 -1
  20. package/dist/ui/components/OpenApiCodeBlock/fetch/index.d.ts +0 -1
  21. package/dist/ui/components/OpenApiCodeBlock/helpers/joinJsx.d.ts +0 -1
  22. package/dist/ui/components/OpenApiCodeBlock/types.d.ts +0 -1
  23. package/dist/ui/components/Prompt/Modal.d.ts +0 -1
  24. package/dist/ui/components/Search/Base.d.ts +0 -1
  25. package/dist/ui/components/Search/Inline.d.ts +0 -1
  26. package/dist/ui/components/Search/Modal.d.ts +0 -1
  27. package/dist/ui/components/Search/types.d.ts +0 -1
  28. package/dist/ui/components/Sidebar/index.d.ts +0 -1
  29. package/dist/ui/components/SparkLine/index.d.ts +0 -1
  30. package/dist/ui/components/Table/index.d.ts +0 -1
  31. package/dist/ui/components/TextEdit/CheckboxEdit.d.ts +0 -1
  32. package/dist/ui/components/TextEdit/ColourEdit.d.ts +0 -1
  33. package/dist/ui/components/TextEdit/LengthBox.d.ts +0 -1
  34. package/dist/ui/components/TextEdit/ListboxEdit.d.ts +0 -1
  35. package/dist/ui/components/TextEdit/RadioGroup.d.ts +0 -1
  36. package/dist/ui/components/TextEdit/TextEdit.d.ts +0 -1
  37. package/dist/ui/components/TextEdit/images.d.ts +0 -1
  38. package/dist/ui/components/Toast/index.d.ts +1 -2
  39. package/dist/ui/components/UserImage/index.d.ts +0 -1
  40. package/dist/ui/helpers/date.d.ts +1 -1
  41. package/dist/ui/helpers/jwt.d.ts +2 -2
  42. package/dist/ui/helpers/useLocalStorage.d.ts +3 -3
  43. package/package.json +12 -12
@@ -1,7 +1,7 @@
1
1
  import { APIGatewayProxyResult, DYNAMOKEYS } from '../types';
2
2
  export declare const returnCode: <T>(statusCode: number, body?: T | undefined, extraHeaders?: {
3
3
  [a: string]: string;
4
- } | undefined, fullSiteUrl?: string | undefined) => APIGatewayProxyResult;
4
+ } | undefined, fullSiteUrl?: string) => APIGatewayProxyResult;
5
5
  /**
6
6
  * strip all dynamo generated keys. can optionally keep PK
7
7
  * @param record
@@ -136,7 +136,7 @@ const openApiImpl = (p) => {
136
136
  const entry = `${endpointsBase}${fullPath}/${verb.toUpperCase()}.ts`;
137
137
  const lambdaV = new aws_cdk_lib_1.aws_lambda_nodejs.NodejsFunction(stack, lambdaName, {
138
138
  functionName: lambdaName,
139
- runtime: aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_14_X,
139
+ runtime: aws_cdk_lib_1.aws_lambda.Runtime.NODEJS_16_X,
140
140
  handler: 'handler',
141
141
  environment: lc.environment,
142
142
  memorySize: lc.memory,
@@ -11,4 +11,4 @@ export declare const CSharpToJs: (charpTicks: number) => Date;
11
11
  * @param date default = now
12
12
  * @returns
13
13
  */
14
- export declare const dateTimeToNearestMinute: (minutes: number, date?: Date | undefined) => Date;
14
+ export declare const dateTimeToNearestMinute: (minutes: number, date?: Date) => Date;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Chevron: ({ width, className, colour, onToggle, point, }: {
3
2
  /**
4
3
  * default right
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ConfirmModal: ({ onSubmit, bottomText, topText, okText, cancelText, }: {
3
2
  onSubmit: (v: boolean) => void;
4
3
  topText?: string | undefined;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { IDropdownList } from './types';
3
2
  export declare function DropdownList<T>(p: IDropdownList<T>): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface IDropdownList<T> {
3
2
  /**
4
3
  * all items that can be in dropdown
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface IHeadersRaw {
3
2
  title?: string;
4
3
  image?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const KebabDots: ({ onClick }: {
3
2
  onClick?: (() => Promise<void>) | undefined;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Loader: ({ name, height, width, }: {
3
2
  /**
4
3
  * default 2rem
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const LoginButton: ({ className, text, invert, savePath, loginPath, style, }: {
3
2
  invert?: boolean | undefined;
4
3
  text: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const LogoutButton: ({ className, invert, logout, }: {
3
2
  invert?: boolean | undefined;
4
3
  className?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ModalItem: import("styled-components").StyledComponent<"div", any, {}, never>;
3
2
  export declare const Modal: ({ open, setOpen, children, position, topPosition, showCloseButton, closeOnMoveMouseOutside, className, closeOnClickOutside, }: {
4
3
  open: boolean;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { IOpenApiCodeBlock } from './types';
3
2
  export declare const OpenApiCodeBlock: <TDefaultApi>(p: IOpenApiCodeBlock<TDefaultApi>) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IOpenApiCodeBlock } from '../../types';
3
2
  export declare const getBody: <TDefaultApi>(p: IOpenApiCodeBlock<TDefaultApi>) => {
4
3
  content: JSX.Element | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IOpenApi, IOpenApiOperation } from '../../types';
3
2
  export declare const getSecurityLine: (p: {
4
3
  apiKey?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../types';
3
2
  export declare const Curl: <TDefaultApi>({ ops, p, }: {
4
3
  p: IOpenApiCodeBlock<TDefaultApi>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
3
2
  export declare const getFetchCall: <TDefaultApi>(p: IOpenApiCodeBlock<TDefaultApi>, ops: IOpenApiOperationBlock) => JSX.Element | undefined;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
3
2
  export declare const getRequestOptions: <TDefaultApi>(p: IOpenApiCodeBlock<TDefaultApi>, ops: IOpenApiOperationBlock) => JSX.Element | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../types';
3
2
  export declare const Fetch: <TDefaultApi>({ ops, p, }: {
4
3
  p: IOpenApiCodeBlock<TDefaultApi>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const joinJsx: (items: (JSX.Element | undefined)[], sep: JSX.Element[]) => JSX.Element[];
3
2
  export declare const joinJsxWithSlash: (items: (JSX.Element | undefined)[]) => JSX.Element[];
4
3
  export declare const joinJsxWithComma: (items: (JSX.Element | undefined)[]) => JSX.Element[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface IOpenApiOperation {
3
2
  description: string;
4
3
  operationId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const PromptModal: ({ wrapper, res, bottomText, topText, okText, cancelText, defaultValue, placeholder, }: {
3
2
  defaultValue?: string | undefined;
4
3
  placeholder?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ISearchDialog, TSearchModalRes } from './types';
3
2
  export declare const SearchBase: <T>({ onSelectItem, onSearchTextChange, placeholderText, closeText, renderItem, displayItems, willDisplayItem, getKeyF, }: ISearchDialog<T> & {
4
3
  onSearchTextChange?: ((v: string) => void) | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ISearchDialog, TSearchModalRes } from './types';
3
2
  export declare const SearchInline: <T>(p: ISearchDialog<T> & {
4
3
  onSelectItem?: ((v: TSearchModalRes<T>) => void) | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ISearchDialog, TSearchModalRes } from './types';
3
2
  export declare const SearchModal: <T>(p: ISearchDialog<T> & {
4
3
  onSelectItem: (v: TSearchModalRes<T>) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface ISearchDialog<T> {
3
2
  placeholderText?: string;
4
3
  closeText?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Sidebar: ({ children, className, key, cookieDocument, width, }: {
3
2
  children: any;
4
3
  className?: string | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface ISparkLine {
3
2
  /**
4
3
  * default #4d76ff
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface TableItem {
3
2
  content: JSX.Element;
4
3
  groupTitle: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const CheckboxEdit: ({ defaultValue, onSubmit, noGrow, }: {
3
2
  defaultValue: boolean;
4
3
  onSubmit: (val: boolean) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ColourEdit: ({ defaultValue, onSubmit, }: {
3
2
  defaultValue: string;
4
3
  onSubmit: (val: string) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const TextEditLengthBox: ({ min, max, }: {
3
2
  min: number;
4
3
  max: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ListboxEdit: <T>({ defaultValue, onSubmit, values, canEdit, renderLabel, }: {
3
2
  defaultValue: T;
4
3
  onSubmit: (val: T) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const RadioGroup: <T>({ defaultValue, onSubmit, values, renderLabel, renderValue, }: {
3
2
  /**
4
3
  * can overload the render of the label. defaults to toString
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ITextEdit } from './types';
3
2
  import { StyledComponent } from 'styled-components';
4
3
  export declare const ValueReadonly: StyledComponent<"div", any, {}, never>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const UndoIcon: () => JSX.Element;
3
2
  export declare const PencilIcon: () => JSX.Element;
4
3
  export declare const SaveIcon: () => JSX.Element;
@@ -1,10 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { ToastPosition } from 'react-hot-toast';
3
2
  export interface IToastOptions {
4
3
  appearance: 'error' | 'success';
5
4
  autoClose?: number;
6
5
  }
7
- export declare const addToast: (m: string, options?: IToastOptions | undefined) => void;
6
+ export declare const addToast: (m: string, options?: IToastOptions) => void;
8
7
  export declare const ToastProvider: ({ position }: {
9
8
  position: ToastPosition;
10
9
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { User } from '../../helpers/jwt';
3
2
  export declare const UserImageIcon: JSX.Element;
4
3
  export declare const UserImage: ({ image, className, }: {
@@ -1,2 +1,2 @@
1
1
  export declare const daydiffstr: (dayticks: number) => string;
2
- export declare const getDMY: (date: Date, dayOffset?: number | undefined) => string;
2
+ export declare const getDMY: (date: Date, dayOffset?: number) => string;
@@ -74,5 +74,5 @@ export interface AuthedUserContext {
74
74
  refreshToken: () => Promise<User | undefined>;
75
75
  }
76
76
  export declare const getBearerToken: (jwt?: {
77
- id_token?: string | undefined;
78
- } | undefined) => string | undefined;
77
+ id_token?: string;
78
+ }) => string | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare const clearLocalStorageItem: (key: string) => void;
2
- export declare const clearAllLocalStorage: (except?: string[] | undefined) => void;
3
- export declare const setLocalStorageItem: <T>(key: string, value: T, ttl?: number | undefined) => void;
4
- export declare const getLocalStorageItem: <T>(key: string, initialValue: T, ttl?: number | undefined) => T;
2
+ export declare const clearAllLocalStorage: (except?: string[]) => void;
3
+ export declare const setLocalStorageItem: <T>(key: string, value: T, ttl?: number) => void;
4
+ export declare const getLocalStorageItem: <T>(key: string, initialValue: T, ttl?: number) => T;
5
5
  export declare function UseLocalStorage<T>(key: string, initialValue: T, ttl?: number): [T, (value: T | ((a: T) => T)) => void];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.254",
3
+ "version": "0.0.255",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",
@@ -31,21 +31,21 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@babel/core": "7.18.2",
34
- "@storybook/addon-actions": "6.5.5",
35
- "@storybook/addon-docs": "6.5.5",
36
- "@storybook/addon-essentials": "6.5.5",
37
- "@storybook/addon-interactions": "6.5.5",
38
- "@storybook/addon-links": "6.5.5",
39
- "@storybook/addons": "6.5.5",
40
- "@storybook/react": "6.5.5",
41
- "@storybook/theming": "6.5.5",
34
+ "@storybook/addon-actions": "6.5.6",
35
+ "@storybook/addon-docs": "6.5.6",
36
+ "@storybook/addon-essentials": "6.5.6",
37
+ "@storybook/addon-interactions": "6.5.6",
38
+ "@storybook/addon-links": "6.5.6",
39
+ "@storybook/addons": "6.5.6",
40
+ "@storybook/react": "6.5.6",
41
+ "@storybook/theming": "6.5.6",
42
42
  "@types/jsonwebtoken": "8.5.8",
43
- "@types/node": "17.0.35",
43
+ "@types/node": "17.0.36",
44
44
  "@types/react": "17.0.43",
45
45
  "@types/react-dom": "17.0.14",
46
46
  "@types/styled-components": "5.1.25",
47
- "@typescript-eslint/eslint-plugin": "5.26.0",
48
- "@typescript-eslint/parser": "5.26.0",
47
+ "@typescript-eslint/eslint-plugin": "5.27.0",
48
+ "@typescript-eslint/parser": "5.27.0",
49
49
  "cross-env": "7.0.3",
50
50
  "eslint": "8.16.0",
51
51
  "eslint-config-airbnb-typescript": "17.0.0",