@fanvue/builder-sdk 0.3.0 → 0.4.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/README.md +77 -1
- package/dist/bridge/index.d.ts +2 -0
- package/dist/bridge/index.js +3 -0
- package/dist/bridge-CGVtI3hr.js +336 -0
- package/dist/bridge-CGVtI3hr.js.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core-BqdYUMrJ.js +1653 -0
- package/dist/core-BqdYUMrJ.js.map +1 -0
- package/dist/index-BRDYLBlc.d.ts +223 -0
- package/dist/index-BRDYLBlc.d.ts.map +1 -0
- package/dist/{index-CweVyIKX.d.ts → index-C4ewLil3.d.ts} +2 -2
- package/dist/{index-CweVyIKX.d.ts.map → index-C4ewLil3.d.ts.map} +1 -1
- package/dist/index-ClbZoV_Z.d.ts +420 -0
- package/dist/index-ClbZoV_Z.d.ts.map +1 -0
- package/dist/{index-pS9wR5yg.d.ts → index-Dr-mZ0qP.d.ts} +500 -901
- package/dist/index-Dr-mZ0qP.d.ts.map +1 -0
- package/dist/nextjs/embedded-app/index.d.ts +2 -2
- package/dist/nextjs/embedded-app/index.js +3 -2
- package/dist/nextjs/embedded-app/index.js.map +1 -1
- package/dist/nextjs/off-platform/index.d.ts +2 -2
- package/dist/nextjs/off-platform/index.js +3 -2
- package/dist/nextjs/off-platform/index.js.map +1 -1
- package/dist/{nextjs-CESI_EiU.js → nextjs-B5Tqgt_n.js} +2 -2
- package/dist/{nextjs-CESI_EiU.js.map → nextjs-B5Tqgt_n.js.map} +1 -1
- package/dist/react/index.d.ts +37 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +61 -2
- package/dist/react/index.js.map +1 -1
- package/dist/{core-CvVOMyqr.js → schemas-DbyHF7Xi.js} +261 -1662
- package/dist/schemas-DbyHF7Xi.js.map +1 -0
- package/package.json +20 -16
- package/dist/core-CvVOMyqr.js.map +0 -1
- package/dist/index-pS9wR5yg.d.ts.map +0 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { _ as $strip, a as ZodEnum, c as ZodNumber, d as ZodRecord, f as ZodString, h as output, l as ZodObject, m as ZodUnknown, n as ZodArray, o as ZodLiteral, p as ZodUnion, r as ZodBoolean, t as Result, u as ZodOptional } from "./index-Dr-mZ0qP.js";
|
|
2
|
+
|
|
3
|
+
//#region src/bridge/protocol.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The bridge protocol version spoken by this SDK.
|
|
6
|
+
*
|
|
7
|
+
* Both sides send it on every message. Changes within a version must be
|
|
8
|
+
* additive; anything breaking increments the version, and the host answers the
|
|
9
|
+
* handshake with the highest version both sides speak.
|
|
10
|
+
*/
|
|
11
|
+
declare const BRIDGE_VERSION = 1;
|
|
12
|
+
/**
|
|
13
|
+
* Message type the embedded app posts to the host to open a handshake.
|
|
14
|
+
*
|
|
15
|
+
* An app may re-announce (it re-posts `ready` until a `hello` lands, in case
|
|
16
|
+
* the host attached its listener late).
|
|
17
|
+
*/
|
|
18
|
+
declare const BRIDGE_READY_TYPE = "fanvue:bridge:ready";
|
|
19
|
+
/**
|
|
20
|
+
* Message type the host posts back, carrying the granted capabilities and the port.
|
|
21
|
+
*
|
|
22
|
+
* The host answers each verified `ready` with a fresh `hello` and port,
|
|
23
|
+
* closing the prior port; the app adopts the newest `hello`.
|
|
24
|
+
*/
|
|
25
|
+
declare const BRIDGE_HELLO_TYPE = "fanvue:bridge:hello";
|
|
26
|
+
/** Capability namespace for analytics (`analytics.track`). */
|
|
27
|
+
declare const ANALYTICS_CAPABILITY = "analytics";
|
|
28
|
+
/** Method name for tracking an analytics event. */
|
|
29
|
+
declare const ANALYTICS_TRACK_METHOD = "track";
|
|
30
|
+
/** The host capabilities an app can be granted. Grants are resolved server-side. */
|
|
31
|
+
declare const bridgeCapabilitySchema: ZodEnum<{
|
|
32
|
+
analytics: "analytics";
|
|
33
|
+
}>;
|
|
34
|
+
/** A host capability an app can be granted. */
|
|
35
|
+
type BridgeCapability = output<typeof bridgeCapabilitySchema>;
|
|
36
|
+
/**
|
|
37
|
+
* Error codes the host can return for a request.
|
|
38
|
+
*
|
|
39
|
+
* - `capability_denied` — the app was not granted the requested capability.
|
|
40
|
+
* - `invalid_payload` — the payload failed the host's schema for the method.
|
|
41
|
+
* - `rate_limited` — the app exceeded the host's budget for the method.
|
|
42
|
+
* - `internal` — the host handler failed unexpectedly.
|
|
43
|
+
*/
|
|
44
|
+
declare const bridgeErrorCodeSchema: ZodEnum<{
|
|
45
|
+
capability_denied: "capability_denied";
|
|
46
|
+
invalid_payload: "invalid_payload";
|
|
47
|
+
rate_limited: "rate_limited";
|
|
48
|
+
internal: "internal";
|
|
49
|
+
}>;
|
|
50
|
+
/** An error code the host can return for a request. */
|
|
51
|
+
type BridgeErrorCode = output<typeof bridgeErrorCodeSchema>;
|
|
52
|
+
/** Schema for the `ready` message an app posts to `window.parent`. */
|
|
53
|
+
declare const bridgeReadyMessageSchema: ZodObject<{
|
|
54
|
+
type: ZodLiteral<"fanvue:bridge:ready">;
|
|
55
|
+
v: ZodLiteral<1>;
|
|
56
|
+
}, $strip>;
|
|
57
|
+
/** The `ready` message an app posts to `window.parent` to open a handshake. */
|
|
58
|
+
type BridgeReadyMessage = output<typeof bridgeReadyMessageSchema>;
|
|
59
|
+
/** Schema for the `hello` message the host posts back with the transferred port. */
|
|
60
|
+
declare const bridgeHelloMessageSchema: ZodObject<{
|
|
61
|
+
type: ZodLiteral<"fanvue:bridge:hello">;
|
|
62
|
+
v: ZodLiteral<1>;
|
|
63
|
+
capabilities: ZodArray<ZodEnum<{
|
|
64
|
+
analytics: "analytics";
|
|
65
|
+
}>>;
|
|
66
|
+
}, $strip>;
|
|
67
|
+
/** The `hello` message the host posts back, alongside the transferred port. */
|
|
68
|
+
type BridgeHelloMessage = output<typeof bridgeHelloMessageSchema>;
|
|
69
|
+
/**
|
|
70
|
+
* Schema for a request sent app → host over the port.
|
|
71
|
+
*
|
|
72
|
+
* Capability and method names are bounded so a misbehaving sender cannot make
|
|
73
|
+
* either side hold or log arbitrarily large strings.
|
|
74
|
+
*/
|
|
75
|
+
declare const bridgeRequestSchema: ZodObject<{
|
|
76
|
+
v: ZodLiteral<1>;
|
|
77
|
+
id: ZodString;
|
|
78
|
+
kind: ZodLiteral<"request">;
|
|
79
|
+
capability: ZodString;
|
|
80
|
+
method: ZodString;
|
|
81
|
+
payload: ZodUnknown;
|
|
82
|
+
}, $strip>;
|
|
83
|
+
/** A request sent app → host over the port, correlated to a response by `id`. */
|
|
84
|
+
type BridgeRequest = output<typeof bridgeRequestSchema>;
|
|
85
|
+
/**
|
|
86
|
+
* Schema for a response sent host → app over the port.
|
|
87
|
+
*
|
|
88
|
+
* The `id` and `error.message` are bounded like the request fields, so a
|
|
89
|
+
* misbehaving host cannot push oversized strings into the app.
|
|
90
|
+
*/
|
|
91
|
+
declare const bridgeResponseSchema: ZodObject<{
|
|
92
|
+
v: ZodLiteral<1>;
|
|
93
|
+
id: ZodString;
|
|
94
|
+
kind: ZodLiteral<"response">;
|
|
95
|
+
ok: ZodBoolean;
|
|
96
|
+
result: ZodOptional<ZodUnknown>;
|
|
97
|
+
error: ZodOptional<ZodObject<{
|
|
98
|
+
code: ZodEnum<{
|
|
99
|
+
capability_denied: "capability_denied";
|
|
100
|
+
invalid_payload: "invalid_payload";
|
|
101
|
+
rate_limited: "rate_limited";
|
|
102
|
+
internal: "internal";
|
|
103
|
+
}>;
|
|
104
|
+
message: ZodString;
|
|
105
|
+
}, $strip>>;
|
|
106
|
+
}, $strip>;
|
|
107
|
+
/** A response sent host → app over the port, correlated to a request by `id`. */
|
|
108
|
+
type BridgeResponse = output<typeof bridgeResponseSchema>;
|
|
109
|
+
/**
|
|
110
|
+
* Event names an app may emit.
|
|
111
|
+
*
|
|
112
|
+
* The host prefixes every name with `embedded_app_` before it reaches
|
|
113
|
+
* Amplitude, so an app can never emit a core platform event. Names are
|
|
114
|
+
* snake_case to match the platform's tracking-plan convention.
|
|
115
|
+
*/
|
|
116
|
+
declare const analyticsEventNameSchema: ZodString;
|
|
117
|
+
/**
|
|
118
|
+
* Properties attached to an analytics event: a flat record of short scalars.
|
|
119
|
+
*
|
|
120
|
+
* Nesting is rejected so the payload stays cheap to validate and to read in
|
|
121
|
+
* Amplitude, and `$`-prefixed keys are rejected because Amplitude reserves them.
|
|
122
|
+
* Numbers must be finite — `Infinity` and `NaN` do not survive serialisation.
|
|
123
|
+
*/
|
|
124
|
+
declare const analyticsPropertiesSchema: ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>;
|
|
125
|
+
/** Schema for the payload of `analytics.track`. */
|
|
126
|
+
declare const analyticsTrackPayloadSchema: ZodObject<{
|
|
127
|
+
eventName: ZodString;
|
|
128
|
+
properties: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean]>>>;
|
|
129
|
+
}, $strip>;
|
|
130
|
+
/** The payload of `analytics.track`. */
|
|
131
|
+
type AnalyticsTrackPayload = output<typeof analyticsTrackPayloadSchema>;
|
|
132
|
+
/** Properties attached to an analytics event. */
|
|
133
|
+
type AnalyticsProperties = output<typeof analyticsPropertiesSchema>;
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/bridge/bridge.d.ts
|
|
136
|
+
/**
|
|
137
|
+
* Why a bridge request failed.
|
|
138
|
+
*
|
|
139
|
+
* Beyond the codes the host can return, the SDK adds `TIMEOUT` (the host never
|
|
140
|
+
* answered) and `PORT_CLOSED` (the message could not be put on the port —
|
|
141
|
+
* in practice the payload was not structured-cloneable). Note that
|
|
142
|
+
* `postMessage` on a closed port silently drops rather than throwing, so a
|
|
143
|
+
* torn-down host surfaces as `TIMEOUT`, not `PORT_CLOSED`.
|
|
144
|
+
*/
|
|
145
|
+
interface BridgeRequestError {
|
|
146
|
+
code: BridgeErrorCode | 'TIMEOUT' | 'PORT_CLOSED';
|
|
147
|
+
message: string;
|
|
148
|
+
}
|
|
149
|
+
/** The analytics capability, as exposed on a connected bridge. */
|
|
150
|
+
interface FanvueBridgeAnalytics {
|
|
151
|
+
track: (eventName: string, properties?: AnalyticsProperties) => Promise<Result<void, BridgeRequestError>>;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* A live connection to the Fanvue host page.
|
|
155
|
+
*
|
|
156
|
+
* @property capabilities - The capabilities the host granted this app.
|
|
157
|
+
* @property has - Whether a given capability was granted. Checking is
|
|
158
|
+
* optional: calling a capability without checking is safe and returns
|
|
159
|
+
* `capability_denied`.
|
|
160
|
+
* @property analytics - Fires events through the host page's Amplitude client.
|
|
161
|
+
*/
|
|
162
|
+
interface FanvueBridge {
|
|
163
|
+
capabilities: readonly BridgeCapability[];
|
|
164
|
+
has: (capability: BridgeCapability) => boolean;
|
|
165
|
+
analytics: FanvueBridgeAnalytics;
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/bridge/connect.d.ts
|
|
169
|
+
/**
|
|
170
|
+
* Why connecting to the host failed.
|
|
171
|
+
*
|
|
172
|
+
* - `NOT_EMBEDDED` — the app is not running in an iframe, so there is no host.
|
|
173
|
+
* - `TIMEOUT` — no `hello` arrived. The page is framed by something other than
|
|
174
|
+
* Fanvue, or Fanvue refused the handshake (unregistered embed origin).
|
|
175
|
+
*/
|
|
176
|
+
interface BridgeConnectError {
|
|
177
|
+
code: 'NOT_EMBEDDED' | 'TIMEOUT';
|
|
178
|
+
message: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Options for {@link connectFanvueBridge}.
|
|
182
|
+
*
|
|
183
|
+
* @property timeoutMs - How long to wait for the host's `hello`. Defaults to 3000.
|
|
184
|
+
*/
|
|
185
|
+
interface ConnectFanvueBridgeOptions {
|
|
186
|
+
timeoutMs?: number;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Opens the capability bridge to the Fanvue page hosting this app.
|
|
190
|
+
*
|
|
191
|
+
* Posts `fanvue:bridge:ready` to `window.parent` and waits for the host's
|
|
192
|
+
* `fanvue:bridge:hello`, which names the granted capabilities and transfers the
|
|
193
|
+
* `MessagePort` all later traffic flows over. The host verifies the frame's
|
|
194
|
+
* origin before replying, so a page framed by anything other than its
|
|
195
|
+
* registered Fanvue surface simply times out.
|
|
196
|
+
*
|
|
197
|
+
* `ready` is re-posted every 500ms until a `hello` lands (or the timeout
|
|
198
|
+
* fires), because the host may attach its listener after the app's first
|
|
199
|
+
* announce. The host answers each verified `ready` with a fresh `hello` and
|
|
200
|
+
* port, closing the prior port — so the bridge keeps listening for the
|
|
201
|
+
* lifetime of the connection and adopts the newest `hello` by swapping onto
|
|
202
|
+
* its port. Requests in flight on a superseded port fail by their timeouts.
|
|
203
|
+
*
|
|
204
|
+
* Calling this again is safe and is how an app reconnects after the iframe
|
|
205
|
+
* reloads: the host closes the previous port and re-handshakes.
|
|
206
|
+
*
|
|
207
|
+
* Failure is not exceptional — apps are expected to keep working standalone
|
|
208
|
+
* (local dev, previews) where the connection never succeeds.
|
|
209
|
+
*
|
|
210
|
+
* @param options - Optional overrides (e.g. a shorter `timeoutMs`).
|
|
211
|
+
* @returns A `Result` with the connected {@link FanvueBridge}, or a
|
|
212
|
+
* {@link BridgeConnectError} when there is no host to talk to.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* const result = await connectFanvueBridge();
|
|
216
|
+
* if (result.isOk() && result.value.has('analytics')) {
|
|
217
|
+
* await result.value.analytics.track('course_created', { chapters: 4 });
|
|
218
|
+
* }
|
|
219
|
+
*/
|
|
220
|
+
declare function connectFanvueBridge(options?: ConnectFanvueBridgeOptions): Promise<Result<FanvueBridge, BridgeConnectError>>;
|
|
221
|
+
//#endregion
|
|
222
|
+
export { bridgeCapabilitySchema as C, bridgeRequestSchema as D, bridgeReadyMessageSchema as E, bridgeResponseSchema as O, analyticsTrackPayloadSchema as S, bridgeHelloMessageSchema as T, BridgeReadyMessage as _, FanvueBridge as a, analyticsEventNameSchema as b, ANALYTICS_TRACK_METHOD as c, BRIDGE_HELLO_TYPE as d, BRIDGE_READY_TYPE as f, BridgeHelloMessage as g, BridgeErrorCode as h, BridgeRequestError as i, AnalyticsProperties as l, BridgeCapability as m, ConnectFanvueBridgeOptions as n, FanvueBridgeAnalytics as o, BRIDGE_VERSION as p, connectFanvueBridge as r, ANALYTICS_CAPABILITY as s, BridgeConnectError as t, AnalyticsTrackPayload as u, BridgeRequest as v, bridgeErrorCodeSchema as w, analyticsPropertiesSchema as x, BridgeResponse as y };
|
|
223
|
+
//# sourceMappingURL=index-BRDYLBlc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BRDYLBlc.d.ts","names":[],"sources":["../src/bridge/protocol.ts","../src/bridge/bridge.ts","../src/bridge/connect.ts"],"mappings":";;;;;AASA;;;;;cAAa,cAAA;;;;;AAgBb;;cARa,iBAAA;;;AAWb;;;;cAHa,iBAAA;AAMb;AAAA,cAHa,oBAAA;;cAGA,sBAAA;;cAGA,sBAAA,EAAsB,OAAA;;;;KAGvB,gBAAA,GAAmB,MAAA,QAAe,sBAAA;;;;;AAA9C;;;;cAUa,qBAAA,EAAqB,OAAA;;;;;;;KAQtB,eAAA,GAAkB,MAAA,QAAe,qBAAA;;cAGhC,wBAAA,EAAwB,SAAA;;;;;KAMzB,kBAAA,GAAqB,MAAA,QAAe,wBAAA;;cAGnC,wBAAA,EAAwB,SAAA;;;;;;;;KAOzB,kBAAA,GAAqB,MAAA,QAAe,wBAAA;;AAhBhD;;;;;cAwBa,mBAAA,EAAmB,SAAA;;;;;;;;;KAUpB,aAAA,GAAgB,MAAA,QAAe,mBAAA;;;;;;;cAQ9B,oBAAA,EAAoB,SAAA;;;;;;;;;;;;;;;;;KAUrB,cAAA,GAAiB,MAAA,QAAe,oBAAA;;;;;;;;cAS/B,wBAAA,EAAwB,SAAA;;;;;;;;cA0BxB,yBAAA,EAAyB,SAAA,CAAA,SAAA,EAAA,QAAA,WAAA,SAAA,EAAA,SAAA,EAAA,UAAA;;cAazB,2BAAA,EAA2B,SAAA;;;;;KAM5B,qBAAA,GAAwB,MAAA,QAAe,2BAAA;;KAGvC,mBAAA,GAAsB,MAAA,QAAe,yBAAA;;;;AA9JjD;;;;;AAQA;;;UCUiB,kBAAA;EACf,IAAA,EAAM,eAAA;EACN,OAAA;AAAA;;UAIe,qBAAA;EACf,KAAA,GACE,SAAA,UACA,UAAA,GAAa,mBAAA,KACV,OAAA,CAAQ,MAAA,OAAa,kBAAA;AAAA;;;;;ADN5B;;;;;UCkBiB,YAAA;EACf,YAAA,WAAuB,gBAAA;EACvB,GAAA,GAAM,UAAA,EAAY,gBAAA;EAClB,SAAA,EAAW,qBAAA;AAAA;;;;AD3Cb;;;;;AAQA;UEkBiB,kBAAA;EACf,IAAA;EACA,OAAA;AAAA;AFZF;;;;;AAAA,UEoBiB,0BAAA;EACf,SAAA;AAAA;;;AFfF;;;;;AAGA;;;;;;;;;AAGA;;;;;;;;;AAUA;;;;;;;iBEkCgB,mBAAA,CACd,OAAA,GAAU,0BAAA,GACT,OAAA,CAAQ,MAAA,CAAO,YAAA,EAAc,kBAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as OAuthConfig } from "./index-
|
|
1
|
+
import { C as OAuthConfig } from "./index-ClbZoV_Z.js";
|
|
2
2
|
|
|
3
3
|
//#region src/nextjs/index.d.ts
|
|
4
4
|
/**
|
|
@@ -45,4 +45,4 @@ type ResolvedConfig = OAuthConfig & {
|
|
|
45
45
|
declare function createConfig(opts?: FanvueAuthOptions): ResolvedConfig;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { ResolvedConfig as n, createConfig as r, FanvueAuthOptions as t };
|
|
48
|
-
//# sourceMappingURL=index-
|
|
48
|
+
//# sourceMappingURL=index-C4ewLil3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-C4ewLil3.d.ts","names":[],"sources":["../src/nextjs/index.ts"],"mappings":";;;;;AAcA;;;;;;KAAY,iBAAA;EACV,QAAA;EACA,YAAA;EACA,WAAA;EACA,SAAA;EACA,UAAA;EACA,MAAA;EACA,aAAA;EACA,iBAAA;EACA,YAAA;EACA,MAAA;EACA,OAAA;AAAA;;;;;;;KASU,cAAA,GAAiB,WAAA;EAC3B,aAAA;EACA,iBAAA;EACA,OAAA;AAAA;;;;;;;;;;iBAYc,YAAA,CAAa,IAAA,GAAO,iBAAA,GAAoB,cAAA"}
|
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { _ as $strip, c as ZodNumber, f as ZodString, g as $loose, i as ZodDefault, l as ZodObject, r as ZodBoolean, s as ZodNullable, t as Result, u as ZodOptional } from "./index-Dr-mZ0qP.js";
|
|
2
|
+
|
|
3
|
+
//#region src/core/constants.d.ts
|
|
4
|
+
/** The `Bearer ` token prefix (includes trailing space). */
|
|
5
|
+
declare const BEARER_PREFIX: "Bearer ";
|
|
6
|
+
/** Response header carrying a refreshed session JWT back to the client. */
|
|
7
|
+
declare const HEADER_UPDATED_SESSION: "X-Updated-Session";
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/core/defaults.d.ts
|
|
10
|
+
/** Default OAuth scopes requested during authorization. */
|
|
11
|
+
declare const DEFAULT_SCOPES: "openid offline_access offline";
|
|
12
|
+
/** Default OAuth issuer URL for Fanvue authentication. */
|
|
13
|
+
declare const DEFAULT_ISSUER_URL: "https://auth.fanvue.com";
|
|
14
|
+
/** Default base URL for the Fanvue API. */
|
|
15
|
+
declare const DEFAULT_API_BASE_URL: "https://api.fanvue.com";
|
|
16
|
+
/** Default base URL for the Fanvue platform (embedded authorize-on-behalf). */
|
|
17
|
+
declare const DEFAULT_PLATFORM_URL: "https://www.fanvue.com";
|
|
18
|
+
/** The Fanvue API version header value sent with every request. */
|
|
19
|
+
declare const API_VERSION: "2025-06-26";
|
|
20
|
+
/**
|
|
21
|
+
* Validates that a URL belongs to the `fanvue.com` domain.
|
|
22
|
+
*
|
|
23
|
+
* @param url - The URL string to validate.
|
|
24
|
+
* @throws If the URL is malformed or its hostname is not `fanvue.com`
|
|
25
|
+
* (or a subdomain of it).
|
|
26
|
+
*/
|
|
27
|
+
declare function assertFanvueDomain(url: string): void;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/core/types.d.ts
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for the OAuth client.
|
|
32
|
+
*
|
|
33
|
+
* @property clientId - The OAuth client ID.
|
|
34
|
+
* @property clientSecret - The OAuth client secret.
|
|
35
|
+
* @property redirectUri - The URI to redirect to after authentication.
|
|
36
|
+
* @property issuerUrl - The OAuth issuer URL, or `null` to use the default.
|
|
37
|
+
* @property apiBaseUrl - The Fanvue API base URL, or `null` to use the default.
|
|
38
|
+
* @property scopes - Additional OAuth scopes to request beyond the defaults, or `null` for defaults only.
|
|
39
|
+
* @property responseMode - The OAuth response mode (e.g., `fragment`), or `null` to omit.
|
|
40
|
+
* @property prompt - The OAuth prompt parameter (e.g., `consent`), or `null` to omit.
|
|
41
|
+
*/
|
|
42
|
+
interface OAuthConfig {
|
|
43
|
+
clientId: string;
|
|
44
|
+
clientSecret: string;
|
|
45
|
+
redirectUri: string;
|
|
46
|
+
issuerUrl: string | null;
|
|
47
|
+
apiBaseUrl: string | null;
|
|
48
|
+
scopes: string | null;
|
|
49
|
+
responseMode: string | null;
|
|
50
|
+
prompt: string | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The raw token response returned by the OAuth token endpoint.
|
|
54
|
+
*
|
|
55
|
+
* @property access_token - The access token issued by the authorization server.
|
|
56
|
+
* @property refresh_token - The refresh token, or `null` if not provided.
|
|
57
|
+
* @property expires_in - The lifetime in seconds of the access token.
|
|
58
|
+
* @property token_type - The type of the token (e.g., `Bearer`).
|
|
59
|
+
* @property scope - The scope of the access token, or `null` if not provided.
|
|
60
|
+
* @property id_token - The ID token, or `null` if not provided.
|
|
61
|
+
*/
|
|
62
|
+
interface TokenResponse {
|
|
63
|
+
access_token: string;
|
|
64
|
+
refresh_token: string | null;
|
|
65
|
+
expires_in: number;
|
|
66
|
+
token_type: string;
|
|
67
|
+
scope: string | null;
|
|
68
|
+
id_token: string | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The payload stored inside the encrypted session JWT.
|
|
72
|
+
*
|
|
73
|
+
* @property accessToken - The OAuth access token.
|
|
74
|
+
* @property refreshToken - The OAuth refresh token, or `null` if unavailable.
|
|
75
|
+
* @property expiresAt - The timestamp (in milliseconds) when the access token expires.
|
|
76
|
+
* @property tokenType - The type of the token (e.g., `Bearer`), or `null` if unavailable.
|
|
77
|
+
* @property scope - The granted scope, or `null` if unavailable.
|
|
78
|
+
* @property idToken - The ID token, or `null` if unavailable.
|
|
79
|
+
* @property userUuid - The unique identifier of the authenticated user.
|
|
80
|
+
* @property handle - The user's handle/username.
|
|
81
|
+
* @property displayName - The user's display name.
|
|
82
|
+
* @property isCreator - Whether the user is a creator.
|
|
83
|
+
* @property avatarUrl - The URL of the user's avatar, or `null` if not set.
|
|
84
|
+
*/
|
|
85
|
+
interface SessionPayload {
|
|
86
|
+
accessToken: string;
|
|
87
|
+
refreshToken: string | null;
|
|
88
|
+
expiresAt: number;
|
|
89
|
+
tokenType: string | null;
|
|
90
|
+
scope: string | null;
|
|
91
|
+
idToken: string | null;
|
|
92
|
+
userUuid: string;
|
|
93
|
+
handle: string;
|
|
94
|
+
displayName: string;
|
|
95
|
+
isCreator: boolean;
|
|
96
|
+
avatarUrl: string | null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A Fanvue user profile as returned by the API.
|
|
100
|
+
*
|
|
101
|
+
* @property uuid - The unique identifier of the user.
|
|
102
|
+
* @property email - The user's email address.
|
|
103
|
+
* @property handle - The user's handle/username.
|
|
104
|
+
* @property displayName - The user's display name.
|
|
105
|
+
* @property isCreator - Whether the user is a creator.
|
|
106
|
+
* @property avatarUrl - The URL of the user's avatar, or `null` if not set.
|
|
107
|
+
* @property bannerUrl - The URL of the user's banner, or `null` if not set.
|
|
108
|
+
* @property createdAt - The ISO 8601 timestamp of when the user was created.
|
|
109
|
+
* @property updatedAt - The ISO 8601 timestamp of when the user was last updated, or `null`.
|
|
110
|
+
*/
|
|
111
|
+
interface FanvueUser {
|
|
112
|
+
uuid: string;
|
|
113
|
+
email: string;
|
|
114
|
+
handle: string;
|
|
115
|
+
displayName: string;
|
|
116
|
+
isCreator: boolean;
|
|
117
|
+
avatarUrl: string | null;
|
|
118
|
+
bannerUrl: string | null;
|
|
119
|
+
createdAt: string;
|
|
120
|
+
updatedAt: string | null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Configuration for the embedded-app (delegated authorize-on-behalf) flow.
|
|
124
|
+
*
|
|
125
|
+
* Extends {@link OAuthConfig} with the Fanvue platform base URL that hosts
|
|
126
|
+
* the `authorize-on-behalf` endpoint.
|
|
127
|
+
*
|
|
128
|
+
* @property platformUrl - The Fanvue platform base URL, or `null` to use the default.
|
|
129
|
+
*/
|
|
130
|
+
interface EmbeddedAuthConfig extends OAuthConfig {
|
|
131
|
+
platformUrl: string | null;
|
|
132
|
+
}
|
|
133
|
+
/** Error type for JSON parsing failures. */
|
|
134
|
+
type JsonParseError = {
|
|
135
|
+
code: 'JSON_PARSE_ERROR';
|
|
136
|
+
rawText: string;
|
|
137
|
+
message: string;
|
|
138
|
+
};
|
|
139
|
+
/** Error type for OAuth operations (token exchange, refresh). */
|
|
140
|
+
type OAuthError = {
|
|
141
|
+
code: 'TOKEN_EXCHANGE_FAILED';
|
|
142
|
+
statusCode: number;
|
|
143
|
+
message: string;
|
|
144
|
+
} | {
|
|
145
|
+
code: 'TOKEN_REFRESH_FAILED';
|
|
146
|
+
statusCode: number;
|
|
147
|
+
message: string;
|
|
148
|
+
} | {
|
|
149
|
+
code: 'OAUTH_JSON_PARSE_ERROR';
|
|
150
|
+
rawText: string;
|
|
151
|
+
message: string;
|
|
152
|
+
} | {
|
|
153
|
+
code: 'OAUTH_VALIDATION_ERROR';
|
|
154
|
+
message: string;
|
|
155
|
+
};
|
|
156
|
+
/** Error type for Fanvue API requests. */
|
|
157
|
+
type ApiError = {
|
|
158
|
+
code: 'API_REQUEST_FAILED';
|
|
159
|
+
statusCode: number;
|
|
160
|
+
message: string;
|
|
161
|
+
} | {
|
|
162
|
+
code: 'API_JSON_PARSE_ERROR';
|
|
163
|
+
rawText: string;
|
|
164
|
+
message: string;
|
|
165
|
+
} | {
|
|
166
|
+
code: 'API_VALIDATION_ERROR';
|
|
167
|
+
message: string;
|
|
168
|
+
};
|
|
169
|
+
/** Error type for session JWT verification. */
|
|
170
|
+
type SessionVerifyError = {
|
|
171
|
+
code: 'JWT_VERIFY_FAILED';
|
|
172
|
+
message: string;
|
|
173
|
+
} | {
|
|
174
|
+
code: 'SESSION_VALIDATION_ERROR';
|
|
175
|
+
message: string;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Error type for the embedded authorize-on-behalf step.
|
|
179
|
+
*
|
|
180
|
+
* - `SESSION_TOKEN_REJECTED` — the platform rejected the session token
|
|
181
|
+
* (missing, malformed, or expired — they live ~60 seconds). The user must
|
|
182
|
+
* reopen the embedded surface to receive a fresh one.
|
|
183
|
+
* - `CONSENT_REQUIRED` — the creator has not approved (or has revoked) the
|
|
184
|
+
* in-platform consent for this app. Consent is granted in the Fanvue UI;
|
|
185
|
+
* the app cannot create it.
|
|
186
|
+
* - `AUTHORIZE_ON_BEHALF_FAILED` — any other failure (network error,
|
|
187
|
+
* unexpected status). `statusCode` is `0` for network errors.
|
|
188
|
+
* - `AUTHORIZE_STATE_MISMATCH` — the returned `state` did not match the one
|
|
189
|
+
* sent; the response must not be trusted.
|
|
190
|
+
*/
|
|
191
|
+
type EmbeddedAuthError = {
|
|
192
|
+
code: 'SESSION_TOKEN_REJECTED';
|
|
193
|
+
statusCode: number;
|
|
194
|
+
message: string;
|
|
195
|
+
} | {
|
|
196
|
+
code: 'CONSENT_REQUIRED';
|
|
197
|
+
statusCode: number;
|
|
198
|
+
message: string;
|
|
199
|
+
} | {
|
|
200
|
+
code: 'AUTHORIZE_ON_BEHALF_FAILED';
|
|
201
|
+
statusCode: number;
|
|
202
|
+
message: string;
|
|
203
|
+
} | {
|
|
204
|
+
code: 'AUTHORIZE_STATE_MISMATCH';
|
|
205
|
+
message: string;
|
|
206
|
+
} | {
|
|
207
|
+
code: 'EMBEDDED_JSON_PARSE_ERROR';
|
|
208
|
+
rawText: string;
|
|
209
|
+
message: string;
|
|
210
|
+
} | {
|
|
211
|
+
code: 'EMBEDDED_VALIDATION_ERROR';
|
|
212
|
+
message: string;
|
|
213
|
+
};
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/core/oauth.d.ts
|
|
216
|
+
/**
|
|
217
|
+
* Builds an OAuth 2.0 authorization URL with PKCE parameters.
|
|
218
|
+
*
|
|
219
|
+
* @param config - The OAuth configuration.
|
|
220
|
+
* @param opts - Optional overrides. Pass `state` to use a deterministic state value.
|
|
221
|
+
* @returns The authorization URL, the PKCE code verifier, and the state parameter.
|
|
222
|
+
*/
|
|
223
|
+
declare function createAuthorizationUrl(config: OAuthConfig, opts?: {
|
|
224
|
+
state: string | null;
|
|
225
|
+
} | null): Promise<{
|
|
226
|
+
url: URL;
|
|
227
|
+
codeVerifier: string;
|
|
228
|
+
state: string;
|
|
229
|
+
}>;
|
|
230
|
+
/**
|
|
231
|
+
* Exchanges an authorization code for tokens using the OAuth token endpoint.
|
|
232
|
+
*
|
|
233
|
+
* @param config - The OAuth configuration.
|
|
234
|
+
* @param opts - The authorization code, PKCE code verifier, and optional redirect URI override.
|
|
235
|
+
* @returns A `Result` containing `TokenResponse` on success or `OAuthError` on failure.
|
|
236
|
+
*/
|
|
237
|
+
declare function exchangeCodeForToken(config: OAuthConfig, opts: {
|
|
238
|
+
code: string;
|
|
239
|
+
codeVerifier: string;
|
|
240
|
+
redirectUri: string | null;
|
|
241
|
+
}): Promise<Result<TokenResponse, OAuthError>>;
|
|
242
|
+
/**
|
|
243
|
+
* Refreshes an access token using a refresh token.
|
|
244
|
+
*
|
|
245
|
+
* @param config - The OAuth configuration.
|
|
246
|
+
* @param refreshToken - The refresh token to use.
|
|
247
|
+
* @returns A `Result` containing `TokenResponse` on success or `OAuthError` on failure.
|
|
248
|
+
*/
|
|
249
|
+
declare function refreshAccessToken(config: OAuthConfig, refreshToken: string): Promise<Result<TokenResponse, OAuthError>>;
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/core/session.d.ts
|
|
252
|
+
/**
|
|
253
|
+
* Creates a signed JWT containing the given session payload.
|
|
254
|
+
*
|
|
255
|
+
* @param secret - The secret key used to sign the JWT.
|
|
256
|
+
* @param payload - The session data to embed in the token.
|
|
257
|
+
* @param expiresIn - How long until the token expires (e.g., `"30d"`), or `null` for the default (`"30d"`).
|
|
258
|
+
* @returns The signed JWT string.
|
|
259
|
+
*/
|
|
260
|
+
declare function createSessionJwt(secret: string, payload: SessionPayload, expiresIn?: string | null): Promise<string>;
|
|
261
|
+
/**
|
|
262
|
+
* Verifies a session JWT and returns the validated session payload.
|
|
263
|
+
*
|
|
264
|
+
* @param secret - The secret key used to verify the JWT signature.
|
|
265
|
+
* @param token - The JWT string to verify.
|
|
266
|
+
* @returns A {@link Result} containing the validated {@link SessionPayload}, or a {@link SessionVerifyError}.
|
|
267
|
+
*/
|
|
268
|
+
declare function verifySessionJwt(secret: string, token: string): Promise<Result<SessionPayload, SessionVerifyError>>;
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/core/embedded.d.ts
|
|
271
|
+
/**
|
|
272
|
+
* The creator's active colour scheme, as resolved by Fanvue.
|
|
273
|
+
*
|
|
274
|
+
* Fanvue resolves a creator's "system" preference to the scheme actually being
|
|
275
|
+
* rendered, so this is always a definite value — never `'system'`.
|
|
276
|
+
*/
|
|
277
|
+
type FanvueTheme = 'light' | 'dark';
|
|
278
|
+
/**
|
|
279
|
+
* Extracts the embedded session token from a URL.
|
|
280
|
+
*
|
|
281
|
+
* When Fanvue opens an embedded app, it loads the app's embed URL with a
|
|
282
|
+
* short-lived session token appended as a `?token=` query parameter.
|
|
283
|
+
*
|
|
284
|
+
* @param url - The URL to read the token from (e.g. `window.location.href`).
|
|
285
|
+
* @returns The session token, or `null` when absent or the URL is malformed.
|
|
286
|
+
*/
|
|
287
|
+
declare function getSessionTokenFromUrl(url: string | URL): string | null;
|
|
288
|
+
/**
|
|
289
|
+
* Extracts the creator's active colour scheme from a URL.
|
|
290
|
+
*
|
|
291
|
+
* When Fanvue opens an embedded app, it appends the creator's resolved colour
|
|
292
|
+
* scheme as a `?theme=` query parameter (`light` or `dark`), letting the app
|
|
293
|
+
* theme-match Fanvue.
|
|
294
|
+
*
|
|
295
|
+
* @param url - The URL to read the theme from (e.g. `window.location.href`).
|
|
296
|
+
* @returns The {@link FanvueTheme}, or `null` when absent, unrecognised, or the
|
|
297
|
+
* URL is malformed (e.g. the app was opened outside Fanvue).
|
|
298
|
+
*/
|
|
299
|
+
declare function getThemeFromUrl(url: string | URL): FanvueTheme | null;
|
|
300
|
+
/**
|
|
301
|
+
* Requests an authorization code from the Fanvue platform on behalf of the
|
|
302
|
+
* creator currently using the embedded app.
|
|
303
|
+
*
|
|
304
|
+
* This is the "authorize" half of the delegated flow: the platform verifies
|
|
305
|
+
* the session token, runs the OAuth authorize as the creator, and returns the
|
|
306
|
+
* resulting authorization code. The PKCE verifier and client secret never
|
|
307
|
+
* leave the caller — only the challenge is sent.
|
|
308
|
+
*
|
|
309
|
+
* Most apps should use {@link exchangeSessionToken}, which composes this with
|
|
310
|
+
* the code exchange.
|
|
311
|
+
*
|
|
312
|
+
* @param config - The embedded auth configuration.
|
|
313
|
+
* @param sessionToken - The short-lived session token received in the iframe.
|
|
314
|
+
* @param opts - The PKCE code challenge and state to bind the code to.
|
|
315
|
+
* @returns A `Result` containing the authorization code on success or
|
|
316
|
+
* {@link EmbeddedAuthError} on failure.
|
|
317
|
+
*/
|
|
318
|
+
declare function requestAuthorizationCodeOnBehalf(config: EmbeddedAuthConfig, sessionToken: string, opts: {
|
|
319
|
+
codeChallenge: string;
|
|
320
|
+
state: string;
|
|
321
|
+
}): Promise<Result<{
|
|
322
|
+
code: string;
|
|
323
|
+
}, EmbeddedAuthError>>;
|
|
324
|
+
/**
|
|
325
|
+
* Exchanges an embedded session token for OAuth access and refresh tokens.
|
|
326
|
+
*
|
|
327
|
+
* Runs the complete delegated authorize-on-behalf flow:
|
|
328
|
+
*
|
|
329
|
+
* 1. Generates a PKCE verifier/challenge pair and a random `state`.
|
|
330
|
+
* 2. Asks the Fanvue platform to authorize as the creator
|
|
331
|
+
* ({@link requestAuthorizationCodeOnBehalf}).
|
|
332
|
+
* 3. Exchanges the returned code at the token endpoint using the client
|
|
333
|
+
* secret and PKCE verifier.
|
|
334
|
+
*
|
|
335
|
+
* Must run server-side: it uses the client secret. The session token should
|
|
336
|
+
* be used promptly — it expires after ~60 seconds.
|
|
337
|
+
*
|
|
338
|
+
* @param config - The embedded auth configuration. `redirectUri` must be a
|
|
339
|
+
* redirect URI registered on the OAuth client (it is never visited; it only
|
|
340
|
+
* binds the authorization code).
|
|
341
|
+
* @param sessionToken - The short-lived session token received in the iframe.
|
|
342
|
+
* @returns A `Result` containing {@link TokenResponse} on success or an
|
|
343
|
+
* {@link EmbeddedAuthError} / {@link OAuthError} on failure.
|
|
344
|
+
*/
|
|
345
|
+
declare function exchangeSessionToken(config: EmbeddedAuthConfig, sessionToken: string): Promise<Result<TokenResponse, EmbeddedAuthError | OAuthError>>;
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/core/json.d.ts
|
|
348
|
+
/**
|
|
349
|
+
* Safely parses a JSON string, returning a `Result` instead of throwing.
|
|
350
|
+
*
|
|
351
|
+
* @param text - The raw text to parse as JSON.
|
|
352
|
+
* @returns `ok(parsed)` on success, or `err({ code, rawText, message })` on failure.
|
|
353
|
+
*/
|
|
354
|
+
declare function safeJsonParse(text: string): Result<unknown, JsonParseError>;
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/core/schemas.d.ts
|
|
357
|
+
/** Zod schema for the raw token response from the OAuth token endpoint. */
|
|
358
|
+
declare const TokenResponseSchema: ZodObject<{
|
|
359
|
+
access_token: ZodString;
|
|
360
|
+
refresh_token: ZodDefault<ZodOptional<ZodNullable<ZodString>>>;
|
|
361
|
+
expires_in: ZodNumber;
|
|
362
|
+
token_type: ZodString;
|
|
363
|
+
scope: ZodDefault<ZodOptional<ZodNullable<ZodString>>>;
|
|
364
|
+
id_token: ZodDefault<ZodOptional<ZodNullable<ZodString>>>;
|
|
365
|
+
}, $strip>;
|
|
366
|
+
/** Zod schema for a Fanvue user profile. */
|
|
367
|
+
declare const FanvueUserSchema: ZodObject<{
|
|
368
|
+
uuid: ZodString;
|
|
369
|
+
email: ZodString;
|
|
370
|
+
handle: ZodString;
|
|
371
|
+
displayName: ZodString;
|
|
372
|
+
isCreator: ZodBoolean;
|
|
373
|
+
avatarUrl: ZodNullable<ZodString>;
|
|
374
|
+
bannerUrl: ZodNullable<ZodString>;
|
|
375
|
+
createdAt: ZodString;
|
|
376
|
+
updatedAt: ZodNullable<ZodString>;
|
|
377
|
+
}, $strip>;
|
|
378
|
+
/** Zod schema for the authorize-on-behalf response from the Fanvue platform. */
|
|
379
|
+
declare const AuthorizeOnBehalfResponseSchema: ZodObject<{
|
|
380
|
+
code: ZodString;
|
|
381
|
+
state: ZodString;
|
|
382
|
+
}, $strip>;
|
|
383
|
+
/** Zod schema for the session JWT payload. */
|
|
384
|
+
declare const SessionPayloadSchema: ZodObject<{
|
|
385
|
+
accessToken: ZodString;
|
|
386
|
+
refreshToken: ZodNullable<ZodString>;
|
|
387
|
+
expiresAt: ZodNumber;
|
|
388
|
+
tokenType: ZodNullable<ZodString>;
|
|
389
|
+
scope: ZodNullable<ZodString>;
|
|
390
|
+
idToken: ZodNullable<ZodString>;
|
|
391
|
+
userUuid: ZodString;
|
|
392
|
+
handle: ZodString;
|
|
393
|
+
displayName: ZodString;
|
|
394
|
+
isCreator: ZodBoolean;
|
|
395
|
+
avatarUrl: ZodNullable<ZodString>;
|
|
396
|
+
}, $loose>;
|
|
397
|
+
//#endregion
|
|
398
|
+
//#region src/core/client.d.ts
|
|
399
|
+
/**
|
|
400
|
+
* A client for making authenticated requests to the Fanvue API.
|
|
401
|
+
*/
|
|
402
|
+
interface FanvueClient {
|
|
403
|
+
/**
|
|
404
|
+
* Fetches the currently authenticated user's profile.
|
|
405
|
+
*
|
|
406
|
+
* @returns A `Result` containing the {@link FanvueUser} on success or `ApiError` on failure.
|
|
407
|
+
*/
|
|
408
|
+
getCurrentUser(): Promise<Result<FanvueUser, ApiError>>;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Creates a new {@link FanvueClient} for making authenticated requests to the Fanvue API.
|
|
412
|
+
*
|
|
413
|
+
* @param accessToken - The OAuth access token to authenticate requests.
|
|
414
|
+
* @param apiBaseUrl - The base URL for the Fanvue API, or `null` to use the default.
|
|
415
|
+
* @returns A {@link FanvueClient} instance.
|
|
416
|
+
*/
|
|
417
|
+
declare function createFanvueClient(accessToken: string, apiBaseUrl: string | null): FanvueClient;
|
|
418
|
+
//#endregion
|
|
419
|
+
export { DEFAULT_ISSUER_URL as A, OAuthConfig as C, TokenResponse as D, SessionVerifyError as E, HEADER_UPDATED_SESSION as F, DEFAULT_SCOPES as M, assertFanvueDomain as N, API_VERSION as O, BEARER_PREFIX as P, JsonParseError as S, SessionPayload as T, refreshAccessToken as _, SessionPayloadSchema as a, EmbeddedAuthError as b, FanvueTheme as c, getThemeFromUrl as d, requestAuthorizationCodeOnBehalf as f, exchangeCodeForToken as g, createAuthorizationUrl as h, FanvueUserSchema as i, DEFAULT_PLATFORM_URL as j, DEFAULT_API_BASE_URL as k, exchangeSessionToken as l, verifySessionJwt as m, createFanvueClient as n, TokenResponseSchema as o, createSessionJwt as p, AuthorizeOnBehalfResponseSchema as r, safeJsonParse as s, FanvueClient as t, getSessionTokenFromUrl as u, ApiError as v, OAuthError as w, FanvueUser as x, EmbeddedAuthConfig as y };
|
|
420
|
+
//# sourceMappingURL=index-ClbZoV_Z.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-ClbZoV_Z.d.ts","names":[],"sources":["../src/core/constants.ts","../src/core/defaults.ts","../src/core/types.ts","../src/core/oauth.ts","../src/core/session.ts","../src/core/embedded.ts","../src/core/json.ts","../src/core/schemas.ts","../src/core/client.ts"],"mappings":"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"}
|