@documedis/react-components 1.0.0-RC.5 → 1.0.0-RC.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/index.d.ts +601 -3
- package/index.mjs +34525 -27752
- package/package.json +1 -1
- package/components/PharmacySelector/PharmacySelector.d.ts +0 -9
- package/components/PharmacySelector/index.d.ts +0 -4
- package/components/PharmacySelector/usePharmacySelector.d.ts +0 -14
- package/components/PrescriptionSign/PrescriptionSign.d.ts +0 -2
- package/components/PrescriptionSign/index.d.ts +0 -4
- package/components/PrescriptionSign/types.d.ts +0 -75
- package/components/PrescriptionSign/useDocumentEvent.d.ts +0 -1
- package/components/PrescriptionSign/usePrescriptionSign.d.ts +0 -46
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Environment, Pharmacy } from '../..';
|
|
2
|
-
export interface PharmacySelectorProps {
|
|
3
|
-
accessToken: string;
|
|
4
|
-
environment: Environment;
|
|
5
|
-
enabledGalenicaChains?: string[];
|
|
6
|
-
className?: string;
|
|
7
|
-
onPharmacySelected: (pharmacy: Pharmacy | null) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const PharmacySelector: ({ accessToken, environment, enabledGalenicaChains, onPharmacySelected, className, }: PharmacySelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { PharmacySelector } from './PharmacySelector';
|
|
2
|
-
export type { PharmacySelectorProps } from './PharmacySelector';
|
|
3
|
-
export { usePharmacySelector } from './usePharmacySelector';
|
|
4
|
-
export type { UsePharmacySelectorConfig, UsePharmacySelectorReturn, } from './usePharmacySelector';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Environment, Pharmacy } from '../..';
|
|
2
|
-
export interface UsePharmacySelectorConfig {
|
|
3
|
-
accessToken: string;
|
|
4
|
-
environment: Environment;
|
|
5
|
-
enabledGalenicaChains?: string[];
|
|
6
|
-
}
|
|
7
|
-
export interface UsePharmacySelectorReturn {
|
|
8
|
-
onQueryChange: (input: string) => void;
|
|
9
|
-
queriedPharmacies: Pharmacy[];
|
|
10
|
-
selectPharmacy: (pharmacy: Pharmacy) => void;
|
|
11
|
-
selectedPharmacy: Pharmacy | null;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const usePharmacySelector: (config: UsePharmacySelectorConfig) => UsePharmacySelectorReturn;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { PrescriptionSign } from './PrescriptionSign';
|
|
2
|
-
export type { PrescriptionSignProps, UsePrescriptionSigningProps, } from './types';
|
|
3
|
-
export { usePrescriptionSign } from './usePrescriptionSign';
|
|
4
|
-
export type { UsePrescriptionSignReturn } from './usePrescriptionSign';
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { DomainError, Environment } from '@documedis/shared-components/core';
|
|
2
|
-
/**
|
|
3
|
-
* Props for the usePrescriptionSign hook
|
|
4
|
-
* Note: chmed is NOT included here because it's passed via the start() method
|
|
5
|
-
*/
|
|
6
|
-
export type UsePrescriptionSigningProps = {
|
|
7
|
-
/**
|
|
8
|
-
* Environment configuration for the prescription service
|
|
9
|
-
* - 'local': Development environment (localhost:52247)
|
|
10
|
-
* - 'int': Integration Azure Container Apps
|
|
11
|
-
* - 'demo': Demo Azure Container Apps
|
|
12
|
-
* - 'prod': Production Azure Container Apps
|
|
13
|
-
*/
|
|
14
|
-
environment: Environment;
|
|
15
|
-
/** Access token for authenticating with the backend service */
|
|
16
|
-
accessToken: string;
|
|
17
|
-
/**
|
|
18
|
-
* Optional existing session token to reuse authentication state.
|
|
19
|
-
* If provided, the hook will attempt to use existing authentication.
|
|
20
|
-
*/
|
|
21
|
-
sessionToken?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Optional callback invoked when the session token is updated.
|
|
24
|
-
* Use this to persist the session token for reuse across hook instances.
|
|
25
|
-
*/
|
|
26
|
-
onSessionTokenUpdate?: (token: string) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Optional callback invoked when prescription signing succeeds.
|
|
29
|
-
* Receives the signed CHMED data as a base64-encoded string.
|
|
30
|
-
* Optionally receives the generatedPdf if the option
|
|
31
|
-
* generatePdf is set to true.
|
|
32
|
-
*
|
|
33
|
-
* @see generatePdf
|
|
34
|
-
*/
|
|
35
|
-
onSuccess?: (signedCHMED: string, generatedPdf?: string) => void;
|
|
36
|
-
/**
|
|
37
|
-
* Optional callback invoked when prescription signing fails.
|
|
38
|
-
* Receives a specific error type indicating what went wrong.
|
|
39
|
-
*/
|
|
40
|
-
onError?: (error: DomainError) => void;
|
|
41
|
-
/**
|
|
42
|
-
* Optional flag to generate PDF after signing.
|
|
43
|
-
* Defaults to false if not specified.
|
|
44
|
-
*/
|
|
45
|
-
generatePdf?: boolean;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Props for the PrescriptionSign React component
|
|
49
|
-
* Uses camelCase (React convention) - internally converted to kebab-case for web component
|
|
50
|
-
*/
|
|
51
|
-
export interface PrescriptionSignProps {
|
|
52
|
-
accessToken: string;
|
|
53
|
-
environment: Environment;
|
|
54
|
-
chmed: string;
|
|
55
|
-
sessionToken?: string;
|
|
56
|
-
generatePdf?: boolean;
|
|
57
|
-
className?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Optional callback invoked when the session token is updated.
|
|
60
|
-
* Use this to persist the session token for reuse across components.
|
|
61
|
-
*/
|
|
62
|
-
onSessionTokenUpdate?: (sessionToken: string) => void;
|
|
63
|
-
/**
|
|
64
|
-
* Optional callback invoked when prescription signing succeeds.
|
|
65
|
-
* Receives the signed CHMED data as a base64-encoded string.
|
|
66
|
-
* Optionally receives the generatedPdf if the option
|
|
67
|
-
* generatePdf is set to true.
|
|
68
|
-
*/
|
|
69
|
-
onSuccess?: (signedCHMED: string, generatedPdf?: string) => void;
|
|
70
|
-
/**
|
|
71
|
-
* Optional callback invoked when prescription signing fails.
|
|
72
|
-
* Receives a specific error type indicating what went wrong.
|
|
73
|
-
*/
|
|
74
|
-
onError?: (error: DomainError) => void;
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useDocumentEvent<T>(eventType: string, handler: ((detail: T) => void) | undefined): void;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { UsePrescriptionSigningProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Return type for the usePrescriptionSign hook
|
|
4
|
-
*/
|
|
5
|
-
export interface UsePrescriptionSignReturn {
|
|
6
|
-
/** Function to initiate the signing process with CHMED data */
|
|
7
|
-
start: (encodedCHMED: string, generatePdf?: boolean) => void;
|
|
8
|
-
/** Function to terminate the signing process at any time */
|
|
9
|
-
interrupt: () => void;
|
|
10
|
-
/** Raw XState machine state (for advanced usage) */
|
|
11
|
-
state: any;
|
|
12
|
-
/** True when ready to start signing (initial state) */
|
|
13
|
-
isIdle: boolean;
|
|
14
|
-
/** True when actively processing (excludes error/success states) */
|
|
15
|
-
isActive: boolean;
|
|
16
|
-
/** True when in error state (persists until retry) */
|
|
17
|
-
isError: boolean;
|
|
18
|
-
/** True when signing completed successfully */
|
|
19
|
-
isSuccess: boolean;
|
|
20
|
-
/** True during the actual signature operation */
|
|
21
|
-
isSigning: boolean;
|
|
22
|
-
/** The signed prescription data (available after success) */
|
|
23
|
-
signedCHMED: string | undefined;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Hook to manage the ePrescription signature process
|
|
27
|
-
*
|
|
28
|
-
* This is a standalone hook that can be shipped in a library.
|
|
29
|
-
* It handles the complete HIN authentication and signing flow.
|
|
30
|
-
*
|
|
31
|
-
* Required peer dependencies:
|
|
32
|
-
* - next-auth/react (for session management)
|
|
33
|
-
* - xstate and @xstate/react
|
|
34
|
-
*
|
|
35
|
-
* @returns Object containing:
|
|
36
|
-
* - start: Function to initiate the signing process with CHMED data
|
|
37
|
-
* - interrupt: Function to terminate the signing process at any time
|
|
38
|
-
* - state: Raw XState machine state (for advanced usage)
|
|
39
|
-
* - isIdle: true when ready to start signing (initial state)
|
|
40
|
-
* - isActive: true when actively processing (excludes error/success states)
|
|
41
|
-
* - isError: true when in error state (persists until retry)
|
|
42
|
-
* - isSuccess: true when signing completed successfully
|
|
43
|
-
* - isSigning: true during the actual signature operation
|
|
44
|
-
* - signedCHMED: The signed prescription data (available after success)
|
|
45
|
-
*/
|
|
46
|
-
export declare function usePrescriptionSign(props: UsePrescriptionSigningProps): UsePrescriptionSignReturn;
|