@gooddata/sdk-backend-tiger 11.40.0-alpha.1 → 11.40.0-alpha.3
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/esm/__version.d.ts +1 -1
- package/esm/__version.js +1 -1
- package/esm/backend/features/feature.js +1 -0
- package/esm/backend/organization/fromBackend/userConvertor.js +2 -0
- package/esm/backend/organization/index.d.ts +1 -2
- package/esm/backend/organization/index.js +0 -4
- package/esm/backend/organization/settings.d.ts +1 -1
- package/esm/backend/organization/settings.js +3 -3
- package/esm/backend/organization/users.js +3 -1
- package/esm/backend/settings/mapping.js +0 -1
- package/esm/backend/uiFeatures.d.ts +3 -0
- package/esm/backend/uiFeatures.js +3 -0
- package/esm/backend/workspace/settings/index.d.ts +1 -1
- package/esm/backend/workspace/settings/index.js +2 -2
- package/esm/utils/widgetLocalIdentifier.js +2 -2
- package/package.json +11 -11
- package/esm/backend/organization/llmEndpoints.d.ts +0 -14
- package/esm/backend/organization/llmEndpoints.js +0 -111
- package/esm/backend/organization/llmEndpointsQuery.d.ts +0 -17
- package/esm/backend/organization/llmEndpointsQuery.js +0 -55
- package/esm/convertors/fromBackend/llmEndpointConvertor.d.ts +0 -3
- package/esm/convertors/fromBackend/llmEndpointConvertor.js +0 -22
package/esm/__version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.40.0-alpha.
|
|
1
|
+
export declare const LIB_VERSION = "11.40.0-alpha.3";
|
|
2
2
|
export declare const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
|
|
3
3
|
export declare const LIB_NAME = "@gooddata/sdk-backend-tiger";
|
package/esm/__version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2021 GoodData Corporation
|
|
2
2
|
// DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
|
|
3
|
-
export const LIB_VERSION = "11.40.0-alpha.
|
|
3
|
+
export const LIB_VERSION = "11.40.0-alpha.3";
|
|
4
4
|
export const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
|
|
5
5
|
export const LIB_NAME = "@gooddata/sdk-backend-tiger";
|
|
@@ -73,6 +73,7 @@ export function mapFeatures(features) {
|
|
|
73
73
|
...loadFeature(features, TigerFeaturesNames.EnableCertification, "enableCertification", "BOOLEAN", FeatureFlagsValues.enableCertification),
|
|
74
74
|
...loadFeature(features, TigerFeaturesNames.EnableAIDataSetting, "enableAIDataSetting", "BOOLEAN", FeatureFlagsValues.enableAIDataSetting),
|
|
75
75
|
...loadFeature(features, TigerFeaturesNames.EnableDashboardFilterViews, "enableDashboardFilterViews", "BOOLEAN", FeatureFlagsValues.enableDashboardFilterViews),
|
|
76
|
+
...loadFeature(features, TigerFeaturesNames.EnableSystemAccountFiltering, "enableSystemAccountFiltering", "BOOLEAN", FeatureFlagsValues.enableSystemAccountFiltering),
|
|
76
77
|
...loadFeature(features, TigerFeaturesNames.EnableCustomizedDashboardsWithoutPluginOverlay, "enableCustomizedDashboardsWithoutPluginOverlay", "BOOLEAN", FeatureFlagsValues.enableCustomizedDashboardsWithoutPluginOverlay),
|
|
77
78
|
...loadFeature(features, TigerFeaturesNames.EnableNewInsightChangedPostMessageEvent, "enableNewInsightChangedPostMessageEvent", "BOOLEAN", FeatureFlagsValues.enableNewInsightChangedPostMessageEvent),
|
|
78
79
|
...loadFeature(features, TigerFeaturesNames.EnableKDVisualizationSwitcher, "enableKDVisualizationSwitcher", "BOOLEAN", FeatureFlagsValues.enableKDVisualizationSwitcher),
|
|
@@ -14,6 +14,7 @@ export const convertUser = (user) => {
|
|
|
14
14
|
fullName: constructFullName(firstName, lastName),
|
|
15
15
|
firstName,
|
|
16
16
|
lastName,
|
|
17
|
+
systemAccount: user.data.attributes?.systemAccount,
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
20
|
export const convertWorkspaceUser = (user) => {
|
|
@@ -54,6 +55,7 @@ export const convertIncludedUser = (user) => {
|
|
|
54
55
|
fullName: constructFullName(firstName, lastName),
|
|
55
56
|
firstName,
|
|
56
57
|
lastName,
|
|
58
|
+
systemAccount: user.attributes?.systemAccount,
|
|
57
59
|
};
|
|
58
60
|
};
|
|
59
61
|
export const convertEntityUserToOrganizationUser = (user) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IOrganization, type IOrganizationAgentsService, type IOrganizationAutomationService, type IOrganizationExportTemplatesService, type IOrganizationGenAIService, type
|
|
1
|
+
import { type IOrganization, type IOrganizationAgentsService, type IOrganizationAutomationService, type IOrganizationExportTemplatesService, type IOrganizationGenAIService, type IOrganizationLlmProvidersService, type IOrganizationNotificationChannelService, type IOrganizationNotificationService, type IOrganizationPermissionService, type IOrganizationSettingsService, type IOrganizationStylingService, type IOrganizationUserService, type IOrganizations, type ISecuritySettingsService } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type IOrganizationDescriptor, type IOrganizationDescriptorUpdate } from "@gooddata/sdk-model";
|
|
3
3
|
import { type TigerAuthenticatedCallGuard } from "../../types/index.js";
|
|
4
4
|
export declare class TigerOrganization implements IOrganization {
|
|
@@ -14,7 +14,6 @@ export declare class TigerOrganization implements IOrganization {
|
|
|
14
14
|
users(): IOrganizationUserService;
|
|
15
15
|
permissions(): IOrganizationPermissionService;
|
|
16
16
|
notificationChannels(): IOrganizationNotificationChannelService;
|
|
17
|
-
llmEndpoints(): IOrganizationLlmEndpointsService;
|
|
18
17
|
llmProviders(): IOrganizationLlmProvidersService;
|
|
19
18
|
notifications(): IOrganizationNotificationService;
|
|
20
19
|
automations(): IOrganizationAutomationService;
|
|
@@ -6,7 +6,6 @@ import { OrganizationAgentsService } from "./agents.js";
|
|
|
6
6
|
import { TigerOrganizationAutomationService } from "./automations/index.js";
|
|
7
7
|
import { OrganizationExportTemplatesService } from "./exportTemplates.js";
|
|
8
8
|
import { TigerOrganizationGenAIService } from "./genAI/index.js";
|
|
9
|
-
import { OrganizationLlmEndpointsService } from "./llmEndpoints.js";
|
|
10
9
|
import { OrganizationLlmProvidersService } from "./llmProviders.js";
|
|
11
10
|
import { OrganizationNotificationChannelService } from "./notificationChannels.js";
|
|
12
11
|
import { OrganizationNotificationService } from "./notifications.js";
|
|
@@ -121,9 +120,6 @@ export class TigerOrganization {
|
|
|
121
120
|
notificationChannels() {
|
|
122
121
|
return new OrganizationNotificationChannelService(this.authCall);
|
|
123
122
|
}
|
|
124
|
-
llmEndpoints() {
|
|
125
|
-
return new OrganizationLlmEndpointsService(this.authCall);
|
|
126
|
-
}
|
|
127
123
|
llmProviders() {
|
|
128
124
|
return new OrganizationLlmProvidersService(this.authCall);
|
|
129
125
|
}
|
|
@@ -11,7 +11,7 @@ export declare class OrganizationSettingsService extends TigerSettingsService<IS
|
|
|
11
11
|
setFormatLocale(locale: string): Promise<void>;
|
|
12
12
|
setTimezone(timezone: string): Promise<void>;
|
|
13
13
|
setSeparators(separators: ISeparators): Promise<void>;
|
|
14
|
-
setActiveLlmEndpoint(
|
|
14
|
+
setActiveLlmEndpoint(): Promise<void>;
|
|
15
15
|
deleteActiveLlmEndpoint(): Promise<void>;
|
|
16
16
|
setActiveLlmProvider(provider: string, defaultModelId: string): Promise<void>;
|
|
17
17
|
deleteActiveLlmProvider(): Promise<void>;
|
|
@@ -28,11 +28,11 @@ export class OrganizationSettingsService extends TigerSettingsService {
|
|
|
28
28
|
async setSeparators(separators) {
|
|
29
29
|
return this.setSetting("SEPARATORS", separators);
|
|
30
30
|
}
|
|
31
|
-
async setActiveLlmEndpoint(
|
|
32
|
-
|
|
31
|
+
async setActiveLlmEndpoint() {
|
|
32
|
+
throw new Error("Deprecated endpoint");
|
|
33
33
|
}
|
|
34
34
|
async deleteActiveLlmEndpoint() {
|
|
35
|
-
|
|
35
|
+
throw new Error("Deprecated endpoint");
|
|
36
36
|
}
|
|
37
37
|
async setActiveLlmProvider(provider, defaultModelId) {
|
|
38
38
|
return this.setSetting("ACTIVE_LLM_PROVIDER", { id: provider, type: "llmProvider", defaultModelId });
|
|
@@ -36,6 +36,7 @@ export class OrganizationUsersService {
|
|
|
36
36
|
email: user.email,
|
|
37
37
|
firstname: user.firstName,
|
|
38
38
|
lastname: user.lastName,
|
|
39
|
+
systemAccount: user.systemAccount,
|
|
39
40
|
},
|
|
40
41
|
},
|
|
41
42
|
},
|
|
@@ -52,7 +53,7 @@ export class OrganizationUsersService {
|
|
|
52
53
|
};
|
|
53
54
|
updateUser = async (user) => {
|
|
54
55
|
return this.authCall(async (client) => {
|
|
55
|
-
const { login, firstName, lastName, email } = user;
|
|
56
|
+
const { login, firstName, lastName, email, systemAccount } = user;
|
|
56
57
|
await EntitiesApi_PatchEntityUsers(client.axios, client.basePath, {
|
|
57
58
|
id: login,
|
|
58
59
|
jsonApiUserPatchDocument: {
|
|
@@ -63,6 +64,7 @@ export class OrganizationUsersService {
|
|
|
63
64
|
firstname: firstName,
|
|
64
65
|
lastname: lastName,
|
|
65
66
|
email: email,
|
|
67
|
+
systemAccount,
|
|
66
68
|
},
|
|
67
69
|
},
|
|
68
70
|
},
|
|
@@ -21,7 +21,6 @@ const TYPE_TO_KEY_MAP = {
|
|
|
21
21
|
organizationSetting: "organizationSetting",
|
|
22
22
|
DATE_FILTER_CONFIG: "dateFilterConfig",
|
|
23
23
|
AI_RATE_LIMIT: "aiRateLimit",
|
|
24
|
-
ACTIVE_LLM_ENDPOINT: "llmEndpoint",
|
|
25
24
|
ATTACHMENT_SIZE_LIMIT: "attachmentSizeLimit",
|
|
26
25
|
ALLOW_UNSAFE_FLEX_CONNECT_ENDPOINTS: "allowUnsafeFlexConnectEndpoints",
|
|
27
26
|
ENABLE_AUTOMATION_EVALUATION_MODE: "enableAutomationEvaluationMode",
|
|
@@ -74,6 +74,7 @@ export declare enum TigerFeaturesNames {
|
|
|
74
74
|
EnableCertification = "enableCertification",
|
|
75
75
|
EnableAIDataSetting = "enableAIDataSetting",
|
|
76
76
|
EnableDashboardFilterViews = "enableDashboardFilterViews",
|
|
77
|
+
EnableSystemAccountFiltering = "enableSystemAccountFiltering",
|
|
77
78
|
EnableCustomizedDashboardsWithoutPluginOverlay = "enableCustomizedDashboardsWithoutPluginOverlay",
|
|
78
79
|
EnableAlertingRollout = "enableAlertingRollout",
|
|
79
80
|
EnableNewInsightChangedPostMessageEvent = "enableNewInsightChangedPostMessageEvent",
|
|
@@ -240,6 +241,7 @@ export type ITigerFeatureFlags = {
|
|
|
240
241
|
enableAIDataSetting: (typeof FeatureFlagsValues)["enableAIDataSetting"][number];
|
|
241
242
|
enableAlertingRollout: (typeof FeatureFlagsValues)["enableAlertingRollout"][number];
|
|
242
243
|
enableDashboardFilterViews: (typeof FeatureFlagsValues)["enableDashboardFilterViews"][number];
|
|
244
|
+
enableSystemAccountFiltering: (typeof FeatureFlagsValues)["enableSystemAccountFiltering"][number];
|
|
243
245
|
enableCustomizedDashboardsWithoutPluginOverlay: (typeof FeatureFlagsValues)["enableCustomizedDashboardsWithoutPluginOverlay"][number];
|
|
244
246
|
enableNewInsightChangedPostMessageEvent: (typeof FeatureFlagsValues)["enableNewInsightChangedPostMessageEvent"][number];
|
|
245
247
|
enableKDVisualizationSwitcher: (typeof FeatureFlagsValues)["enableKDVisualizationSwitcher"][number];
|
|
@@ -408,6 +410,7 @@ export declare const FeatureFlagsValues: {
|
|
|
408
410
|
enableAIDataSetting: readonly [true, false];
|
|
409
411
|
enableAlertingRollout: readonly [true, false];
|
|
410
412
|
enableDashboardFilterViews: readonly [true, false];
|
|
413
|
+
enableSystemAccountFiltering: readonly [true, false];
|
|
411
414
|
enableCustomizedDashboardsWithoutPluginOverlay: readonly [true, false];
|
|
412
415
|
enableNewInsightChangedPostMessageEvent: readonly [true, false];
|
|
413
416
|
enableKDVisualizationSwitcher: readonly [true, false];
|
|
@@ -78,6 +78,7 @@ var TigerFeaturesNames;
|
|
|
78
78
|
TigerFeaturesNames["EnableCertification"] = "enableCertification";
|
|
79
79
|
TigerFeaturesNames["EnableAIDataSetting"] = "enableAIDataSetting";
|
|
80
80
|
TigerFeaturesNames["EnableDashboardFilterViews"] = "enableDashboardFilterViews";
|
|
81
|
+
TigerFeaturesNames["EnableSystemAccountFiltering"] = "enableSystemAccountFiltering";
|
|
81
82
|
TigerFeaturesNames["EnableCustomizedDashboardsWithoutPluginOverlay"] = "enableCustomizedDashboardsWithoutPluginOverlay";
|
|
82
83
|
TigerFeaturesNames["EnableAlertingRollout"] = "enableAlertingRollout";
|
|
83
84
|
TigerFeaturesNames["EnableNewInsightChangedPostMessageEvent"] = "enableNewInsightChangedPostMessageEvent";
|
|
@@ -244,6 +245,7 @@ export const DefaultFeatureFlags = {
|
|
|
244
245
|
enableAIDataSetting: false,
|
|
245
246
|
enableAlertingRollout: false,
|
|
246
247
|
enableDashboardFilterViews: true,
|
|
248
|
+
enableSystemAccountFiltering: false,
|
|
247
249
|
enableCustomizedDashboardsWithoutPluginOverlay: true,
|
|
248
250
|
enableNewInsightChangedPostMessageEvent: false,
|
|
249
251
|
enableKDVisualizationSwitcher: true,
|
|
@@ -411,6 +413,7 @@ export const FeatureFlagsValues = {
|
|
|
411
413
|
enableAIDataSetting: [true, false],
|
|
412
414
|
enableAlertingRollout: [true, false],
|
|
413
415
|
enableDashboardFilterViews: [true, false],
|
|
416
|
+
enableSystemAccountFiltering: [true, false],
|
|
414
417
|
enableCustomizedDashboardsWithoutPluginOverlay: [true, false],
|
|
415
418
|
enableNewInsightChangedPostMessageEvent: [true, false],
|
|
416
419
|
enableKDVisualizationSwitcher: [true, false],
|
|
@@ -12,7 +12,7 @@ export declare class TigerWorkspaceSettings extends TigerSettingsService<IWorksp
|
|
|
12
12
|
setMetadataLocale(locale: string): Promise<void>;
|
|
13
13
|
setFormatLocale(locale: string): Promise<void>;
|
|
14
14
|
setSeparators(separators: ISeparators): Promise<void>;
|
|
15
|
-
setActiveLlmEndpoint(
|
|
15
|
+
setActiveLlmEndpoint(): Promise<void>;
|
|
16
16
|
setActiveLlmProvider(provider: string, defaultModelId: string): Promise<void>;
|
|
17
17
|
setTimezone(timezone: string): Promise<void>;
|
|
18
18
|
setDateFormat(dateFormat: string): Promise<void>;
|
|
@@ -41,8 +41,8 @@ export class TigerWorkspaceSettings extends TigerSettingsService {
|
|
|
41
41
|
async setSeparators(separators) {
|
|
42
42
|
return this.setSetting("SEPARATORS", separators);
|
|
43
43
|
}
|
|
44
|
-
async setActiveLlmEndpoint(
|
|
45
|
-
|
|
44
|
+
async setActiveLlmEndpoint() {
|
|
45
|
+
throw new Error("Deprecated endpoint");
|
|
46
46
|
}
|
|
47
47
|
async setActiveLlmProvider(provider, defaultModelId) {
|
|
48
48
|
return this.setSetting("ACTIVE_LLM_PROVIDER", { id: provider, type: "llmProvider", defaultModelId });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// (C) 2024 GoodData Corporation
|
|
1
|
+
// (C) 2024-2026 GoodData Corporation
|
|
2
2
|
import { v4 as uuidv4 } from "uuid";
|
|
3
3
|
let counter = 0;
|
|
4
4
|
/**
|
|
5
5
|
* When running e2e tests, we need to generate deterministic widget local identifiers.
|
|
6
6
|
*/
|
|
7
7
|
export function generateWidgetLocalIdentifier() {
|
|
8
|
-
if (window?.
|
|
8
|
+
if (window?.useSafeLocalIdentifiersForE2e === true) {
|
|
9
9
|
return `test_widget_local_identifier_${counter++}`;
|
|
10
10
|
}
|
|
11
11
|
return uuidv4();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-backend-tiger",
|
|
3
|
-
"version": "11.40.0-alpha.
|
|
3
|
+
"version": "11.40.0-alpha.3",
|
|
4
4
|
"description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"ts-invariant": "0.10.3",
|
|
34
34
|
"tslib": "2.8.1",
|
|
35
35
|
"uuid": "11.1.0",
|
|
36
|
-
"@gooddata/
|
|
37
|
-
"@gooddata/
|
|
38
|
-
"@gooddata/sdk-
|
|
39
|
-
"@gooddata/sdk-
|
|
40
|
-
"@gooddata/sdk-
|
|
41
|
-
"@gooddata/util": "11.40.0-alpha.
|
|
36
|
+
"@gooddata/sdk-backend-base": "11.40.0-alpha.3",
|
|
37
|
+
"@gooddata/api-client-tiger": "11.40.0-alpha.3",
|
|
38
|
+
"@gooddata/sdk-backend-spi": "11.40.0-alpha.3",
|
|
39
|
+
"@gooddata/sdk-code-convertors": "11.40.0-alpha.3",
|
|
40
|
+
"@gooddata/sdk-model": "11.40.0-alpha.3",
|
|
41
|
+
"@gooddata/util": "11.40.0-alpha.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@gooddata/fixtures": "3.3.12",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"oxlint-tsgolint": "0.11.4",
|
|
66
66
|
"typescript": "5.9.3",
|
|
67
67
|
"vitest": "4.1.0",
|
|
68
|
-
"@gooddata/
|
|
69
|
-
"@gooddata/
|
|
70
|
-
"@gooddata/
|
|
71
|
-
"@gooddata/
|
|
68
|
+
"@gooddata/eslint-config": "11.40.0-alpha.3",
|
|
69
|
+
"@gooddata/catalog-export": "11.40.0-alpha.3",
|
|
70
|
+
"@gooddata/oxlint-config": "11.40.0-alpha.3",
|
|
71
|
+
"@gooddata/reference-workspace": "11.40.0-alpha.3"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"_phase:build": "npm run build",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ILlmEndpointsQuery, type IOrganizationLlmEndpointsService } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type ILlmEndpointOpenAI, type LlmEndpointOpenAIPatch } from "@gooddata/sdk-model";
|
|
3
|
-
import { type TigerAuthenticatedCallGuard } from "../../types/index.js";
|
|
4
|
-
export declare class OrganizationLlmEndpointsService implements IOrganizationLlmEndpointsService {
|
|
5
|
-
readonly authCall: TigerAuthenticatedCallGuard;
|
|
6
|
-
constructor(authCall: TigerAuthenticatedCallGuard);
|
|
7
|
-
getCount(): Promise<number>;
|
|
8
|
-
getEndpointsQuery(): ILlmEndpointsQuery;
|
|
9
|
-
getLlmEndpoint(id: string): Promise<ILlmEndpointOpenAI | undefined>;
|
|
10
|
-
createLlmEndpoint(endpoint: ILlmEndpointOpenAI, token: string): Promise<ILlmEndpointOpenAI>;
|
|
11
|
-
updateLlmEndpoint(endpoint: ILlmEndpointOpenAI, token: string): Promise<ILlmEndpointOpenAI>;
|
|
12
|
-
patchLlmEndpoint(endpoint: LlmEndpointOpenAIPatch, token?: string): Promise<ILlmEndpointOpenAI>;
|
|
13
|
-
deleteLlmEndpoint(id: string): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// (C) 2024-2026 GoodData Corporation
|
|
2
|
-
import { EntitiesApi_CreateEntityLlmEndpoints, EntitiesApi_DeleteEntityLlmEndpoints, EntitiesApi_GetAllEntitiesLlmEndpoints, EntitiesApi_GetEntityLlmEndpoints, EntitiesApi_PatchEntityLlmEndpoints, EntitiesApi_UpdateEntityLlmEndpoints, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
|
|
3
|
-
import { convertLlmEndpoint } from "../../convertors/fromBackend/llmEndpointConvertor.js";
|
|
4
|
-
import { LlmEndpointsQuery } from "./llmEndpointsQuery.js";
|
|
5
|
-
export class OrganizationLlmEndpointsService {
|
|
6
|
-
authCall;
|
|
7
|
-
constructor(authCall) {
|
|
8
|
-
this.authCall = authCall;
|
|
9
|
-
}
|
|
10
|
-
getCount() {
|
|
11
|
-
return this.authCall(async (client) => {
|
|
12
|
-
const result = await EntitiesApi_GetAllEntitiesLlmEndpoints(client.axios, client.basePath, {
|
|
13
|
-
size: 1,
|
|
14
|
-
metaInclude: ["page"],
|
|
15
|
-
});
|
|
16
|
-
return result.data.meta?.page?.totalElements ?? 0;
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
getEndpointsQuery() {
|
|
20
|
-
return new LlmEndpointsQuery(this.authCall);
|
|
21
|
-
}
|
|
22
|
-
getLlmEndpoint(id) {
|
|
23
|
-
return this.authCall(async (client) => {
|
|
24
|
-
const result = await EntitiesApi_GetEntityLlmEndpoints(client.axios, client.basePath, { id });
|
|
25
|
-
const endpoint = result.data?.data;
|
|
26
|
-
if (!endpoint) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
return convertLlmEndpoint(endpoint);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
createLlmEndpoint(endpoint, token) {
|
|
33
|
-
return this.authCall(async (client) => {
|
|
34
|
-
const result = await EntitiesApi_CreateEntityLlmEndpoints(client.axios, client.basePath, {
|
|
35
|
-
jsonApiLlmEndpointInDocument: {
|
|
36
|
-
data: {
|
|
37
|
-
type: "llmEndpoint",
|
|
38
|
-
id: endpoint.id,
|
|
39
|
-
attributes: {
|
|
40
|
-
title: endpoint.title,
|
|
41
|
-
llmModel: endpoint.model,
|
|
42
|
-
llmOrganization: endpoint.organization,
|
|
43
|
-
provider: endpoint.provider,
|
|
44
|
-
token,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
const createdEndpoint = result.data?.data;
|
|
50
|
-
if (!createdEndpoint) {
|
|
51
|
-
throw new Error("Failed to create LLM endpoint");
|
|
52
|
-
}
|
|
53
|
-
return convertLlmEndpoint(createdEndpoint);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
updateLlmEndpoint(endpoint, token) {
|
|
57
|
-
return this.authCall(async (client) => {
|
|
58
|
-
const result = await EntitiesApi_UpdateEntityLlmEndpoints(client.axios, client.basePath, {
|
|
59
|
-
id: endpoint.id,
|
|
60
|
-
jsonApiLlmEndpointInDocument: {
|
|
61
|
-
data: {
|
|
62
|
-
type: "llmEndpoint",
|
|
63
|
-
id: endpoint.id,
|
|
64
|
-
attributes: {
|
|
65
|
-
title: endpoint.title,
|
|
66
|
-
llmModel: endpoint.model,
|
|
67
|
-
llmOrganization: endpoint.organization,
|
|
68
|
-
provider: endpoint.provider,
|
|
69
|
-
token,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
const updatedEndpoint = result.data?.data;
|
|
75
|
-
if (!updatedEndpoint) {
|
|
76
|
-
throw new Error("Failed to update LLM endpoint");
|
|
77
|
-
}
|
|
78
|
-
return convertLlmEndpoint(updatedEndpoint);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
patchLlmEndpoint(endpoint, token) {
|
|
82
|
-
return this.authCall(async (client) => {
|
|
83
|
-
const result = await EntitiesApi_PatchEntityLlmEndpoints(client.axios, client.basePath, {
|
|
84
|
-
id: endpoint.id,
|
|
85
|
-
jsonApiLlmEndpointPatchDocument: {
|
|
86
|
-
data: {
|
|
87
|
-
type: "llmEndpoint",
|
|
88
|
-
id: endpoint.id,
|
|
89
|
-
attributes: Object.fromEntries(Object.entries({
|
|
90
|
-
title: endpoint.title,
|
|
91
|
-
llmModel: endpoint.model,
|
|
92
|
-
llmOrganization: endpoint.organization,
|
|
93
|
-
provider: endpoint.provider,
|
|
94
|
-
token,
|
|
95
|
-
}).filter(([_, value]) => value !== undefined)),
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
const updatedEndpoint = result.data?.data;
|
|
100
|
-
if (!updatedEndpoint) {
|
|
101
|
-
throw new Error("Failed to update LLM endpoint");
|
|
102
|
-
}
|
|
103
|
-
return convertLlmEndpoint(updatedEndpoint);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
deleteLlmEndpoint(id) {
|
|
107
|
-
return this.authCall(async (client) => {
|
|
108
|
-
await EntitiesApi_DeleteEntityLlmEndpoints(client.axios, client.basePath, { id });
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ILlmEndpointsQuery, type ILlmEndpointsQueryResult } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type ILlmEndpointOpenAI } from "@gooddata/sdk-model";
|
|
3
|
-
import { type TigerAuthenticatedCallGuard } from "../../types/index.js";
|
|
4
|
-
export declare class LlmEndpointsQuery implements ILlmEndpointsQuery {
|
|
5
|
-
readonly authCall: TigerAuthenticatedCallGuard;
|
|
6
|
-
private size;
|
|
7
|
-
private page;
|
|
8
|
-
private sort;
|
|
9
|
-
private totalCount;
|
|
10
|
-
constructor(authCall: TigerAuthenticatedCallGuard);
|
|
11
|
-
private setTotalCount;
|
|
12
|
-
withSize(size: number): ILlmEndpointsQuery;
|
|
13
|
-
withPage(page: number): ILlmEndpointsQuery;
|
|
14
|
-
withSorting(sort: string[]): ILlmEndpointsQuery;
|
|
15
|
-
query(): Promise<ILlmEndpointsQueryResult>;
|
|
16
|
-
queryAll(): Promise<ILlmEndpointOpenAI[]>;
|
|
17
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// (C) 2024-2026 GoodData Corporation
|
|
2
|
-
import { EntitiesApi_GetAllEntitiesLlmEndpoints } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
|
|
3
|
-
import { ServerPaging } from "@gooddata/sdk-backend-base";
|
|
4
|
-
import { convertLlmEndpoint } from "../../convertors/fromBackend/llmEndpointConvertor.js";
|
|
5
|
-
export class LlmEndpointsQuery {
|
|
6
|
-
authCall;
|
|
7
|
-
size = 100;
|
|
8
|
-
page = 0;
|
|
9
|
-
sort = {};
|
|
10
|
-
totalCount = undefined;
|
|
11
|
-
constructor(authCall) {
|
|
12
|
-
this.authCall = authCall;
|
|
13
|
-
}
|
|
14
|
-
setTotalCount = (value) => {
|
|
15
|
-
this.totalCount = value;
|
|
16
|
-
};
|
|
17
|
-
withSize(size) {
|
|
18
|
-
this.size = size;
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
withPage(page) {
|
|
22
|
-
this.page = page;
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
withSorting(sort) {
|
|
26
|
-
this.sort = { sort };
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
query() {
|
|
30
|
-
return ServerPaging.for(async ({ limit, offset }) => {
|
|
31
|
-
/**
|
|
32
|
-
* For backend performance reasons, we do not want to ask for paging info each time.
|
|
33
|
-
*/
|
|
34
|
-
const metaIncludeObj = this.totalCount === undefined ? { metaInclude: ["page"] } : {};
|
|
35
|
-
const items = await this.authCall((client) => EntitiesApi_GetAllEntitiesLlmEndpoints(client.axios, client.basePath, {
|
|
36
|
-
...metaIncludeObj,
|
|
37
|
-
...this.sort,
|
|
38
|
-
size: limit,
|
|
39
|
-
page: offset / limit,
|
|
40
|
-
})).then((res) => {
|
|
41
|
-
const data = res.data;
|
|
42
|
-
const totalCount = data.meta?.page?.totalElements;
|
|
43
|
-
if (!(totalCount === null || totalCount === undefined)) {
|
|
44
|
-
this.setTotalCount(totalCount);
|
|
45
|
-
}
|
|
46
|
-
return data.data.map(convertLlmEndpoint);
|
|
47
|
-
});
|
|
48
|
-
return { items, totalCount: this.totalCount };
|
|
49
|
-
}, this.size, this.page * this.size);
|
|
50
|
-
}
|
|
51
|
-
async queryAll() {
|
|
52
|
-
const firstQuery = await this.query();
|
|
53
|
-
return firstQuery.all();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// (C) 2024-2026 GoodData Corporation
|
|
2
|
-
export function convertLlmEndpoint(endpoint) {
|
|
3
|
-
if (endpoint.attributes?.provider === "OPENAI") {
|
|
4
|
-
return {
|
|
5
|
-
id: endpoint.id,
|
|
6
|
-
title: endpoint.attributes?.title,
|
|
7
|
-
provider: "OPENAI",
|
|
8
|
-
model: endpoint.attributes?.llmModel,
|
|
9
|
-
organization: endpoint.attributes?.llmOrganization,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
if (endpoint.attributes?.provider === "AZURE_OPENAI") {
|
|
13
|
-
return {
|
|
14
|
-
id: endpoint.id,
|
|
15
|
-
title: endpoint.attributes?.title,
|
|
16
|
-
provider: "AZURE_OPENAI",
|
|
17
|
-
model: endpoint.attributes?.llmModel,
|
|
18
|
-
organization: endpoint.attributes?.llmOrganization,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
throw new Error(`Unknown llm endpoint provider: ${endpoint.attributes?.provider}`);
|
|
22
|
-
}
|