@documedis/react-components 1.0.0-RC.4 → 1.0.0-RC.5

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.
@@ -1,20 +1,14 @@
1
- import { DomainError, Environment } from '../..';
2
- interface PrescriptionSignReactProps {
3
- accessToken: string;
4
- environment: Environment;
5
- chmed: string;
6
- sessionToken?: string;
7
- generatePdf?: boolean;
8
- }
1
+ import { DomainError, Environment } from '@documedis/shared-components/core';
9
2
  /**
10
3
  * Props for the usePrescriptionSign hook
4
+ * Note: chmed is NOT included here because it's passed via the start() method
11
5
  */
12
6
  export type UsePrescriptionSigningProps = {
13
7
  /**
14
8
  * Environment configuration for the prescription service
15
9
  * - 'local': Development environment (localhost:52247)
16
- * - 'dev': Development Azure Container Apps
17
10
  * - 'int': Integration Azure Container Apps
11
+ * - 'demo': Demo Azure Container Apps
18
12
  * - 'prod': Production Azure Container Apps
19
13
  */
20
14
  environment: Environment;
@@ -45,16 +39,21 @@ export type UsePrescriptionSigningProps = {
45
39
  */
46
40
  onError?: (error: DomainError) => void;
47
41
  /**
48
- * Flag to generate PDF after signing.
42
+ * Optional flag to generate PDF after signing.
43
+ * Defaults to false if not specified.
49
44
  */
50
- generatePdf: boolean;
45
+ generatePdf?: boolean;
51
46
  };
52
47
  /**
53
48
  * Props for the PrescriptionSign React component
54
49
  * Uses camelCase (React convention) - internally converted to kebab-case for web component
55
50
  */
56
- export interface PrescriptionSignProps extends PrescriptionSignReactProps {
57
- /** Optional additional CSS class names to apply to the component */
51
+ export interface PrescriptionSignProps {
52
+ accessToken: string;
53
+ environment: Environment;
54
+ chmed: string;
55
+ sessionToken?: string;
56
+ generatePdf?: boolean;
58
57
  className?: string;
59
58
  /**
60
59
  * Optional callback invoked when the session token is updated.
@@ -74,4 +73,3 @@ export interface PrescriptionSignProps extends PrescriptionSignReactProps {
74
73
  */
75
74
  onError?: (error: DomainError) => void;
76
75
  }
77
- export {};
@@ -4,7 +4,7 @@ import { UsePrescriptionSigningProps } from './types';
4
4
  */
5
5
  export interface UsePrescriptionSignReturn {
6
6
  /** Function to initiate the signing process with CHMED data */
7
- start: (encodedCHMED: string, generatePdf: boolean) => void;
7
+ start: (encodedCHMED: string, generatePdf?: boolean) => void;
8
8
  /** Function to terminate the signing process at any time */
9
9
  interrupt: () => void;
10
10
  /** Raw XState machine state (for advanced usage) */
package/index.d.ts CHANGED
@@ -1,23 +1,3 @@
1
1
  export * from './components/PharmacySelector';
2
2
  export * from './components/PrescriptionSign';
3
- export type Environment = 'local' | 'int' | 'demo' | 'prod';
4
- export interface Pharmacy {
5
- id: string;
6
- gln: string;
7
- name: string;
8
- hinEmail?: string;
9
- galenicaChain?: string;
10
- }
11
- export interface DomainError extends Error {
12
- readonly id: string;
13
- readonly timestamp: Date;
14
- readonly code: string;
15
- readonly userMessage: string;
16
- readonly cause?: unknown;
17
- toJSON(): {
18
- type: string;
19
- code: string;
20
- message: string;
21
- };
22
- toHttpStatus(): number;
23
- }
3
+ export type { Environment, DomainError, Pharmacy } from '@documedis/shared-components/core';
package/index.mjs CHANGED
@@ -11567,6 +11567,7 @@ const kL = () => ({
11567
11567
  INVALID_CONFIG: "INVALID_CONFIG",
11568
11568
  POPUP_BLOCKED: "POPUP_BLOCKED",
11569
11569
  BROWSER_INCOMPATIBLE: "BROWSER_INCOMPATIBLE",
11570
+ COMPONENT_INITIALIZATION_ERROR: "COMPONENT_INITIALIZATION_ERROR",
11570
11571
  KEYVAULT_ERROR: "KEYVAULT_ERROR",
11571
11572
  DATABASE_ERROR: "DATABASE_ERROR",
11572
11573
  CACHE_ERROR: "CACHE_ERROR",
@@ -46243,7 +46244,7 @@ function Dj(o) {
46243
46244
  onSessionTokenUpdate: f,
46244
46245
  onSuccess: h,
46245
46246
  onError: y,
46246
- generatePdf: w
46247
+ generatePdf: w = !1
46247
46248
  } = o, [b, k, x] = Tj(kR, {
46248
46249
  input: {
46249
46250
  sessionToken: l,
@@ -46252,7 +46253,7 @@ function Dj(o) {
46252
46253
  generatePdf: w
46253
46254
  }
46254
46255
  }), _ = Ld(
46255
- (T, N) => {
46256
+ (T, N = !1) => {
46256
46257
  k({ type: "START", encodedCHMED: T, generatePdf: N });
46257
46258
  },
46258
46259
  [k]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@documedis/react-components",
3
- "version": "1.0.0-RC.4",
3
+ "version": "1.0.0-RC.5",
4
4
  "description": "React components for Documedis healthcare applications - prescription signing, pharmacy selection, and more",
5
5
  "keywords": [
6
6
  "react",