@langfuse/core 4.4.0 → 4.4.2
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 +106 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +213 -8
- package/dist/index.d.ts +213 -8
- package/dist/index.mjs +106 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -350,7 +350,7 @@ var resetGlobalLogger = () => {
|
|
|
350
350
|
// package.json
|
|
351
351
|
var package_default = {
|
|
352
352
|
name: "@langfuse/core",
|
|
353
|
-
version: "4.4.
|
|
353
|
+
version: "4.4.2",
|
|
354
354
|
description: "Core functions and utilities for Langfuse packages",
|
|
355
355
|
type: "module",
|
|
356
356
|
sideEffects: false,
|
|
@@ -4319,7 +4319,9 @@ var Datasets = class {
|
|
|
4319
4319
|
* await client.datasets.create({
|
|
4320
4320
|
* name: "name",
|
|
4321
4321
|
* description: undefined,
|
|
4322
|
-
* metadata: undefined
|
|
4322
|
+
* metadata: undefined,
|
|
4323
|
+
* inputSchema: undefined,
|
|
4324
|
+
* expectedOutputSchema: undefined
|
|
4323
4325
|
* })
|
|
4324
4326
|
*/
|
|
4325
4327
|
create(request, requestOptions) {
|
|
@@ -7424,6 +7426,108 @@ var Organizations = class {
|
|
|
7424
7426
|
});
|
|
7425
7427
|
}
|
|
7426
7428
|
}
|
|
7429
|
+
/**
|
|
7430
|
+
* Get all API keys for the organization associated with the API key (requires organization-scoped API key)
|
|
7431
|
+
*
|
|
7432
|
+
* @param {Organizations.RequestOptions} requestOptions - Request-specific configuration.
|
|
7433
|
+
*
|
|
7434
|
+
* @throws {@link LangfuseAPI.Error}
|
|
7435
|
+
* @throws {@link LangfuseAPI.UnauthorizedError}
|
|
7436
|
+
* @throws {@link LangfuseAPI.AccessDeniedError}
|
|
7437
|
+
* @throws {@link LangfuseAPI.MethodNotAllowedError}
|
|
7438
|
+
* @throws {@link LangfuseAPI.NotFoundError}
|
|
7439
|
+
*
|
|
7440
|
+
* @example
|
|
7441
|
+
* await client.organizations.getOrganizationApiKeys()
|
|
7442
|
+
*/
|
|
7443
|
+
getOrganizationApiKeys(requestOptions) {
|
|
7444
|
+
return HttpResponsePromise.fromPromise(
|
|
7445
|
+
this.__getOrganizationApiKeys(requestOptions)
|
|
7446
|
+
);
|
|
7447
|
+
}
|
|
7448
|
+
async __getOrganizationApiKeys(requestOptions) {
|
|
7449
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
7450
|
+
let _headers = mergeHeaders(
|
|
7451
|
+
(_a2 = this._options) == null ? void 0 : _a2.headers,
|
|
7452
|
+
mergeOnlyDefinedHeaders({
|
|
7453
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
7454
|
+
"X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName,
|
|
7455
|
+
"X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion,
|
|
7456
|
+
"X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey
|
|
7457
|
+
}),
|
|
7458
|
+
requestOptions == null ? void 0 : requestOptions.headers
|
|
7459
|
+
);
|
|
7460
|
+
const _response = await fetcher({
|
|
7461
|
+
url: url_exports.join(
|
|
7462
|
+
(_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment),
|
|
7463
|
+
"/api/public/organizations/apiKeys"
|
|
7464
|
+
),
|
|
7465
|
+
method: "GET",
|
|
7466
|
+
headers: _headers,
|
|
7467
|
+
queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams,
|
|
7468
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4,
|
|
7469
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
7470
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
7471
|
+
});
|
|
7472
|
+
if (_response.ok) {
|
|
7473
|
+
return {
|
|
7474
|
+
data: _response.body,
|
|
7475
|
+
rawResponse: _response.rawResponse
|
|
7476
|
+
};
|
|
7477
|
+
}
|
|
7478
|
+
if (_response.error.reason === "status-code") {
|
|
7479
|
+
switch (_response.error.statusCode) {
|
|
7480
|
+
case 400:
|
|
7481
|
+
throw new Error2(
|
|
7482
|
+
_response.error.body,
|
|
7483
|
+
_response.rawResponse
|
|
7484
|
+
);
|
|
7485
|
+
case 401:
|
|
7486
|
+
throw new UnauthorizedError(
|
|
7487
|
+
_response.error.body,
|
|
7488
|
+
_response.rawResponse
|
|
7489
|
+
);
|
|
7490
|
+
case 403:
|
|
7491
|
+
throw new AccessDeniedError(
|
|
7492
|
+
_response.error.body,
|
|
7493
|
+
_response.rawResponse
|
|
7494
|
+
);
|
|
7495
|
+
case 405:
|
|
7496
|
+
throw new MethodNotAllowedError(
|
|
7497
|
+
_response.error.body,
|
|
7498
|
+
_response.rawResponse
|
|
7499
|
+
);
|
|
7500
|
+
case 404:
|
|
7501
|
+
throw new NotFoundError(
|
|
7502
|
+
_response.error.body,
|
|
7503
|
+
_response.rawResponse
|
|
7504
|
+
);
|
|
7505
|
+
default:
|
|
7506
|
+
throw new LangfuseAPIError({
|
|
7507
|
+
statusCode: _response.error.statusCode,
|
|
7508
|
+
body: _response.error.body,
|
|
7509
|
+
rawResponse: _response.rawResponse
|
|
7510
|
+
});
|
|
7511
|
+
}
|
|
7512
|
+
}
|
|
7513
|
+
switch (_response.error.reason) {
|
|
7514
|
+
case "non-json":
|
|
7515
|
+
throw new LangfuseAPIError({
|
|
7516
|
+
statusCode: _response.error.statusCode,
|
|
7517
|
+
body: _response.error.rawBody,
|
|
7518
|
+
rawResponse: _response.rawResponse
|
|
7519
|
+
});
|
|
7520
|
+
case "timeout":
|
|
7521
|
+
throw new LangfuseAPITimeoutError(
|
|
7522
|
+
"Timeout exceeded when calling GET /api/public/organizations/apiKeys."
|
|
7523
|
+
);
|
|
7524
|
+
case "unknown":
|
|
7525
|
+
throw new LangfuseAPIError({
|
|
7526
|
+
message: _response.error.errorMessage,
|
|
7527
|
+
rawResponse: _response.rawResponse
|
|
7528
|
+
});
|
|
7529
|
+
}
|
|
7530
|
+
}
|
|
7427
7531
|
async _getAuthorizationHeader() {
|
|
7428
7532
|
const username = await Supplier.get(this._options.username);
|
|
7429
7533
|
const password = await Supplier.get(this._options.password);
|