ag-common 0.0.472 → 0.0.474
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 +1 -1
- package/dist/api/helpers/dynamo.d.ts +1 -1
- package/dist/api/helpers/openApiHelpers.d.ts +4 -3
- package/dist/api/helpers/openApiHelpers.js +0 -1
- package/dist/api/helpers/ssm.d.ts +1 -1
- package/dist/api/helpers/ssmInfra/dynamo.d.ts +2 -1
- package/dist/api/helpers/ssmInfra/s3.d.ts +2 -1
- package/dist/api/helpers/ssmInfra/sqs.d.ts +2 -1
- package/dist/api/helpers/validateOpenApi.d.ts +4 -4
- package/dist/api/helpers/validations.d.ts +2 -2
- package/dist/api/types/aws.d.ts +1 -1
- package/dist/api/types/index.d.ts +2 -2
- package/dist/ui/components/Button/index.d.ts +2 -1
- package/dist/ui/components/Confirm/Dialog.d.ts +1 -1
- package/dist/ui/components/Confirm/Modal.d.ts +1 -1
- package/dist/ui/components/DropdownList/Base.d.ts +1 -1
- package/dist/ui/components/DropdownList/Dialog.d.ts +1 -1
- package/dist/ui/components/DropdownList/types.d.ts +1 -1
- package/dist/ui/components/FlexColumn/index.d.ts +1 -1
- package/dist/ui/components/FlexRow/index.d.ts +1 -1
- package/dist/ui/components/Icon/index.d.ts +2 -1
- package/dist/ui/components/Image/index.d.ts +2 -1
- package/dist/ui/components/Modal/Modal.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/OpenApiCodeBlock.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/curl/helpers/body.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/curl/helpers/getCurlLines.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/curl/helpers/security.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/curl/index.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/call.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/getFetchLines.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/req.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/fetch/index.d.ts +1 -1
- package/dist/ui/components/OpenApiCodeBlock/helpers/common.d.ts +1 -1
- package/dist/ui/components/Prompt/Modal.d.ts +1 -1
- package/dist/ui/components/RowOrColumn/index.d.ts +2 -1
- package/dist/ui/components/Search/Base.d.ts +1 -1
- package/dist/ui/components/Search/Dialog.d.ts +1 -1
- package/dist/ui/components/Search/Inline.d.ts +1 -1
- package/dist/ui/components/Search/Modal.d.ts +1 -1
- package/dist/ui/components/Search/SearchBox.d.ts +1 -1
- package/dist/ui/components/TextEdit/TextEdit.d.ts +1 -1
- package/dist/ui/components/TextEdit/types.d.ts +1 -1
- package/dist/ui/components/TimelineChart/index.d.ts +1 -1
- package/dist/ui/components/Toast/base.d.ts +1 -1
- package/dist/ui/components/TreeChart/base.d.ts +1 -1
- package/dist/ui/components/TreeChart/helpers.d.ts +1 -1
- package/dist/ui/components/UserImage/index.d.ts +1 -1
- package/dist/ui/helpers/axiosHelper.d.ts +1 -1
- package/dist/ui/helpers/callOpenApi/cached.d.ts +3 -3
- package/dist/ui/helpers/callOpenApi/direct.d.ts +2 -2
- package/dist/ui/helpers/callOpenApi/helpers.d.ts +1 -1
- package/dist/ui/helpers/callOpenApi/hook.d.ts +3 -3
- package/dist/ui/helpers/callOpenApi/hook.js +2 -1
- package/dist/ui/helpers/callOpenApi/types.d.ts +1 -1
- package/dist/ui/helpers/cookie/use.d.ts +1 -1
- package/dist/ui/helpers/routes.d.ts +2 -2
- package/dist/ui/helpers/useGranularHook.d.ts +1 -1
- package/dist/ui/helpers/useOnClickOutside.d.ts +1 -1
- package/dist/ui/helpers/useOnScroll.d.ts +1 -1
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIGatewayProxyResult, DYNAMOKEYS } from '../types';
|
|
1
|
+
import type { APIGatewayProxyResult, DYNAMOKEYS } from '../types';
|
|
2
2
|
export declare const returnCode: <T>(statusCode: number, body?: T | undefined, extraHeaders?: {
|
|
3
3
|
[a: string]: string;
|
|
4
4
|
} | undefined, fullSiteUrl?: string) => APIGatewayProxyResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
|
|
2
|
-
import { DYNAMOKEYS, IQueryDynamo, Key } from '../types';
|
|
2
|
+
import type { DYNAMOKEYS, IQueryDynamo, Key } from '../types';
|
|
3
3
|
export declare const setDynamo: (region: string) => DynamoDBDocument;
|
|
4
4
|
export declare let dynamoDb: DynamoDBDocument;
|
|
5
5
|
export declare const putDynamo: <T extends Record<string, any>>(item: T, tableName: string, opt?: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { aws_certificatemanager as certmgr } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_apigateway as apigw, aws_route53 as route53 } from 'aws-cdk-lib';
|
|
3
|
+
import type { Construct } from 'constructs';
|
|
4
|
+
import type { ILambdaConfigs } from '../types';
|
|
4
5
|
export declare const openApiImpl: (p: {
|
|
5
6
|
stack: Construct;
|
|
6
7
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.openApiImpl = void 0;
|
|
4
|
-
/* eslint-disable no-new */
|
|
5
4
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
6
5
|
const array_1 = require("../../common/helpers/array");
|
|
7
6
|
const log_1 = require("../../common/helpers/log");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Stack } from 'aws-cdk-lib';
|
|
2
|
+
import { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
|
|
2
3
|
export declare const generateTableRef: ({ stack, baseKey, hasStream, hasGSI, }: {
|
|
3
4
|
hasStream: boolean;
|
|
4
5
|
hasGSI: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TLang } from '../../common/helpers/i18n';
|
|
2
|
-
import { User } from '../../ui/helpers/jwt';
|
|
3
|
-
import { APIGatewayEvent, APIGatewayProxyResult } from '../types';
|
|
4
|
-
import { TGetAndValidateToken } from './validations';
|
|
1
|
+
import type { TLang } from '../../common/helpers/i18n';
|
|
2
|
+
import type { User } from '../../ui/helpers/jwt';
|
|
3
|
+
import type { APIGatewayEvent, APIGatewayProxyResult } from '../types';
|
|
4
|
+
import type { TGetAndValidateToken } from './validations';
|
|
5
5
|
export type NextType<T> = ({ event, body, params, userProfile, lang, }: {
|
|
6
6
|
params: Record<string, string>;
|
|
7
7
|
event: APIGatewayEvent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { User } from '../../ui/helpers/jwt';
|
|
2
|
-
import { APIGatewayProxyResult } from '../types';
|
|
1
|
+
import type { User } from '../../ui/helpers/jwt';
|
|
2
|
+
import type { APIGatewayProxyResult } from '../types';
|
|
3
3
|
export interface IGetAndValidateToken {
|
|
4
4
|
/**
|
|
5
5
|
* default ap-southeast-2
|
package/dist/api/types/aws.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aws_dynamodb as dynamodb, aws_iam as iam, aws_lambda as lambda } from 'aws-cdk-lib';
|
|
2
|
-
import { Key } from './aws';
|
|
1
|
+
import type { aws_dynamodb as dynamodb, aws_iam as iam, aws_lambda as lambda } from 'aws-cdk-lib';
|
|
2
|
+
import type { Key } from './aws';
|
|
3
3
|
export interface DYNAMOKEYS {
|
|
4
4
|
type: string;
|
|
5
5
|
L1: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { KeyboardEventHandler, MouseEventHandler } from 'react';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
export declare const ButtonBase: import("@emotion/react").SerializedStyles;
|
|
3
4
|
export interface IButton {
|
|
4
5
|
title?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IModal } from './types';
|
|
2
|
+
import type { IModal } from './types';
|
|
3
3
|
export declare const ModalItem: import("@emotion/styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: React.ElementType<any> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IOpenApiCodeBlock } from '../../types';
|
|
2
|
+
import type { IOpenApiCodeBlock } from '../../types';
|
|
3
3
|
export declare const getBody: <TDefaultApi>(p: IOpenApiCodeBlock<TDefaultApi>) => {
|
|
4
4
|
content: JSX.Element | undefined;
|
|
5
5
|
header: JSX.Element | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICurlLines, IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
1
|
+
import type { ICurlLines, IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
2
2
|
export declare const getCurlLines: <TDefaultApi>(ops: IOpenApiOperationBlock, p: IOpenApiCodeBlock<TDefaultApi>) => ICurlLines;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../types';
|
|
2
|
+
import type { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../types';
|
|
3
3
|
export declare const Curl: <TDefaultApi>({ ops, p, }: {
|
|
4
4
|
p: IOpenApiCodeBlock<TDefaultApi>;
|
|
5
5
|
ops: IOpenApiOperationBlock;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
2
|
+
import type { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
3
3
|
export declare const getFetchCall: <TDefaultApi>(p: IOpenApiCodeBlock<TDefaultApi>, ops: IOpenApiOperationBlock) => JSX.Element | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IFetchLines, IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
1
|
+
import type { IFetchLines, IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
2
2
|
export declare const getFetchLines: <TDefaultApi>(ops: IOpenApiOperationBlock, p: IOpenApiCodeBlock<TDefaultApi>) => IFetchLines;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
2
|
+
import type { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../../types';
|
|
3
3
|
export declare const getRequestOptions: <TDefaultApi>(p: IOpenApiCodeBlock<TDefaultApi>, ops: IOpenApiOperationBlock) => JSX.Element | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../types';
|
|
2
|
+
import type { IOpenApiCodeBlock, IOpenApiOperationBlock } from '../types';
|
|
3
3
|
export declare const Fetch: <TDefaultApi>({ ops, p, }: {
|
|
4
4
|
p: IOpenApiCodeBlock<TDefaultApi>;
|
|
5
5
|
ops: IOpenApiOperationBlock;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { IOpenApi, IOpenApiCodeBlock, IOpenApiOperation, IOpenApiOperationBlock } from '../types';
|
|
2
|
+
import type { IOpenApi, IOpenApiCodeBlock, IOpenApiOperation, IOpenApiOperationBlock } from '../types';
|
|
3
3
|
export declare const Highlight: import("@emotion/styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ISearchDialog, TSearchModalRes } from './types';
|
|
2
|
+
import type { ISearchDialog, TSearchModalRes } from './types';
|
|
3
3
|
type ISearchBase<T> = ISearchDialog<T> & {
|
|
4
4
|
onSearchTextChange?: (v: string) => void;
|
|
5
5
|
onSelectItem?: (v: TSearchModalRes<T>) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ISearchInline, TSearchModalRes } from './types';
|
|
2
|
+
import type { ISearchInline, TSearchModalRes } from './types';
|
|
3
3
|
export declare const SearchInline: <T>(p: ISearchInline<T> & {
|
|
4
4
|
onSelectItem?: ((v: TSearchModalRes<T>) => void) | undefined;
|
|
5
5
|
onSearchTextChange?: ((v: string) => void) | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ISearchModal, TSearchModalRes } from './types';
|
|
2
|
+
import type { ISearchModal, TSearchModalRes } from './types';
|
|
3
3
|
export declare const SearchModal: <T>(p: ISearchModal<T> & {
|
|
4
4
|
onSelectItem: (v: TSearchModalRes<T>) => void;
|
|
5
5
|
}) => React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IRefTextEdit, ITextEdit } from './types';
|
|
2
|
+
import type { IRefTextEdit, ITextEdit } from './types';
|
|
3
3
|
export declare const ValueReadonly: import("@emotion/styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: React.ElementType<any> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AxiosWrapperLite } from '../jwt';
|
|
2
|
-
import { CacheItems } from '../routes';
|
|
3
|
-
import { ICallOpenApi, OverrideAuth } from './types';
|
|
1
|
+
import type { AxiosWrapperLite } from '../jwt';
|
|
2
|
+
import type { CacheItems } from '../routes';
|
|
3
|
+
import type { ICallOpenApi, OverrideAuth } from './types';
|
|
4
4
|
export type TCallOpenApiCached<T, TDefaultApi> = ICallOpenApi<T, TDefaultApi> & {
|
|
5
5
|
/**
|
|
6
6
|
* if falsey, will run callOpenApi directly
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AxiosWrapperLite } from '../jwt';
|
|
2
|
-
import { ICallOpenApi, OverrideAuth } from './types';
|
|
1
|
+
import type { AxiosWrapperLite } from '../jwt';
|
|
2
|
+
import type { ICallOpenApi, OverrideAuth } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* get the id_token from provided value, or cookie, or LS
|
|
5
5
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AxiosWrapper } from '../jwt';
|
|
3
|
-
import { CacheItems } from '../routes';
|
|
4
|
-
import { ICallOpenApi } from './types';
|
|
2
|
+
import type { AxiosWrapper } from '../jwt';
|
|
3
|
+
import type { CacheItems } from '../routes';
|
|
4
|
+
import type { ICallOpenApi } from './types';
|
|
5
5
|
export type TUseCallOpenApi<T> = AxiosWrapper<T> & {
|
|
6
6
|
loaded: boolean;
|
|
7
7
|
loadcount: number;
|
|
@@ -36,7 +36,8 @@ const useCallOpenApi = (inConfig) => {
|
|
|
36
36
|
/** config about hook*/
|
|
37
37
|
const [config, setConfig] = (0, react_1.useState)(inConfig);
|
|
38
38
|
(0, useGranularHook_1.useGranularEffect)(() => {
|
|
39
|
-
if (JSON.stringify(config)
|
|
39
|
+
if (JSON.stringify(Object.assign(Object.assign({}, config), { headers: undefined, ssrCacheItems: undefined })) !==
|
|
40
|
+
JSON.stringify(Object.assign(Object.assign({}, inConfig), { headers: undefined, ssrCacheItems: undefined }))) {
|
|
40
41
|
setConfig(inConfig);
|
|
41
42
|
setResp(Object.assign(Object.assign({}, defaultState(inConfig, true)), { loading: true }));
|
|
42
43
|
void (0, direct_1.callOpenApi)(inConfig).then((r) => setResp((r2) => (Object.assign(Object.assign(Object.assign({}, r2), r), { loading: false }))));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TLang } from '../../common/helpers/i18n';
|
|
2
|
-
import { AxiosWrapperLite } from './jwt';
|
|
1
|
+
import type { TLang } from '../../common/helpers/i18n';
|
|
2
|
+
import type { AxiosWrapperLite } from './jwt';
|
|
3
3
|
export type TProtocol = 'http:' | 'https:';
|
|
4
4
|
export interface LocationSubset {
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DependencyList, EffectCallback } from 'react';
|
|
1
|
+
import type { DependencyList, EffectCallback } from 'react';
|
|
2
2
|
type HookWithDependencies<C, R> = (callback: C, deps: DependencyList) => R;
|
|
3
3
|
export declare const useGranularHook: <T extends HookWithDependencies<C, ReturnType<T>>, C>(hook: T, callback: C, primaryDeps: DependencyList, secondaryDeps: DependencyList) => ReturnType<T>;
|
|
4
4
|
export declare const useGranularEffect: (effect: EffectCallback, primaryDeps: DependencyList, secondaryDeps: DependencyList) => void;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.474",
|
|
3
3
|
"name": "ag-common",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"typescript": "^5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/core": "7.22.
|
|
40
|
-
"@babel/preset-typescript": "
|
|
41
|
-
"@babel/types": "
|
|
39
|
+
"@babel/core": "7.22.10",
|
|
40
|
+
"@babel/preset-typescript": "7.21.5",
|
|
41
|
+
"@babel/types": "7.21.5",
|
|
42
42
|
"@emotion/react": "11.11.1",
|
|
43
43
|
"@emotion/styled": "11.11.0",
|
|
44
|
-
"@smithy/types": "
|
|
44
|
+
"@smithy/types": "2.0.2",
|
|
45
45
|
"@storybook/addon-actions": "7.2.1",
|
|
46
46
|
"@storybook/addon-docs": "7.2.1",
|
|
47
47
|
"@storybook/addon-essentials": "7.2.1",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"@storybook/react": "7.2.1",
|
|
52
52
|
"@storybook/react-webpack5": "7.2.1",
|
|
53
53
|
"@storybook/theming": "7.2.1",
|
|
54
|
-
"@types/jest": "
|
|
54
|
+
"@types/jest": "29.5.3",
|
|
55
55
|
"@types/jsonwebtoken": "9.0.2",
|
|
56
|
-
"@types/node": "20.4.
|
|
56
|
+
"@types/node": "20.4.8",
|
|
57
57
|
"@types/react": "18.2.18",
|
|
58
58
|
"@types/react-dom": "18.2.7",
|
|
59
59
|
"cross-env": "7.0.3",
|
|
60
|
-
"eslint-config-e7npm": "0.0.
|
|
61
|
-
"jest": "
|
|
60
|
+
"eslint-config-e7npm": "0.0.18",
|
|
61
|
+
"jest": "29.6.2",
|
|
62
62
|
"rimraf": "5.0.1",
|
|
63
63
|
"storybook": "7.2.1",
|
|
64
|
-
"ts-jest": "
|
|
64
|
+
"ts-jest": "29.1.1"
|
|
65
65
|
},
|
|
66
66
|
"files": [
|
|
67
67
|
"dist/**/*",
|