ag-common 0.0.692 → 0.0.693
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/api/helpers/api.d.ts +7 -7
- package/dist/api/helpers/dynamo.d.ts +1 -1
- package/dist/api/helpers/enforceDynamoProvisionCap.d.ts +3 -3
- package/dist/api/helpers/s3.d.ts +2 -3
- package/dist/api/helpers/ssmInfra/dynamo.d.ts +1 -1
- package/dist/common/helpers/secondsInNearest.d.ts +1 -1
- package/dist/ui/components/BarChart/Base.d.ts +2 -2
- package/dist/ui/components/BarChart/Item.d.ts +3 -3
- package/dist/ui/components/BarChart/TooltipContent.d.ts +1 -1
- package/dist/ui/components/BarChart/getLegendItems.d.ts +1 -1
- package/dist/ui/components/HorizontalScrollBar/index.d.ts +1 -1
- package/dist/ui/components/PulseRing/index.d.ts +9 -9
- package/dist/ui/components/TextEdit/ListboxEdit.d.ts +2 -2
- package/dist/ui/components/Toast/base.d.ts +1 -1
- package/dist/ui/helpers/axiosHelper.d.ts +4 -4
- package/dist/ui/helpers/cookie/raw.d.ts +1 -1
- package/dist/ui/helpers/routes.d.ts +3 -3
- package/dist/ui/helpers/useOverloadPageSearch.d.ts +1 -1
- package/dist/ui/helpers/useQueryString.d.ts +3 -3
- package/dist/ui/icons/Checkmark.d.ts +3 -3
- package/dist/ui/icons/Circle.d.ts +4 -4
- package/dist/ui/icons/CircleDot.d.ts +1 -1
- package/dist/ui/icons/Computer.d.ts +3 -3
- package/dist/ui/icons/CrossIcon.d.ts +2 -2
- package/dist/ui/icons/Hamburger.d.ts +1 -1
- package/dist/ui/icons/Magnify.d.ts +3 -3
- package/dist/ui/icons/Moon.d.ts +3 -3
- package/dist/ui/icons/Warning.d.ts +4 -4
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { APIGatewayProxyResult, DYNAMOKEYS } from '../types';
|
|
2
2
|
export declare const returnCode: <T>(statusCode: number, body?: T, extraHeaders?: {
|
|
3
3
|
[a: string]: string;
|
|
4
|
-
}
|
|
4
|
+
}, fullSiteUrl?: string) => APIGatewayProxyResult;
|
|
5
5
|
/**
|
|
6
6
|
* strip all dynamo generated keys. can optionally keep PK
|
|
7
7
|
* @param record
|
|
@@ -22,10 +22,10 @@ export declare const stripPKs: <T>(record: T, keepPk?: boolean) => T;
|
|
|
22
22
|
export declare const generateDynamoPKS: ({ type, L1, L2, L3, L4, L5, L6, additionalPKValues, }: {
|
|
23
23
|
type: string;
|
|
24
24
|
L1: string;
|
|
25
|
-
L2?: string
|
|
26
|
-
L3?: string
|
|
27
|
-
L4?: string
|
|
28
|
-
L5?: string
|
|
29
|
-
L6?: string
|
|
30
|
-
additionalPKValues?: string[]
|
|
25
|
+
L2?: string;
|
|
26
|
+
L3?: string;
|
|
27
|
+
L4?: string;
|
|
28
|
+
L5?: string;
|
|
29
|
+
L6?: string;
|
|
30
|
+
additionalPKValues?: string[];
|
|
31
31
|
}) => DYNAMOKEYS;
|
|
@@ -56,7 +56,7 @@ export declare const getItemDynamo: <T>({ tableName, pkName, pkValue, }: {
|
|
|
56
56
|
}>;
|
|
57
57
|
export declare const queryDynamo: <T>({ tableName, pkName, pkValue, pkOperator, skName, skValue, skOperator, indexName, limit, startKey, filterName, filterValue, filterOperator, sortAscending, }: IQueryDynamo) => Promise<{
|
|
58
58
|
data: T[];
|
|
59
|
-
startKey?: Key
|
|
59
|
+
startKey?: Key;
|
|
60
60
|
} | {
|
|
61
61
|
error: string;
|
|
62
62
|
}>;
|
|
@@ -4,13 +4,13 @@ export declare const enforceDynamoProvisionCap: ({ tables, readsMax, writesMax,
|
|
|
4
4
|
/**
|
|
5
5
|
* default 25
|
|
6
6
|
*/
|
|
7
|
-
readsMax?: number
|
|
7
|
+
readsMax?: number;
|
|
8
8
|
/**
|
|
9
9
|
* default 25
|
|
10
10
|
*/
|
|
11
|
-
writesMax?: number
|
|
11
|
+
writesMax?: number;
|
|
12
12
|
/**
|
|
13
13
|
* default false. if true, will throw if cap isnt met. will still throw if exceeds.
|
|
14
14
|
*/
|
|
15
|
-
mustEqual?: boolean
|
|
15
|
+
mustEqual?: boolean;
|
|
16
16
|
}) => void;
|
package/dist/api/helpers/s3.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { S3Client } from '@aws-sdk/client-s3';
|
|
3
3
|
import type { StreamingBlobPayloadOutputTypes } from '@smithy/types';
|
|
4
4
|
import type { Buffer } from 'buffer';
|
|
5
|
-
import { error } from '../../common/helpers/log';
|
|
6
5
|
export declare const setS3: (region: string) => S3Client;
|
|
7
6
|
export declare const s3: S3Client;
|
|
8
7
|
export declare const getS3Object: ({ fileurl: { Bucket, Key }, }: {
|
|
@@ -32,7 +31,7 @@ export declare function getS3Objects({ bucket, keys, }: {
|
|
|
32
31
|
error?: undefined;
|
|
33
32
|
}, void, unknown>;
|
|
34
33
|
export declare const putS3Object: ({ Body, Bucket, Key, ContentType, }: {
|
|
35
|
-
ContentType?: string
|
|
34
|
+
ContentType?: string;
|
|
36
35
|
Body: string | Blob | Buffer;
|
|
37
36
|
Bucket: string;
|
|
38
37
|
Key: string;
|
|
@@ -56,7 +55,7 @@ export declare const copyFile: ({ Bucket, fromKey, toKey, deleteSource, }: {
|
|
|
56
55
|
fromKey: string;
|
|
57
56
|
toKey: string;
|
|
58
57
|
/** if true, will delete original after copy. default false */
|
|
59
|
-
deleteSource?: boolean
|
|
58
|
+
deleteSource?: boolean;
|
|
60
59
|
}) => Promise<{
|
|
61
60
|
error?: string;
|
|
62
61
|
}>;
|
|
@@ -3,6 +3,6 @@ import { type IVarStyles } from '../../styles/common';
|
|
|
3
3
|
import type { IBarChartData } from './types';
|
|
4
4
|
export declare const BarChart: ({ data: dataRaw, style: sRaw, className, }: {
|
|
5
5
|
data: IBarChartData[];
|
|
6
|
-
style?: Partial<IVarStyles
|
|
7
|
-
className?: string
|
|
6
|
+
style?: Partial<IVarStyles>;
|
|
7
|
+
className?: string;
|
|
8
8
|
}) => React.JSX.Element;
|
|
@@ -4,9 +4,9 @@ import type { IVarStyles } from '../../styles';
|
|
|
4
4
|
import type { IBarChartData } from './types';
|
|
5
5
|
export declare const Item: ({ data, className, onMouseMove, onMouseLeave, maxWidth, style, }: {
|
|
6
6
|
data: IBarChartData;
|
|
7
|
-
className?: string
|
|
8
|
-
onMouseMove?: MouseEventHandler<HTMLDivElement
|
|
9
|
-
onMouseLeave?: MouseEventHandler<HTMLDivElement
|
|
7
|
+
className?: string;
|
|
8
|
+
onMouseMove?: MouseEventHandler<HTMLDivElement>;
|
|
9
|
+
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
|
|
10
10
|
maxWidth: number;
|
|
11
11
|
style: IVarStyles;
|
|
12
12
|
}) => React.JSX.Element;
|
|
@@ -3,6 +3,6 @@ import type { IVarStyles } from '../../styles/common';
|
|
|
3
3
|
import type { IBarChartData } from './types';
|
|
4
4
|
export declare const TooltipContent: ({ data, selectedKey, style, }: {
|
|
5
5
|
data: IBarChartData;
|
|
6
|
-
selectedKey?: string
|
|
6
|
+
selectedKey?: string;
|
|
7
7
|
style: IVarStyles;
|
|
8
8
|
}) => React.JSX.Element;
|
|
@@ -2,18 +2,18 @@ import type { CSSProperties } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const PulseRing: ({ style, className, text, title, }: {
|
|
4
4
|
/** tooltip text */
|
|
5
|
-
title?: string
|
|
5
|
+
title?: string;
|
|
6
6
|
/** bubble text */
|
|
7
|
-
text?: string
|
|
8
|
-
className?: string
|
|
9
|
-
style?:
|
|
7
|
+
text?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: CSSProperties & {
|
|
10
10
|
/** default 2.5rem */
|
|
11
|
-
width?: string
|
|
11
|
+
width?: string;
|
|
12
12
|
/** default 2.5rem */
|
|
13
|
-
height?: string
|
|
13
|
+
height?: string;
|
|
14
14
|
/** colour of pulse. default #01a4e9 */
|
|
15
|
-
backgroundColor?: string
|
|
15
|
+
backgroundColor?: string;
|
|
16
16
|
/** colour of tex. default #000 */
|
|
17
|
-
color?: string
|
|
18
|
-
}
|
|
17
|
+
color?: string;
|
|
18
|
+
};
|
|
19
19
|
}) => React.JSX.Element;
|
|
@@ -6,9 +6,9 @@ export declare const ListboxEdit: <T>({ defaultValue, onSubmit, values, canEdit,
|
|
|
6
6
|
/**
|
|
7
7
|
* if true can revert or explicit save. default true
|
|
8
8
|
*/
|
|
9
|
-
canEdit?: boolean
|
|
9
|
+
canEdit?: boolean;
|
|
10
10
|
/**
|
|
11
11
|
* can overload the render of the label. defaults to toString
|
|
12
12
|
*/
|
|
13
|
-
renderLabel?: (
|
|
13
|
+
renderLabel?: (a: T) => string;
|
|
14
14
|
}) => React.JSX.Element;
|
|
@@ -12,5 +12,5 @@ export declare const Toast: ({ toast, close, style, }: {
|
|
|
12
12
|
}) => React.JSX.Element;
|
|
13
13
|
export declare const ToastProvider: ({ children, providerOptions, }: {
|
|
14
14
|
children: React.ReactNode;
|
|
15
|
-
providerOptions?: IToastProviderOptions
|
|
15
|
+
providerOptions?: IToastProviderOptions;
|
|
16
16
|
}) => React.JSX.Element;
|
|
@@ -7,11 +7,11 @@ import type { AxiosResponse } from 'axios';
|
|
|
7
7
|
export declare const axiosHelper: <TOut>({ verb, url, body, headers, timeout, retryMax, onStaleAuth, }: {
|
|
8
8
|
headers?: {
|
|
9
9
|
[a: string]: string;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
verb: 'put' | 'post' | 'get' | 'patch' | 'delete';
|
|
12
12
|
url: string;
|
|
13
13
|
body?: unknown;
|
|
14
|
-
timeout?: number
|
|
15
|
-
retryMax?: number
|
|
16
|
-
onStaleAuth?: (
|
|
14
|
+
timeout?: number;
|
|
15
|
+
retryMax?: number;
|
|
16
|
+
onStaleAuth?: () => void;
|
|
17
17
|
}) => Promise<AxiosResponse<TOut>>;
|
|
@@ -7,7 +7,7 @@ export declare const getAllCookies: (cookieString?: string) => Partial<Record<st
|
|
|
7
7
|
/** get a cookie by name*/
|
|
8
8
|
export declare const getCookie: ({ name, cookieDocument, }: {
|
|
9
9
|
name: string;
|
|
10
|
-
cookieDocument?: string
|
|
10
|
+
cookieDocument?: string;
|
|
11
11
|
}) => string | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* expiryDays <0 will delete
|
|
@@ -45,10 +45,10 @@ export declare const getClientReqHref: () => IRequestCommon;
|
|
|
45
45
|
* @returns
|
|
46
46
|
*/
|
|
47
47
|
export declare const getClientOrServerReqHref: ({ url, query, userAgent, }: {
|
|
48
|
-
url?: URLLite
|
|
49
|
-
query?: Record<string, string
|
|
48
|
+
url?: URLLite;
|
|
49
|
+
query?: Record<string, string>;
|
|
50
50
|
/** will use navigator if possible */
|
|
51
|
-
userAgent?: string
|
|
51
|
+
userAgent?: string;
|
|
52
52
|
}) => IRequestCommon;
|
|
53
53
|
/**
|
|
54
54
|
* get server side parsed url
|
|
@@ -6,7 +6,7 @@ export declare const isServer: boolean;
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const useQueryStringRaw: <T>({ name, queryValues, defaultValue, stringify, parse, }: {
|
|
8
8
|
name: string;
|
|
9
|
-
queryValues?: Record<string, string
|
|
9
|
+
queryValues?: Record<string, string>;
|
|
10
10
|
defaultValue: T;
|
|
11
11
|
stringify: (v: T) => string | undefined;
|
|
12
12
|
parse: (v: string | undefined) => T;
|
|
@@ -18,7 +18,7 @@ export declare const useQueryStringRaw: <T>({ name, queryValues, defaultValue, s
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const useQueryStringArray: ({ name, queryValues, defaultValue, }: {
|
|
20
20
|
name: string;
|
|
21
|
-
queryValues?: Record<string, string
|
|
21
|
+
queryValues?: Record<string, string>;
|
|
22
22
|
defaultValue: string[];
|
|
23
23
|
}) => [string[], (v: string[]) => void];
|
|
24
24
|
/**
|
|
@@ -28,7 +28,7 @@ export declare const useQueryStringArray: ({ name, queryValues, defaultValue, }:
|
|
|
28
28
|
*/
|
|
29
29
|
export declare const useQueryStringSingle: ({ name, queryValues, defaultValue, }: {
|
|
30
30
|
name: string;
|
|
31
|
-
queryValues?: Record<string, string
|
|
31
|
+
queryValues?: Record<string, string>;
|
|
32
32
|
/**
|
|
33
33
|
* default value. default undefined
|
|
34
34
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const Checkmark: ({ style, }: {
|
|
4
|
-
style?:
|
|
4
|
+
style?: {
|
|
5
5
|
/** change the colour of the tick. default black */
|
|
6
|
-
fill?: string
|
|
7
|
-
} & CSSProperties
|
|
6
|
+
fill?: string;
|
|
7
|
+
} & CSSProperties;
|
|
8
8
|
}) => React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const Circle: ({ style, dotted, }: {
|
|
4
|
-
style?:
|
|
4
|
+
style?: {
|
|
5
5
|
/** change the colour of the circle. default black */
|
|
6
|
-
fill?: string
|
|
7
|
-
} & CSSProperties
|
|
8
|
-
dotted?: boolean
|
|
6
|
+
fill?: string;
|
|
7
|
+
} & CSSProperties;
|
|
8
|
+
dotted?: boolean;
|
|
9
9
|
}) => React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const Computer: ({ style, }: {
|
|
4
|
-
style?:
|
|
4
|
+
style?: {
|
|
5
5
|
/** change the colour of the icon. default black */
|
|
6
|
-
fill?: string
|
|
7
|
-
} & CSSProperties
|
|
6
|
+
fill?: string;
|
|
7
|
+
} & CSSProperties;
|
|
8
8
|
}) => React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const Magnify: ({ style, }: {
|
|
4
|
-
style?:
|
|
4
|
+
style?: {
|
|
5
5
|
/** change the colour of the icon. default black */
|
|
6
|
-
fill?: string
|
|
7
|
-
} & CSSProperties
|
|
6
|
+
fill?: string;
|
|
7
|
+
} & CSSProperties;
|
|
8
8
|
}) => React.JSX.Element;
|
package/dist/ui/icons/Moon.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const Moon: ({ style, }: {
|
|
4
|
-
style?:
|
|
4
|
+
style?: {
|
|
5
5
|
/** change the colour of the icon. default black */
|
|
6
|
-
fill?: string
|
|
7
|
-
} & CSSProperties
|
|
6
|
+
fill?: string;
|
|
7
|
+
} & CSSProperties;
|
|
8
8
|
}) => React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const Warning: ({ style, className, }: {
|
|
4
|
-
className?: string
|
|
5
|
-
style?:
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: {
|
|
6
6
|
/** change the colour of the icon. default #ffc515 */
|
|
7
|
-
fill?: string
|
|
8
|
-
} & CSSProperties
|
|
7
|
+
fill?: string;
|
|
8
|
+
} & CSSProperties;
|
|
9
9
|
}) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.693",
|
|
3
3
|
"name": "ag-common",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"preinstall": "npx only-allow pnpm",
|
|
11
|
-
"format": "eslint
|
|
11
|
+
"format": "eslint src --fix",
|
|
12
12
|
"lint:tsc": "tsc --noEmit",
|
|
13
|
-
"lint:eslint": "eslint
|
|
13
|
+
"lint:eslint": "eslint src",
|
|
14
14
|
"lint": "pnpm run /^lint:/",
|
|
15
15
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
16
16
|
"start": "cross-env BROWSER=none cross-env storybook dev -p 6006",
|