@npm-zenwork/tax-remittance-ui 0.1.5 → 0.1.7
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/statePayments.d.ts +1 -0
- package/dist/components/payments/AddStatePaymentForm.d.ts +5 -1
- package/dist/config.d.ts +13 -0
- package/dist/embedded/EmbeddedAuthContext.d.ts +7 -5
- package/dist/embedded/RuntimeContext.d.ts +7 -0
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4271 -4111
- package/dist/index.mjs.map +1 -1
- package/dist/lib/auth-events.d.ts +4 -0
- package/dist/pages/EditStatePaymentPage.d.ts +2 -0
- package/dist/pages/StatePaymentEditorPage.d.ts +5 -0
- package/dist/styles.css +1 -1
- package/dist/types/statePayment.d.ts +4 -0
- package/dist/types/statePaymentFlow.d.ts +12 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CreateStatePaymentRequest, StatePaymentResponse, UpdateStatePaymentRequest } from '../types/statePayment';
|
|
2
2
|
export declare function getStatePayments(entityId: number): Promise<StatePaymentResponse[]>;
|
|
3
|
+
export declare function getStatePaymentById(statePaymentDetailId: number): Promise<StatePaymentResponse>;
|
|
3
4
|
export declare function createStatePayment(request: CreateStatePaymentRequest): Promise<StatePaymentResponse>;
|
|
4
5
|
export declare function updateStatePayment(statePaymentDetailId: number, request: UpdateStatePaymentRequest): Promise<StatePaymentResponse>;
|
|
5
6
|
export declare function submitStatePayment(statePaymentDetailId: number): Promise<StatePaymentResponse>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EntityDetailsResponse } from '../../types/entity';
|
|
2
|
+
import { StatePaymentDraft } from '../../types/statePaymentFlow';
|
|
2
3
|
interface AddStatePaymentFormProps {
|
|
3
4
|
entity: EntityDetailsResponse | null;
|
|
5
|
+
initialDraft?: StatePaymentDraft;
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
onCancel?: () => void;
|
|
4
8
|
}
|
|
5
|
-
export declare function AddStatePaymentForm({ entity }: AddStatePaymentFormProps): import("react").JSX.Element;
|
|
9
|
+
export declare function AddStatePaymentForm({ entity, initialDraft, readonly, onCancel, }: AddStatePaymentFormProps): import("react").JSX.Element;
|
|
6
10
|
export {};
|
package/dist/config.d.ts
CHANGED
|
@@ -9,6 +9,19 @@
|
|
|
9
9
|
* Library consumers provide the URL via the apiBaseUrl prop on TaxRemittancePortal.
|
|
10
10
|
*/
|
|
11
11
|
export declare function validateClientConfig(): void;
|
|
12
|
+
export interface WidgetRuntimeConfig {
|
|
13
|
+
apiBaseUrl: string;
|
|
14
|
+
accessToken: string;
|
|
15
|
+
clientId: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function setRuntime(instanceId: string, cfg: WidgetRuntimeConfig): void;
|
|
18
|
+
export declare function getRuntime(instanceId: string): WidgetRuntimeConfig | undefined;
|
|
19
|
+
export declare function clearRuntime(instanceId: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the instanceId whose accessToken matches the given token.
|
|
22
|
+
* Used by client.ts to fire the correct instance's session-expired event on 401.
|
|
23
|
+
*/
|
|
24
|
+
export declare function findInstanceIdByToken(token: string): string | undefined;
|
|
12
25
|
export declare function setRuntimeApiBaseUrl(url: string): void;
|
|
13
26
|
export declare function setRuntimeAccessToken(token: string | null): void;
|
|
14
27
|
export declare function getRuntimeAccessToken(): string | null;
|
|
@@ -4,6 +4,7 @@ interface EmbeddedAuthContextValue {
|
|
|
4
4
|
accessToken: string;
|
|
5
5
|
}
|
|
6
6
|
interface EmbeddedAuthProviderProps {
|
|
7
|
+
instanceId: string;
|
|
7
8
|
accessToken: string;
|
|
8
9
|
onSessionExpired?: () => void;
|
|
9
10
|
children: ReactNode;
|
|
@@ -12,16 +13,17 @@ interface EmbeddedAuthProviderProps {
|
|
|
12
13
|
* Holds the host-provided access token and makes it available to the embedded
|
|
13
14
|
* widget's API calls. No login/register flow — auth is entirely the host's concern.
|
|
14
15
|
*
|
|
15
|
-
* The token is written to the
|
|
16
|
+
* The token is written to the per-instance runtime Map synchronously on every render.
|
|
16
17
|
* This means:
|
|
17
18
|
* - Host-side token refresh (new accessToken prop) is picked up immediately.
|
|
18
19
|
* - React Strict Mode's double-mount never creates a window where the token is null,
|
|
19
20
|
* because the synchronous render-time write runs before any async fetch can fire.
|
|
21
|
+
* - Two simultaneously-mounted widgets don't overwrite each other's tokens because
|
|
22
|
+
* they use separate instanceId keys in the runtime Map.
|
|
20
23
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* module-level variable is harmless — the next mounted instance will overwrite it.
|
|
24
|
+
* Session-expired events are scoped to instanceId so a 401 in Widget A does not
|
|
25
|
+
* trigger onSessionExpired in Widget B.
|
|
24
26
|
*/
|
|
25
|
-
export declare function EmbeddedAuthProvider({ accessToken, onSessionExpired, children, }: EmbeddedAuthProviderProps): import("react").JSX.Element;
|
|
27
|
+
export declare function EmbeddedAuthProvider({ instanceId, accessToken, onSessionExpired, children, }: EmbeddedAuthProviderProps): import("react").JSX.Element;
|
|
26
28
|
export declare function useEmbeddedAuth(): EmbeddedAuthContextValue;
|
|
27
29
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds the stable instanceId for an EmbeddedWidgetBase mount.
|
|
3
|
+
* Every widget instance gets a unique ID so its runtime config and session
|
|
4
|
+
* events are isolated from other simultaneously-mounted widget instances.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RuntimeContext: import('react').Context<string | null>;
|
|
7
|
+
export declare function useRuntimeId(): string | null;
|