@scalemule/nextjs 0.1.65 → 0.1.66
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/audio.d.mts +3 -1
- package/dist/audio.d.ts +3 -1
- package/dist/audio.js +49 -16
- package/dist/audio.mjs +49 -16
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/{index-Sm43YPgb.d.mts → index-CEi5Nd4L.d.mts} +0 -6
- package/dist/{index-Sm43YPgb.d.ts → index-CEi5Nd4L.d.ts} +0 -6
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/server/auth.js +2 -13
- package/dist/server/auth.mjs +2 -13
- package/dist/server/index.d.mts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +2 -13
- package/dist/server/index.mjs +2 -13
- package/dist/server/webhook-handler.d.mts +2 -2
- package/dist/server/webhook-handler.d.ts +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{webhook-handler-363gMdVs.d.mts → webhook-handler-CJm0sIZG.d.mts} +1 -1
- package/dist/{webhook-handler-Cglm2AVC.d.ts → webhook-handler-CnQe9hm5.d.ts} +1 -1
- package/package.json +1 -1
package/dist/audio.d.mts
CHANGED
|
@@ -99,6 +99,8 @@ declare class NarrationHighlighter {
|
|
|
99
99
|
private currentWord;
|
|
100
100
|
private currentSentence;
|
|
101
101
|
private follow;
|
|
102
|
+
private userScrolledAt;
|
|
103
|
+
private lastScrollAt;
|
|
102
104
|
private detachUserScroll;
|
|
103
105
|
private reducedMotion;
|
|
104
106
|
private root;
|
|
@@ -114,7 +116,7 @@ declare class NarrationHighlighter {
|
|
|
114
116
|
* to hide the toggle below ~0.5. */
|
|
115
117
|
matchRatio(): number;
|
|
116
118
|
private attachUserScroll;
|
|
117
|
-
/** Re-engage auto-scroll (the reader pressed the toggle or sought). */
|
|
119
|
+
/** Re-engage auto-scroll immediately (the reader pressed the toggle or sought). */
|
|
118
120
|
resumeFollowing(): void;
|
|
119
121
|
/** Lazily creates the overlay layer behind the article text. */
|
|
120
122
|
private ensureLayer;
|
package/dist/audio.d.ts
CHANGED
|
@@ -99,6 +99,8 @@ declare class NarrationHighlighter {
|
|
|
99
99
|
private currentWord;
|
|
100
100
|
private currentSentence;
|
|
101
101
|
private follow;
|
|
102
|
+
private userScrolledAt;
|
|
103
|
+
private lastScrollAt;
|
|
102
104
|
private detachUserScroll;
|
|
103
105
|
private reducedMotion;
|
|
104
106
|
private root;
|
|
@@ -114,7 +116,7 @@ declare class NarrationHighlighter {
|
|
|
114
116
|
* to hide the toggle below ~0.5. */
|
|
115
117
|
matchRatio(): number;
|
|
116
118
|
private attachUserScroll;
|
|
117
|
-
/** Re-engage auto-scroll (the reader pressed the toggle or sought). */
|
|
119
|
+
/** Re-engage auto-scroll immediately (the reader pressed the toggle or sought). */
|
|
118
120
|
resumeFollowing(): void;
|
|
119
121
|
/** Lazily creates the overlay layer behind the article text. */
|
|
120
122
|
private ensureLayer;
|
package/dist/audio.js
CHANGED
|
@@ -74,22 +74,43 @@ function collectDomWords(root) {
|
|
|
74
74
|
}
|
|
75
75
|
function alignWords(timingNorms, domNorms, window2 = 6) {
|
|
76
76
|
const out = new Array(timingNorms.length).fill(-1);
|
|
77
|
+
const resyncWindow = Math.max(window2 * 4, 24);
|
|
77
78
|
let j = 0;
|
|
79
|
+
let inSync = true;
|
|
78
80
|
for (let i = 0; i < timingNorms.length; i++) {
|
|
79
81
|
const target = timingNorms[i];
|
|
80
82
|
if (!target) continue;
|
|
83
|
+
const nextTarget = i + 1 < timingNorms.length ? timingNorms[i + 1] : "";
|
|
81
84
|
let found = -1;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
if (inSync && j < domNorms.length && domNorms[j] === target) {
|
|
86
|
+
found = j;
|
|
87
|
+
} else {
|
|
88
|
+
if (nextTarget) {
|
|
89
|
+
const limit = Math.min(domNorms.length - 1, j + resyncWindow);
|
|
90
|
+
for (let k = j; k < limit; k++) {
|
|
91
|
+
if (domNorms[k] === target && domNorms[k + 1] === nextTarget) {
|
|
92
|
+
found = k;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (found === -1 && (inSync || !nextTarget)) {
|
|
98
|
+
const limit = Math.min(domNorms.length, j + window2);
|
|
99
|
+
for (let k = j; k < limit; k++) {
|
|
100
|
+
if (domNorms[k] === target) {
|
|
101
|
+
found = k;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
86
105
|
}
|
|
87
106
|
}
|
|
88
107
|
if (found === -1) {
|
|
108
|
+
inSync = false;
|
|
89
109
|
continue;
|
|
90
110
|
}
|
|
91
111
|
out[i] = found;
|
|
92
112
|
j = found + 1;
|
|
113
|
+
inSync = true;
|
|
93
114
|
}
|
|
94
115
|
return out;
|
|
95
116
|
}
|
|
@@ -135,11 +156,15 @@ function narrationHighlightSupported() {
|
|
|
135
156
|
}
|
|
136
157
|
var PAD_X = 2;
|
|
137
158
|
var PAD_Y = 1;
|
|
159
|
+
var AUTO_SCROLL_THROTTLE_MS = 180;
|
|
160
|
+
var USER_SCROLL_COOLDOWN_MS = 1200;
|
|
138
161
|
var NarrationHighlighter = class {
|
|
139
162
|
constructor(root, timings) {
|
|
140
163
|
this.currentWord = -2;
|
|
141
164
|
this.currentSentence = -2;
|
|
142
165
|
this.follow = true;
|
|
166
|
+
this.userScrolledAt = 0;
|
|
167
|
+
this.lastScrollAt = 0;
|
|
143
168
|
this.detachUserScroll = null;
|
|
144
169
|
this.layer = null;
|
|
145
170
|
this.sentenceLayer = null;
|
|
@@ -185,20 +210,23 @@ var NarrationHighlighter = class {
|
|
|
185
210
|
return this.ranges.filter(Boolean).length / this.ranges.length;
|
|
186
211
|
}
|
|
187
212
|
attachUserScroll(doc) {
|
|
188
|
-
const
|
|
189
|
-
this.
|
|
213
|
+
const onUserScroll = () => {
|
|
214
|
+
this.userScrolledAt = Date.now();
|
|
190
215
|
};
|
|
191
216
|
const opts = { passive: true };
|
|
192
|
-
doc.addEventListener("wheel",
|
|
193
|
-
doc.addEventListener("touchmove",
|
|
217
|
+
doc.addEventListener("wheel", onUserScroll, opts);
|
|
218
|
+
doc.addEventListener("touchmove", onUserScroll, opts);
|
|
194
219
|
this.detachUserScroll = () => {
|
|
195
|
-
doc.removeEventListener("wheel",
|
|
196
|
-
doc.removeEventListener("touchmove",
|
|
220
|
+
doc.removeEventListener("wheel", onUserScroll, opts);
|
|
221
|
+
doc.removeEventListener("touchmove", onUserScroll, opts);
|
|
197
222
|
};
|
|
198
223
|
}
|
|
199
|
-
/** Re-engage auto-scroll (the reader pressed the toggle or sought). */
|
|
224
|
+
/** Re-engage auto-scroll immediately (the reader pressed the toggle or sought). */
|
|
200
225
|
resumeFollowing() {
|
|
201
226
|
this.follow = true;
|
|
227
|
+
this.userScrolledAt = 0;
|
|
228
|
+
this.lastScrollAt = 0;
|
|
229
|
+
this.currentWord = -2;
|
|
202
230
|
this.currentSentence = -2;
|
|
203
231
|
}
|
|
204
232
|
/** Lazily creates the overlay layer behind the article text. */
|
|
@@ -298,21 +326,26 @@ var NarrationHighlighter = class {
|
|
|
298
326
|
if (!this.ensureLayer()) return;
|
|
299
327
|
this.paint(this.wordLayer, this.ranges[idx] ? this.boxesFor([idx]) : [], "word");
|
|
300
328
|
const sentence = this.words[idx][3];
|
|
329
|
+
const members = this.sentenceWords.get(sentence) ?? [];
|
|
301
330
|
if (sentence !== this.currentSentence) {
|
|
302
331
|
this.currentSentence = sentence;
|
|
303
|
-
const members = this.sentenceWords.get(sentence) ?? [];
|
|
304
332
|
this.paint(this.sentenceLayer, this.boxesFor(members), "sentence");
|
|
305
|
-
const first = members.length ? this.ranges[members[0]] : null;
|
|
306
|
-
if (first) this.scrollTo(first);
|
|
307
333
|
}
|
|
334
|
+
const activeRange = this.ranges[idx] ?? (members.length ? this.ranges[members[0]] : null);
|
|
335
|
+
if (activeRange) this.scrollTo(activeRange);
|
|
308
336
|
}
|
|
309
337
|
scrollTo(range) {
|
|
310
338
|
if (!this.follow) return;
|
|
339
|
+
const now = Date.now();
|
|
340
|
+
if (now - this.userScrolledAt < USER_SCROLL_COOLDOWN_MS) return;
|
|
341
|
+
if (now - this.lastScrollAt < AUTO_SCROLL_THROTTLE_MS) return;
|
|
311
342
|
try {
|
|
312
343
|
const rect = range.getBoundingClientRect();
|
|
313
344
|
const viewport = window.innerHeight || 0;
|
|
314
|
-
if (
|
|
315
|
-
|
|
345
|
+
if (viewport <= 0) return;
|
|
346
|
+
if (rect.top < viewport * 0.2 || rect.bottom > viewport * 0.75) {
|
|
347
|
+
this.lastScrollAt = now;
|
|
348
|
+
const target = Math.max(0, window.scrollY + rect.top - viewport * 0.35);
|
|
316
349
|
window.scrollTo({ top: target, behavior: this.reducedMotion ? "auto" : "smooth" });
|
|
317
350
|
}
|
|
318
351
|
} catch {
|
package/dist/audio.mjs
CHANGED
|
@@ -44,22 +44,43 @@ function collectDomWords(root) {
|
|
|
44
44
|
}
|
|
45
45
|
function alignWords(timingNorms, domNorms, window2 = 6) {
|
|
46
46
|
const out = new Array(timingNorms.length).fill(-1);
|
|
47
|
+
const resyncWindow = Math.max(window2 * 4, 24);
|
|
47
48
|
let j = 0;
|
|
49
|
+
let inSync = true;
|
|
48
50
|
for (let i = 0; i < timingNorms.length; i++) {
|
|
49
51
|
const target = timingNorms[i];
|
|
50
52
|
if (!target) continue;
|
|
53
|
+
const nextTarget = i + 1 < timingNorms.length ? timingNorms[i + 1] : "";
|
|
51
54
|
let found = -1;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
if (inSync && j < domNorms.length && domNorms[j] === target) {
|
|
56
|
+
found = j;
|
|
57
|
+
} else {
|
|
58
|
+
if (nextTarget) {
|
|
59
|
+
const limit = Math.min(domNorms.length - 1, j + resyncWindow);
|
|
60
|
+
for (let k = j; k < limit; k++) {
|
|
61
|
+
if (domNorms[k] === target && domNorms[k + 1] === nextTarget) {
|
|
62
|
+
found = k;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (found === -1 && (inSync || !nextTarget)) {
|
|
68
|
+
const limit = Math.min(domNorms.length, j + window2);
|
|
69
|
+
for (let k = j; k < limit; k++) {
|
|
70
|
+
if (domNorms[k] === target) {
|
|
71
|
+
found = k;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
56
75
|
}
|
|
57
76
|
}
|
|
58
77
|
if (found === -1) {
|
|
78
|
+
inSync = false;
|
|
59
79
|
continue;
|
|
60
80
|
}
|
|
61
81
|
out[i] = found;
|
|
62
82
|
j = found + 1;
|
|
83
|
+
inSync = true;
|
|
63
84
|
}
|
|
64
85
|
return out;
|
|
65
86
|
}
|
|
@@ -105,11 +126,15 @@ function narrationHighlightSupported() {
|
|
|
105
126
|
}
|
|
106
127
|
var PAD_X = 2;
|
|
107
128
|
var PAD_Y = 1;
|
|
129
|
+
var AUTO_SCROLL_THROTTLE_MS = 180;
|
|
130
|
+
var USER_SCROLL_COOLDOWN_MS = 1200;
|
|
108
131
|
var NarrationHighlighter = class {
|
|
109
132
|
constructor(root, timings) {
|
|
110
133
|
this.currentWord = -2;
|
|
111
134
|
this.currentSentence = -2;
|
|
112
135
|
this.follow = true;
|
|
136
|
+
this.userScrolledAt = 0;
|
|
137
|
+
this.lastScrollAt = 0;
|
|
113
138
|
this.detachUserScroll = null;
|
|
114
139
|
this.layer = null;
|
|
115
140
|
this.sentenceLayer = null;
|
|
@@ -155,20 +180,23 @@ var NarrationHighlighter = class {
|
|
|
155
180
|
return this.ranges.filter(Boolean).length / this.ranges.length;
|
|
156
181
|
}
|
|
157
182
|
attachUserScroll(doc) {
|
|
158
|
-
const
|
|
159
|
-
this.
|
|
183
|
+
const onUserScroll = () => {
|
|
184
|
+
this.userScrolledAt = Date.now();
|
|
160
185
|
};
|
|
161
186
|
const opts = { passive: true };
|
|
162
|
-
doc.addEventListener("wheel",
|
|
163
|
-
doc.addEventListener("touchmove",
|
|
187
|
+
doc.addEventListener("wheel", onUserScroll, opts);
|
|
188
|
+
doc.addEventListener("touchmove", onUserScroll, opts);
|
|
164
189
|
this.detachUserScroll = () => {
|
|
165
|
-
doc.removeEventListener("wheel",
|
|
166
|
-
doc.removeEventListener("touchmove",
|
|
190
|
+
doc.removeEventListener("wheel", onUserScroll, opts);
|
|
191
|
+
doc.removeEventListener("touchmove", onUserScroll, opts);
|
|
167
192
|
};
|
|
168
193
|
}
|
|
169
|
-
/** Re-engage auto-scroll (the reader pressed the toggle or sought). */
|
|
194
|
+
/** Re-engage auto-scroll immediately (the reader pressed the toggle or sought). */
|
|
170
195
|
resumeFollowing() {
|
|
171
196
|
this.follow = true;
|
|
197
|
+
this.userScrolledAt = 0;
|
|
198
|
+
this.lastScrollAt = 0;
|
|
199
|
+
this.currentWord = -2;
|
|
172
200
|
this.currentSentence = -2;
|
|
173
201
|
}
|
|
174
202
|
/** Lazily creates the overlay layer behind the article text. */
|
|
@@ -268,21 +296,26 @@ var NarrationHighlighter = class {
|
|
|
268
296
|
if (!this.ensureLayer()) return;
|
|
269
297
|
this.paint(this.wordLayer, this.ranges[idx] ? this.boxesFor([idx]) : [], "word");
|
|
270
298
|
const sentence = this.words[idx][3];
|
|
299
|
+
const members = this.sentenceWords.get(sentence) ?? [];
|
|
271
300
|
if (sentence !== this.currentSentence) {
|
|
272
301
|
this.currentSentence = sentence;
|
|
273
|
-
const members = this.sentenceWords.get(sentence) ?? [];
|
|
274
302
|
this.paint(this.sentenceLayer, this.boxesFor(members), "sentence");
|
|
275
|
-
const first = members.length ? this.ranges[members[0]] : null;
|
|
276
|
-
if (first) this.scrollTo(first);
|
|
277
303
|
}
|
|
304
|
+
const activeRange = this.ranges[idx] ?? (members.length ? this.ranges[members[0]] : null);
|
|
305
|
+
if (activeRange) this.scrollTo(activeRange);
|
|
278
306
|
}
|
|
279
307
|
scrollTo(range) {
|
|
280
308
|
if (!this.follow) return;
|
|
309
|
+
const now = Date.now();
|
|
310
|
+
if (now - this.userScrolledAt < USER_SCROLL_COOLDOWN_MS) return;
|
|
311
|
+
if (now - this.lastScrollAt < AUTO_SCROLL_THROTTLE_MS) return;
|
|
281
312
|
try {
|
|
282
313
|
const rect = range.getBoundingClientRect();
|
|
283
314
|
const viewport = window.innerHeight || 0;
|
|
284
|
-
if (
|
|
285
|
-
|
|
315
|
+
if (viewport <= 0) return;
|
|
316
|
+
if (rect.top < viewport * 0.2 || rect.bottom > viewport * 0.75) {
|
|
317
|
+
this.lastScrollAt = now;
|
|
318
|
+
const target = Math.max(0, window.scrollY + rect.top - viewport * 0.35);
|
|
286
319
|
window.scrollTo({ top: target, behavior: this.reducedMotion ? "auto" : "smooth" });
|
|
287
320
|
}
|
|
288
321
|
} catch {
|
package/dist/client.d.mts
CHANGED
package/dist/client.d.ts
CHANGED
|
@@ -178,12 +178,6 @@ interface RegisterRequest {
|
|
|
178
178
|
website?: string;
|
|
179
179
|
company?: string;
|
|
180
180
|
hp_field?: string;
|
|
181
|
-
/**
|
|
182
|
-
* Token from an account invitation link. When ScaleMule challenges a sign-up
|
|
183
|
-
* (for example a first-time browser), a pending invitation addressed to this
|
|
184
|
-
* email lets the registration through. It does not accept the invitation.
|
|
185
|
-
*/
|
|
186
|
-
invitation_token?: string;
|
|
187
181
|
}
|
|
188
182
|
interface LoginRequest {
|
|
189
183
|
challenge_token?: string;
|
|
@@ -178,12 +178,6 @@ interface RegisterRequest {
|
|
|
178
178
|
website?: string;
|
|
179
179
|
company?: string;
|
|
180
180
|
hp_field?: string;
|
|
181
|
-
/**
|
|
182
|
-
* Token from an account invitation link. When ScaleMule challenges a sign-up
|
|
183
|
-
* (for example a first-time browser), a pending invitation addressed to this
|
|
184
|
-
* email lets the registration through. It does not accept the invitation.
|
|
185
|
-
*/
|
|
186
|
-
invitation_token?: string;
|
|
187
181
|
}
|
|
188
182
|
interface LoginRequest {
|
|
189
183
|
challenge_token?: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -6,8 +6,8 @@ import { MoneyClient } from '@scalemule/money';
|
|
|
6
6
|
export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
|
|
7
7
|
import { ScaleMuleClient } from './client.mjs';
|
|
8
8
|
export { ClientConfig, RequestOptions, createClient } from './client.mjs';
|
|
9
|
-
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-
|
|
10
|
-
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, k as AuthLoginResponse, B as BatchTrackRequest, l as BillingPayment, m as BillingPayout, n as BillingRefund, o as BillingTransaction, C as ChangeEmailRequest, p as ChangePasswordRequest, q as ClientContext, r as ConnectedAccount, s as CookieLoginResponse, t as CookieOAuthCallbackResponse, D as DeviceFingerprint, u as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, v as LinkedAccount, w as ListFilesResponse, x as LoginDeviceInfo, y as LoginRequest, z as LoginResponseWithMFA, G as LoginRiskInfo, M as MFAChallengeResponse, H as MFAMethod, I as MFASMSSetupResponse, J as MFASetupRequest, N as MFAStatus, O as MFATOTPSetupResponse, P as MFAVerifyRequest, Q as OAuthCallbackRequest, R as OAuthCallbackResponse, T as OAuthConfig, V as OAuthProvider, W as OAuthStartResponse, X as PageViewData, Y as PayoutSchedule, Z as PhoneLoginRequest, _ as PhoneSendCodeRequest, $ as PhoneVerifyRequest, a0 as Profile, a1 as ProxyBearerLoginResponse, a2 as RefreshResponse, a3 as RegisterRequest, a4 as ResetPasswordRequest, a5 as ScaleMuleApiError, a6 as ScaleMuleEnvironment, a7 as Session, a8 as SignedUploadCompleteRequest, a9 as SignedUploadRequest, aa as SignedUploadResponse, ab as SignedUploadUrl, ac as StorageAdapter, ad as StorageFile, ae as TrackEventResponse, af as TransactionSummary, ag as UTMParams, ah as UpdateProfileRequest, ai as UploadOptions, aj as UploadResponse, ak as VerifyEmailRequest } from './index-
|
|
9
|
+
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-CEi5Nd4L.mjs';
|
|
10
|
+
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, k as AuthLoginResponse, B as BatchTrackRequest, l as BillingPayment, m as BillingPayout, n as BillingRefund, o as BillingTransaction, C as ChangeEmailRequest, p as ChangePasswordRequest, q as ClientContext, r as ConnectedAccount, s as CookieLoginResponse, t as CookieOAuthCallbackResponse, D as DeviceFingerprint, u as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, v as LinkedAccount, w as ListFilesResponse, x as LoginDeviceInfo, y as LoginRequest, z as LoginResponseWithMFA, G as LoginRiskInfo, M as MFAChallengeResponse, H as MFAMethod, I as MFASMSSetupResponse, J as MFASetupRequest, N as MFAStatus, O as MFATOTPSetupResponse, P as MFAVerifyRequest, Q as OAuthCallbackRequest, R as OAuthCallbackResponse, T as OAuthConfig, V as OAuthProvider, W as OAuthStartResponse, X as PageViewData, Y as PayoutSchedule, Z as PhoneLoginRequest, _ as PhoneSendCodeRequest, $ as PhoneVerifyRequest, a0 as Profile, a1 as ProxyBearerLoginResponse, a2 as RefreshResponse, a3 as RegisterRequest, a4 as ResetPasswordRequest, a5 as ScaleMuleApiError, a6 as ScaleMuleEnvironment, a7 as Session, a8 as SignedUploadCompleteRequest, a9 as SignedUploadRequest, aa as SignedUploadResponse, ab as SignedUploadUrl, ac as StorageAdapter, ad as StorageFile, ae as TrackEventResponse, af as TransactionSummary, ag as UTMParams, ah as UpdateProfileRequest, ai as UploadOptions, aj as UploadResponse, ak as VerifyEmailRequest } from './index-CEi5Nd4L.mjs';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Tri-state file visibility — `'private' | 'app_public' | 'anonymous_visible'`.
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { MoneyClient } from '@scalemule/money';
|
|
|
6
6
|
export { MoneyClient, MoneyClientConfig, createMoneyClient } from '@scalemule/money';
|
|
7
7
|
import { ScaleMuleClient } from './client.js';
|
|
8
8
|
export { ClientConfig, RequestOptions, createClient } from './client.js';
|
|
9
|
-
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-
|
|
10
|
-
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, k as AuthLoginResponse, B as BatchTrackRequest, l as BillingPayment, m as BillingPayout, n as BillingRefund, o as BillingTransaction, C as ChangeEmailRequest, p as ChangePasswordRequest, q as ClientContext, r as ConnectedAccount, s as CookieLoginResponse, t as CookieOAuthCallbackResponse, D as DeviceFingerprint, u as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, v as LinkedAccount, w as ListFilesResponse, x as LoginDeviceInfo, y as LoginRequest, z as LoginResponseWithMFA, G as LoginRiskInfo, M as MFAChallengeResponse, H as MFAMethod, I as MFASMSSetupResponse, J as MFASetupRequest, N as MFAStatus, O as MFATOTPSetupResponse, P as MFAVerifyRequest, Q as OAuthCallbackRequest, R as OAuthCallbackResponse, T as OAuthConfig, V as OAuthProvider, W as OAuthStartResponse, X as PageViewData, Y as PayoutSchedule, Z as PhoneLoginRequest, _ as PhoneSendCodeRequest, $ as PhoneVerifyRequest, a0 as Profile, a1 as ProxyBearerLoginResponse, a2 as RefreshResponse, a3 as RegisterRequest, a4 as ResetPasswordRequest, a5 as ScaleMuleApiError, a6 as ScaleMuleEnvironment, a7 as Session, a8 as SignedUploadCompleteRequest, a9 as SignedUploadRequest, aa as SignedUploadResponse, ab as SignedUploadUrl, ac as StorageAdapter, ad as StorageFile, ae as TrackEventResponse, af as TransactionSummary, ag as UTMParams, ah as UpdateProfileRequest, ai as UploadOptions, aj as UploadResponse, ak as VerifyEmailRequest } from './index-
|
|
9
|
+
import { S as ScaleMuleConfig, U as User, L as LoginResponse, A as ApiError$1, a as UseAuthReturn, b as UseBillingReturn, c as ListFilesParams, d as UseContentReturn, e as UseUserReturn, f as UseAnalyticsOptions, g as UseAnalyticsReturn } from './index-CEi5Nd4L.js';
|
|
10
|
+
export { h as AccountBalance, i as AnalyticsEvent, j as ApiResponse, k as AuthLoginResponse, B as BatchTrackRequest, l as BillingPayment, m as BillingPayout, n as BillingRefund, o as BillingTransaction, C as ChangeEmailRequest, p as ChangePasswordRequest, q as ClientContext, r as ConnectedAccount, s as CookieLoginResponse, t as CookieOAuthCallbackResponse, D as DeviceFingerprint, u as DeviceInfo, E as EnhancedAnalyticsEvent, F as ForgotPasswordRequest, K as KnownAccountInfo, v as LinkedAccount, w as ListFilesResponse, x as LoginDeviceInfo, y as LoginRequest, z as LoginResponseWithMFA, G as LoginRiskInfo, M as MFAChallengeResponse, H as MFAMethod, I as MFASMSSetupResponse, J as MFASetupRequest, N as MFAStatus, O as MFATOTPSetupResponse, P as MFAVerifyRequest, Q as OAuthCallbackRequest, R as OAuthCallbackResponse, T as OAuthConfig, V as OAuthProvider, W as OAuthStartResponse, X as PageViewData, Y as PayoutSchedule, Z as PhoneLoginRequest, _ as PhoneSendCodeRequest, $ as PhoneVerifyRequest, a0 as Profile, a1 as ProxyBearerLoginResponse, a2 as RefreshResponse, a3 as RegisterRequest, a4 as ResetPasswordRequest, a5 as ScaleMuleApiError, a6 as ScaleMuleEnvironment, a7 as Session, a8 as SignedUploadCompleteRequest, a9 as SignedUploadRequest, aa as SignedUploadResponse, ab as SignedUploadUrl, ac as StorageAdapter, ad as StorageFile, ae as TrackEventResponse, af as TransactionSummary, ag as UTMParams, ah as UpdateProfileRequest, ai as UploadOptions, aj as UploadResponse, ak as VerifyEmailRequest } from './index-CEi5Nd4L.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Tri-state file visibility — `'private' | 'app_public' | 'anonymous_visible'`.
|
package/dist/server/auth.js
CHANGED
|
@@ -1440,7 +1440,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1440
1440
|
switch (path) {
|
|
1441
1441
|
// ==================== Register ====================
|
|
1442
1442
|
case "register": {
|
|
1443
|
-
const { email, password, full_name, username, phone, publication_code, website, company, hp_field
|
|
1443
|
+
const { email, password, full_name, username, phone, publication_code, website, company, hp_field } = body;
|
|
1444
1444
|
if (!email || !password) {
|
|
1445
1445
|
return errorResponse("VALIDATION_ERROR", "Email and password required", 400);
|
|
1446
1446
|
}
|
|
@@ -1460,18 +1460,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
let registeredUser;
|
|
1462
1462
|
try {
|
|
1463
|
-
registeredUser = await sm.auth.register(
|
|
1464
|
-
{
|
|
1465
|
-
email,
|
|
1466
|
-
password,
|
|
1467
|
-
full_name,
|
|
1468
|
-
username,
|
|
1469
|
-
phone,
|
|
1470
|
-
// Lets an invited person through a first-visit trust challenge.
|
|
1471
|
-
...typeof invitation_token === "string" && invitation_token ? { invitation_token } : {}
|
|
1472
|
-
},
|
|
1473
|
-
{ clientContext }
|
|
1474
|
-
);
|
|
1463
|
+
registeredUser = await sm.auth.register({ email, password, full_name, username, phone }, { clientContext });
|
|
1475
1464
|
} catch (err) {
|
|
1476
1465
|
const apiErr = err instanceof ScaleMuleApiError ? err : null;
|
|
1477
1466
|
return errorResponse(
|
package/dist/server/auth.mjs
CHANGED
|
@@ -1438,7 +1438,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1438
1438
|
switch (path) {
|
|
1439
1439
|
// ==================== Register ====================
|
|
1440
1440
|
case "register": {
|
|
1441
|
-
const { email, password, full_name, username, phone, publication_code, website, company, hp_field
|
|
1441
|
+
const { email, password, full_name, username, phone, publication_code, website, company, hp_field } = body;
|
|
1442
1442
|
if (!email || !password) {
|
|
1443
1443
|
return errorResponse("VALIDATION_ERROR", "Email and password required", 400);
|
|
1444
1444
|
}
|
|
@@ -1458,18 +1458,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
let registeredUser;
|
|
1460
1460
|
try {
|
|
1461
|
-
registeredUser = await sm.auth.register(
|
|
1462
|
-
{
|
|
1463
|
-
email,
|
|
1464
|
-
password,
|
|
1465
|
-
full_name,
|
|
1466
|
-
username,
|
|
1467
|
-
phone,
|
|
1468
|
-
// Lets an invited person through a first-visit trust challenge.
|
|
1469
|
-
...typeof invitation_token === "string" && invitation_token ? { invitation_token } : {}
|
|
1470
|
-
},
|
|
1471
|
-
{ clientContext }
|
|
1472
|
-
);
|
|
1461
|
+
registeredUser = await sm.auth.register({ email, password, full_name, username, phone }, { clientContext });
|
|
1473
1462
|
} catch (err) {
|
|
1474
1463
|
const apiErr = err instanceof ScaleMuleApiError ? err : null;
|
|
1475
1464
|
return errorResponse(
|
package/dist/server/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ServerConfig } from '../webhook-handler-
|
|
2
|
-
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-
|
|
3
|
-
import { q as ClientContext, A as ApiError } from '../index-
|
|
1
|
+
import { S as ServerConfig } from '../webhook-handler-CJm0sIZG.mjs';
|
|
2
|
+
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-CJm0sIZG.mjs';
|
|
3
|
+
import { q as ClientContext, A as ApiError } from '../index-CEi5Nd4L.mjs';
|
|
4
4
|
export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.mjs';
|
|
5
5
|
import { NextRequest, NextResponse } from 'next/server';
|
|
6
6
|
import '@scalemule/sdk';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ServerConfig } from '../webhook-handler-
|
|
2
|
-
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-
|
|
3
|
-
import { q as ClientContext, A as ApiError } from '../index-
|
|
1
|
+
import { S as ServerConfig } from '../webhook-handler-CnQe9hm5.js';
|
|
2
|
+
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-CnQe9hm5.js';
|
|
3
|
+
import { q as ClientContext, A as ApiError } from '../index-CEi5Nd4L.js';
|
|
4
4
|
export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.js';
|
|
5
5
|
import { NextRequest, NextResponse } from 'next/server';
|
|
6
6
|
import '@scalemule/sdk';
|
package/dist/server/index.js
CHANGED
|
@@ -1611,7 +1611,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1611
1611
|
switch (path) {
|
|
1612
1612
|
// ==================== Register ====================
|
|
1613
1613
|
case "register": {
|
|
1614
|
-
const { email, password, full_name, username, phone, publication_code, website, company, hp_field
|
|
1614
|
+
const { email, password, full_name, username, phone, publication_code, website, company, hp_field } = body;
|
|
1615
1615
|
if (!email || !password) {
|
|
1616
1616
|
return errorResponse("VALIDATION_ERROR", "Email and password required", 400);
|
|
1617
1617
|
}
|
|
@@ -1631,18 +1631,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1631
1631
|
}
|
|
1632
1632
|
let registeredUser;
|
|
1633
1633
|
try {
|
|
1634
|
-
registeredUser = await sm.auth.register(
|
|
1635
|
-
{
|
|
1636
|
-
email,
|
|
1637
|
-
password,
|
|
1638
|
-
full_name,
|
|
1639
|
-
username,
|
|
1640
|
-
phone,
|
|
1641
|
-
// Lets an invited person through a first-visit trust challenge.
|
|
1642
|
-
...typeof invitation_token === "string" && invitation_token ? { invitation_token } : {}
|
|
1643
|
-
},
|
|
1644
|
-
{ clientContext }
|
|
1645
|
-
);
|
|
1634
|
+
registeredUser = await sm.auth.register({ email, password, full_name, username, phone }, { clientContext });
|
|
1646
1635
|
} catch (err) {
|
|
1647
1636
|
const apiErr = err instanceof ScaleMuleApiError ? err : null;
|
|
1648
1637
|
return errorResponse(
|
package/dist/server/index.mjs
CHANGED
|
@@ -1609,7 +1609,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1609
1609
|
switch (path) {
|
|
1610
1610
|
// ==================== Register ====================
|
|
1611
1611
|
case "register": {
|
|
1612
|
-
const { email, password, full_name, username, phone, publication_code, website, company, hp_field
|
|
1612
|
+
const { email, password, full_name, username, phone, publication_code, website, company, hp_field } = body;
|
|
1613
1613
|
if (!email || !password) {
|
|
1614
1614
|
return errorResponse("VALIDATION_ERROR", "Email and password required", 400);
|
|
1615
1615
|
}
|
|
@@ -1629,18 +1629,7 @@ function createAuthRoutes(config = {}) {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
let registeredUser;
|
|
1631
1631
|
try {
|
|
1632
|
-
registeredUser = await sm.auth.register(
|
|
1633
|
-
{
|
|
1634
|
-
email,
|
|
1635
|
-
password,
|
|
1636
|
-
full_name,
|
|
1637
|
-
username,
|
|
1638
|
-
phone,
|
|
1639
|
-
// Lets an invited person through a first-visit trust challenge.
|
|
1640
|
-
...typeof invitation_token === "string" && invitation_token ? { invitation_token } : {}
|
|
1641
|
-
},
|
|
1642
|
-
{ clientContext }
|
|
1643
|
-
);
|
|
1632
|
+
registeredUser = await sm.auth.register({ email, password, full_name, username, phone }, { clientContext });
|
|
1644
1633
|
} catch (err) {
|
|
1645
1634
|
const apiErr = err instanceof ScaleMuleApiError ? err : null;
|
|
1646
1635
|
return errorResponse(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as createWebhookHandler } from '../webhook-handler-
|
|
1
|
+
export { g as createWebhookHandler } from '../webhook-handler-CJm0sIZG.mjs';
|
|
2
2
|
import '@scalemule/sdk';
|
|
3
3
|
import '@scalemule/money';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-CEi5Nd4L.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as createWebhookHandler } from '../webhook-handler-
|
|
1
|
+
export { g as createWebhookHandler } from '../webhook-handler-CnQe9hm5.js';
|
|
2
2
|
import '@scalemule/sdk';
|
|
3
3
|
import '@scalemule/money';
|
|
4
|
-
import '../index-
|
|
4
|
+
import '../index-CEi5Nd4L.js';
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { U as User, A as ApiError, ad as StorageFile } from './index-
|
|
3
|
+
import { U as User, A as ApiError, ad as StorageFile } from './index-CEi5Nd4L.mjs';
|
|
4
4
|
|
|
5
5
|
interface MockUserOptions {
|
|
6
6
|
id?: string;
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { U as User, A as ApiError, ad as StorageFile } from './index-
|
|
3
|
+
import { U as User, A as ApiError, ad as StorageFile } from './index-CEi5Nd4L.js';
|
|
4
4
|
|
|
5
5
|
interface MockUserOptions {
|
|
6
6
|
id?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExperimentAssignment } from '@scalemule/sdk';
|
|
2
2
|
import { MoneyClient } from '@scalemule/money';
|
|
3
|
-
import { A as ApiError, a3 as RegisterRequest, q as ClientContext, U as User, L as LoginResponse, y as LoginRequest, c as ListFilesParams, w as ListFilesResponse, ad as StorageFile, aj as UploadResponse } from './index-
|
|
3
|
+
import { A as ApiError, a3 as RegisterRequest, q as ClientContext, U as User, L as LoginResponse, y as LoginRequest, c as ListFilesParams, w as ListFilesResponse, ad as StorageFile, aj as UploadResponse } from './index-CEi5Nd4L.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Server-Side ScaleMule Client
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExperimentAssignment } from '@scalemule/sdk';
|
|
2
2
|
import { MoneyClient } from '@scalemule/money';
|
|
3
|
-
import { A as ApiError, a3 as RegisterRequest, q as ClientContext, U as User, L as LoginResponse, y as LoginRequest, c as ListFilesParams, w as ListFilesResponse, ad as StorageFile, aj as UploadResponse } from './index-
|
|
3
|
+
import { A as ApiError, a3 as RegisterRequest, q as ClientContext, U as User, L as LoginResponse, y as LoginRequest, c as ListFilesParams, w as ListFilesResponse, ad as StorageFile, aj as UploadResponse } from './index-CEi5Nd4L.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Server-Side ScaleMule Client
|
package/package.json
CHANGED