oiu-core 0.0.2 → 0.0.4
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/auth/AuthenticationProvider.d.ts +14 -0
- package/dist/auth/AuthenticationProvider.d.ts.map +1 -0
- package/dist/auth/AuthorizationProvider.d.ts +20 -0
- package/dist/auth/AuthorizationProvider.d.ts.map +1 -0
- package/dist/auth/Context.d.ts +5 -0
- package/dist/auth/Context.d.ts.map +1 -0
- package/dist/auth/OAuthService/index.d.ts +57 -0
- package/dist/auth/OAuthService/index.d.ts.map +1 -0
- package/dist/auth/OAuthService/utils.d.ts +15 -0
- package/dist/auth/OAuthService/utils.d.ts.map +1 -0
- package/dist/auth/_type.d.ts +22 -0
- package/dist/auth/_type.d.ts.map +1 -1
- package/dist/auth/index.d.ts +17 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/utils.d.ts +42 -0
- package/dist/auth/utils.d.ts.map +1 -0
- package/dist/components/ConfigLoader/index.d.ts +22 -0
- package/dist/components/ConfigLoader/index.d.ts.map +1 -0
- package/dist/components/Wait/_type.d.ts +31 -0
- package/dist/components/Wait/_type.d.ts.map +1 -0
- package/dist/components/Wait/index.d.ts +9 -0
- package/dist/components/Wait/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hoc/index.d.ts +2 -0
- package/dist/hoc/index.d.ts.map +1 -0
- package/dist/hoc/wl.d.ts +31 -0
- package/dist/hoc/wl.d.ts.map +1 -0
- package/dist/index-BzyehgBi.js +2659 -0
- package/dist/language/index.d.ts +0 -3
- package/dist/language/index.d.ts.map +1 -1
- package/dist/main-CKwVM_d-.js +6700 -0
- package/dist/main.d.ts +17 -5
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +11 -5956
- package/dist/redux/slices/appSlice.d.ts +4 -0
- package/dist/redux/slices/appSlice.d.ts.map +1 -1
- package/dist/utils/config.d.ts +34 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/Await/_type.d.ts +0 -29
- package/dist/components/Await/_type.d.ts.map +0 -1
- package/dist/components/Await/index.d.ts +0 -9
- package/dist/components/Await/index.d.ts.map +0 -1
- package/dist/components/Test1/index.d.ts +0 -2
- package/dist/components/Test1/index.d.ts.map +0 -1
- package/dist/components/Test2/index.d.ts +0 -2
- package/dist/components/Test2/index.d.ts.map +0 -1
- /package/dist/assets/{oiu.css → oiu-core.css} +0 -0
|
@@ -3,6 +3,8 @@ import { ThemeKey } from '../../utils/_types';
|
|
|
3
3
|
import { Identity } from '../../auth/_type';
|
|
4
4
|
export type AuthPayload = {
|
|
5
5
|
seed?: string;
|
|
6
|
+
/** Last reason of the operation */
|
|
7
|
+
reason: string;
|
|
6
8
|
identity?: Identity;
|
|
7
9
|
twoFactor?: {
|
|
8
10
|
username: string;
|
|
@@ -39,6 +41,8 @@ type ThemeAction = Action<string> & {
|
|
|
39
41
|
};
|
|
40
42
|
type AuthAction = Action<string> & {
|
|
41
43
|
payload: {
|
|
44
|
+
/** Reason of the operation */
|
|
45
|
+
reason: string;
|
|
42
46
|
/** Information of the customer profile */
|
|
43
47
|
identity?: Identity;
|
|
44
48
|
/** Customer is supplied username and passwd correct and now require check the 2fa */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appSlice.d.ts","sourceRoot":"","sources":["../../../lib/redux/slices/appSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,S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8BAA8B;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,0CAA0C;QAC1C,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,qFAAqF;QACrF,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;KACxC,CAAA;CACJ,CAAC;AAcF,gBAAgB;AAChB,eAAO,MAAM,QAAQ;yEAIe,YAAY;uEAGd,UAAU;wEAGT,WAAW;wEAMX,UAAU;;qEAe3C,CAAC;AAEH;;;;GAIG;AAEH,eAAO,MAAM,WAAW,GAAI,OAAO,GAAG,KAAyB,QAAQ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Internal configuration for OIU library */
|
|
2
|
+
export type OIUConfig = {
|
|
3
|
+
version: string;
|
|
4
|
+
getEndpoint: (id: number) => string;
|
|
5
|
+
};
|
|
6
|
+
/** Represent the local configuration base type */
|
|
7
|
+
export type Config = {
|
|
8
|
+
_isLoaded: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** Function used to convert the remote configuration to local configuration */
|
|
11
|
+
export type FillFn<TRConfig> = (config: TRConfig) => OIUConfig | undefined;
|
|
12
|
+
/** Function used to load the remote configuration, this is optional by default the system will try to load from window.config */
|
|
13
|
+
export type ConfigLoader<TRConfig> = () => Promise<TRConfig>;
|
|
14
|
+
/**
|
|
15
|
+
* Wait for the configuration to be downloaded and assigned in window.config, then load from the window.config object into config var. This is a one-time operation.
|
|
16
|
+
* This process allow asynchronous loading of the configuration before the React app is started.
|
|
17
|
+
* @param config
|
|
18
|
+
* @param fill Receive the remote configuration and fill the local configuration object. example: () => { config.url = remoteConfig.url; return { version: '0.0.0', getEndpoint: () => remoteConfig.url,} as OIUConfig; }
|
|
19
|
+
* @param customLoadConfig
|
|
20
|
+
* @typeParam TRConfig The remote configuration type.
|
|
21
|
+
* @typeParam TConfig The local configuration base type.
|
|
22
|
+
* @returns If is the first time config load return true, otherwise false.
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadConfig<TRConfig, TConfig extends Config>(config: TConfig, fill: FillFn<TRConfig>, customLoadConfig?: ConfigLoader<TRConfig>): Promise<boolean>;
|
|
25
|
+
export declare const oiuConfig: {
|
|
26
|
+
version: () => string;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve the base URL endpoint to be called for a given ID from the cached configuration.
|
|
29
|
+
* @param id
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
getEndpoint: (id: number) => string;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/utils/config.ts"],"names":[],"mappings":"AAIA,6CAA6C;AAC7C,MAAM,MAAM,SAAS,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AAEF,kDAAkD;AAClD,MAAM,MAAM,MAAM,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAC5C,+EAA+E;AAC/E,MAAM,MAAM,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,QAAQ,KAAK,SAAS,GAAG,SAAS,CAAC;AAC3E,iIAAiI;AACjI,MAAM,MAAM,YAAY,CAAC,QAAQ,IAAI,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;AAI7D;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,SAAS,MAAM,EACvD,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EACtB,gBAAgB,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CASlB;AAkDD,eAAO,MAAM,SAAS;;IAKlB;;;;OAIG;sBACe,MAAM;CAI3B,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './_types';
|
|
2
|
-
export * from './string';
|
|
3
2
|
export * from './promise';
|
|
3
|
+
export * from './string';
|
|
4
4
|
export * from './sys';
|
|
5
5
|
export * from './url';
|
|
6
|
+
export { loadConfig } from './config';
|
|
7
|
+
export type { Config, FillFn, ConfigLoader, OIUConfig } from './config';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ComponentType, PropsWithChildren, ReactNode } from "react";
|
|
2
|
-
export type SpinProps<T = unknown> = PropsWithChildren<{
|
|
3
|
-
/** Whether to show the spin */
|
|
4
|
-
spinning?: boolean;
|
|
5
|
-
/** The text to show when the spin is spinning */
|
|
6
|
-
tip?: ReactNode;
|
|
7
|
-
/** Class name */
|
|
8
|
-
className?: string;
|
|
9
|
-
/** Allow set extra properties to be passed to the final spin component */
|
|
10
|
-
extraProps?: T;
|
|
11
|
-
}>;
|
|
12
|
-
export type SpinOrSkeletonProps<T = unknown> = {
|
|
13
|
-
spin: SpinProps<T>;
|
|
14
|
-
skeleton?: never;
|
|
15
|
-
} | {
|
|
16
|
-
spin?: never;
|
|
17
|
-
skeleton: SpinProps<T>;
|
|
18
|
-
};
|
|
19
|
-
export type AwaitProps<T = unknown> = PropsWithChildren<{
|
|
20
|
-
/** Use translation api to resolve the text */
|
|
21
|
-
useTranslation?: boolean;
|
|
22
|
-
/** Show children when the spin is spinning in other case hide the children component */
|
|
23
|
-
showChildren?: boolean;
|
|
24
|
-
} & SpinOrSkeletonProps<T>>;
|
|
25
|
-
export type AwaitComponentType = ComponentType<AwaitProps> & {
|
|
26
|
-
spin: ComponentType<SpinProps>;
|
|
27
|
-
skeleton?: ComponentType<SpinProps>;
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=_type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_type.d.ts","sourceRoot":"","sources":["../../../lib/components/Await/_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAAI,iBAAiB,CAAC;IACnD,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,CAAC,CAAC;CAClB,CAAC,CAAC;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,GAAG,OAAO,IAAI;IAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AACnI,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,iBAAiB,CACnD;IACI,8CAA8C;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wFAAwF;IACxF,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAC7B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,GAAG;IACzD,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACvC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AwaitProps, SpinProps } from './_type';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param param0
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare const Await: import("react").MemoExoticComponent<({ showChildren, useTranslation, spin, skeleton, children }: AwaitProps) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode>>>;
|
|
8
|
-
export type { SpinProps, AwaitProps };
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Await/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAsB,MAAM,SAAS,CAAC;AAOpE;;;;GAIG;AACH,eAAO,MAAM,KAAK,mGAAmF,UAAU,uUAwB7G,CAAC;AAsDH,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Test1/index.tsx"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,4CAOpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Test2/index.tsx"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,4CAEpB"}
|
|
File without changes
|