@insureco/bio 0.6.0 → 0.9.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.
- package/dist/{chunk-PLN6QPED.mjs → chunk-CKHMGUDP.mjs} +41 -0
- package/dist/chunk-UBURAGWI.mjs +154 -0
- package/dist/graph.d.mts +73 -1
- package/dist/graph.d.ts +73 -1
- package/dist/graph.js +41 -0
- package/dist/graph.mjs +1 -1
- package/dist/index.d.mts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +217 -5
- package/dist/index.mjs +28 -6
- package/dist/passport-react.d.mts +27 -0
- package/dist/passport-react.d.ts +27 -0
- package/dist/passport-react.js +115 -0
- package/dist/passport-react.mjs +90 -0
- package/dist/passport-types-bPgjNxv-.d.mts +79 -0
- package/dist/passport-types-bPgjNxv-.d.ts +79 -0
- package/dist/passport.d.mts +70 -0
- package/dist/passport.d.ts +70 -0
- package/dist/passport.js +180 -0
- package/dist/passport.mjs +6 -0
- package/dist/{types-CJe1FP61.d.mts → types-Cm0uZYaQ.d.mts} +29 -3
- package/dist/{types-CJe1FP61.d.ts → types-Cm0uZYaQ.d.ts} +29 -3
- package/dist/users.d.mts +1 -1
- package/dist/users.d.ts +1 -1
- package/dist/users.js +1 -0
- package/dist/users.mjs +1 -0
- package/package.json +24 -2
|
@@ -64,7 +64,48 @@ var GraphClient = class _GraphClient {
|
|
|
64
64
|
async matchAppetite(input) {
|
|
65
65
|
return this.post("/api/graph/appetite/match", input, { requiresAuth: true });
|
|
66
66
|
}
|
|
67
|
+
// ─── Verification Routes (auth required, gas-metered) ─────────────────────
|
|
68
|
+
/**
|
|
69
|
+
* Verify an agent's license for a given state and line of business.
|
|
70
|
+
* Returns validity, license number, expiry, and a Septor proof hash.
|
|
71
|
+
*/
|
|
72
|
+
async verifyLicense(input) {
|
|
73
|
+
return this.post("/api/graph/verify/license", input, { requiresAuth: true });
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Verify an agent's appointment with a carrier.
|
|
77
|
+
* Returns validity, appointed date, states, and a Septor proof hash.
|
|
78
|
+
*/
|
|
79
|
+
async verifyAppointment(input) {
|
|
80
|
+
return this.post("/api/graph/verify/appointment", input, { requiresAuth: true });
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get the distribution chain for an entity (agent → agency → MGA → carrier).
|
|
84
|
+
* Requires an accessToken (auth: required).
|
|
85
|
+
*/
|
|
86
|
+
async getChain(entityId) {
|
|
87
|
+
return this.getAuth(`/api/graph/chain/${encodeURIComponent(entityId)}`);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Search across Agent, Agency, MGA, and Carrier nodes.
|
|
91
|
+
* Public route — no auth required.
|
|
92
|
+
*/
|
|
93
|
+
async search(query, options) {
|
|
94
|
+
const params = new URLSearchParams({ q: query });
|
|
95
|
+
if (options?.limit) params.set("limit", String(options.limit));
|
|
96
|
+
if (options?.types?.length) params.set("types", options.types.join(","));
|
|
97
|
+
return this.get(`/api/graph/search?${params.toString()}`);
|
|
98
|
+
}
|
|
67
99
|
// ─── Internal ─────────────────────────────────────────────────────────────
|
|
100
|
+
async getAuth(path) {
|
|
101
|
+
if (!this.accessToken) {
|
|
102
|
+
throw new BioError(
|
|
103
|
+
`bio-graph ${path} requires an accessToken \u2014 pass it in the GraphClient constructor`,
|
|
104
|
+
"config_error"
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return this.get(path);
|
|
108
|
+
}
|
|
68
109
|
async get(path, attempt = 0) {
|
|
69
110
|
const url = `${this.graphUrl}${path}`;
|
|
70
111
|
const controller = new AbortController();
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// src/passport-client.ts
|
|
2
|
+
var PassportClient = class {
|
|
3
|
+
config;
|
|
4
|
+
ws = null;
|
|
5
|
+
_passport = null;
|
|
6
|
+
_status = "disconnected";
|
|
7
|
+
reconnectAttempt = 0;
|
|
8
|
+
reconnectTimer = null;
|
|
9
|
+
listeners = /* @__PURE__ */ new Map();
|
|
10
|
+
closed = false;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.config = {
|
|
13
|
+
autoReconnect: true,
|
|
14
|
+
maxReconnectDelay: 3e4,
|
|
15
|
+
...config
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Current passport object (null until first identity message) */
|
|
19
|
+
get passport() {
|
|
20
|
+
return this._passport;
|
|
21
|
+
}
|
|
22
|
+
/** Current connection status */
|
|
23
|
+
get status() {
|
|
24
|
+
return this._status;
|
|
25
|
+
}
|
|
26
|
+
/** Connect to the passport WebSocket */
|
|
27
|
+
connect() {
|
|
28
|
+
if (this.closed) return;
|
|
29
|
+
this.setStatus("connecting");
|
|
30
|
+
const url = new URL("/passport", this.config.bioIdUrl.replace(/^http/, "ws"));
|
|
31
|
+
url.searchParams.set("token", this.config.accessToken);
|
|
32
|
+
url.searchParams.set("version", "1");
|
|
33
|
+
if (this.config.service) {
|
|
34
|
+
url.searchParams.set("service", this.config.service);
|
|
35
|
+
}
|
|
36
|
+
this.ws = new WebSocket(url.toString());
|
|
37
|
+
this.ws.onopen = () => {
|
|
38
|
+
this.reconnectAttempt = 0;
|
|
39
|
+
this.setStatus("connected");
|
|
40
|
+
this.emit("connected", this._status);
|
|
41
|
+
};
|
|
42
|
+
this.ws.onmessage = (event) => {
|
|
43
|
+
try {
|
|
44
|
+
const data = JSON.parse(
|
|
45
|
+
typeof event.data === "string" ? event.data : ""
|
|
46
|
+
);
|
|
47
|
+
if (data.type === "identity" || data.type === "passport_updated") {
|
|
48
|
+
this._passport = data.passport ?? null;
|
|
49
|
+
this.emit(data.type, this._passport);
|
|
50
|
+
} else if (data.type === "revoked") {
|
|
51
|
+
this._passport = null;
|
|
52
|
+
this.emit("revoked");
|
|
53
|
+
}
|
|
54
|
+
} catch {
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
this.ws.onclose = (event) => {
|
|
58
|
+
this.setStatus("disconnected");
|
|
59
|
+
this.emit("disconnected", this._status);
|
|
60
|
+
if (event?.code === 4003 && this.config.refreshToken && this.config.bioAuth) {
|
|
61
|
+
this.handleTokenRefresh();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.scheduleReconnect();
|
|
65
|
+
};
|
|
66
|
+
this.ws.onerror = () => {
|
|
67
|
+
const error = new Error("Passport WebSocket error");
|
|
68
|
+
this.emit("error", error);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Subscribe to an event */
|
|
72
|
+
on(event, handler) {
|
|
73
|
+
if (!this.listeners.has(event)) {
|
|
74
|
+
this.listeners.set(event, /* @__PURE__ */ new Set());
|
|
75
|
+
}
|
|
76
|
+
this.listeners.get(event).add(handler);
|
|
77
|
+
}
|
|
78
|
+
/** Unsubscribe from an event */
|
|
79
|
+
off(event, handler) {
|
|
80
|
+
this.listeners.get(event)?.delete(handler);
|
|
81
|
+
}
|
|
82
|
+
/** Disconnect and stop reconnecting */
|
|
83
|
+
close() {
|
|
84
|
+
this.closed = true;
|
|
85
|
+
if (this.reconnectTimer) {
|
|
86
|
+
clearTimeout(this.reconnectTimer);
|
|
87
|
+
this.reconnectTimer = null;
|
|
88
|
+
}
|
|
89
|
+
if (this.ws) {
|
|
90
|
+
this.ws.onclose = null;
|
|
91
|
+
this.ws.close();
|
|
92
|
+
this.ws = null;
|
|
93
|
+
}
|
|
94
|
+
this.setStatus("disconnected");
|
|
95
|
+
}
|
|
96
|
+
/** Update access token (e.g. after refresh) and reconnect */
|
|
97
|
+
updateToken(accessToken) {
|
|
98
|
+
this.config.accessToken = accessToken;
|
|
99
|
+
if (this.ws) {
|
|
100
|
+
this.ws.onclose = null;
|
|
101
|
+
this.ws.close();
|
|
102
|
+
this.ws = null;
|
|
103
|
+
}
|
|
104
|
+
this.reconnectAttempt = 0;
|
|
105
|
+
this.connect();
|
|
106
|
+
}
|
|
107
|
+
async handleTokenRefresh() {
|
|
108
|
+
if (!this.config.refreshToken || !this.config.bioAuth) return;
|
|
109
|
+
try {
|
|
110
|
+
const tokens = await this.config.bioAuth.refreshToken(this.config.refreshToken);
|
|
111
|
+
this.config.accessToken = tokens.access_token;
|
|
112
|
+
if (tokens.refresh_token) {
|
|
113
|
+
this.config.refreshToken = tokens.refresh_token;
|
|
114
|
+
}
|
|
115
|
+
if (this.config.onTokenRefresh) {
|
|
116
|
+
this.config.onTokenRefresh(tokens);
|
|
117
|
+
}
|
|
118
|
+
this.reconnectAttempt = 0;
|
|
119
|
+
this.connect();
|
|
120
|
+
} catch {
|
|
121
|
+
this.emit("error", new Error("Token refresh failed"));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
setStatus(status) {
|
|
125
|
+
this._status = status;
|
|
126
|
+
}
|
|
127
|
+
emit(event, ...args) {
|
|
128
|
+
const handlers = this.listeners.get(event);
|
|
129
|
+
if (handlers) {
|
|
130
|
+
for (const handler of handlers) {
|
|
131
|
+
try {
|
|
132
|
+
handler(...args);
|
|
133
|
+
} catch {
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
scheduleReconnect() {
|
|
139
|
+
if (this.closed || !this.config.autoReconnect) return;
|
|
140
|
+
const delay = Math.min(
|
|
141
|
+
1e3 * Math.pow(2, this.reconnectAttempt),
|
|
142
|
+
this.config.maxReconnectDelay ?? 3e4
|
|
143
|
+
);
|
|
144
|
+
this.reconnectAttempt++;
|
|
145
|
+
this.reconnectTimer = setTimeout(() => {
|
|
146
|
+
this.reconnectTimer = null;
|
|
147
|
+
this.connect();
|
|
148
|
+
}, delay);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
PassportClient
|
|
154
|
+
};
|
package/dist/graph.d.mts
CHANGED
|
@@ -136,6 +136,57 @@ interface AppetiteMatchResult {
|
|
|
136
136
|
programs: AppetiteMatchProgram[];
|
|
137
137
|
total: number;
|
|
138
138
|
}
|
|
139
|
+
interface VerifyLicenseInput {
|
|
140
|
+
npn: string;
|
|
141
|
+
state: string;
|
|
142
|
+
lob: string;
|
|
143
|
+
}
|
|
144
|
+
interface LicenseVerifyResult {
|
|
145
|
+
valid: boolean;
|
|
146
|
+
licenseNumber: string | null;
|
|
147
|
+
expiry: string | null;
|
|
148
|
+
septorProof: string;
|
|
149
|
+
}
|
|
150
|
+
interface VerifyAppointmentInput {
|
|
151
|
+
npn: string;
|
|
152
|
+
carrierNaic: string;
|
|
153
|
+
}
|
|
154
|
+
interface AppointmentVerifyResult {
|
|
155
|
+
valid: boolean;
|
|
156
|
+
appointedDate: string | null;
|
|
157
|
+
states: string[];
|
|
158
|
+
septorProof: string;
|
|
159
|
+
}
|
|
160
|
+
interface GraphChainNode {
|
|
161
|
+
id: string;
|
|
162
|
+
type: string;
|
|
163
|
+
label: string;
|
|
164
|
+
}
|
|
165
|
+
interface GraphChainEdge {
|
|
166
|
+
source: string;
|
|
167
|
+
target: string;
|
|
168
|
+
type: string;
|
|
169
|
+
}
|
|
170
|
+
interface GraphChainResult {
|
|
171
|
+
nodes: GraphChainNode[];
|
|
172
|
+
edges: GraphChainEdge[];
|
|
173
|
+
}
|
|
174
|
+
interface GraphSearchOptions {
|
|
175
|
+
limit?: number;
|
|
176
|
+
types?: string[];
|
|
177
|
+
}
|
|
178
|
+
interface GraphSearchResultItem {
|
|
179
|
+
type: string;
|
|
180
|
+
iecHash: string;
|
|
181
|
+
name: string;
|
|
182
|
+
npn?: string;
|
|
183
|
+
naic?: string;
|
|
184
|
+
orgSlug?: string;
|
|
185
|
+
}
|
|
186
|
+
interface GraphSearchResult {
|
|
187
|
+
results: GraphSearchResultItem[];
|
|
188
|
+
total: number;
|
|
189
|
+
}
|
|
139
190
|
/**
|
|
140
191
|
* Client for bio-graph InsureBio distribution graph endpoints.
|
|
141
192
|
*
|
|
@@ -195,10 +246,31 @@ declare class GraphClient {
|
|
|
195
246
|
* @param input - Risk criteria: NAICS code, state, line of business, optional limits
|
|
196
247
|
*/
|
|
197
248
|
matchAppetite(input: AppetiteMatchInput): Promise<AppetiteMatchResult>;
|
|
249
|
+
/**
|
|
250
|
+
* Verify an agent's license for a given state and line of business.
|
|
251
|
+
* Returns validity, license number, expiry, and a Septor proof hash.
|
|
252
|
+
*/
|
|
253
|
+
verifyLicense(input: VerifyLicenseInput): Promise<LicenseVerifyResult>;
|
|
254
|
+
/**
|
|
255
|
+
* Verify an agent's appointment with a carrier.
|
|
256
|
+
* Returns validity, appointed date, states, and a Septor proof hash.
|
|
257
|
+
*/
|
|
258
|
+
verifyAppointment(input: VerifyAppointmentInput): Promise<AppointmentVerifyResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Get the distribution chain for an entity (agent → agency → MGA → carrier).
|
|
261
|
+
* Requires an accessToken (auth: required).
|
|
262
|
+
*/
|
|
263
|
+
getChain(entityId: string): Promise<GraphChainResult>;
|
|
264
|
+
/**
|
|
265
|
+
* Search across Agent, Agency, MGA, and Carrier nodes.
|
|
266
|
+
* Public route — no auth required.
|
|
267
|
+
*/
|
|
268
|
+
search(query: string, options?: GraphSearchOptions): Promise<GraphSearchResult>;
|
|
269
|
+
private getAuth;
|
|
198
270
|
private get;
|
|
199
271
|
private post;
|
|
200
272
|
private buildHeaders;
|
|
201
273
|
private handleResponse;
|
|
202
274
|
}
|
|
203
275
|
|
|
204
|
-
export { type AgencyProfile, type AgencyProgram, type AgencyStaffMember, type AgentEmployer, type AgentProfile, type AppetiteMatchInput, type AppetiteMatchProgram, type AppetiteMatchResult, type CarrierProfile, type CarrierProgram, GraphClient, type GraphClientConfig, type ProgramProfile };
|
|
276
|
+
export { type AgencyProfile, type AgencyProgram, type AgencyStaffMember, type AgentEmployer, type AgentProfile, type AppetiteMatchInput, type AppetiteMatchProgram, type AppetiteMatchResult, type AppointmentVerifyResult, type CarrierProfile, type CarrierProgram, type GraphChainEdge, type GraphChainNode, type GraphChainResult, GraphClient, type GraphClientConfig, type GraphSearchOptions, type GraphSearchResult, type GraphSearchResultItem, type LicenseVerifyResult, type ProgramProfile, type VerifyAppointmentInput, type VerifyLicenseInput };
|
package/dist/graph.d.ts
CHANGED
|
@@ -136,6 +136,57 @@ interface AppetiteMatchResult {
|
|
|
136
136
|
programs: AppetiteMatchProgram[];
|
|
137
137
|
total: number;
|
|
138
138
|
}
|
|
139
|
+
interface VerifyLicenseInput {
|
|
140
|
+
npn: string;
|
|
141
|
+
state: string;
|
|
142
|
+
lob: string;
|
|
143
|
+
}
|
|
144
|
+
interface LicenseVerifyResult {
|
|
145
|
+
valid: boolean;
|
|
146
|
+
licenseNumber: string | null;
|
|
147
|
+
expiry: string | null;
|
|
148
|
+
septorProof: string;
|
|
149
|
+
}
|
|
150
|
+
interface VerifyAppointmentInput {
|
|
151
|
+
npn: string;
|
|
152
|
+
carrierNaic: string;
|
|
153
|
+
}
|
|
154
|
+
interface AppointmentVerifyResult {
|
|
155
|
+
valid: boolean;
|
|
156
|
+
appointedDate: string | null;
|
|
157
|
+
states: string[];
|
|
158
|
+
septorProof: string;
|
|
159
|
+
}
|
|
160
|
+
interface GraphChainNode {
|
|
161
|
+
id: string;
|
|
162
|
+
type: string;
|
|
163
|
+
label: string;
|
|
164
|
+
}
|
|
165
|
+
interface GraphChainEdge {
|
|
166
|
+
source: string;
|
|
167
|
+
target: string;
|
|
168
|
+
type: string;
|
|
169
|
+
}
|
|
170
|
+
interface GraphChainResult {
|
|
171
|
+
nodes: GraphChainNode[];
|
|
172
|
+
edges: GraphChainEdge[];
|
|
173
|
+
}
|
|
174
|
+
interface GraphSearchOptions {
|
|
175
|
+
limit?: number;
|
|
176
|
+
types?: string[];
|
|
177
|
+
}
|
|
178
|
+
interface GraphSearchResultItem {
|
|
179
|
+
type: string;
|
|
180
|
+
iecHash: string;
|
|
181
|
+
name: string;
|
|
182
|
+
npn?: string;
|
|
183
|
+
naic?: string;
|
|
184
|
+
orgSlug?: string;
|
|
185
|
+
}
|
|
186
|
+
interface GraphSearchResult {
|
|
187
|
+
results: GraphSearchResultItem[];
|
|
188
|
+
total: number;
|
|
189
|
+
}
|
|
139
190
|
/**
|
|
140
191
|
* Client for bio-graph InsureBio distribution graph endpoints.
|
|
141
192
|
*
|
|
@@ -195,10 +246,31 @@ declare class GraphClient {
|
|
|
195
246
|
* @param input - Risk criteria: NAICS code, state, line of business, optional limits
|
|
196
247
|
*/
|
|
197
248
|
matchAppetite(input: AppetiteMatchInput): Promise<AppetiteMatchResult>;
|
|
249
|
+
/**
|
|
250
|
+
* Verify an agent's license for a given state and line of business.
|
|
251
|
+
* Returns validity, license number, expiry, and a Septor proof hash.
|
|
252
|
+
*/
|
|
253
|
+
verifyLicense(input: VerifyLicenseInput): Promise<LicenseVerifyResult>;
|
|
254
|
+
/**
|
|
255
|
+
* Verify an agent's appointment with a carrier.
|
|
256
|
+
* Returns validity, appointed date, states, and a Septor proof hash.
|
|
257
|
+
*/
|
|
258
|
+
verifyAppointment(input: VerifyAppointmentInput): Promise<AppointmentVerifyResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Get the distribution chain for an entity (agent → agency → MGA → carrier).
|
|
261
|
+
* Requires an accessToken (auth: required).
|
|
262
|
+
*/
|
|
263
|
+
getChain(entityId: string): Promise<GraphChainResult>;
|
|
264
|
+
/**
|
|
265
|
+
* Search across Agent, Agency, MGA, and Carrier nodes.
|
|
266
|
+
* Public route — no auth required.
|
|
267
|
+
*/
|
|
268
|
+
search(query: string, options?: GraphSearchOptions): Promise<GraphSearchResult>;
|
|
269
|
+
private getAuth;
|
|
198
270
|
private get;
|
|
199
271
|
private post;
|
|
200
272
|
private buildHeaders;
|
|
201
273
|
private handleResponse;
|
|
202
274
|
}
|
|
203
275
|
|
|
204
|
-
export { type AgencyProfile, type AgencyProgram, type AgencyStaffMember, type AgentEmployer, type AgentProfile, type AppetiteMatchInput, type AppetiteMatchProgram, type AppetiteMatchResult, type CarrierProfile, type CarrierProgram, GraphClient, type GraphClientConfig, type ProgramProfile };
|
|
276
|
+
export { type AgencyProfile, type AgencyProgram, type AgencyStaffMember, type AgentEmployer, type AgentProfile, type AppetiteMatchInput, type AppetiteMatchProgram, type AppetiteMatchResult, type AppointmentVerifyResult, type CarrierProfile, type CarrierProgram, type GraphChainEdge, type GraphChainNode, type GraphChainResult, GraphClient, type GraphClientConfig, type GraphSearchOptions, type GraphSearchResult, type GraphSearchResultItem, type LicenseVerifyResult, type ProgramProfile, type VerifyAppointmentInput, type VerifyLicenseInput };
|
package/dist/graph.js
CHANGED
|
@@ -120,7 +120,48 @@ var GraphClient = class _GraphClient {
|
|
|
120
120
|
async matchAppetite(input) {
|
|
121
121
|
return this.post("/api/graph/appetite/match", input, { requiresAuth: true });
|
|
122
122
|
}
|
|
123
|
+
// ─── Verification Routes (auth required, gas-metered) ─────────────────────
|
|
124
|
+
/**
|
|
125
|
+
* Verify an agent's license for a given state and line of business.
|
|
126
|
+
* Returns validity, license number, expiry, and a Septor proof hash.
|
|
127
|
+
*/
|
|
128
|
+
async verifyLicense(input) {
|
|
129
|
+
return this.post("/api/graph/verify/license", input, { requiresAuth: true });
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Verify an agent's appointment with a carrier.
|
|
133
|
+
* Returns validity, appointed date, states, and a Septor proof hash.
|
|
134
|
+
*/
|
|
135
|
+
async verifyAppointment(input) {
|
|
136
|
+
return this.post("/api/graph/verify/appointment", input, { requiresAuth: true });
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get the distribution chain for an entity (agent → agency → MGA → carrier).
|
|
140
|
+
* Requires an accessToken (auth: required).
|
|
141
|
+
*/
|
|
142
|
+
async getChain(entityId) {
|
|
143
|
+
return this.getAuth(`/api/graph/chain/${encodeURIComponent(entityId)}`);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Search across Agent, Agency, MGA, and Carrier nodes.
|
|
147
|
+
* Public route — no auth required.
|
|
148
|
+
*/
|
|
149
|
+
async search(query, options) {
|
|
150
|
+
const params = new URLSearchParams({ q: query });
|
|
151
|
+
if (options?.limit) params.set("limit", String(options.limit));
|
|
152
|
+
if (options?.types?.length) params.set("types", options.types.join(","));
|
|
153
|
+
return this.get(`/api/graph/search?${params.toString()}`);
|
|
154
|
+
}
|
|
123
155
|
// ─── Internal ─────────────────────────────────────────────────────────────
|
|
156
|
+
async getAuth(path) {
|
|
157
|
+
if (!this.accessToken) {
|
|
158
|
+
throw new BioError(
|
|
159
|
+
`bio-graph ${path} requires an accessToken \u2014 pass it in the GraphClient constructor`,
|
|
160
|
+
"config_error"
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return this.get(path);
|
|
164
|
+
}
|
|
124
165
|
async get(path, attempt = 0) {
|
|
125
166
|
const url = `${this.graphUrl}${path}`;
|
|
126
167
|
const controller = new AbortController();
|
package/dist/graph.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { AgencyProfile, AgencyProgram, AgencyStaffMember, AgentEmployer, AgentProfile, AppetiteMatchInput, AppetiteMatchProgram, AppetiteMatchResult, CarrierProfile, CarrierProgram, GraphClient, GraphClientConfig, ProgramProfile } from './graph.mjs';
|
|
1
|
+
import { b as BioAuthConfig, A as AuthorizeOptions, c as AuthorizeResult, S as SilentAuthOptions, T as TokenResponse, d as BioUser, I as IntrospectResult, e as BioAdminConfig, U as UserFilters, f as UpdateUserData, g as BioDepartment, C as CreateDepartmentData, h as BioRole, i as CreateRoleData, j as BioOAuthClient, k as CreateClientData, E as EmbedClientConfig, l as EmbedLoginParams, m as EmbedAuthResult, n as EmbedSignupParams, o as EmbedMagicLinkParams, p as EmbedVerifyParams, q as EmbedRefreshParams, r as EmbedLogoutParams, s as BioTokenPayload, V as VerifyOptions, J as JWKSVerifyOptions } from './types-Cm0uZYaQ.mjs';
|
|
2
|
+
export { t as AdminResponse, u as BioAddress, v as BioClientTokenPayload, w as BioMessaging, B as BioUsersConfig, x as EmbedBranding, y as EmbedUser, z as OrgMember, O as OrgMemberFilters, a as OrgMembersResult, D as ServiceRole } from './types-Cm0uZYaQ.mjs';
|
|
3
|
+
export { AgencyProfile, AgencyProgram, AgencyStaffMember, AgentEmployer, AgentProfile, AppetiteMatchInput, AppetiteMatchProgram, AppetiteMatchResult, AppointmentVerifyResult, CarrierProfile, CarrierProgram, GraphChainEdge, GraphChainNode, GraphChainResult, GraphClient, GraphClientConfig, GraphSearchOptions, GraphSearchResult, GraphSearchResultItem, LicenseVerifyResult, ProgramProfile, VerifyAppointmentInput, VerifyLicenseInput } from './graph.mjs';
|
|
4
|
+
export { PassportClient } from './passport.mjs';
|
|
5
|
+
export { P as Passport, b as PassportBranding, c as PassportClientConfig, d as PassportCrossOrgPermission, e as PassportEventType, f as PassportMessage, g as PassportServiceGrant, h as PassportSession, a as PassportStatus, i as PassportTokenRefresher, j as PassportVillage } from './passport-types-bPgjNxv-.mjs';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* OAuth flow client for Bio-ID SSO.
|
|
@@ -28,6 +30,14 @@ declare class BioAuth {
|
|
|
28
30
|
* Store the state and codeVerifier securely (e.g. in a cookie) for the callback.
|
|
29
31
|
*/
|
|
30
32
|
getAuthorizationUrl(opts: AuthorizeOptions): AuthorizeResult;
|
|
33
|
+
/**
|
|
34
|
+
* Build an authorization URL with prompt=none for silent authentication.
|
|
35
|
+
*
|
|
36
|
+
* Useful for checking if the user has an existing session without showing
|
|
37
|
+
* a login screen. If the user is not authenticated, Bio-ID redirects back
|
|
38
|
+
* with an `error=login_required` query parameter instead of showing UI.
|
|
39
|
+
*/
|
|
40
|
+
silentAuth(opts: SilentAuthOptions): AuthorizeResult;
|
|
31
41
|
/**
|
|
32
42
|
* Exchange an authorization code for tokens.
|
|
33
43
|
*
|
|
@@ -240,4 +250,4 @@ declare function isTokenExpired(token: string, bufferSeconds?: number): boolean;
|
|
|
240
250
|
*/
|
|
241
251
|
declare function verifyTokenJWKS(token: string, options?: JWKSVerifyOptions): Promise<BioTokenPayload>;
|
|
242
252
|
|
|
243
|
-
export { AuthorizeOptions, AuthorizeResult, BioAdmin, BioAdminConfig, BioAuth, BioAuthConfig, BioDepartment, BioError, BioOAuthClient, BioRole, BioTokenPayload, BioUser, CreateClientData, CreateDepartmentData, CreateRoleData, EmbedAuthResult, EmbedClient, EmbedClientConfig, EmbedLoginParams, EmbedLogoutParams, EmbedMagicLinkParams, EmbedRefreshParams, EmbedSignupParams, EmbedVerifyParams, IntrospectResult, JWKSVerifyOptions, TokenResponse, UpdateUserData, UserFilters, VerifyOptions, decodeToken, generatePKCE, isTokenExpired, verifyToken, verifyTokenJWKS };
|
|
253
|
+
export { AuthorizeOptions, AuthorizeResult, BioAdmin, BioAdminConfig, BioAuth, BioAuthConfig, BioDepartment, BioError, BioOAuthClient, BioRole, BioTokenPayload, BioUser, CreateClientData, CreateDepartmentData, CreateRoleData, EmbedAuthResult, EmbedClient, EmbedClientConfig, EmbedLoginParams, EmbedLogoutParams, EmbedMagicLinkParams, EmbedRefreshParams, EmbedSignupParams, EmbedVerifyParams, IntrospectResult, JWKSVerifyOptions, SilentAuthOptions, TokenResponse, UpdateUserData, UserFilters, VerifyOptions, decodeToken, generatePKCE, isTokenExpired, verifyToken, verifyTokenJWKS };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { AgencyProfile, AgencyProgram, AgencyStaffMember, AgentEmployer, AgentProfile, AppetiteMatchInput, AppetiteMatchProgram, AppetiteMatchResult, CarrierProfile, CarrierProgram, GraphClient, GraphClientConfig, ProgramProfile } from './graph.js';
|
|
1
|
+
import { b as BioAuthConfig, A as AuthorizeOptions, c as AuthorizeResult, S as SilentAuthOptions, T as TokenResponse, d as BioUser, I as IntrospectResult, e as BioAdminConfig, U as UserFilters, f as UpdateUserData, g as BioDepartment, C as CreateDepartmentData, h as BioRole, i as CreateRoleData, j as BioOAuthClient, k as CreateClientData, E as EmbedClientConfig, l as EmbedLoginParams, m as EmbedAuthResult, n as EmbedSignupParams, o as EmbedMagicLinkParams, p as EmbedVerifyParams, q as EmbedRefreshParams, r as EmbedLogoutParams, s as BioTokenPayload, V as VerifyOptions, J as JWKSVerifyOptions } from './types-Cm0uZYaQ.js';
|
|
2
|
+
export { t as AdminResponse, u as BioAddress, v as BioClientTokenPayload, w as BioMessaging, B as BioUsersConfig, x as EmbedBranding, y as EmbedUser, z as OrgMember, O as OrgMemberFilters, a as OrgMembersResult, D as ServiceRole } from './types-Cm0uZYaQ.js';
|
|
3
|
+
export { AgencyProfile, AgencyProgram, AgencyStaffMember, AgentEmployer, AgentProfile, AppetiteMatchInput, AppetiteMatchProgram, AppetiteMatchResult, AppointmentVerifyResult, CarrierProfile, CarrierProgram, GraphChainEdge, GraphChainNode, GraphChainResult, GraphClient, GraphClientConfig, GraphSearchOptions, GraphSearchResult, GraphSearchResultItem, LicenseVerifyResult, ProgramProfile, VerifyAppointmentInput, VerifyLicenseInput } from './graph.js';
|
|
4
|
+
export { PassportClient } from './passport.js';
|
|
5
|
+
export { P as Passport, b as PassportBranding, c as PassportClientConfig, d as PassportCrossOrgPermission, e as PassportEventType, f as PassportMessage, g as PassportServiceGrant, h as PassportSession, a as PassportStatus, i as PassportTokenRefresher, j as PassportVillage } from './passport-types-bPgjNxv-.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* OAuth flow client for Bio-ID SSO.
|
|
@@ -28,6 +30,14 @@ declare class BioAuth {
|
|
|
28
30
|
* Store the state and codeVerifier securely (e.g. in a cookie) for the callback.
|
|
29
31
|
*/
|
|
30
32
|
getAuthorizationUrl(opts: AuthorizeOptions): AuthorizeResult;
|
|
33
|
+
/**
|
|
34
|
+
* Build an authorization URL with prompt=none for silent authentication.
|
|
35
|
+
*
|
|
36
|
+
* Useful for checking if the user has an existing session without showing
|
|
37
|
+
* a login screen. If the user is not authenticated, Bio-ID redirects back
|
|
38
|
+
* with an `error=login_required` query parameter instead of showing UI.
|
|
39
|
+
*/
|
|
40
|
+
silentAuth(opts: SilentAuthOptions): AuthorizeResult;
|
|
31
41
|
/**
|
|
32
42
|
* Exchange an authorization code for tokens.
|
|
33
43
|
*
|
|
@@ -240,4 +250,4 @@ declare function isTokenExpired(token: string, bufferSeconds?: number): boolean;
|
|
|
240
250
|
*/
|
|
241
251
|
declare function verifyTokenJWKS(token: string, options?: JWKSVerifyOptions): Promise<BioTokenPayload>;
|
|
242
252
|
|
|
243
|
-
export { AuthorizeOptions, AuthorizeResult, BioAdmin, BioAdminConfig, BioAuth, BioAuthConfig, BioDepartment, BioError, BioOAuthClient, BioRole, BioTokenPayload, BioUser, CreateClientData, CreateDepartmentData, CreateRoleData, EmbedAuthResult, EmbedClient, EmbedClientConfig, EmbedLoginParams, EmbedLogoutParams, EmbedMagicLinkParams, EmbedRefreshParams, EmbedSignupParams, EmbedVerifyParams, IntrospectResult, JWKSVerifyOptions, TokenResponse, UpdateUserData, UserFilters, VerifyOptions, decodeToken, generatePKCE, isTokenExpired, verifyToken, verifyTokenJWKS };
|
|
253
|
+
export { AuthorizeOptions, AuthorizeResult, BioAdmin, BioAdminConfig, BioAuth, BioAuthConfig, BioDepartment, BioError, BioOAuthClient, BioRole, BioTokenPayload, BioUser, CreateClientData, CreateDepartmentData, CreateRoleData, EmbedAuthResult, EmbedClient, EmbedClientConfig, EmbedLoginParams, EmbedLogoutParams, EmbedMagicLinkParams, EmbedRefreshParams, EmbedSignupParams, EmbedVerifyParams, IntrospectResult, JWKSVerifyOptions, SilentAuthOptions, TokenResponse, UpdateUserData, UserFilters, VerifyOptions, decodeToken, generatePKCE, isTokenExpired, verifyToken, verifyTokenJWKS };
|