@blaxel/core 0.2.55-preview.17 → 0.2.56-dev.23
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/client/sdk.gen.js +2 -36
- package/dist/cjs/common/sentry.js +227 -131
- package/dist/cjs/common/settings.js +3 -3
- package/dist/cjs/common/version.js +6 -0
- package/dist/cjs/types/client/sdk.gen.d.ts +1 -11
- package/dist/cjs/types/client/types.gen.d.ts +0 -48
- package/dist/cjs/types/common/sentry.d.ts +1 -3
- package/dist/cjs/types/common/version.d.ts +2 -0
- package/dist/cjs/types/sandbox/client/sdk.gen.d.ts +3 -3
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/client/sdk.gen.js +2 -36
- package/dist/cjs-browser/common/sentry-browser.js +27 -0
- package/dist/cjs-browser/common/sentry.js +306 -11
- package/dist/cjs-browser/common/settings.js +3 -3
- package/dist/cjs-browser/common/version.js +6 -0
- package/dist/cjs-browser/types/client/sdk.gen.d.ts +1 -11
- package/dist/cjs-browser/types/client/types.gen.d.ts +0 -48
- package/dist/cjs-browser/types/common/sentry.d.ts +1 -3
- package/dist/cjs-browser/types/common/version.d.ts +2 -0
- package/dist/cjs-browser/types/sandbox/client/sdk.gen.d.ts +3 -3
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/client/sdk.gen.js +0 -32
- package/dist/esm/common/sentry.js +227 -98
- package/dist/esm/common/settings.js +3 -3
- package/dist/esm/common/version.js +3 -0
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/client/sdk.gen.js +0 -32
- package/dist/esm-browser/common/sentry-browser.js +22 -0
- package/dist/esm-browser/common/sentry.js +306 -11
- package/dist/esm-browser/common/settings.js +3 -3
- package/dist/esm-browser/common/version.js +3 -0
- package/package.json +2 -4
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.updateModel = exports.getModel = exports.deleteModel = exports.createModel = exports.listModels = exports.listMcpHubDefinitions = exports.listLocations = exports.listJobRevisions = exports.getJobExecution = exports.deleteJobExecution = exports.createJobExecution = exports.listJobExecutions = exports.updateJob = exports.getJob = exports.deleteJob = exports.createJob = exports.listJobs = exports.getIntegrationConnectionModel = exports.listIntegrationConnectionModels = exports.getIntegrationConnectionModelEndpointConfigurations = exports.updateIntegrationConnection = exports.getIntegrationConnection = exports.deleteIntegrationConnection = exports.createIntegrationConnection = exports.listIntegrationConnections = exports.getIntegration = exports.deleteImageTag = exports.getImage = exports.deleteImage = exports.listImages = exports.cleanupImages = exports.listFunctionRevisions = exports.updateFunction = exports.getFunction = exports.deleteFunction = exports.createFunction = exports.listFunctions = exports.verifyCustomDomain = exports.updateCustomDomain = exports.getCustomDomain = exports.deleteCustomDomain = exports.createCustomDomain = exports.listCustomDomains = exports.getConfiguration = exports.listAgentRevisions = exports.updateAgent = exports.getAgent = exports.deleteAgent = exports.createAgent = exports.listAgents = void 0;
|
|
5
|
-
exports.deleteWorkspace = exports.createWorkspace = exports.listWorkspaces = exports.getVolume = exports.deleteVolume = exports.createVolume = exports.listVolumes = exports.deleteVolumeTemplateVersion = exports.updateVolumeTemplate = exports.getVolumeTemplate = exports.deleteVolumeTemplate = exports.createVolumeTemplate = exports.listVolumeTemplates = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = exports.
|
|
6
|
-
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation =
|
|
5
|
+
exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorkspace = exports.listWorkspaces = exports.getVolume = exports.deleteVolume = exports.createVolume = exports.listVolumes = exports.deleteVolumeTemplateVersion = exports.updateVolumeTemplate = exports.getVolumeTemplate = exports.deleteVolumeTemplate = exports.createVolumeTemplate = exports.listVolumeTemplates = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = exports.deleteSandboxPreviewToken = exports.createSandboxPreviewToken = exports.listSandboxPreviewTokens = exports.updateSandboxPreview = exports.getSandboxPreview = exports.deleteSandboxPreview = exports.createSandboxPreview = exports.listSandboxPreviews = exports.updateSandbox = exports.getSandbox = exports.deleteSandbox = exports.createSandbox = exports.listSandboxes = exports.listSandboxHubDefinitions = exports.listPublicIps = exports.listAllPendingInvitations = exports.updatePolicy = exports.getPolicy = exports.deletePolicy = exports.createPolicy = exports.listPolicies = exports.listModelRevisions = void 0;
|
|
6
|
+
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = void 0;
|
|
7
7
|
const client_gen_1 = require("./client.gen");
|
|
8
8
|
/**
|
|
9
9
|
* List all agents
|
|
@@ -1283,40 +1283,6 @@ const deleteSandboxPreviewToken = (options) => {
|
|
|
1283
1283
|
});
|
|
1284
1284
|
};
|
|
1285
1285
|
exports.deleteSandboxPreviewToken = deleteSandboxPreviewToken;
|
|
1286
|
-
/**
|
|
1287
|
-
* Start Sandbox
|
|
1288
|
-
* Starts a Sandbox by name.
|
|
1289
|
-
*/
|
|
1290
|
-
const startSandbox = (options) => {
|
|
1291
|
-
return (options.client ?? client_gen_1.client).put({
|
|
1292
|
-
security: [
|
|
1293
|
-
{
|
|
1294
|
-
scheme: 'bearer',
|
|
1295
|
-
type: 'http'
|
|
1296
|
-
}
|
|
1297
|
-
],
|
|
1298
|
-
url: '/sandboxes/{sandboxName}/start',
|
|
1299
|
-
...options
|
|
1300
|
-
});
|
|
1301
|
-
};
|
|
1302
|
-
exports.startSandbox = startSandbox;
|
|
1303
|
-
/**
|
|
1304
|
-
* Stop Sandbox
|
|
1305
|
-
* Stops a Sandbox by name.
|
|
1306
|
-
*/
|
|
1307
|
-
const stopSandbox = (options) => {
|
|
1308
|
-
return (options.client ?? client_gen_1.client).put({
|
|
1309
|
-
security: [
|
|
1310
|
-
{
|
|
1311
|
-
scheme: 'bearer',
|
|
1312
|
-
type: 'http'
|
|
1313
|
-
}
|
|
1314
|
-
],
|
|
1315
|
-
url: '/sandboxes/{sandboxName}/stop',
|
|
1316
|
-
...options
|
|
1317
|
-
});
|
|
1318
|
-
};
|
|
1319
|
-
exports.stopSandbox = stopSandbox;
|
|
1320
1286
|
/**
|
|
1321
1287
|
* Get workspace service accounts
|
|
1322
1288
|
* Returns a list of all service accounts in the workspace.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.initSentry = initSentry;
|
|
5
|
+
exports.flushSentry = flushSentry;
|
|
6
|
+
exports.isSentryInitialized = isSentryInitialized;
|
|
7
|
+
// Browser/Edge-compatible exports for Sentry
|
|
8
|
+
// In browser/edge environments, @sentry/node is not available
|
|
9
|
+
// All functions are no-ops
|
|
10
|
+
/**
|
|
11
|
+
* Initialize Sentry - no-op in browser/edge environments.
|
|
12
|
+
*/
|
|
13
|
+
function initSentry() {
|
|
14
|
+
// No-op in browser/edge environments
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Flush pending Sentry events - no-op in browser/edge environments.
|
|
18
|
+
*/
|
|
19
|
+
async function flushSentry(_timeout = 2000) {
|
|
20
|
+
// No-op in browser/edge environments
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Check if Sentry is initialized - always returns false in browser/edge environments.
|
|
24
|
+
*/
|
|
25
|
+
function isSentryInitialized() {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
@@ -1,27 +1,322 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable */
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.initSentry = initSentry;
|
|
5
4
|
exports.flushSentry = flushSentry;
|
|
6
5
|
exports.isSentryInitialized = isSentryInitialized;
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
|
|
6
|
+
const settings_js_1 = require("./settings.js");
|
|
7
|
+
// Lightweight Sentry client using fetch - only captures SDK errors
|
|
8
|
+
let sentryInitialized = false;
|
|
9
|
+
const capturedExceptions = new Set();
|
|
10
|
+
let handlersRegistered = false;
|
|
11
|
+
// Parsed DSN components
|
|
12
|
+
let sentryConfig = null;
|
|
13
|
+
// SDK path patterns to identify errors originating from our SDK
|
|
14
|
+
const SDK_PATTERNS = [
|
|
15
|
+
"@blaxel/",
|
|
16
|
+
"blaxel-sdk",
|
|
17
|
+
"/node_modules/@blaxel/",
|
|
18
|
+
"/@blaxel/core/",
|
|
19
|
+
"/@blaxel/telemetry/",
|
|
20
|
+
];
|
|
10
21
|
/**
|
|
11
|
-
*
|
|
22
|
+
* Check if an error originated from the SDK based on its stack trace.
|
|
23
|
+
* Returns true if the stack trace contains any SDK-related paths.
|
|
24
|
+
*/
|
|
25
|
+
function isFromSDK(error) {
|
|
26
|
+
const stack = error.stack || "";
|
|
27
|
+
return SDK_PATTERNS.some((pattern) => stack.includes(pattern));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse a Sentry DSN into its components.
|
|
31
|
+
* DSN format: https://{public_key}@{host}/{project_id}
|
|
32
|
+
*/
|
|
33
|
+
function parseDsn(dsn) {
|
|
34
|
+
try {
|
|
35
|
+
const url = new URL(dsn);
|
|
36
|
+
const publicKey = url.username;
|
|
37
|
+
const host = url.host;
|
|
38
|
+
const projectId = url.pathname.slice(1); // Remove leading slash
|
|
39
|
+
if (!publicKey || !host || !projectId) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return { publicKey, host, projectId };
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Generate a UUID v4
|
|
50
|
+
*/
|
|
51
|
+
function generateEventId() {
|
|
52
|
+
return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
53
|
+
const r = (Math.random() * 16) | 0;
|
|
54
|
+
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
55
|
+
return v.toString(16);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Convert an Error to a Sentry event payload.
|
|
60
|
+
*/
|
|
61
|
+
function errorToSentryEvent(error) {
|
|
62
|
+
const frames = parseStackTrace(error.stack || "");
|
|
63
|
+
return {
|
|
64
|
+
event_id: generateEventId(),
|
|
65
|
+
timestamp: Date.now() / 1000,
|
|
66
|
+
platform: "javascript",
|
|
67
|
+
level: "error",
|
|
68
|
+
environment: settings_js_1.settings.env,
|
|
69
|
+
release: `sdk-typescript@${settings_js_1.settings.version}`,
|
|
70
|
+
tags: {
|
|
71
|
+
"blaxel.workspace": settings_js_1.settings.workspace,
|
|
72
|
+
"blaxel.version": settings_js_1.settings.version,
|
|
73
|
+
"blaxel.commit": settings_js_1.settings.commit,
|
|
74
|
+
},
|
|
75
|
+
exception: {
|
|
76
|
+
values: [
|
|
77
|
+
{
|
|
78
|
+
type: error.name,
|
|
79
|
+
value: error.message,
|
|
80
|
+
stacktrace: {
|
|
81
|
+
frames,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Parse a stack trace string into Sentry-compatible frames.
|
|
90
|
+
*/
|
|
91
|
+
function parseStackTrace(stack) {
|
|
92
|
+
const lines = stack.split("\n").slice(1); // Skip first line (error message)
|
|
93
|
+
const frames = [];
|
|
94
|
+
for (const line of lines) {
|
|
95
|
+
// Match patterns like "at functionName (filename:line:col)" or "at filename:line:col"
|
|
96
|
+
const match = line.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?/);
|
|
97
|
+
if (match) {
|
|
98
|
+
frames.unshift({
|
|
99
|
+
function: match[1] || "<anonymous>",
|
|
100
|
+
filename: match[2],
|
|
101
|
+
lineno: parseInt(match[3], 10),
|
|
102
|
+
colno: parseInt(match[4], 10),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return frames;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Send an event to Sentry using fetch.
|
|
110
|
+
*/
|
|
111
|
+
async function sendToSentry(event) {
|
|
112
|
+
if (!sentryConfig)
|
|
113
|
+
return;
|
|
114
|
+
const { publicKey, host, projectId } = sentryConfig;
|
|
115
|
+
const envelopeUrl = `https://${host}/api/${projectId}/envelope/`;
|
|
116
|
+
// Create envelope header
|
|
117
|
+
const envelopeHeader = JSON.stringify({
|
|
118
|
+
event_id: event.event_id,
|
|
119
|
+
sent_at: new Date().toISOString(),
|
|
120
|
+
dsn: `https://${publicKey}@${host}/${projectId}`,
|
|
121
|
+
});
|
|
122
|
+
// Create item header
|
|
123
|
+
const itemHeader = JSON.stringify({
|
|
124
|
+
type: "event",
|
|
125
|
+
content_type: "application/json",
|
|
126
|
+
});
|
|
127
|
+
// Create envelope body
|
|
128
|
+
const envelope = `${envelopeHeader}\n${itemHeader}\n${JSON.stringify(event)}`;
|
|
129
|
+
try {
|
|
130
|
+
await fetch(envelopeUrl, {
|
|
131
|
+
method: "POST",
|
|
132
|
+
headers: {
|
|
133
|
+
"Content-Type": "application/x-sentry-envelope",
|
|
134
|
+
"X-Sentry-Auth": `Sentry sentry_version=7, sentry_client=blaxel-sdk/${settings_js_1.settings.version}, sentry_key=${publicKey}`,
|
|
135
|
+
},
|
|
136
|
+
body: envelope,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// Silently fail - error reporting should never break the SDK
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Queue for pending events
|
|
144
|
+
const pendingEvents = [];
|
|
145
|
+
let flushPromise = null;
|
|
146
|
+
/**
|
|
147
|
+
* Register browser/edge environment error handlers.
|
|
148
|
+
* Separated to isolate dynamic globalThis access.
|
|
149
|
+
*/
|
|
150
|
+
function registerBrowserHandlers() {
|
|
151
|
+
const g = globalThis;
|
|
152
|
+
if (g && typeof g.addEventListener === "function") {
|
|
153
|
+
g.addEventListener("error", (event) => {
|
|
154
|
+
const e = event;
|
|
155
|
+
if (e.error instanceof Error && isFromSDK(e.error)) {
|
|
156
|
+
captureException(e.error);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
g.addEventListener("unhandledrejection", (event) => {
|
|
160
|
+
const e = event;
|
|
161
|
+
const error = e.reason instanceof Error ? e.reason : new Error(String(e.reason));
|
|
162
|
+
if (isFromSDK(error)) {
|
|
163
|
+
captureException(error);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Initialize the lightweight Sentry client for SDK error tracking.
|
|
12
170
|
*/
|
|
13
171
|
function initSentry() {
|
|
14
|
-
|
|
172
|
+
try {
|
|
173
|
+
// Check if tracking is disabled
|
|
174
|
+
if (!settings_js_1.settings.tracking) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const dsn = settings_js_1.settings.sentryDsn;
|
|
178
|
+
if (!dsn) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
// Parse DSN
|
|
182
|
+
sentryConfig = parseDsn(dsn);
|
|
183
|
+
if (!sentryConfig) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
// Only allow dev/prod environments
|
|
187
|
+
if (settings_js_1.settings.env !== "dev" && settings_js_1.settings.env !== "prod") {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
sentryInitialized = true;
|
|
191
|
+
// Register error handlers only once
|
|
192
|
+
if (!handlersRegistered) {
|
|
193
|
+
handlersRegistered = true;
|
|
194
|
+
// Node.js specific handlers
|
|
195
|
+
if (typeof process !== "undefined" && typeof process.on === "function") {
|
|
196
|
+
// For SIGTERM/SIGINT, flush before exit
|
|
197
|
+
const signalHandler = (signal) => {
|
|
198
|
+
flushSentry(500)
|
|
199
|
+
.catch(() => {
|
|
200
|
+
// Silently fail
|
|
201
|
+
})
|
|
202
|
+
.finally(() => {
|
|
203
|
+
process.exit(signal === "SIGTERM" ? 143 : 130);
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
// Uncaught exception handler - only capture SDK errors
|
|
207
|
+
const uncaughtExceptionHandler = (error) => {
|
|
208
|
+
if (isFromSDK(error)) {
|
|
209
|
+
captureException(error);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
// Unhandled rejection handler - only capture SDK errors
|
|
213
|
+
const unhandledRejectionHandler = (reason) => {
|
|
214
|
+
const error = reason instanceof Error ? reason : new Error(String(reason));
|
|
215
|
+
if (isFromSDK(error)) {
|
|
216
|
+
captureException(error);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
process.on("SIGTERM", () => signalHandler("SIGTERM"));
|
|
220
|
+
process.on("SIGINT", () => signalHandler("SIGINT"));
|
|
221
|
+
process.on("uncaughtException", uncaughtExceptionHandler);
|
|
222
|
+
process.on("unhandledRejection", unhandledRejectionHandler);
|
|
223
|
+
// Intercept console.error to capture SDK errors that are caught and logged
|
|
224
|
+
const originalConsoleError = console.error;
|
|
225
|
+
console.error = function (...args) {
|
|
226
|
+
originalConsoleError.apply(console, args);
|
|
227
|
+
for (const arg of args) {
|
|
228
|
+
if (arg instanceof Error && isFromSDK(arg)) {
|
|
229
|
+
captureException(arg);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
// Browser/Edge environment handlers
|
|
237
|
+
registerBrowserHandlers();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
// Silently fail - Sentry initialization should never break the SDK
|
|
243
|
+
if (settings_js_1.settings.env !== "production") {
|
|
244
|
+
console.error("[Blaxel SDK] Error initializing Sentry:", error);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Capture an exception to Sentry.
|
|
250
|
+
* Only errors originating from SDK code will be captured.
|
|
251
|
+
*
|
|
252
|
+
* @param error - The error to capture
|
|
253
|
+
*/
|
|
254
|
+
function captureException(error) {
|
|
255
|
+
if (!sentryInitialized || !sentryConfig) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
// Double-check that error is from SDK (defense in depth)
|
|
259
|
+
if (!isFromSDK(error)) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
try {
|
|
263
|
+
// Create a unique identifier for this exception to avoid duplicates
|
|
264
|
+
const errorKey = `${error.name}:${error.message}:${error.stack?.slice(0, 200)}`;
|
|
265
|
+
if (capturedExceptions.has(errorKey)) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
capturedExceptions.add(errorKey);
|
|
269
|
+
// Clean up old exception keys to prevent memory leak
|
|
270
|
+
if (capturedExceptions.size > 1000) {
|
|
271
|
+
capturedExceptions.clear();
|
|
272
|
+
}
|
|
273
|
+
// Convert error to Sentry event and queue it
|
|
274
|
+
const event = errorToSentryEvent(error);
|
|
275
|
+
pendingEvents.push(event);
|
|
276
|
+
// Send immediately (fire and forget)
|
|
277
|
+
sendToSentry(event).catch(() => {
|
|
278
|
+
// Silently fail
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
// Silently fail - error capturing should never break the SDK
|
|
283
|
+
}
|
|
15
284
|
}
|
|
16
285
|
/**
|
|
17
|
-
* Flush pending Sentry events
|
|
286
|
+
* Flush pending Sentry events.
|
|
287
|
+
* This should be called before the process exits to ensure all events are sent.
|
|
288
|
+
*
|
|
289
|
+
* @param timeout - Maximum time in milliseconds to wait for flush (default: 2000)
|
|
18
290
|
*/
|
|
19
|
-
async function flushSentry(
|
|
20
|
-
|
|
291
|
+
async function flushSentry(timeout = 2000) {
|
|
292
|
+
if (!sentryInitialized || pendingEvents.length === 0) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
// If already flushing, wait for it
|
|
296
|
+
if (flushPromise) {
|
|
297
|
+
await flushPromise;
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
try {
|
|
301
|
+
// Send all pending events
|
|
302
|
+
const eventsToSend = [...pendingEvents];
|
|
303
|
+
pendingEvents.length = 0;
|
|
304
|
+
flushPromise = Promise.race([
|
|
305
|
+
Promise.all(eventsToSend.map((event) => sendToSentry(event))).then(() => { }),
|
|
306
|
+
new Promise((resolve) => setTimeout(resolve, timeout)),
|
|
307
|
+
]);
|
|
308
|
+
await flushPromise;
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
// Silently fail
|
|
312
|
+
}
|
|
313
|
+
finally {
|
|
314
|
+
flushPromise = null;
|
|
315
|
+
}
|
|
21
316
|
}
|
|
22
317
|
/**
|
|
23
|
-
* Check if Sentry is initialized
|
|
318
|
+
* Check if Sentry is initialized and available.
|
|
24
319
|
*/
|
|
25
320
|
function isSentryInitialized() {
|
|
26
|
-
return
|
|
321
|
+
return sentryInitialized;
|
|
27
322
|
}
|
|
@@ -9,9 +9,9 @@ const index_js_1 = require("../authentication/index.js");
|
|
|
9
9
|
const env_js_1 = require("../common/env.js");
|
|
10
10
|
const node_js_1 = require("../common/node.js");
|
|
11
11
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
12
|
-
const BUILD_VERSION = "0.2.
|
|
13
|
-
const BUILD_COMMIT = "
|
|
14
|
-
const BUILD_SENTRY_DSN = "
|
|
12
|
+
const BUILD_VERSION = "0.2.56-dev.23";
|
|
13
|
+
const BUILD_COMMIT = "d54548dc9e764e57728f9eda7721d5e50f11573a";
|
|
14
|
+
const BUILD_SENTRY_DSN = "";
|
|
15
15
|
// Cache for config.yaml tracking value
|
|
16
16
|
let configTrackingValue = null;
|
|
17
17
|
let configTrackingLoaded = false;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PACKAGE_COMMIT = exports.PACKAGE_VERSION = void 0;
|
|
4
|
+
// This file is auto-generated during build. Do not edit manually.
|
|
5
|
+
exports.PACKAGE_VERSION = "0.2.50";
|
|
6
|
+
exports.PACKAGE_COMMIT = "4a74989dcb65a6ff8d826aed7976436c64554f6a";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, CleanupImagesData, ListImagesData, DeleteImageData, GetImageData, DeleteImageTagData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobExecutionsData, CreateJobExecutionData, DeleteJobExecutionData, GetJobExecutionData, ListJobRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListAllPendingInvitationsData, ListPublicIpsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData,
|
|
2
|
+
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, CleanupImagesData, ListImagesData, DeleteImageData, GetImageData, DeleteImageTagData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobExecutionsData, CreateJobExecutionData, DeleteJobExecutionData, GetJobExecutionData, ListJobRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListAllPendingInvitationsData, ListPublicIpsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData, GetWorkspaceServiceAccountsData, CreateWorkspaceServiceAccountData, DeleteWorkspaceServiceAccountData, UpdateWorkspaceServiceAccountData, ListApiKeysForServiceAccountData, CreateApiKeyForServiceAccountData, DeleteApiKeyForServiceAccountData, ListTemplatesData, GetTemplateData, ListWorkspaceUsersData, InviteWorkspaceUserData, RemoveWorkspaceUserData, UpdateWorkspaceUserRoleData, ListVolumeTemplatesData, CreateVolumeTemplateData, DeleteVolumeTemplateData, GetVolumeTemplateData, UpdateVolumeTemplateData, DeleteVolumeTemplateVersionData, ListVolumesData, CreateVolumeData, DeleteVolumeData, GetVolumeData, ListWorkspacesData, CreateWorkspaceData, DeleteWorkspaceData, GetWorkspaceData, UpdateWorkspaceData, DeclineWorkspaceInvitationData, AcceptWorkspaceInvitationData, LeaveWorkspaceData, CheckWorkspaceAvailabilityData } from './types.gen.js';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -352,16 +352,6 @@ export declare const createSandboxPreviewToken: <ThrowOnError extends boolean =
|
|
|
352
352
|
export declare const deleteSandboxPreviewToken: <ThrowOnError extends boolean = false>(options: Options<DeleteSandboxPreviewTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
353
353
|
message?: string;
|
|
354
354
|
}, unknown, ThrowOnError>;
|
|
355
|
-
/**
|
|
356
|
-
* Start Sandbox
|
|
357
|
-
* Starts a Sandbox by name.
|
|
358
|
-
*/
|
|
359
|
-
export declare const startSandbox: <ThrowOnError extends boolean = false>(options: Options<StartSandboxData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").StartSandbox, unknown, ThrowOnError>;
|
|
360
|
-
/**
|
|
361
|
-
* Stop Sandbox
|
|
362
|
-
* Stops a Sandbox by name.
|
|
363
|
-
*/
|
|
364
|
-
export declare const stopSandbox: <ThrowOnError extends boolean = false>(options: Options<StopSandboxData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").StopSandbox, unknown, ThrowOnError>;
|
|
365
355
|
/**
|
|
366
356
|
* Get workspace service accounts
|
|
367
357
|
* Returns a list of all service accounts in the workspace.
|
|
@@ -4432,54 +4432,6 @@ export type DeleteSandboxPreviewTokenResponses = {
|
|
|
4432
4432
|
};
|
|
4433
4433
|
};
|
|
4434
4434
|
export type DeleteSandboxPreviewTokenResponse = DeleteSandboxPreviewTokenResponses[keyof DeleteSandboxPreviewTokenResponses];
|
|
4435
|
-
export type StartSandboxData = {
|
|
4436
|
-
body?: never;
|
|
4437
|
-
path: {
|
|
4438
|
-
/**
|
|
4439
|
-
* Name of the Sandbox
|
|
4440
|
-
*/
|
|
4441
|
-
sandboxName: string;
|
|
4442
|
-
};
|
|
4443
|
-
query?: never;
|
|
4444
|
-
url: '/sandboxes/{sandboxName}/start';
|
|
4445
|
-
};
|
|
4446
|
-
export type StartSandboxErrors = {
|
|
4447
|
-
/**
|
|
4448
|
-
* Sandbox is already running
|
|
4449
|
-
*/
|
|
4450
|
-
409: unknown;
|
|
4451
|
-
};
|
|
4452
|
-
export type StartSandboxResponses = {
|
|
4453
|
-
/**
|
|
4454
|
-
* successful operation
|
|
4455
|
-
*/
|
|
4456
|
-
200: StartSandbox;
|
|
4457
|
-
};
|
|
4458
|
-
export type StartSandboxResponse = StartSandboxResponses[keyof StartSandboxResponses];
|
|
4459
|
-
export type StopSandboxData = {
|
|
4460
|
-
body?: never;
|
|
4461
|
-
path: {
|
|
4462
|
-
/**
|
|
4463
|
-
* Name of the Sandbox
|
|
4464
|
-
*/
|
|
4465
|
-
sandboxName: string;
|
|
4466
|
-
};
|
|
4467
|
-
query?: never;
|
|
4468
|
-
url: '/sandboxes/{sandboxName}/stop';
|
|
4469
|
-
};
|
|
4470
|
-
export type StopSandboxErrors = {
|
|
4471
|
-
/**
|
|
4472
|
-
* Sandbox is not running
|
|
4473
|
-
*/
|
|
4474
|
-
409: unknown;
|
|
4475
|
-
};
|
|
4476
|
-
export type StopSandboxResponses = {
|
|
4477
|
-
/**
|
|
4478
|
-
* successful operation
|
|
4479
|
-
*/
|
|
4480
|
-
200: StopSandbox;
|
|
4481
|
-
};
|
|
4482
|
-
export type StopSandboxResponse = StopSandboxResponses[keyof StopSandboxResponses];
|
|
4483
4435
|
export type GetWorkspaceServiceAccountsData = {
|
|
4484
4436
|
body?: never;
|
|
4485
4437
|
path?: never;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Initialize
|
|
3
|
-
* This creates a separate Sentry instance that won't interfere with any
|
|
4
|
-
* Sentry configuration the user might have in their application.
|
|
2
|
+
* Initialize the lightweight Sentry client for SDK error tracking.
|
|
5
3
|
*/
|
|
6
4
|
export declare function initSentry(): void;
|
|
7
5
|
/**
|
|
@@ -138,7 +138,7 @@ export declare const deleteFilesystemByPath: <ThrowOnError extends boolean = fal
|
|
|
138
138
|
* Get file or directory information
|
|
139
139
|
* Get content of a file or listing of a directory. Use Accept header to control response format for files.
|
|
140
140
|
*/
|
|
141
|
-
export declare const getFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").
|
|
141
|
+
export declare const getFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Directory | Blob | import("./types.gen").FileWithContent | import("./types.gen").File, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
142
142
|
/**
|
|
143
143
|
* Create or update a file or directory
|
|
144
144
|
* Create or update a file or directory
|
|
@@ -153,12 +153,12 @@ export declare const deleteFilesystemTreeByPath: <ThrowOnError extends boolean =
|
|
|
153
153
|
* Get directory tree
|
|
154
154
|
* Get a recursive directory tree structure starting from the specified path
|
|
155
155
|
*/
|
|
156
|
-
export declare const getFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").
|
|
156
|
+
export declare const getFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Directory | Blob | import("./types.gen").FileWithContent | import("./types.gen").File, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
157
157
|
/**
|
|
158
158
|
* Create or update directory tree
|
|
159
159
|
* Create or update multiple files within a directory tree structure
|
|
160
160
|
*/
|
|
161
|
-
export declare const putFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<PutFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").
|
|
161
|
+
export declare const putFilesystemTreeByPath: <ThrowOnError extends boolean = false>(options: Options<PutFilesystemTreeByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Directory | Blob | import("./types.gen").FileWithContent | import("./types.gen").File, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
162
162
|
/**
|
|
163
163
|
* Stop monitoring ports for a process
|
|
164
164
|
* Stop monitoring for new ports opened by a process
|