@apextelemed/partner-core 0.1.0

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.
Files changed (114) hide show
  1. package/LICENSE +64 -0
  2. package/README.md +363 -0
  3. package/dist/api/index.d.ts +12 -0
  4. package/dist/api/index.js +8 -0
  5. package/dist/api/index.js.map +1 -0
  6. package/dist/api/index.jsx +127 -0
  7. package/dist/cart-CBH8Em8f.d.ts +189 -0
  8. package/dist/cart-D4mVX_zx.d.ts +66 -0
  9. package/dist/chunk/2OXI5TKO.jsx +249 -0
  10. package/dist/chunk/3A3MF7R2.jsx +1 -0
  11. package/dist/chunk/3VEOP7TZ.jsx +16679 -0
  12. package/dist/chunk/5XGPFYIJ.js +26 -0
  13. package/dist/chunk/5XGPFYIJ.js.map +1 -0
  14. package/dist/chunk/67KHO66G.js +26 -0
  15. package/dist/chunk/67KHO66G.js.map +1 -0
  16. package/dist/chunk/6TFBQECC.jsx +135 -0
  17. package/dist/chunk/AN3WPMEP.js +3 -0
  18. package/dist/chunk/AN3WPMEP.js.map +1 -0
  19. package/dist/chunk/DHII7L5Y.js +686 -0
  20. package/dist/chunk/DHII7L5Y.js.map +1 -0
  21. package/dist/chunk/DS4E7FAI.js +132 -0
  22. package/dist/chunk/DS4E7FAI.js.map +1 -0
  23. package/dist/chunk/DY5BJ6UG.js +1195 -0
  24. package/dist/chunk/DY5BJ6UG.js.map +1 -0
  25. package/dist/chunk/E7722UPF.js +378 -0
  26. package/dist/chunk/E7722UPF.js.map +1 -0
  27. package/dist/chunk/HLXKWRRW.js +16774 -0
  28. package/dist/chunk/HLXKWRRW.js.map +1 -0
  29. package/dist/chunk/I46Y2J5W.jsx +144 -0
  30. package/dist/chunk/J63XPQP4.jsx +21 -0
  31. package/dist/chunk/J6KNY37T.js +122 -0
  32. package/dist/chunk/J6KNY37T.js.map +1 -0
  33. package/dist/chunk/KNTZTYXE.jsx +3315 -0
  34. package/dist/chunk/KZZSQ7LP.jsx +409 -0
  35. package/dist/chunk/L46OKCKG.jsx +733 -0
  36. package/dist/chunk/LDZIUFDM.jsx +31 -0
  37. package/dist/chunk/LZWA44KD.js +3 -0
  38. package/dist/chunk/LZWA44KD.js.map +1 -0
  39. package/dist/chunk/NVRAOAVV.js +3 -0
  40. package/dist/chunk/NVRAOAVV.js.map +1 -0
  41. package/dist/chunk/O3QK7YZR.jsx +1 -0
  42. package/dist/chunk/UZCST66N.jsx +21 -0
  43. package/dist/chunk/V42CGY2S.jsx +1229 -0
  44. package/dist/chunk/YJEHCCLY.js +467 -0
  45. package/dist/chunk/YJEHCCLY.js.map +1 -0
  46. package/dist/chunk/ZMOG2IIC.js +3194 -0
  47. package/dist/chunk/ZMOG2IIC.js.map +1 -0
  48. package/dist/client-BzSg2DEK.d.ts +1539 -0
  49. package/dist/config/index.d.ts +55 -0
  50. package/dist/config/index.js +3 -0
  51. package/dist/config/index.js.map +1 -0
  52. package/dist/config/index.jsx +11 -0
  53. package/dist/flows/index.d.ts +1322 -0
  54. package/dist/flows/index.js +9 -0
  55. package/dist/flows/index.js.map +1 -0
  56. package/dist/flows/index.jsx +124 -0
  57. package/dist/index/index.d.ts +71 -0
  58. package/dist/index/index.js +15 -0
  59. package/dist/index/index.js.map +1 -0
  60. package/dist/index/index.jsx +311 -0
  61. package/dist/pages/index.d.ts +617 -0
  62. package/dist/pages/index.js +10 -0
  63. package/dist/pages/index.js.map +1 -0
  64. package/dist/pages/index.jsx +50 -0
  65. package/dist/primitives/default/index.d.ts +6 -0
  66. package/dist/primitives/default/index.js +3 -0
  67. package/dist/primitives/default/index.js.map +1 -0
  68. package/dist/primitives/default/index.jsx +7 -0
  69. package/dist/primitives/index.d.ts +122 -0
  70. package/dist/primitives/index.js +3 -0
  71. package/dist/primitives/index.js.map +1 -0
  72. package/dist/primitives/index.jsx +9 -0
  73. package/dist/stores/index.d.ts +48 -0
  74. package/dist/stores/index.js +6 -0
  75. package/dist/stores/index.js.map +1 -0
  76. package/dist/stores/index.jsx +16 -0
  77. package/dist/surveyV2-BgQHK0GE.d.ts +48 -0
  78. package/dist/testing/adapter.d.ts +104 -0
  79. package/dist/testing/adapter.d.ts.map +1 -0
  80. package/dist/testing/adapter.js +14 -0
  81. package/dist/testing/adapter.js.map +1 -0
  82. package/dist/testing/env.d.ts +29 -0
  83. package/dist/testing/env.d.ts.map +1 -0
  84. package/dist/testing/env.js +42 -0
  85. package/dist/testing/env.js.map +1 -0
  86. package/dist/testing/fixtures.d.ts +70 -0
  87. package/dist/testing/fixtures.d.ts.map +1 -0
  88. package/dist/testing/fixtures.js +74 -0
  89. package/dist/testing/fixtures.js.map +1 -0
  90. package/dist/testing/index.d.ts +15 -0
  91. package/dist/testing/index.d.ts.map +1 -0
  92. package/dist/testing/index.js +14 -0
  93. package/dist/testing/index.js.map +1 -0
  94. package/dist/testing/mocks.d.ts +53 -0
  95. package/dist/testing/mocks.d.ts.map +1 -0
  96. package/dist/testing/mocks.js +90 -0
  97. package/dist/testing/mocks.js.map +1 -0
  98. package/dist/testing/seam-suite.d.ts +39 -0
  99. package/dist/testing/seam-suite.d.ts.map +1 -0
  100. package/dist/testing/seam-suite.js +196 -0
  101. package/dist/testing/seam-suite.js.map +1 -0
  102. package/dist/testing/storage.d.ts +40 -0
  103. package/dist/testing/storage.d.ts.map +1 -0
  104. package/dist/testing/storage.js +71 -0
  105. package/dist/testing/storage.js.map +1 -0
  106. package/dist/theme/admin.css +579 -0
  107. package/dist/theme/affiliate.css +191 -0
  108. package/dist/theme/flow.css +497 -0
  109. package/dist/theme/index.d.ts +84 -0
  110. package/dist/theme/index.js +94 -0
  111. package/dist/theme/index.js.map +1 -0
  112. package/dist/theme/index.jsx +97 -0
  113. package/dist/theme/member-portal.css +1762 -0
  114. package/package.json +199 -0
@@ -0,0 +1,6 @@
1
+ import { Primitives } from '../index.js';
2
+ import 'solid-js';
3
+
4
+ declare const defaultPrimitives: Primitives;
5
+
6
+ export { defaultPrimitives };
@@ -0,0 +1,3 @@
1
+ export { defaultPrimitives } from '../../chunk/YJEHCCLY.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,7 @@
1
+ import {
2
+ defaultPrimitives
3
+ } from "../../chunk/2OXI5TKO.jsx";
4
+ export {
5
+ defaultPrimitives
6
+ };
7
+ //# sourceMappingURL=index.jsx.map
@@ -0,0 +1,122 @@
1
+ import { JSX, Component } from 'solid-js';
2
+
3
+ type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
4
+ type ButtonSize = 'sm' | 'md' | 'lg';
5
+ interface ButtonProps {
6
+ variant?: ButtonVariant;
7
+ size?: ButtonSize;
8
+ type?: 'button' | 'submit';
9
+ disabled?: boolean;
10
+ loading?: boolean;
11
+ fullWidth?: boolean;
12
+ onClick?: (e: MouseEvent) => void;
13
+ children: JSX.Element;
14
+ }
15
+ interface TextFieldProps {
16
+ value: string;
17
+ onInput: (v: string) => void;
18
+ type?: 'text' | 'email' | 'password' | 'tel' | 'date' | 'number';
19
+ label?: string;
20
+ placeholder?: string;
21
+ error?: string;
22
+ required?: boolean;
23
+ disabled?: boolean;
24
+ autocomplete?: string;
25
+ inputmode?: 'text' | 'numeric' | 'tel' | 'email' | 'decimal';
26
+ }
27
+ interface TextareaProps {
28
+ value: string;
29
+ onInput: (v: string) => void;
30
+ label?: string;
31
+ placeholder?: string;
32
+ rows?: number;
33
+ error?: string;
34
+ required?: boolean;
35
+ }
36
+ interface SelectOption {
37
+ value: string;
38
+ label: string;
39
+ }
40
+ interface SelectProps {
41
+ value: string;
42
+ onChange: (v: string) => void;
43
+ options: SelectOption[];
44
+ label?: string;
45
+ placeholder?: string;
46
+ error?: string;
47
+ required?: boolean;
48
+ /** Parity with TextFieldProps — lets a Select sit in a read-only group
49
+ * (e.g. billing fields mirrored from shipping) instead of being unmounted. */
50
+ disabled?: boolean;
51
+ }
52
+ interface ChoiceOption {
53
+ value: string;
54
+ label: string;
55
+ description?: string;
56
+ }
57
+ interface RadioGroupProps {
58
+ value: string;
59
+ onChange: (v: string) => void;
60
+ options: ChoiceOption[];
61
+ label?: string;
62
+ error?: string;
63
+ }
64
+ interface CheckboxGroupProps {
65
+ values: string[];
66
+ onChange: (vs: string[]) => void;
67
+ options: ChoiceOption[];
68
+ label?: string;
69
+ error?: string;
70
+ }
71
+ interface CardProps {
72
+ children: JSX.Element;
73
+ /** Visual emphasis. `primary` is the page-level container; `inset` is for nested content. */
74
+ variant?: 'primary' | 'inset';
75
+ padding?: 'sm' | 'md' | 'lg' | 'none';
76
+ class?: string;
77
+ }
78
+ type BannerVariant = 'error' | 'success' | 'warning' | 'info';
79
+ interface BannerProps {
80
+ variant: BannerVariant;
81
+ children: JSX.Element;
82
+ }
83
+ type Status = 'active' | 'pending' | 'processing' | 'completed' | 'approved' | 'denied' | 'paused' | 'cancelled' | 'new';
84
+ interface StatusPillProps {
85
+ status: Status;
86
+ /** Override the default label derived from `status`. */
87
+ label?: string;
88
+ }
89
+ interface SpinnerProps {
90
+ size?: 'sm' | 'md' | 'lg';
91
+ }
92
+ interface HeadingProps {
93
+ level: 1 | 2 | 3;
94
+ children: JSX.Element;
95
+ class?: string;
96
+ }
97
+ interface StepIndicatorProps {
98
+ current: number;
99
+ total: number;
100
+ labels?: string[];
101
+ }
102
+ interface Primitives {
103
+ Card: Component<CardProps>;
104
+ TextField: Component<TextFieldProps>;
105
+ Textarea: Component<TextareaProps>;
106
+ Select: Component<SelectProps>;
107
+ RadioGroup: Component<RadioGroupProps>;
108
+ CheckboxGroup: Component<CheckboxGroupProps>;
109
+ Button: Component<ButtonProps>;
110
+ Banner: Component<BannerProps>;
111
+ StatusPill: Component<StatusPillProps>;
112
+ Spinner: Component<SpinnerProps>;
113
+ Heading: Component<HeadingProps>;
114
+ StepIndicator: Component<StepIndicatorProps>;
115
+ }
116
+ declare function PrimitivesProvider(props: {
117
+ value: Primitives;
118
+ children: JSX.Element;
119
+ }): JSX.Element;
120
+ declare function usePrimitives(): Primitives;
121
+
122
+ export { type BannerProps, type BannerVariant, type ButtonProps, type ButtonSize, type ButtonVariant, type CardProps, type CheckboxGroupProps, type ChoiceOption, type HeadingProps, type Primitives, PrimitivesProvider, type RadioGroupProps, type SelectOption, type SelectProps, type SpinnerProps, type Status, type StatusPillProps, type StepIndicatorProps, type TextFieldProps, type TextareaProps, usePrimitives };
@@ -0,0 +1,3 @@
1
+ export { PrimitivesProvider, usePrimitives } from '../chunk/67KHO66G.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,9 @@
1
+ import {
2
+ PrimitivesProvider,
3
+ usePrimitives
4
+ } from "../chunk/J63XPQP4.jsx";
5
+ export {
6
+ PrimitivesProvider,
7
+ usePrimitives
8
+ };
9
+ //# sourceMappingURL=index.jsx.map
@@ -0,0 +1,48 @@
1
+ import * as solid_js from 'solid-js';
2
+ import { M as AuthTokens, aF as User, al as RegisterPayload, ak as RegisterAndSubscribePayload, s as AffiliateAuthTokens, r as Affiliate, D as AffiliateRegisterInput } from '../client-BzSg2DEK.js';
3
+ export { A as AppliedPromoCode, C as CartItem, c as cartStore } from '../cart-D4mVX_zx.js';
4
+
5
+ declare const authStore: {
6
+ tokens: solid_js.Accessor<AuthTokens | null>;
7
+ user: solid_js.Accessor<User | null>;
8
+ isAuthenticated: solid_js.Accessor<boolean>;
9
+ isAdmin: solid_js.Accessor<boolean>;
10
+ loading: solid_js.Accessor<boolean>;
11
+ login: (email: string, password: string) => Promise<void>;
12
+ signup: (payload: RegisterPayload) => Promise<void>;
13
+ signupAndSubscribe: (payload: RegisterAndSubscribePayload, opts?: {
14
+ idempotencyKey?: string;
15
+ }) => Promise<{
16
+ user: User;
17
+ accessToken: string;
18
+ refreshToken: string;
19
+ userId: string;
20
+ subscriptionId?: string;
21
+ } | undefined>;
22
+ logout: () => void;
23
+ fetchProfile: () => Promise<void>;
24
+ };
25
+
26
+ declare const affiliateAuthStore: {
27
+ tokens: solid_js.Accessor<AffiliateAuthTokens | null>;
28
+ affiliate: solid_js.Accessor<Affiliate | null>;
29
+ isAuthenticated: solid_js.Accessor<boolean>;
30
+ isHydrated: solid_js.Accessor<boolean>;
31
+ loading: solid_js.Accessor<boolean>;
32
+ login: (email: string, password: string) => Promise<void>;
33
+ register: (input: AffiliateRegisterInput) => Promise<void>;
34
+ logout: () => Promise<void>;
35
+ fetchProfile: () => Promise<void>;
36
+ };
37
+
38
+ interface MedicationSelection {
39
+ drugId: string | null;
40
+ drugName: string;
41
+ }
42
+ declare const medicationStore: {
43
+ selected: solid_js.Accessor<MedicationSelection | null>;
44
+ select: (medication: MedicationSelection) => void;
45
+ clear: () => void;
46
+ };
47
+
48
+ export { type MedicationSelection, affiliateAuthStore, authStore, medicationStore };
@@ -0,0 +1,6 @@
1
+ import '../chunk/NVRAOAVV.js';
2
+ export { affiliateAuth_default as affiliateAuthStore, auth_default as authStore, cart_default as cartStore, medication_default as medicationStore } from '../chunk/E7722UPF.js';
3
+ import '../chunk/DY5BJ6UG.js';
4
+ import '../chunk/5XGPFYIJ.js';
5
+ //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,16 @@
1
+ import "../chunk/3A3MF7R2.jsx";
2
+ import {
3
+ affiliateAuth_default,
4
+ auth_default,
5
+ cart_default,
6
+ medication_default
7
+ } from "../chunk/KZZSQ7LP.jsx";
8
+ import "../chunk/V42CGY2S.jsx";
9
+ import "../chunk/LDZIUFDM.jsx";
10
+ export {
11
+ affiliateAuth_default as affiliateAuthStore,
12
+ auth_default as authStore,
13
+ cart_default as cartStore,
14
+ medication_default as medicationStore
15
+ };
16
+ //# sourceMappingURL=index.jsx.map
@@ -0,0 +1,48 @@
1
+ import { EmbedEvent, SurveyV2Flow } from '@apextelemed/survey-solid';
2
+ import { PatientInfo } from '@apextelemed/survey-core';
3
+
4
+ /**
5
+ * Options the partner-core hook accepts. Mirrors the package's option shape
6
+ * minus the connection params (apiBaseUrl / publishableKey / tenantKey), which
7
+ * partner-core injects from `getConfig()`.
8
+ */
9
+ interface UseSurveyV2FlowOptions {
10
+ drugIds?: string[];
11
+ templateId?: string;
12
+ mode?: 'initial' | 'refill';
13
+ token?: string;
14
+ /**
15
+ * Opt-in: auto-submit at the end of the questionnaire (skipping the
16
+ * patient-info step) when a returning/known member's identity is already
17
+ * complete. Default OFF. Pair with `knownPatientInfo`. See the engine docs.
18
+ */
19
+ skipPatientInfoWhenComplete?: boolean;
20
+ /**
21
+ * Known identity for a returning member on the `drugIds` path. Seeds the
22
+ * engine so the skip guard can pass and the patient-info step is prefilled.
23
+ * Resolve it BEFORE this hook runs — the engine is built once, from the
24
+ * options passed at that time.
25
+ */
26
+ knownPatientInfo?: Partial<PatientInfo>;
27
+ /**
28
+ * Widen the fields required for the skip to fire (default: the engine's
29
+ * firstName/lastName/email/dob/state). Add any your downstream needs (e.g. a
30
+ * shipping address) so the skip never drops them.
31
+ */
32
+ requiredPatientInfoFields?: Array<keyof PatientInfo>;
33
+ /** Override the storage TTL (default 24h). */
34
+ draftTtlMs?: number;
35
+ /** Lifecycle events from the engine. */
36
+ onEvent?: (e: EmbedEvent) => void;
37
+ /** Load/submit failures from the engine (mirrors the package hook's option). */
38
+ onError?: (error: Error) => void;
39
+ }
40
+ /**
41
+ * partner-core wrapper over `@apextelemed/survey-solid`'s `useSurveyV2Flow`.
42
+ * Reads the Apex embed connection details from portal config and forwards the
43
+ * survey scope unchanged. Throws early if the host never called `configure()`
44
+ * with `apexEmbedApiBase`.
45
+ */
46
+ declare function useSurveyV2Flow(opts: UseSurveyV2FlowOptions): SurveyV2Flow;
47
+
48
+ export { type UseSurveyV2FlowOptions as U, useSurveyV2Flow as u };
@@ -0,0 +1,104 @@
1
+ /**
2
+ * What a consumer site has to tell the seam suite about itself.
3
+ *
4
+ * Kept deliberately small. Everything the package can know about the package —
5
+ * endpoint list, storage key names, the boot-order failure mode — is supplied
6
+ * by the suite; the site supplies only what is genuinely its own: where its
7
+ * routes live, what its chrome is called, which keys it writes itself.
8
+ *
9
+ * If this interface starts growing site-specific selectors, that is the signal
10
+ * that a check has drifted from "does the seam hold" into "does this site look
11
+ * right", and it belongs in the site's own suite instead.
12
+ */
13
+ /** Routes the suite will visit. Only `home`, `login` and `signup` are required. */
14
+ export interface SeamRoutes {
15
+ home: string;
16
+ login: string;
17
+ signup: string;
18
+ /** Product listing, if the site has one. */
19
+ catalog?: string;
20
+ /** Where an authenticated member lands. */
21
+ dashboard?: string;
22
+ /** Cart/checkout entry. */
23
+ checkout?: string;
24
+ /** Intake/survey entry. */
25
+ survey?: string;
26
+ }
27
+ /**
28
+ * Site chrome around the package's pages, for the singleton check.
29
+ *
30
+ * Omit to skip that check: it is the one part of the suite that has to address
31
+ * markup the package doesn't own, so a site with unusual chrome is better off
32
+ * writing it by hand than contorting to fit these three selectors.
33
+ */
34
+ export interface SeamNav {
35
+ /** Locator for the site's primary nav. Default: `nav`. */
36
+ selector?: string;
37
+ /** Visible text shown only when logged OUT, e.g. 'Log In'. */
38
+ loggedOutText: string;
39
+ /** Visible text shown only when logged IN, e.g. 'Dashboard'. */
40
+ loggedInText: string;
41
+ /** Visible text that ends the session, e.g. 'Log Out'. */
42
+ logOutText: string;
43
+ }
44
+ /** Credentials for a real UI login. Required only when `nav` is supplied. */
45
+ export interface SeamUser {
46
+ email: string;
47
+ password: string;
48
+ }
49
+ /**
50
+ * Selectors for the site's login form.
51
+ *
52
+ * Defaults cover any form built from the package's `defaultPrimitives` and most
53
+ * hand-rolled ones. Override only where a site's markup differs — a site whose
54
+ * `<label>` carries no `for` is the common case, since a label-based lookup
55
+ * silently matches nothing there.
56
+ */
57
+ export interface SeamLoginForm {
58
+ /** Default: `input[type="email"]`. */
59
+ email?: string;
60
+ /** Default: `input[type="password"]`. */
61
+ password?: string;
62
+ /** Default: `button[type="submit"]`. */
63
+ submit?: string;
64
+ }
65
+ export type SeamCheck = 'routes' | 'boot' | 'storage' | 'singleton';
66
+ export interface SiteSeamAdapter {
67
+ /** Appears in test titles, so a failure names the site. */
68
+ siteName: string;
69
+ /** The `storagePrefix` this site passes to `configure()`. */
70
+ storagePrefix: string;
71
+ /** The `apiBase` this site passes to `configure()`. Default `/api`. */
72
+ apiBase?: string;
73
+ routes: SeamRoutes;
74
+ /** Supply to enable the singleton check. */
75
+ nav?: SeamNav;
76
+ /** Required when `nav` is set — the suite performs a real UI login. */
77
+ patient?: SeamUser;
78
+ /** Overrides for the login form's fields, when the defaults don't match. */
79
+ login?: SeamLoginForm;
80
+ /**
81
+ * Selector proving the app rendered an authenticated view. Used by the boot
82
+ * check to confirm the session was not merely left in storage but actually
83
+ * read. Optional; without it the boot check asserts storage survival only.
84
+ */
85
+ authedMarker?: string;
86
+ /**
87
+ * localStorage keys this site writes itself, exempt from the namespace audit.
88
+ * Strings match exactly, regexes are tested against the whole key.
89
+ */
90
+ allowStorageKeys?: readonly (string | RegExp)[];
91
+ /**
92
+ * Fail a spec if the app calls a backend endpoint the suite hasn't mocked.
93
+ * Off by default — turn it on once the site's suite is green, then a new
94
+ * core endpoint surfaces as a named failure instead of a flake.
95
+ */
96
+ strictNetwork?: boolean;
97
+ /**
98
+ * Checks to skip, each with a reason. A skipped check is reported as skipped
99
+ * rather than silently dropped, so `git grep skip:` shows what every site
100
+ * has opted out of and why.
101
+ */
102
+ skip?: Partial<Record<SeamCheck, string>>;
103
+ }
104
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/testing/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;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AAa,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAChD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;CAC3C"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * What a consumer site has to tell the seam suite about itself.
3
+ *
4
+ * Kept deliberately small. Everything the package can know about the package —
5
+ * endpoint list, storage key names, the boot-order failure mode — is supplied
6
+ * by the suite; the site supplies only what is genuinely its own: where its
7
+ * routes live, what its chrome is called, which keys it writes itself.
8
+ *
9
+ * If this interface starts growing site-specific selectors, that is the signal
10
+ * that a check has drifted from "does the seam hold" into "does this site look
11
+ * right", and it belongs in the site's own suite instead.
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/testing/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Guard for the one environment flag the seam suite cannot set for itself.
3
+ *
4
+ * Consumer sites depend on this package through `file:../the-frontend`, which
5
+ * npm installs as a symlink. Node resolves a symlinked module to its real path,
6
+ * which puts this file OUTSIDE the site's project root — and Playwright, which
7
+ * keys tests by the path of the file that declared them, then cannot match the
8
+ * tests it collected in the parent to the ones a worker re-collects. The run
9
+ * fails with "Test not found in the worker process", which says nothing at all
10
+ * about symlinks.
11
+ *
12
+ * `--preserve-symlinks` keeps the module at its symlinked path
13
+ * (`node_modules/@apextelemed/partner-core/...`), inside the project,
14
+ * and everything matches up.
15
+ *
16
+ * It has to be set before Node starts, so neither this package nor a Playwright
17
+ * config can apply it late — setting `process.env.NODE_OPTIONS` from inside the
18
+ * config is too late, the parent has already resolved. All we can do is refuse
19
+ * to run with a message that names the actual problem.
20
+ */
21
+ /** The flag the runner must be started with. */
22
+ export declare const SEAM_NODE_OPTION = "--preserve-symlinks";
23
+ /**
24
+ * Throws unless the current process was started with `--preserve-symlinks`.
25
+ * Call it at the top of the site's Playwright config, so the failure arrives
26
+ * before a confusing worker error does.
27
+ */
28
+ export declare function assertSeamEnv(): void;
29
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/testing/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gDAAgD;AAChD,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAepC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Guard for the one environment flag the seam suite cannot set for itself.
3
+ *
4
+ * Consumer sites depend on this package through `file:../the-frontend`, which
5
+ * npm installs as a symlink. Node resolves a symlinked module to its real path,
6
+ * which puts this file OUTSIDE the site's project root — and Playwright, which
7
+ * keys tests by the path of the file that declared them, then cannot match the
8
+ * tests it collected in the parent to the ones a worker re-collects. The run
9
+ * fails with "Test not found in the worker process", which says nothing at all
10
+ * about symlinks.
11
+ *
12
+ * `--preserve-symlinks` keeps the module at its symlinked path
13
+ * (`node_modules/@apextelemed/partner-core/...`), inside the project,
14
+ * and everything matches up.
15
+ *
16
+ * It has to be set before Node starts, so neither this package nor a Playwright
17
+ * config can apply it late — setting `process.env.NODE_OPTIONS` from inside the
18
+ * config is too late, the parent has already resolved. All we can do is refuse
19
+ * to run with a message that names the actual problem.
20
+ */
21
+ /** The flag the runner must be started with. */
22
+ export const SEAM_NODE_OPTION = '--preserve-symlinks';
23
+ /**
24
+ * Throws unless the current process was started with `--preserve-symlinks`.
25
+ * Call it at the top of the site's Playwright config, so the failure arrives
26
+ * before a confusing worker error does.
27
+ */
28
+ export function assertSeamEnv() {
29
+ const env = globalThis.process
30
+ ?.env;
31
+ const opts = env?.NODE_OPTIONS ?? '';
32
+ if (opts.includes(SEAM_NODE_OPTION))
33
+ return;
34
+ throw new Error(`The core seam suite needs NODE_OPTIONS=${SEAM_NODE_OPTION}.\n\n` +
35
+ 'The package is installed as a symlink (file:../the-frontend). Without ' +
36
+ 'this flag Node resolves it outside the project root, and Playwright ' +
37
+ 'cannot match the tests it collected to the ones its workers load — the ' +
38
+ 'run fails with "Test not found in the worker process".\n\n' +
39
+ 'Run the suite through its npm script, which sets the flag:\n' +
40
+ ' npm run test:seam\n');
41
+ }
42
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/testing/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,gDAAgD;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAI,UAAyE,CAAC,OAAO;QAC5F,EAAE,GAAG,CAAC;IACR,MAAM,IAAI,GAAG,GAAG,EAAE,YAAY,IAAI,EAAE,CAAC;IACrC,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAAE,OAAO;IAE5C,MAAM,IAAI,KAAK,CACb,0CAA0C,gBAAgB,OAAO;QAC/D,wEAAwE;QACxE,sEAAsE;QACtE,yEAAyE;QACzE,4DAA4D;QAC5D,8DAA8D;QAC9D,uBAAuB,CAC1B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Canned API payloads for the seam suite.
3
+ *
4
+ * Deliberately self-contained — no `import type` from `../api/client`. The
5
+ * emitted declarations for this directory ship as `dist/testing/*.d.ts`, and a
6
+ * relative type import would resolve against `dist/api/client`, which is never
7
+ * built. Consumers would get broken types.
8
+ *
9
+ * The link to the real shapes is not lost, just moved: fixtures.contract.test.ts
10
+ * asserts each fixture still `satisfies` its counterpart in `src/api/client.ts`,
11
+ * so a response shape that changes upstream fails core's own typecheck instead
12
+ * of silently handing every site a fixture the backend would never send.
13
+ */
14
+ /** Matches `User` in src/api/client.ts. */
15
+ export interface MockUser {
16
+ id: string;
17
+ email: string;
18
+ firstName: string;
19
+ lastName: string;
20
+ role: string;
21
+ [key: string]: unknown;
22
+ }
23
+ /** A logged-in member. Deliberately boring — specs assert on wiring, not data. */
24
+ export declare const MOCK_USER: MockUser;
25
+ export declare const MOCK_ADMIN: MockUser;
26
+ /** Tokens in the exact shape `authStorageKey()` holds. */
27
+ export interface MockTokens {
28
+ accessToken: string;
29
+ refreshToken: string;
30
+ userId: string;
31
+ }
32
+ export declare const MOCK_TOKENS: MockTokens;
33
+ /** The subset of `CatalogProduct` the seam suite needs to populate a catalog. */
34
+ export interface MockProduct {
35
+ id: string;
36
+ name: string;
37
+ description: string | null;
38
+ price: number | null;
39
+ categories: string[];
40
+ is_subscription: boolean;
41
+ benefits: string[];
42
+ metadata: Record<string, unknown> | null;
43
+ dosage_prices: Array<{
44
+ dosage: string;
45
+ price: number;
46
+ savingsPrice: number | null;
47
+ }>;
48
+ thumbnail_url: string | null;
49
+ apex_drug_id?: string | null;
50
+ }
51
+ /**
52
+ * One subscription product and one one-time product.
53
+ *
54
+ * Two, not one, because a catalog seam bug usually shows up as "the
55
+ * subscription branch renders the one-time layout" — indistinguishable with a
56
+ * single-product fixture.
57
+ */
58
+ export declare const MOCK_PRODUCTS: MockProduct[];
59
+ /** A cart item matching MOCK_PRODUCTS[1], for seeding storage directly. */
60
+ export declare const MOCK_CART_ITEM: {
61
+ productId: string;
62
+ productName: string;
63
+ dosage: string;
64
+ quantity: number;
65
+ priceCents: number;
66
+ drugId: null;
67
+ categories: string[];
68
+ isSubscription: boolean;
69
+ };
70
+ //# sourceMappingURL=fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.d.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,MAAM,aAAa,EAAE,WAAW,EA2BtC,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,cAAc;;;;;;;;;CAS1B,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Canned API payloads for the seam suite.
3
+ *
4
+ * Deliberately self-contained — no `import type` from `../api/client`. The
5
+ * emitted declarations for this directory ship as `dist/testing/*.d.ts`, and a
6
+ * relative type import would resolve against `dist/api/client`, which is never
7
+ * built. Consumers would get broken types.
8
+ *
9
+ * The link to the real shapes is not lost, just moved: fixtures.contract.test.ts
10
+ * asserts each fixture still `satisfies` its counterpart in `src/api/client.ts`,
11
+ * so a response shape that changes upstream fails core's own typecheck instead
12
+ * of silently handing every site a fixture the backend would never send.
13
+ */
14
+ /** A logged-in member. Deliberately boring — specs assert on wiring, not data. */
15
+ export const MOCK_USER = {
16
+ id: 'seam-user-1',
17
+ email: 'seam@integration-test.com',
18
+ firstName: 'Seam',
19
+ lastName: 'Tester',
20
+ role: 'user',
21
+ };
22
+ export const MOCK_ADMIN = { ...MOCK_USER, id: 'seam-admin-1', role: 'admin' };
23
+ export const MOCK_TOKENS = {
24
+ accessToken: 'seam-access-token',
25
+ refreshToken: 'seam-refresh-token',
26
+ userId: MOCK_USER.id,
27
+ };
28
+ /**
29
+ * One subscription product and one one-time product.
30
+ *
31
+ * Two, not one, because a catalog seam bug usually shows up as "the
32
+ * subscription branch renders the one-time layout" — indistinguishable with a
33
+ * single-product fixture.
34
+ */
35
+ export const MOCK_PRODUCTS = [
36
+ {
37
+ id: 'seam-sub-product',
38
+ name: 'Seam Subscription Product',
39
+ description: 'Fixture product, subscription.',
40
+ price: 149,
41
+ categories: ['seam'],
42
+ is_subscription: true,
43
+ benefits: [],
44
+ metadata: null,
45
+ dosage_prices: [{ dosage: '5mg', price: 149, savingsPrice: null }],
46
+ thumbnail_url: null,
47
+ apex_drug_id: null,
48
+ },
49
+ {
50
+ id: 'seam-onetime-product',
51
+ name: 'Seam One-Time Product',
52
+ description: 'Fixture product, one-time.',
53
+ price: 89,
54
+ categories: ['seam'],
55
+ is_subscription: false,
56
+ benefits: [],
57
+ metadata: null,
58
+ dosage_prices: [{ dosage: '5mg', price: 89, savingsPrice: null }],
59
+ thumbnail_url: null,
60
+ apex_drug_id: null,
61
+ },
62
+ ];
63
+ /** A cart item matching MOCK_PRODUCTS[1], for seeding storage directly. */
64
+ export const MOCK_CART_ITEM = {
65
+ productId: 'seam-onetime-product',
66
+ productName: 'Seam One-Time Product',
67
+ dosage: '5mg',
68
+ quantity: 1,
69
+ priceCents: 8900,
70
+ drugId: null,
71
+ categories: ['seam'],
72
+ isSubscription: false,
73
+ };
74
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/testing/fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAa;IACjC,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,2BAA2B;IAClC,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAa,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AASxF,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC,WAAW,EAAE,mBAAmB;IAChC,YAAY,EAAE,oBAAoB;IAClC,MAAM,EAAE,SAAS,CAAC,EAAE;CACrB,CAAC;AAiBF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C;QACE,EAAE,EAAE,kBAAkB;QACtB,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,gCAAgC;QAC7C,KAAK,EAAE,GAAG;QACV,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,eAAe,EAAE,IAAI;QACrB,QAAQ,EAAE,E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