notte-sdk 0.0.21 → 0.0.22
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 +20 -0
- package/dist/index.d.mts +536 -350
- package/dist/index.d.ts +536 -350
- package/dist/index.js +113 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +107 -49
- package/dist/index.mjs.map +1 -1
- package/dist/proxy/core.js +7 -9
- package/dist/proxy/core.js.map +1 -1
- package/dist/proxy/core.mjs +7 -9
- package/dist/proxy/core.mjs.map +1 -1
- package/dist/proxy/next.js +7 -9
- package/dist/proxy/next.js.map +1 -1
- package/dist/proxy/next.mjs +7 -9
- package/dist/proxy/next.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
// src/version.ts
|
|
9
|
-
var SDK_VERSION = true ? "0.0.
|
|
9
|
+
var SDK_VERSION = true ? "0.0.22" : "dev";
|
|
10
10
|
var SDK_PACKAGE_NAME = true ? "notte-sdk" : "notte-sdk";
|
|
11
11
|
|
|
12
12
|
// src/version-check.ts
|
|
@@ -1014,6 +1014,31 @@ var sessionReplay = (options) => (options.client ?? client).get({
|
|
|
1014
1014
|
url: "/sessions/{session_id}/replay",
|
|
1015
1015
|
...options
|
|
1016
1016
|
});
|
|
1017
|
+
var listSessionFiles = (options) => (options.client ?? client).get({
|
|
1018
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1019
|
+
url: "/sessions/{session_id}/files",
|
|
1020
|
+
...options
|
|
1021
|
+
});
|
|
1022
|
+
var uploadSessionFile = (options) => (options.client ?? client).post({
|
|
1023
|
+
...formDataBodySerializer,
|
|
1024
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1025
|
+
url: "/sessions/{session_id}/files",
|
|
1026
|
+
...options,
|
|
1027
|
+
headers: {
|
|
1028
|
+
"Content-Type": null,
|
|
1029
|
+
...options.headers
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
var deleteSessionFile = (options) => (options.client ?? client).delete({
|
|
1033
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1034
|
+
url: "/sessions/{session_id}/files/{file_id}",
|
|
1035
|
+
...options
|
|
1036
|
+
});
|
|
1037
|
+
var downloadSessionFile = (options) => (options.client ?? client).get({
|
|
1038
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1039
|
+
url: "/sessions/{session_id}/files/{file_id}",
|
|
1040
|
+
...options
|
|
1041
|
+
});
|
|
1017
1042
|
var agentStart = (options) => (options.client ?? client).post({
|
|
1018
1043
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1019
1044
|
url: "/agents/start",
|
|
@@ -1418,46 +1443,6 @@ var getUsageLogs = (options) => (options?.client ?? client).get({
|
|
|
1418
1443
|
url: "/usage/logs",
|
|
1419
1444
|
...options
|
|
1420
1445
|
});
|
|
1421
|
-
var fileDownload = (options) => (options.client ?? client).get({
|
|
1422
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1423
|
-
url: "/storage/{session_id}/downloads/{filename}",
|
|
1424
|
-
...options
|
|
1425
|
-
});
|
|
1426
|
-
var fileUploadDownloadedFile = (options) => (options.client ?? client).post({
|
|
1427
|
-
...formDataBodySerializer,
|
|
1428
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1429
|
-
url: "/storage/{session_id}/downloads/{filename}",
|
|
1430
|
-
...options,
|
|
1431
|
-
headers: {
|
|
1432
|
-
"Content-Type": null,
|
|
1433
|
-
...options.headers
|
|
1434
|
-
}
|
|
1435
|
-
});
|
|
1436
|
-
var fileListDownloads = (options) => (options.client ?? client).get({
|
|
1437
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1438
|
-
url: "/storage/{session_id}/downloads",
|
|
1439
|
-
...options
|
|
1440
|
-
});
|
|
1441
|
-
var fileDownloadUploadedFile = (options) => (options.client ?? client).get({
|
|
1442
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1443
|
-
url: "/storage/uploads/{filename}",
|
|
1444
|
-
...options
|
|
1445
|
-
});
|
|
1446
|
-
var fileUpload = (options) => (options.client ?? client).post({
|
|
1447
|
-
...formDataBodySerializer,
|
|
1448
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1449
|
-
url: "/storage/uploads/{filename}",
|
|
1450
|
-
...options,
|
|
1451
|
-
headers: {
|
|
1452
|
-
"Content-Type": null,
|
|
1453
|
-
...options.headers
|
|
1454
|
-
}
|
|
1455
|
-
});
|
|
1456
|
-
var fileListUploads = (options) => (options?.client ?? client).get({
|
|
1457
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
1458
|
-
url: "/storage/uploads",
|
|
1459
|
-
...options
|
|
1460
|
-
});
|
|
1461
1446
|
var anythingStart = (options) => (options.client ?? client).post({
|
|
1462
1447
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1463
1448
|
url: "/anything/start",
|
|
@@ -1491,6 +1476,15 @@ var deleteSecret = (options) => (options.client ?? client).delete({
|
|
|
1491
1476
|
url: "/secrets/{secret_id}",
|
|
1492
1477
|
...options
|
|
1493
1478
|
});
|
|
1479
|
+
var mintProxyCredentials = (options) => (options.client ?? client).post({
|
|
1480
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1481
|
+
url: "/proxies/gateway/credentials",
|
|
1482
|
+
...options,
|
|
1483
|
+
headers: {
|
|
1484
|
+
"Content-Type": "application/json",
|
|
1485
|
+
...options.headers
|
|
1486
|
+
}
|
|
1487
|
+
});
|
|
1494
1488
|
var healthCheck = (options) => (options?.client ?? client).get({ url: "/health", ...options });
|
|
1495
1489
|
var readyCheck = (options) => (options?.client ?? client).get({ url: "/ready", ...options });
|
|
1496
1490
|
var scrapeWebpage = (options) => (options.client ?? client).post({
|
|
@@ -2692,6 +2686,18 @@ var NottePersona = class {
|
|
|
2692
2686
|
}
|
|
2693
2687
|
return this.response.persona_id;
|
|
2694
2688
|
}
|
|
2689
|
+
/**
|
|
2690
|
+
* Public, human-readable email address of the persona
|
|
2691
|
+
*/
|
|
2692
|
+
get email() {
|
|
2693
|
+
return this.info.email;
|
|
2694
|
+
}
|
|
2695
|
+
/**
|
|
2696
|
+
* Internal UUID-backed mailbox address of the persona
|
|
2697
|
+
*/
|
|
2698
|
+
get internalEmail() {
|
|
2699
|
+
return this.info.internal_email;
|
|
2700
|
+
}
|
|
2695
2701
|
/**
|
|
2696
2702
|
* Start the persona - ensures initialization
|
|
2697
2703
|
*/
|
|
@@ -2952,7 +2958,7 @@ var NotteFunction = class {
|
|
|
2952
2958
|
/**
|
|
2953
2959
|
* Start a function run
|
|
2954
2960
|
*/
|
|
2955
|
-
async run(variables = {}) {
|
|
2961
|
+
async run(variables = {}, options = {}) {
|
|
2956
2962
|
const apiKey = this.client.getConfig().apiKey || "";
|
|
2957
2963
|
if (!apiKey) {
|
|
2958
2964
|
throw new Error("API key is required. Provide it via config.apiKey or set the NOTTE_API_KEY environment variable.");
|
|
@@ -2971,7 +2977,8 @@ var NotteFunction = class {
|
|
|
2971
2977
|
body: {
|
|
2972
2978
|
workflow_id: this.functionId,
|
|
2973
2979
|
variables,
|
|
2974
|
-
stream: false
|
|
2980
|
+
stream: false,
|
|
2981
|
+
...options.runtime ? { runtime: options.runtime } : {}
|
|
2975
2982
|
}
|
|
2976
2983
|
});
|
|
2977
2984
|
if (response?.error) {
|
|
@@ -3064,6 +3071,53 @@ function isHttpUrl(value) {
|
|
|
3064
3071
|
|
|
3065
3072
|
// src/client.ts
|
|
3066
3073
|
import { z as z3 } from "zod";
|
|
3074
|
+
|
|
3075
|
+
// src/files.ts
|
|
3076
|
+
var SessionFiles = class {
|
|
3077
|
+
constructor(client2, sessionId) {
|
|
3078
|
+
this.client = client2;
|
|
3079
|
+
this.sessionId = sessionId;
|
|
3080
|
+
}
|
|
3081
|
+
path(fileId) {
|
|
3082
|
+
const root = `/sessions/${encodeURIComponent(this.sessionId)}/files`;
|
|
3083
|
+
return fileId ? `${root}/${encodeURIComponent(fileId)}` : root;
|
|
3084
|
+
}
|
|
3085
|
+
async upload(file, filename = "file") {
|
|
3086
|
+
const body = new FormData();
|
|
3087
|
+
body.append("file", file, filename);
|
|
3088
|
+
const result = await this.client.request({
|
|
3089
|
+
method: "POST",
|
|
3090
|
+
url: this.path(),
|
|
3091
|
+
body
|
|
3092
|
+
});
|
|
3093
|
+
if (result.error || !result.data) throw new Error("Failed to upload session file");
|
|
3094
|
+
return result.data;
|
|
3095
|
+
}
|
|
3096
|
+
async list(options = {}) {
|
|
3097
|
+
const result = await this.client.request({
|
|
3098
|
+
method: "GET",
|
|
3099
|
+
url: this.path(),
|
|
3100
|
+
query: { limit: options.limit ?? 100, offset: options.offset ?? 0, source: options.source }
|
|
3101
|
+
});
|
|
3102
|
+
if (result.error || !result.data) throw new Error("Failed to list session files");
|
|
3103
|
+
return result.data;
|
|
3104
|
+
}
|
|
3105
|
+
async download(fileId) {
|
|
3106
|
+
const result = await this.client.request({
|
|
3107
|
+
method: "GET",
|
|
3108
|
+
url: this.path(fileId),
|
|
3109
|
+
parseAs: "blob"
|
|
3110
|
+
});
|
|
3111
|
+
if (result.error || !result.data) throw new Error(`Failed to download session file ${fileId}`);
|
|
3112
|
+
return result.data;
|
|
3113
|
+
}
|
|
3114
|
+
async delete(fileId) {
|
|
3115
|
+
const result = await this.client.request({ method: "DELETE", url: this.path(fileId) });
|
|
3116
|
+
if (result.error) throw new Error(`Failed to delete session file ${fileId}`);
|
|
3117
|
+
}
|
|
3118
|
+
};
|
|
3119
|
+
|
|
3120
|
+
// src/client.ts
|
|
3067
3121
|
var NotteClient = class {
|
|
3068
3122
|
constructor(config = {}) {
|
|
3069
3123
|
const apiKey = config.apiKey || process.env.NOTTE_API_KEY;
|
|
@@ -3120,6 +3174,10 @@ var NotteClient = class {
|
|
|
3120
3174
|
Session(options = {}) {
|
|
3121
3175
|
return new Session(this, options);
|
|
3122
3176
|
}
|
|
3177
|
+
/** Access files owned by a specific session, including closed sessions. */
|
|
3178
|
+
Files(sessionId) {
|
|
3179
|
+
return new SessionFiles(this.getClient(), sessionId);
|
|
3180
|
+
}
|
|
3123
3181
|
/**
|
|
3124
3182
|
* Create a new agent
|
|
3125
3183
|
*/
|
|
@@ -3240,6 +3298,7 @@ export {
|
|
|
3240
3298
|
NotteProxyAuthError,
|
|
3241
3299
|
NotteVault,
|
|
3242
3300
|
Session,
|
|
3301
|
+
SessionFiles,
|
|
3243
3302
|
agentStart,
|
|
3244
3303
|
agentStatus,
|
|
3245
3304
|
agentStop,
|
|
@@ -3254,12 +3313,8 @@ export {
|
|
|
3254
3313
|
createClient2 as createClient,
|
|
3255
3314
|
NotteClient as default,
|
|
3256
3315
|
deleteSecret,
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
fileListDownloads,
|
|
3260
|
-
fileListUploads,
|
|
3261
|
-
fileUpload,
|
|
3262
|
-
fileUploadDownloadedFile,
|
|
3316
|
+
deleteSessionFile,
|
|
3317
|
+
downloadSessionFile,
|
|
3263
3318
|
functionCreate,
|
|
3264
3319
|
functionDelete,
|
|
3265
3320
|
functionDownloadUrl,
|
|
@@ -3286,6 +3341,7 @@ export {
|
|
|
3286
3341
|
listFunctions,
|
|
3287
3342
|
listPersonas,
|
|
3288
3343
|
listSecrets,
|
|
3344
|
+
listSessionFiles,
|
|
3289
3345
|
listSessions,
|
|
3290
3346
|
listVaults,
|
|
3291
3347
|
mailboxConnectToken,
|
|
@@ -3295,6 +3351,7 @@ export {
|
|
|
3295
3351
|
mailboxSync,
|
|
3296
3352
|
mailboxUpdate,
|
|
3297
3353
|
managedAuthConnectLinkCreate,
|
|
3354
|
+
mintProxyCredentials,
|
|
3298
3355
|
nudgePrompt,
|
|
3299
3356
|
pageExecute,
|
|
3300
3357
|
pageObserve,
|
|
@@ -3327,6 +3384,7 @@ export {
|
|
|
3327
3384
|
sessionStatus,
|
|
3328
3385
|
sessionStop,
|
|
3329
3386
|
storeSecret,
|
|
3387
|
+
uploadSessionFile,
|
|
3330
3388
|
vaultCreate,
|
|
3331
3389
|
vaultCredentialsAdd,
|
|
3332
3390
|
vaultCredentialsDelete,
|