@photonhealth/client 2.0.0-rc.2 → 2.0.0-rc.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/README.md +4 -2
- package/dist/analytics/lifecycleEvents.d.ts +5 -2
- package/dist/analytics/lifecycleEvents.d.ts.map +1 -1
- package/dist/analytics/lifecycleEvents.js +4 -1
- package/dist/analytics/lifecycleEvents.js.map +1 -1
- package/dist/{photon/analytics.d.ts → analytics/track.d.ts} +3 -3
- package/dist/analytics/track.d.ts.map +1 -0
- package/dist/{photon/analytics.js → analytics/track.js} +2 -2
- package/dist/analytics/track.js.map +1 -0
- package/dist/api/changes/applyOption.d.ts +4 -1
- package/dist/api/changes/applyOption.d.ts.map +1 -1
- package/dist/api/changes/applyOption.js +23 -2
- package/dist/api/changes/applyOption.js.map +1 -1
- package/dist/api/orders.d.ts +21 -0
- package/dist/api/orders.d.ts.map +1 -1
- package/dist/gql/gql.d.ts +1 -1
- package/dist/gql/gql.d.ts.map +1 -1
- package/dist/gql/gql.js +1 -1
- package/dist/gql/gql.js.map +1 -1
- package/dist/gql/graphql.d.ts +336 -1
- package/dist/gql/graphql.d.ts.map +1 -1
- package/dist/gql/graphql.js +75 -0
- package/dist/gql/graphql.js.map +1 -1
- package/dist/meta/version.js +1 -1
- package/dist/photon/index.d.ts +2 -2
- package/dist/photon/index.d.ts.map +1 -1
- package/dist/photon/index.js.map +1 -1
- package/dist/photon/map.d.ts.map +1 -1
- package/dist/photon/map.js +13 -11
- package/dist/photon/map.js.map +1 -1
- package/dist/photon/order.d.ts +3 -4
- package/dist/photon/order.d.ts.map +1 -1
- package/dist/photon/order.js +6 -11
- package/dist/photon/order.js.map +1 -1
- package/dist/photon/photon.d.ts +1 -1
- package/dist/photon/photon.d.ts.map +1 -1
- package/dist/photon/photon.js +1 -1
- package/dist/photon/photon.js.map +1 -1
- package/dist/photon/session.d.ts +3 -2
- package/dist/photon/session.d.ts.map +1 -1
- package/dist/photon/session.js +22 -9
- package/dist/photon/session.js.map +1 -1
- package/dist/photon/types.d.ts +10 -2
- package/dist/photon/types.d.ts.map +1 -1
- package/dist/testing/fixtures.d.ts +26 -0
- package/dist/testing/fixtures.d.ts.map +1 -1
- package/dist/testing/fixtures.js +6 -0
- package/dist/testing/fixtures.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/src/analytics/lifecycleEvents.test.ts +25 -5
- package/src/analytics/lifecycleEvents.ts +20 -3
- package/src/analytics/track.test.ts +231 -0
- package/src/{photon/analytics.ts → analytics/track.ts} +2 -2
- package/src/api/changes/applyOption.ts +25 -2
- package/src/gql/gql.ts +3 -3
- package/src/gql/graphql.ts +523 -111
- package/src/meta/version.ts +1 -1
- package/src/operations/fragments.graphql +3 -0
- package/src/photon/index.ts +2 -1
- package/src/photon/map.ts +14 -11
- package/src/photon/order.ts +7 -12
- package/src/photon/photon.ts +1 -1
- package/src/photon/session.ts +23 -9
- package/src/photon/types.ts +11 -2
- package/src/testing/fixtures.ts +12 -0
- package/src/testing.ts +1 -0
- package/dist/photon/analytics.d.ts.map +0 -1
- package/dist/photon/analytics.js.map +0 -1
package/src/meta/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const clientVersion: string = "0.
|
|
1
|
+
export const clientVersion: string = "0.15.0";
|
package/src/photon/index.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type {
|
|
|
22
22
|
CallerOrganization,
|
|
23
23
|
} from "./photon.ts";
|
|
24
24
|
export { clientVersion } from "../meta/version.ts";
|
|
25
|
-
export type { Analytics, AnalyticsTarget, AnalyticsProperties } from "
|
|
25
|
+
export type { Analytics, AnalyticsTarget, AnalyticsProperties } from "../analytics/track.ts";
|
|
26
26
|
export type {
|
|
27
27
|
DraftPrescriptionForLifecycleAnalytics,
|
|
28
28
|
DraftPrescriptionSource,
|
|
@@ -31,6 +31,7 @@ export type {
|
|
|
31
31
|
OrderForLifecycleAnalytics,
|
|
32
32
|
PatientForLifecycleAnalytics,
|
|
33
33
|
PrescriptionForLifecycleAnalytics,
|
|
34
|
+
SignedPrescriptionForLifecycleAnalytics,
|
|
34
35
|
} from "../analytics/lifecycleEvents.ts";
|
|
35
36
|
export type { PatientExtra } from "./patient.ts";
|
|
36
37
|
export type { PrescriptionExtra, PrescriptionUpdate } from "./prescription.ts";
|
package/src/photon/map.ts
CHANGED
|
@@ -38,17 +38,20 @@ import type {
|
|
|
38
38
|
* so a schema change stops here (and typecheck says where).
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
const redemptionMethod = (m: RedemptionMethodFieldsFragment): RedemptionMethod =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
/** Tagged by `type`, so a new member of the union doesn't change how callers switch. */
|
|
42
|
+
const redemptionMethod = (m: RedemptionMethodFieldsFragment): RedemptionMethod =>
|
|
43
|
+
m.__typename === "ProgramEnrollmentLink"
|
|
44
|
+
? { type: "enrollmentLink", url: m.url }
|
|
45
|
+
: {
|
|
46
|
+
type: "discountCard",
|
|
47
|
+
id: m.id,
|
|
48
|
+
prescriptionId: m.prescriptionId,
|
|
49
|
+
bin: m.bin,
|
|
50
|
+
pcn: m.pcn,
|
|
51
|
+
group: m.group,
|
|
52
|
+
memberId: m.memberId,
|
|
53
|
+
externalUrl: m.externalUrl,
|
|
54
|
+
};
|
|
52
55
|
|
|
53
56
|
const offer = (o: PharmacyOfferFieldsFragment): PharmacyOffer => ({
|
|
54
57
|
source: o.source,
|
package/src/photon/order.ts
CHANGED
|
@@ -160,23 +160,18 @@ export class Order extends LiveRecord<OrderRecord, OrderExtra> {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
|
-
*
|
|
164
|
-
* unsigned prescription
|
|
165
|
-
*
|
|
166
|
-
* They never stop a send.
|
|
163
|
+
* The order's screening alerts (its prescriptions screened together) that none of its prescriptions carries,
|
|
164
|
+
* signed or not: an unsigned prescription shows its own and a signed one's are acknowledged, so a page shows
|
|
165
|
+
* only these by Send. They never stop a send.
|
|
167
166
|
*/
|
|
168
167
|
get unacknowledgedAlerts(): ScreeningAlert[] {
|
|
169
|
-
const
|
|
170
|
-
this.prescriptions.flatMap((rx) => (rx.
|
|
168
|
+
const carriedByAPrescription = new Set(
|
|
169
|
+
this.prescriptions.flatMap((rx) => (rx.state?.screeningAlerts ?? []).map(alertKey)),
|
|
171
170
|
);
|
|
172
|
-
const open = [
|
|
173
|
-
...(this.state?.screeningAlerts ?? []),
|
|
174
|
-
...this.prescriptions.flatMap((rx) => (rx.signed ? [] : (rx.state?.screeningAlerts ?? []))),
|
|
175
|
-
];
|
|
176
171
|
const seen = new Set<string>();
|
|
177
|
-
return
|
|
172
|
+
return (this.state?.screeningAlerts ?? []).filter((a) => {
|
|
178
173
|
const key = alertKey(a);
|
|
179
|
-
if (
|
|
174
|
+
if (carriedByAPrescription.has(key) || seen.has(key)) return false;
|
|
180
175
|
seen.add(key);
|
|
181
176
|
return true;
|
|
182
177
|
});
|
package/src/photon/photon.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { isMachine, linkAuthOf, refuseSecretInBrowser, signsIn, type LinkAuth, t
|
|
|
11
11
|
import { machineCredentials, type MachineCredentials } from "./machine.ts";
|
|
12
12
|
import { sessionFor, type Session } from "./session.ts";
|
|
13
13
|
import type { Context } from "./context.ts";
|
|
14
|
-
import { analyticsFor, type Analytics, type AnalyticsTarget } from "
|
|
14
|
+
import { analyticsFor, type Analytics, type AnalyticsTarget } from "../analytics/track.ts";
|
|
15
15
|
import { environmentUrls, type EnvironmentUrls, type PhotonEnvironment } from "./environments.ts";
|
|
16
16
|
import { linkPath, parseLinkPath, type FlowLink } from "./links.ts";
|
|
17
17
|
import { guarded, PhotonError, refuse } from "./errors.ts";
|
package/src/photon/session.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { PhotonError } from "./errors.ts";
|
|
|
21
21
|
* stored. No refresh token from Auth0: nothing is kept, and the session lasts as long as the page.
|
|
22
22
|
*
|
|
23
23
|
* Known risks: a script on the page can still read the refresh token (the posture chosen, Auth0's own for SPAs);
|
|
24
|
-
* a session ending mid-work swaps the cards for Sign in.
|
|
24
|
+
* a session ending mid-work swaps the cards for Sign in (signing in again goes back to its organization).
|
|
25
25
|
*/
|
|
26
26
|
export type SessionStatus = "starting" | "signed-out" | "signing-in" | "signed-in" | "error";
|
|
27
27
|
|
|
@@ -98,6 +98,7 @@ export class Session {
|
|
|
98
98
|
#refreshToken: string | null = null;
|
|
99
99
|
/** Whether storage holds the refresh token — then the newest one is read from there (another tab may rotate it). */
|
|
100
100
|
#kept = false;
|
|
101
|
+
#lastOrganization: string | null = null;
|
|
101
102
|
#renewing: Promise<string> | null = null;
|
|
102
103
|
#started: Promise<void> | null = null;
|
|
103
104
|
readonly #config: SessionConfig;
|
|
@@ -128,7 +129,8 @@ export class Session {
|
|
|
128
129
|
/**
|
|
129
130
|
* Sign in — from a click. Leaves the page for Auth0 (its organization picker; `organization`, or the page's
|
|
130
131
|
* `?organization=`, goes straight in; `connection`, e.g. `"google-oauth2"`, goes straight to that identity provider,
|
|
131
|
-
* past Auth0's page) and comes back here.
|
|
132
|
+
* past Auth0's page) and comes back here. A session that ended without signing out (a refused refresh) signs in
|
|
133
|
+
* again to its organization, unless another is named. Inside an iframe: a popup, then signed in here.
|
|
132
134
|
*/
|
|
133
135
|
async signIn(options: SignInOptions = {}): Promise<void> {
|
|
134
136
|
this.#set({ status: "signing-in", error: null });
|
|
@@ -158,6 +160,7 @@ export class Session {
|
|
|
158
160
|
/** Sign out: forget the session here, and end Auth0's (`signOutUrl`). Not something the cards offer. */
|
|
159
161
|
signOut(options: { returnTo?: string } = {}): void {
|
|
160
162
|
this.#forget();
|
|
163
|
+
this.#lastOrganization = null;
|
|
161
164
|
this.#set({ status: "signed-out", user: null, error: null });
|
|
162
165
|
this.#navigate(this.signOutUrl(options));
|
|
163
166
|
}
|
|
@@ -177,7 +180,8 @@ export class Session {
|
|
|
177
180
|
const state = randomString(16);
|
|
178
181
|
const verifier = randomString(32);
|
|
179
182
|
const redirectUri = window.location.origin;
|
|
180
|
-
const organization =
|
|
183
|
+
const organization =
|
|
184
|
+
options.organization ?? new URLSearchParams(window.location.search).get("organization") ?? this.#lastOrganization;
|
|
181
185
|
const params = new URLSearchParams({
|
|
182
186
|
response_type: "code",
|
|
183
187
|
client_id: this.#config.clientId,
|
|
@@ -213,10 +217,18 @@ export class Session {
|
|
|
213
217
|
const stored = this.#readStored();
|
|
214
218
|
if (!stored) return this.#set({ status: "signed-out" });
|
|
215
219
|
this.#user = stored.user;
|
|
216
|
-
await this.#
|
|
220
|
+
await this.#renewStoredSession(); // the access token was never kept: every load starts with a refresh
|
|
217
221
|
} catch (e) {
|
|
218
|
-
|
|
219
|
-
|
|
222
|
+
this.#set({ status: "error", user: null, error: asError(e) });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
async #renewStoredSession(): Promise<void> {
|
|
227
|
+
try {
|
|
228
|
+
await this.#renew();
|
|
229
|
+
} catch (e) {
|
|
230
|
+
if (wasSignedOutByRenewal(e)) return;
|
|
231
|
+
throw e;
|
|
220
232
|
}
|
|
221
233
|
}
|
|
222
234
|
|
|
@@ -227,14 +239,14 @@ export class Session {
|
|
|
227
239
|
#renew(): Promise<string> {
|
|
228
240
|
return this.#oneTabAtATime(async () => {
|
|
229
241
|
const refreshToken = this.#kept ? (this.#readStored()?.refreshToken ?? null) : this.#refreshToken;
|
|
230
|
-
if (!refreshToken) return this.#
|
|
242
|
+
if (!refreshToken) return this.#endSession(); // signed out here, or in another tab
|
|
231
243
|
try {
|
|
232
244
|
const tokens = await this.#tokenRequest({ grant_type: "refresh_token", refresh_token: refreshToken });
|
|
233
245
|
this.#keep(tokens, refreshToken);
|
|
234
246
|
return this.#access!.token;
|
|
235
247
|
} catch (e) {
|
|
236
248
|
// A refresh token Auth0 won't take (expired, revoked, rotated away): signed out — not an error.
|
|
237
|
-
if (e instanceof PhotonError && e.kind === "unauthorized") return this.#
|
|
249
|
+
if (e instanceof PhotonError && e.kind === "unauthorized") return this.#endSession();
|
|
238
250
|
throw e;
|
|
239
251
|
}
|
|
240
252
|
});
|
|
@@ -338,7 +350,8 @@ export class Session {
|
|
|
338
350
|
this.#set({ status: "signed-in", user: this.#user, error: null });
|
|
339
351
|
}
|
|
340
352
|
|
|
341
|
-
#
|
|
353
|
+
#endSession(): never {
|
|
354
|
+
this.#lastOrganization = this.#user?.organization ?? this.#lastOrganization;
|
|
342
355
|
this.#forget();
|
|
343
356
|
this.#set({ status: "signed-out", user: null, error: null });
|
|
344
357
|
throw new PhotonError("unauthorized", "Sign in to Photon first.");
|
|
@@ -427,6 +440,7 @@ export function claimsOf(jwt: string | undefined): Record<string, unknown> {
|
|
|
427
440
|
const str = (value: unknown) => (typeof value === "string" ? value : null);
|
|
428
441
|
const signInError = (message: string) => new PhotonError("unauthorized", message);
|
|
429
442
|
const asError = (e: unknown) => (e instanceof PhotonError ? e : new PhotonError("network", String(e), true));
|
|
443
|
+
const wasSignedOutByRenewal = (e: unknown) => e instanceof PhotonError && e.kind === "unauthorized";
|
|
430
444
|
|
|
431
445
|
function read<T>(storage: Storage, key: string): T | null {
|
|
432
446
|
try {
|
package/src/photon/types.ts
CHANGED
|
@@ -119,8 +119,11 @@ export interface OfferDeliveryEstimate {
|
|
|
119
119
|
*/
|
|
120
120
|
export type RedemptionState = "SETTLED" | "PENDING" | "SKIPPED";
|
|
121
121
|
|
|
122
|
-
/**
|
|
123
|
-
|
|
122
|
+
/**
|
|
123
|
+
* What the patient presents or follows to redeem an offer, tagged by `type`. A PharmacyBenefitCard for the
|
|
124
|
+
* patient's own insurance is the expected next member.
|
|
125
|
+
*/
|
|
126
|
+
export type RedemptionMethod = PharmacyDiscountCard | ProgramEnrollmentLink;
|
|
124
127
|
|
|
125
128
|
/** A cash discount card — a GoodRx or RxSense coupon, read out at the counter or claimed on `externalUrl`. */
|
|
126
129
|
export interface PharmacyDiscountCard {
|
|
@@ -138,6 +141,12 @@ export interface PharmacyDiscountCard {
|
|
|
138
141
|
externalUrl: string | null;
|
|
139
142
|
}
|
|
140
143
|
|
|
144
|
+
/** A link where the patient enrolls in a partner program to get the program's offer. */
|
|
145
|
+
export interface ProgramEnrollmentLink {
|
|
146
|
+
type: "enrollmentLink";
|
|
147
|
+
url: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
141
150
|
/** An order's offers, split by whether they depend on the pharmacy it's routed to. */
|
|
142
151
|
export interface OrderOffers {
|
|
143
152
|
/** null until a pharmacy is chosen; `[]` when one is chosen but no offer applies. */
|
package/src/testing/fixtures.ts
CHANGED
|
@@ -70,6 +70,18 @@ export const discountCard = (overrides: Partial<PharmacyDiscountCard> = {}): Pha
|
|
|
70
70
|
...overrides,
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
+
type ProgramEnrollmentLink = Extract<
|
|
74
|
+
PharmacyOffer["redemptionMethods"][number],
|
|
75
|
+
{ __typename: "ProgramEnrollmentLink" }
|
|
76
|
+
>;
|
|
77
|
+
|
|
78
|
+
/** A partner program's enrollment link, as an offer's redemption method. Pair it with `redemptionState: "SETTLED"`. */
|
|
79
|
+
export const enrollmentLink = (overrides: Partial<ProgramEnrollmentLink> = {}): ProgramEnrollmentLink => ({
|
|
80
|
+
__typename: "ProgramEnrollmentLink",
|
|
81
|
+
url: "https://example.test/enroll",
|
|
82
|
+
...overrides,
|
|
83
|
+
});
|
|
84
|
+
|
|
73
85
|
export const pharmacy = (overrides: Partial<Pharmacy> = {}): Pharmacy => ({
|
|
74
86
|
__typename: "Pharmacy",
|
|
75
87
|
id: "phr_1",
|
package/src/testing.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/photon/analytics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAA8B,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAEtG;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,EAAE,CAAC,CAAC;AAE9F,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,kGAAkG;AAClG,MAAM,WAAW,SAAU,SAAQ,eAAe,EAAE,kBAAkB;IACpE;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,eAAe,KAAK,CAAC;AAGlC,UAAU,QAAQ;IAChB,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,gHAAgH;IAChH,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACtC;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,CA2DnF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/photon/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AA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