@sylphx/sdk 0.10.4 → 0.10.6
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/index.d.ts +27 -25
- package/dist/index.mjs +12 -9
- package/dist/index.mjs.map +1 -1
- package/dist/nextjs/index.d.ts +21 -0
- package/dist/nextjs/index.mjs +351 -4
- package/dist/nextjs/index.mjs.map +1 -1
- package/dist/react/index.d.ts +5 -1
- package/dist/react/index.mjs +34 -17
- package/dist/react/index.mjs.map +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/web-analytics.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2007,10 +2007,14 @@ declare function verifyEmail(config: SylphxConfig, token: string): Promise<void>
|
|
|
2007
2007
|
*
|
|
2008
2008
|
* @example
|
|
2009
2009
|
* ```typescript
|
|
2010
|
-
* await forgotPassword(config, 'user@example.com'
|
|
2010
|
+
* await forgotPassword(config, 'user@example.com', {
|
|
2011
|
+
* redirectUrl: 'https://app.example.com/reset-password'
|
|
2012
|
+
* })
|
|
2011
2013
|
* ```
|
|
2012
2014
|
*/
|
|
2013
|
-
declare function forgotPassword(config: SylphxConfig, email: string
|
|
2015
|
+
declare function forgotPassword(config: SylphxConfig, email: string, options?: {
|
|
2016
|
+
redirectUrl?: string;
|
|
2017
|
+
}): Promise<void>;
|
|
2014
2018
|
/**
|
|
2015
2019
|
* Request a verification email resend.
|
|
2016
2020
|
*
|
|
@@ -7580,8 +7584,8 @@ interface SandboxOptions {
|
|
|
7580
7584
|
env?: Record<string, string>;
|
|
7581
7585
|
/**
|
|
7582
7586
|
* Shared volume mounts from org-level managed volumes.
|
|
7583
|
-
*
|
|
7584
|
-
*
|
|
7587
|
+
* Use volumes created with sharing="shared" when multiple sandboxes need
|
|
7588
|
+
* concurrent filesystem access.
|
|
7585
7589
|
*/
|
|
7586
7590
|
volumeMounts?: Array<{
|
|
7587
7591
|
/** Volume resource ID (from `sylphx volumes list`) */
|
|
@@ -7786,7 +7790,7 @@ declare class SandboxClient {
|
|
|
7786
7790
|
/**
|
|
7787
7791
|
* Create a new sandbox.
|
|
7788
7792
|
*
|
|
7789
|
-
* Platform provisions the
|
|
7793
|
+
* Platform provisions the sandbox runtime, waits for readiness, and returns
|
|
7790
7794
|
* { endpoint, token } once the sandbox is fully ready to accept traffic.
|
|
7791
7795
|
* No client-side polling required.
|
|
7792
7796
|
*/
|
|
@@ -7872,7 +7876,7 @@ declare class SandboxClient {
|
|
|
7872
7876
|
*
|
|
7873
7877
|
* Fire-and-forget batch compute API (Modal-style run-to-completion jobs).
|
|
7874
7878
|
*
|
|
7875
|
-
* Runs are ephemeral
|
|
7879
|
+
* Runs are ephemeral isolated jobs that run to completion. Use them for:
|
|
7876
7880
|
* - ML training folds (walk-forward cross-validation)
|
|
7877
7881
|
* - Data processing pipelines
|
|
7878
7882
|
* - Batch inference
|
|
@@ -7919,11 +7923,11 @@ declare class SandboxClient {
|
|
|
7919
7923
|
*
|
|
7920
7924
|
* ## Architecture
|
|
7921
7925
|
*
|
|
7922
|
-
* - Workers are
|
|
7926
|
+
* - Workers are isolated one-shot runs (backoffLimit: 0, no restarts)
|
|
7923
7927
|
* - Images must be from registry.sylphx.com (scanned, private)
|
|
7924
|
-
* - Volumes: org-level
|
|
7925
|
-
* -
|
|
7926
|
-
* -
|
|
7928
|
+
* - Volumes: org-level volume resources mounted into the run
|
|
7929
|
+
* - single-writer for one active writer at a time
|
|
7930
|
+
* - shared for concurrent runs and shared feature caches
|
|
7927
7931
|
* - Auth: sk_* secret key (server-side only)
|
|
7928
7932
|
* - Quota: 20 concurrent workers per org
|
|
7929
7933
|
*
|
|
@@ -7981,12 +7985,12 @@ interface CreateRunOptions {
|
|
|
7981
7985
|
resources?: RunResourceSpec;
|
|
7982
7986
|
/**
|
|
7983
7987
|
* Hard timeout in seconds (default: 3600 = 1 hour, max: 86400 = 24 hours).
|
|
7984
|
-
*
|
|
7988
|
+
* The platform terminates the run when the deadline is reached (status: 'timeout').
|
|
7985
7989
|
*/
|
|
7986
7990
|
timeoutSeconds?: number;
|
|
7987
7991
|
/**
|
|
7988
7992
|
* Volume mounts from org-level volumeResources.
|
|
7989
|
-
*
|
|
7993
|
+
* Shared volumes allow concurrent access by multiple parallel workers.
|
|
7990
7994
|
*/
|
|
7991
7995
|
volumeMounts?: RunVolumeMount[];
|
|
7992
7996
|
}
|
|
@@ -8094,7 +8098,7 @@ declare class RunHandle {
|
|
|
8094
8098
|
/**
|
|
8095
8099
|
* Fetch captured logs for this worker.
|
|
8096
8100
|
*
|
|
8097
|
-
* - For a running worker: returns live logs streamed from
|
|
8101
|
+
* - For a running worker: returns live logs streamed from the runtime (may be incomplete)
|
|
8098
8102
|
* - For a completed worker: returns the full captured output stored in DB
|
|
8099
8103
|
*
|
|
8100
8104
|
* @example
|
|
@@ -8108,8 +8112,8 @@ declare class RunHandle {
|
|
|
8108
8112
|
/**
|
|
8109
8113
|
* Cancel this worker.
|
|
8110
8114
|
*
|
|
8111
|
-
* - If still pending: immediately cancelled
|
|
8112
|
-
* - If running:
|
|
8115
|
+
* - If still pending: immediately cancelled
|
|
8116
|
+
* - If running: runtime is terminated
|
|
8113
8117
|
* - If already completed: no-op
|
|
8114
8118
|
*/
|
|
8115
8119
|
cancel(): Promise<void>;
|
|
@@ -8131,9 +8135,9 @@ declare class RunHandle {
|
|
|
8131
8135
|
*/
|
|
8132
8136
|
declare const RunsClient: {
|
|
8133
8137
|
/**
|
|
8134
|
-
* Spawn a new worker
|
|
8138
|
+
* Spawn a new worker and return a handle.
|
|
8135
8139
|
*
|
|
8136
|
-
* The
|
|
8140
|
+
* The run is created immediately and starts pulling the image.
|
|
8137
8141
|
* Use the returned handle to `.wait()` for completion or `.cancel()`.
|
|
8138
8142
|
*
|
|
8139
8143
|
* @example
|
|
@@ -8193,9 +8197,9 @@ declare const RunsClient: {
|
|
|
8193
8197
|
/** @deprecated Use RunsClient */
|
|
8194
8198
|
declare const WorkersClient: {
|
|
8195
8199
|
/**
|
|
8196
|
-
* Spawn a new worker
|
|
8200
|
+
* Spawn a new worker and return a handle.
|
|
8197
8201
|
*
|
|
8198
|
-
* The
|
|
8202
|
+
* The run is created immediately and starts pulling the image.
|
|
8199
8203
|
* Use the returned handle to `.wait()` for completion or `.cancel()`.
|
|
8200
8204
|
*
|
|
8201
8205
|
* @example
|
|
@@ -8504,15 +8508,13 @@ interface ProjectMetadata {
|
|
|
8504
8508
|
readonly slug: string;
|
|
8505
8509
|
readonly [key: string]: unknown;
|
|
8506
8510
|
}
|
|
8507
|
-
type ChallengeMethod = 'password' | 'email' | 'totp' | '
|
|
8511
|
+
type ChallengeMethod = 'password' | 'email' | 'totp' | 'backup';
|
|
8508
8512
|
type ChallengeType = 'identity' | 'mfa';
|
|
8509
8513
|
interface ChallengeVerifyInput {
|
|
8510
8514
|
/** Verification method to use. */
|
|
8511
8515
|
readonly method: ChallengeMethod;
|
|
8512
|
-
/**
|
|
8513
|
-
readonly
|
|
8514
|
-
/** Whether this challenge is for identity step-up or MFA gate (default: identity). */
|
|
8515
|
-
readonly type?: ChallengeType;
|
|
8516
|
+
/** Verification value matching `method` (password, email code, TOTP code, backup code). */
|
|
8517
|
+
readonly value: string;
|
|
8516
8518
|
}
|
|
8517
8519
|
interface ChallengeVerifyResult {
|
|
8518
8520
|
readonly verified: boolean;
|
|
@@ -8532,7 +8534,7 @@ declare function getProjectMetadata(config: SylphxConfig): Promise<ProjectMetada
|
|
|
8532
8534
|
*
|
|
8533
8535
|
* @example
|
|
8534
8536
|
* ```typescript
|
|
8535
|
-
* await verifyChallenge(config, { method: 'password',
|
|
8537
|
+
* await verifyChallenge(config, { method: 'password', value: pw })
|
|
8536
8538
|
* ```
|
|
8537
8539
|
*/
|
|
8538
8540
|
declare function verifyChallenge(config: SylphxConfig, input: ChallengeVerifyInput): Promise<ChallengeVerifyResult>;
|
package/dist/index.mjs
CHANGED
|
@@ -5915,10 +5915,13 @@ async function verifyEmail(config, token) {
|
|
|
5915
5915
|
body: { token }
|
|
5916
5916
|
});
|
|
5917
5917
|
}
|
|
5918
|
-
async function forgotPassword(config, email) {
|
|
5918
|
+
async function forgotPassword(config, email, options = {}) {
|
|
5919
5919
|
await callApi(config, "/auth/forgot-password", {
|
|
5920
5920
|
method: "POST",
|
|
5921
|
-
body: {
|
|
5921
|
+
body: {
|
|
5922
|
+
email,
|
|
5923
|
+
...options.redirectUrl ? { redirectUrl: options.redirectUrl } : {}
|
|
5924
|
+
}
|
|
5922
5925
|
});
|
|
5923
5926
|
}
|
|
5924
5927
|
async function resendVerificationEmail(config, email) {
|
|
@@ -5932,7 +5935,7 @@ async function resendVerificationEmail(config, email) {
|
|
|
5932
5935
|
async function resetPassword(config, input) {
|
|
5933
5936
|
await callApi(config, "/auth/reset-password", {
|
|
5934
5937
|
method: "POST",
|
|
5935
|
-
body: { token: input.token,
|
|
5938
|
+
body: { token: input.token, password: input.password }
|
|
5936
5939
|
});
|
|
5937
5940
|
}
|
|
5938
5941
|
async function getSession(config) {
|
|
@@ -10259,7 +10262,7 @@ var SandboxClient = class _SandboxClient {
|
|
|
10259
10262
|
/**
|
|
10260
10263
|
* Create a new sandbox.
|
|
10261
10264
|
*
|
|
10262
|
-
* Platform provisions the
|
|
10265
|
+
* Platform provisions the sandbox runtime, waits for readiness, and returns
|
|
10263
10266
|
* { endpoint, token } once the sandbox is fully ready to accept traffic.
|
|
10264
10267
|
* No client-side polling required.
|
|
10265
10268
|
*/
|
|
@@ -10548,7 +10551,7 @@ var RunHandle = class {
|
|
|
10548
10551
|
/**
|
|
10549
10552
|
* Fetch captured logs for this worker.
|
|
10550
10553
|
*
|
|
10551
|
-
* - For a running worker: returns live logs streamed from
|
|
10554
|
+
* - For a running worker: returns live logs streamed from the runtime (may be incomplete)
|
|
10552
10555
|
* - For a completed worker: returns the full captured output stored in DB
|
|
10553
10556
|
*
|
|
10554
10557
|
* @example
|
|
@@ -10567,8 +10570,8 @@ var RunHandle = class {
|
|
|
10567
10570
|
/**
|
|
10568
10571
|
* Cancel this worker.
|
|
10569
10572
|
*
|
|
10570
|
-
* - If still pending: immediately cancelled
|
|
10571
|
-
* - If running:
|
|
10573
|
+
* - If still pending: immediately cancelled
|
|
10574
|
+
* - If running: runtime is terminated
|
|
10572
10575
|
* - If already completed: no-op
|
|
10573
10576
|
*/
|
|
10574
10577
|
async cancel() {
|
|
@@ -10580,9 +10583,9 @@ var RunsClient = {
|
|
|
10580
10583
|
// Run
|
|
10581
10584
|
// --------------------------------------------------------------------------
|
|
10582
10585
|
/**
|
|
10583
|
-
* Spawn a new worker
|
|
10586
|
+
* Spawn a new worker and return a handle.
|
|
10584
10587
|
*
|
|
10585
|
-
* The
|
|
10588
|
+
* The run is created immediately and starts pulling the image.
|
|
10586
10589
|
* Use the returned handle to `.wait()` for completion or `.cancel()`.
|
|
10587
10590
|
*
|
|
10588
10591
|
* @example
|