@langfuse/core 5.0.0 → 5.0.1
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.cjs +121 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -10
- package/dist/index.d.ts +76 -10
- package/dist/index.mjs +120 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
BlobStorageExportMode: () => BlobStorageExportMode,
|
|
28
28
|
BlobStorageIntegrationFileType: () => BlobStorageIntegrationFileType,
|
|
29
29
|
BlobStorageIntegrationType: () => BlobStorageIntegrationType,
|
|
30
|
+
BlobStorageSyncStatus: () => BlobStorageSyncStatus,
|
|
30
31
|
ChatMessageType: () => ChatMessageType,
|
|
31
32
|
CommentObjectType: () => CommentObjectType,
|
|
32
33
|
CreateChatPromptType: () => CreateChatPromptType,
|
|
@@ -376,7 +377,7 @@ var resetGlobalLogger = () => {
|
|
|
376
377
|
// package.json
|
|
377
378
|
var package_default = {
|
|
378
379
|
name: "@langfuse/core",
|
|
379
|
-
version: "
|
|
380
|
+
version: "5.0.1",
|
|
380
381
|
description: "Core functions and utilities for Langfuse packages",
|
|
381
382
|
type: "module",
|
|
382
383
|
sideEffects: false,
|
|
@@ -487,7 +488,8 @@ __export(blobStorageIntegrations_exports, {
|
|
|
487
488
|
BlobStorageExportFrequency: () => BlobStorageExportFrequency,
|
|
488
489
|
BlobStorageExportMode: () => BlobStorageExportMode,
|
|
489
490
|
BlobStorageIntegrationFileType: () => BlobStorageIntegrationFileType,
|
|
490
|
-
BlobStorageIntegrationType: () => BlobStorageIntegrationType
|
|
491
|
+
BlobStorageIntegrationType: () => BlobStorageIntegrationType,
|
|
492
|
+
BlobStorageSyncStatus: () => BlobStorageSyncStatus
|
|
491
493
|
});
|
|
492
494
|
|
|
493
495
|
// src/api/api/resources/blobStorageIntegrations/types/BlobStorageIntegrationType.ts
|
|
@@ -518,6 +520,15 @@ var BlobStorageExportFrequency = {
|
|
|
518
520
|
Weekly: "weekly"
|
|
519
521
|
};
|
|
520
522
|
|
|
523
|
+
// src/api/api/resources/blobStorageIntegrations/types/BlobStorageSyncStatus.ts
|
|
524
|
+
var BlobStorageSyncStatus = {
|
|
525
|
+
Idle: "idle",
|
|
526
|
+
Queued: "queued",
|
|
527
|
+
UpToDate: "up_to_date",
|
|
528
|
+
Disabled: "disabled",
|
|
529
|
+
Error: "error"
|
|
530
|
+
};
|
|
531
|
+
|
|
521
532
|
// src/api/api/resources/comments/index.ts
|
|
522
533
|
var comments_exports = {};
|
|
523
534
|
|
|
@@ -3023,6 +3034,109 @@ var BlobStorageIntegrations = class {
|
|
|
3023
3034
|
});
|
|
3024
3035
|
}
|
|
3025
3036
|
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key)
|
|
3039
|
+
*
|
|
3040
|
+
* @param {string} id
|
|
3041
|
+
* @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration.
|
|
3042
|
+
*
|
|
3043
|
+
* @throws {@link LangfuseAPI.Error}
|
|
3044
|
+
* @throws {@link LangfuseAPI.UnauthorizedError}
|
|
3045
|
+
* @throws {@link LangfuseAPI.AccessDeniedError}
|
|
3046
|
+
* @throws {@link LangfuseAPI.MethodNotAllowedError}
|
|
3047
|
+
* @throws {@link LangfuseAPI.NotFoundError}
|
|
3048
|
+
*
|
|
3049
|
+
* @example
|
|
3050
|
+
* await client.blobStorageIntegrations.getBlobStorageIntegrationStatus("id")
|
|
3051
|
+
*/
|
|
3052
|
+
getBlobStorageIntegrationStatus(id, requestOptions) {
|
|
3053
|
+
return HttpResponsePromise.fromPromise(
|
|
3054
|
+
this.__getBlobStorageIntegrationStatus(id, requestOptions)
|
|
3055
|
+
);
|
|
3056
|
+
}
|
|
3057
|
+
async __getBlobStorageIntegrationStatus(id, requestOptions) {
|
|
3058
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
3059
|
+
let _headers = mergeHeaders(
|
|
3060
|
+
(_a2 = this._options) == null ? void 0 : _a2.headers,
|
|
3061
|
+
mergeOnlyDefinedHeaders({
|
|
3062
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
3063
|
+
"X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName,
|
|
3064
|
+
"X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion,
|
|
3065
|
+
"X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey
|
|
3066
|
+
}),
|
|
3067
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
3068
|
+
);
|
|
3069
|
+
const _response = await fetcher({
|
|
3070
|
+
url: url_exports.join(
|
|
3071
|
+
(_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment),
|
|
3072
|
+
`/api/public/integrations/blob-storage/${encodeURIComponent(id)}`
|
|
3073
|
+
),
|
|
3074
|
+
method: "GET",
|
|
3075
|
+
headers: _headers,
|
|
3076
|
+
queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams,
|
|
3077
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4,
|
|
3078
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
3079
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
3080
|
+
});
|
|
3081
|
+
if (_response.ok) {
|
|
3082
|
+
return {
|
|
3083
|
+
data: _response.body,
|
|
3084
|
+
rawResponse: _response.rawResponse
|
|
3085
|
+
};
|
|
3086
|
+
}
|
|
3087
|
+
if (_response.error.reason === "status-code") {
|
|
3088
|
+
switch (_response.error.statusCode) {
|
|
3089
|
+
case 400:
|
|
3090
|
+
throw new Error2(
|
|
3091
|
+
_response.error.body,
|
|
3092
|
+
_response.rawResponse
|
|
3093
|
+
);
|
|
3094
|
+
case 401:
|
|
3095
|
+
throw new UnauthorizedError(
|
|
3096
|
+
_response.error.body,
|
|
3097
|
+
_response.rawResponse
|
|
3098
|
+
);
|
|
3099
|
+
case 403:
|
|
3100
|
+
throw new AccessDeniedError(
|
|
3101
|
+
_response.error.body,
|
|
3102
|
+
_response.rawResponse
|
|
3103
|
+
);
|
|
3104
|
+
case 405:
|
|
3105
|
+
throw new MethodNotAllowedError(
|
|
3106
|
+
_response.error.body,
|
|
3107
|
+
_response.rawResponse
|
|
3108
|
+
);
|
|
3109
|
+
case 404:
|
|
3110
|
+
throw new NotFoundError(
|
|
3111
|
+
_response.error.body,
|
|
3112
|
+
_response.rawResponse
|
|
3113
|
+
);
|
|
3114
|
+
default:
|
|
3115
|
+
throw new LangfuseAPIError({
|
|
3116
|
+
statusCode: _response.error.statusCode,
|
|
3117
|
+
body: _response.error.body,
|
|
3118
|
+
rawResponse: _response.rawResponse
|
|
3119
|
+
});
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
switch (_response.error.reason) {
|
|
3123
|
+
case "non-json":
|
|
3124
|
+
throw new LangfuseAPIError({
|
|
3125
|
+
statusCode: _response.error.statusCode,
|
|
3126
|
+
body: _response.error.rawBody,
|
|
3127
|
+
rawResponse: _response.rawResponse
|
|
3128
|
+
});
|
|
3129
|
+
case "timeout":
|
|
3130
|
+
throw new LangfuseAPITimeoutError(
|
|
3131
|
+
"Timeout exceeded when calling GET /api/public/integrations/blob-storage/{id}."
|
|
3132
|
+
);
|
|
3133
|
+
case "unknown":
|
|
3134
|
+
throw new LangfuseAPIError({
|
|
3135
|
+
message: _response.error.errorMessage,
|
|
3136
|
+
rawResponse: _response.rawResponse
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3026
3140
|
/**
|
|
3027
3141
|
* Delete a blob storage integration by ID (requires organization-scoped API key)
|
|
3028
3142
|
*
|
|
@@ -9287,7 +9401,7 @@ var Prompts = class {
|
|
|
9287
9401
|
}
|
|
9288
9402
|
async __get(promptName, request = {}, requestOptions) {
|
|
9289
9403
|
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
9290
|
-
const { version, label } = request;
|
|
9404
|
+
const { version, label, resolve } = request;
|
|
9291
9405
|
const _queryParams = {};
|
|
9292
9406
|
if (version != null) {
|
|
9293
9407
|
_queryParams["version"] = version.toString();
|
|
@@ -9295,6 +9409,9 @@ var Prompts = class {
|
|
|
9295
9409
|
if (label != null) {
|
|
9296
9410
|
_queryParams["label"] = label;
|
|
9297
9411
|
}
|
|
9412
|
+
if (resolve != null) {
|
|
9413
|
+
_queryParams["resolve"] = resolve.toString();
|
|
9414
|
+
}
|
|
9298
9415
|
let _headers = mergeHeaders(
|
|
9299
9416
|
(_a2 = this._options) == null ? void 0 : _a2.headers,
|
|
9300
9417
|
mergeOnlyDefinedHeaders({
|
|
@@ -12711,6 +12828,7 @@ function getSpanKeyFromBaggageKey(baggageKey) {
|
|
|
12711
12828
|
BlobStorageExportMode,
|
|
12712
12829
|
BlobStorageIntegrationFileType,
|
|
12713
12830
|
BlobStorageIntegrationType,
|
|
12831
|
+
BlobStorageSyncStatus,
|
|
12714
12832
|
ChatMessageType,
|
|
12715
12833
|
CommentObjectType,
|
|
12716
12834
|
CreateChatPromptType,
|