@gooddata/sdk-backend-tiger 11.40.0-alpha.2 → 11.40.0-alpha.4
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/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/settings/mapping.js +0 -1
- package/esm/backend/uiFeatures.d.ts +4 -1
- package/esm/backend/uiFeatures.js +3 -0
- package/esm/backend/workspace/index.d.ts +2 -1
- package/esm/backend/workspace/index.js +4 -0
- package/esm/backend/workspace/objectPermissions/index.d.ts +13 -0
- package/esm/backend/workspace/objectPermissions/index.js +129 -0
- package/esm/backend/workspace/settings/index.d.ts +1 -1
- package/esm/backend/workspace/settings/index.js +2 -2
- package/package.json +15 -15
- 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.4";
|
|
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.4";
|
|
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";
|
|
@@ -169,6 +169,7 @@ export function mapFeatures(features) {
|
|
|
169
169
|
...loadFeature(features, TigerFeaturesNames.EnableUserDataFiltersUi, "enableUserDataFiltersUi", "BOOLEAN", FeatureFlagsValues.enableUserDataFiltersUi),
|
|
170
170
|
...loadFeature(features, TigerFeaturesNames.EnableEnhancedInsightPicker, "enableEnhancedInsightPicker", "BOOLEAN", FeatureFlagsValues.enableEnhancedInsightPicker),
|
|
171
171
|
...loadFeature(features, TigerFeaturesNames.EnableMetricEditorRemoteModule, "enableShellApplication_metricEditor", "BOOLEAN", FeatureFlagsValues.enableShellApplication_metricEditor),
|
|
172
|
+
...loadFeature(features, TigerFeaturesNames.EnableDashboardSidebarResize, "enableDashboardSidebarResize", "BOOLEAN", FeatureFlagsValues.enableDashboardSidebarResize),
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
175
|
function loadFeature(features, feature, name, outputType, possibleValues) {
|
|
@@ -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 });
|
|
@@ -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",
|
|
@@ -169,7 +169,8 @@ export declare enum TigerFeaturesNames {
|
|
|
169
169
|
EnableAiAgenticMultiConversations = "enableAiAgenticMultiConversations",
|
|
170
170
|
EnableAiLlmAnthropicProvider = "enableAiLlmAnthropicProvider",
|
|
171
171
|
EnableRadarChart = "enableRadarChart",
|
|
172
|
-
EnableMetricEditorRemoteModule = "enableShellApplication_metricEditor"
|
|
172
|
+
EnableMetricEditorRemoteModule = "enableShellApplication_metricEditor",
|
|
173
|
+
EnableDashboardSidebarResize = "enableDashboardSidebarResize"
|
|
173
174
|
}
|
|
174
175
|
export type ITigerFeatureFlags = {
|
|
175
176
|
dashboardEditModeDevRollout: (typeof FeatureFlagsValues)["dashboardEditModeDevRollout"][number];
|
|
@@ -338,6 +339,7 @@ export type ITigerFeatureFlags = {
|
|
|
338
339
|
enableEnhancedInsightPicker: (typeof FeatureFlagsValues)["enableEnhancedInsightPicker"][number];
|
|
339
340
|
enableAiLlmAnthropicProvider: (typeof FeatureFlagsValues)["enableAiLlmAnthropicProvider"][number];
|
|
340
341
|
enableShellApplication_metricEditor: (typeof FeatureFlagsValues)["enableShellApplication_metricEditor"][number];
|
|
342
|
+
enableDashboardSidebarResize: (typeof FeatureFlagsValues)["enableDashboardSidebarResize"][number];
|
|
341
343
|
};
|
|
342
344
|
export declare const DefaultFeatureFlags: ITigerFeatureFlags;
|
|
343
345
|
export declare const FeatureFlagsValues: {
|
|
@@ -508,4 +510,5 @@ export declare const FeatureFlagsValues: {
|
|
|
508
510
|
enableEnhancedInsightPicker: readonly [true, false];
|
|
509
511
|
enableAiLlmAnthropicProvider: readonly [true, false];
|
|
510
512
|
enableShellApplication_metricEditor: readonly [true, false];
|
|
513
|
+
enableDashboardSidebarResize: readonly [true, false];
|
|
511
514
|
};
|
|
@@ -174,6 +174,7 @@ var TigerFeaturesNames;
|
|
|
174
174
|
TigerFeaturesNames["EnableAiLlmAnthropicProvider"] = "enableAiLlmAnthropicProvider";
|
|
175
175
|
TigerFeaturesNames["EnableRadarChart"] = "enableRadarChart";
|
|
176
176
|
TigerFeaturesNames["EnableMetricEditorRemoteModule"] = "enableShellApplication_metricEditor";
|
|
177
|
+
TigerFeaturesNames["EnableDashboardSidebarResize"] = "enableDashboardSidebarResize";
|
|
177
178
|
})(TigerFeaturesNames || (TigerFeaturesNames = {}));
|
|
178
179
|
export const DefaultFeatureFlags = {
|
|
179
180
|
dashboardEditModeDevRollout: true,
|
|
@@ -342,6 +343,7 @@ export const DefaultFeatureFlags = {
|
|
|
342
343
|
enableEnhancedInsightPicker: false,
|
|
343
344
|
enableAiLlmAnthropicProvider: false,
|
|
344
345
|
enableShellApplication_metricEditor: false,
|
|
346
|
+
enableDashboardSidebarResize: false,
|
|
345
347
|
};
|
|
346
348
|
export const FeatureFlagsValues = {
|
|
347
349
|
dashboardEditModeDevRollout: [true, false],
|
|
@@ -511,4 +513,5 @@ export const FeatureFlagsValues = {
|
|
|
511
513
|
enableEnhancedInsightPicker: [true, false],
|
|
512
514
|
enableAiLlmAnthropicProvider: [true, false],
|
|
513
515
|
enableShellApplication_metricEditor: [true, false],
|
|
516
|
+
enableDashboardSidebarResize: [true, false],
|
|
514
517
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IAnalyticalWorkspace, type IAttributeHierarchiesService, type IDataFiltersService, type IDateFilterConfigsQuery, type IExecutionFactory, type IGenAIService, type IReferencesService, type IWorkspaceAccessControlService, type IWorkspaceAttributesService, type IWorkspaceAutomationService, type IWorkspaceCatalogFactory, type IWorkspaceDashboardsService, type IWorkspaceDatasetsService, type IWorkspaceDescriptor, type IWorkspaceDescriptorUpdate, type IWorkspaceExportDefinitionsService, type IWorkspaceFactsService, type IWorkspaceInsightsService, type IWorkspaceKeyDriverAnalysisService, type IWorkspaceLogicalModelService, type IWorkspaceMeasuresService, type IWorkspaceParametersService, type IWorkspacePermissionsService, type IWorkspaceSettingsService, type IWorkspaceStylingService, type IWorkspaceUserGroupsQuery, type IWorkspaceUsersQuery } from "@gooddata/sdk-backend-spi";
|
|
1
|
+
import { type IAnalyticalWorkspace, type IAttributeHierarchiesService, type IDataFiltersService, type IDateFilterConfigsQuery, type IExecutionFactory, type IGenAIService, type IReferencesService, type IWorkspaceAccessControlService, type IWorkspaceAttributesService, type IWorkspaceAutomationService, type IWorkspaceCatalogFactory, type IWorkspaceDashboardsService, type IWorkspaceDatasetsService, type IWorkspaceDescriptor, type IWorkspaceDescriptorUpdate, type IWorkspaceExportDefinitionsService, type IWorkspaceFactsService, type IWorkspaceInsightsService, type IWorkspaceKeyDriverAnalysisService, type IWorkspaceLogicalModelService, type IWorkspaceMeasuresService, type IWorkspaceObjectPermissionsService, type IWorkspaceParametersService, type IWorkspacePermissionsService, type IWorkspaceSettingsService, type IWorkspaceStylingService, type IWorkspaceUserGroupsQuery, type IWorkspaceUsersQuery } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type DateFormatter, type DateNormalizer, type DateStringifier } from "../../convertors/fromBackend/dateFormatting/types.js";
|
|
3
3
|
import { type TigerAuthenticatedCallGuard } from "../../types/index.js";
|
|
4
4
|
export declare class TigerWorkspace implements IAnalyticalWorkspace {
|
|
@@ -28,6 +28,7 @@ export declare class TigerWorkspace implements IAnalyticalWorkspace {
|
|
|
28
28
|
users(): IWorkspaceUsersQuery;
|
|
29
29
|
userGroups(): IWorkspaceUserGroupsQuery;
|
|
30
30
|
accessControl(): IWorkspaceAccessControlService;
|
|
31
|
+
objectPermissions(): IWorkspaceObjectPermissionsService;
|
|
31
32
|
dateFilterConfigs(): IDateFilterConfigsQuery;
|
|
32
33
|
attributeHierarchies(): IAttributeHierarchiesService;
|
|
33
34
|
exportDefinitions(): IWorkspaceExportDefinitionsService;
|
|
@@ -22,6 +22,7 @@ import { TigerWorkspaceInsights } from "./insights/index.js";
|
|
|
22
22
|
import { TigerWorkspaceKeyDriverAnalysis } from "./keyDriverAnalysis/index.js";
|
|
23
23
|
import { TigerWorkspaceLogicalModelService } from "./ldm/index.js";
|
|
24
24
|
import { TigerWorkspaceMeasures } from "./measures/index.js";
|
|
25
|
+
import { TigerWorkspaceObjectPermissionsService } from "./objectPermissions/index.js";
|
|
25
26
|
import { TigerWorkspaceParameters } from "./parameters/index.js";
|
|
26
27
|
import { TigerWorkspacePermissionsFactory } from "./permissions/index.js";
|
|
27
28
|
import { TigerReferencesService } from "./references/index.js";
|
|
@@ -126,6 +127,9 @@ export class TigerWorkspace {
|
|
|
126
127
|
accessControl() {
|
|
127
128
|
return new TigerWorkspaceAccessControlService(this.authCall, this.workspace);
|
|
128
129
|
}
|
|
130
|
+
objectPermissions() {
|
|
131
|
+
return new TigerWorkspaceObjectPermissionsService(this.authCall, this.workspace);
|
|
132
|
+
}
|
|
129
133
|
dateFilterConfigs() {
|
|
130
134
|
return new TigerWorkspaceDateFilterConfigsQuery(this.authCall, this.workspace);
|
|
131
135
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IObjectPermissionsObject, type IWorkspaceObjectPermissionsService } from "@gooddata/sdk-backend-spi";
|
|
2
|
+
import { type IAvailableAccessGrantee, type IGranularAccessGrantee, type IObjectAccessList } from "@gooddata/sdk-model";
|
|
3
|
+
import { type TigerAuthenticatedCallGuard } from "../../../types/index.js";
|
|
4
|
+
export declare class TigerWorkspaceObjectPermissionsService implements IWorkspaceObjectPermissionsService {
|
|
5
|
+
private readonly authCall;
|
|
6
|
+
private readonly workspace;
|
|
7
|
+
constructor(authCall: TigerAuthenticatedCallGuard, workspace: string);
|
|
8
|
+
getAccessList(target: IObjectPermissionsObject): Promise<IObjectAccessList>;
|
|
9
|
+
manageObjectPermissions(target: IObjectPermissionsObject, grantees: IGranularAccessGrantee[]): Promise<void>;
|
|
10
|
+
getAvailableAssignees(_target: IObjectPermissionsObject): Promise<IAvailableAccessGrantee[]>;
|
|
11
|
+
private fetchAllWorkspaceUsers;
|
|
12
|
+
private fetchAllWorkspaceUserGroups;
|
|
13
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { ActionsApi_AttributePermissions, ActionsApi_FactPermissions, ActionsApi_LabelPermissions, ActionsApi_ListWorkspaceUserGroups, ActionsApi_ListWorkspaceUsers, ActionsApi_ManageAttributePermissions, ActionsApi_ManageFactPermissions, ActionsApi_ManageLabelPermissions, } from "@gooddata/api-client-tiger/endpoints/actions";
|
|
3
|
+
import { ProfileApi_GetCurrent } from "@gooddata/api-client-tiger/endpoints/profile";
|
|
4
|
+
import { isGranularUserAccessGrantee, } from "@gooddata/sdk-model";
|
|
5
|
+
import { convertRulesPermission, convertUserAssignee, convertUserGroupAssignee, convertUserGroupPermission, convertUserPermission, } from "../../../convertors/fromBackend/AccessControlConverter.js";
|
|
6
|
+
import { objRefToIdentifier } from "../../../utils/api.js";
|
|
7
|
+
const PAGE_SIZE = 1000;
|
|
8
|
+
export class TigerWorkspaceObjectPermissionsService {
|
|
9
|
+
authCall;
|
|
10
|
+
workspace;
|
|
11
|
+
constructor(authCall, workspace) {
|
|
12
|
+
this.authCall = authCall;
|
|
13
|
+
this.workspace = workspace;
|
|
14
|
+
}
|
|
15
|
+
async getAccessList(target) {
|
|
16
|
+
const objectId = objRefToIdentifier(target.ref, this.authCall);
|
|
17
|
+
const permissions = await this.authCall((client) => fetchPermissionsByKind(client, target.kind, this.workspace, objectId).then((result) => result.data));
|
|
18
|
+
return {
|
|
19
|
+
grants: [
|
|
20
|
+
...permissions.rules.map(convertRulesPermission),
|
|
21
|
+
...permissions.users.map(convertUserPermission),
|
|
22
|
+
...permissions.userGroups.map(convertUserGroupPermission),
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async manageObjectPermissions(target, grantees) {
|
|
27
|
+
const objectId = objRefToIdentifier(target.ref, this.authCall);
|
|
28
|
+
const payload = grantees.map((grantee) => {
|
|
29
|
+
if (grantee.type === "allWorkspaceUsers") {
|
|
30
|
+
return {
|
|
31
|
+
assigneeRule: { type: grantee.type },
|
|
32
|
+
permissions: grantee.permissions,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
assigneeIdentifier: {
|
|
37
|
+
id: objRefToIdentifier(grantee.granteeRef, this.authCall),
|
|
38
|
+
type: isGranularUserAccessGrantee(grantee) ? "user" : "userGroup",
|
|
39
|
+
},
|
|
40
|
+
permissions: grantee.permissions,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
await this.authCall((client) => manageByKind(client, target.kind, this.workspace, objectId, payload));
|
|
44
|
+
}
|
|
45
|
+
async getAvailableAssignees(_target) {
|
|
46
|
+
// Composed from workspace-wide user/group lists, filtered to exclude the
|
|
47
|
+
// current user. Admins aren't filtered: the listing endpoints don't
|
|
48
|
+
// expose role information.
|
|
49
|
+
const [currentUserId, users, userGroups] = await Promise.all([
|
|
50
|
+
this.authCall((client) => ProfileApi_GetCurrent(client.axios).then((p) => p.userId)),
|
|
51
|
+
this.fetchAllWorkspaceUsers(),
|
|
52
|
+
this.fetchAllWorkspaceUserGroups(),
|
|
53
|
+
]);
|
|
54
|
+
return [
|
|
55
|
+
...users
|
|
56
|
+
.filter((u) => u.id !== currentUserId)
|
|
57
|
+
.map((u) => convertUserAssignee(workspaceUserToAssignee(u))),
|
|
58
|
+
...userGroups.map((g) => convertUserGroupAssignee(workspaceUserGroupToAssignee(g))),
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
fetchAllWorkspaceUsers() {
|
|
62
|
+
return fetchAllPages((page) => this.authCall((client) => ActionsApi_ListWorkspaceUsers(client.axios, client.basePath, {
|
|
63
|
+
workspaceId: this.workspace,
|
|
64
|
+
page,
|
|
65
|
+
size: PAGE_SIZE,
|
|
66
|
+
}).then((result) => ({ items: result.data.users, totalCount: result.data.totalCount }))));
|
|
67
|
+
}
|
|
68
|
+
fetchAllWorkspaceUserGroups() {
|
|
69
|
+
return fetchAllPages((page) => this.authCall((client) => ActionsApi_ListWorkspaceUserGroups(client.axios, client.basePath, {
|
|
70
|
+
workspaceId: this.workspace,
|
|
71
|
+
page,
|
|
72
|
+
size: PAGE_SIZE,
|
|
73
|
+
}).then((result) => ({
|
|
74
|
+
items: result.data.userGroups,
|
|
75
|
+
totalCount: result.data.totalCount,
|
|
76
|
+
}))));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const fetchAllPages = async (fetchPage) => {
|
|
80
|
+
const first = await fetchPage(0);
|
|
81
|
+
const out = [...first.items];
|
|
82
|
+
const pageCount = Math.ceil(first.totalCount / PAGE_SIZE);
|
|
83
|
+
for (let page = 1; page < pageCount; page++) {
|
|
84
|
+
const next = await fetchPage(page);
|
|
85
|
+
out.push(...next.items);
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
};
|
|
89
|
+
const fetchPermissionsByKind = (client, kind, workspaceId, objectId) => {
|
|
90
|
+
const { axios, basePath } = client;
|
|
91
|
+
switch (kind) {
|
|
92
|
+
case "attribute":
|
|
93
|
+
return ActionsApi_AttributePermissions(axios, basePath, {
|
|
94
|
+
workspaceId,
|
|
95
|
+
attributeId: objectId,
|
|
96
|
+
});
|
|
97
|
+
case "fact":
|
|
98
|
+
return ActionsApi_FactPermissions(axios, basePath, { workspaceId, factId: objectId });
|
|
99
|
+
case "label":
|
|
100
|
+
return ActionsApi_LabelPermissions(axios, basePath, { workspaceId, labelId: objectId });
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const manageByKind = (client, kind, workspaceId, objectId, manageLabelPermissionsRequestInner) => {
|
|
104
|
+
const { axios, basePath } = client;
|
|
105
|
+
switch (kind) {
|
|
106
|
+
case "attribute":
|
|
107
|
+
return ActionsApi_ManageAttributePermissions(axios, basePath, {
|
|
108
|
+
workspaceId,
|
|
109
|
+
attributeId: objectId,
|
|
110
|
+
manageLabelPermissionsRequestInner,
|
|
111
|
+
});
|
|
112
|
+
case "fact":
|
|
113
|
+
return ActionsApi_ManageFactPermissions(axios, basePath, {
|
|
114
|
+
workspaceId,
|
|
115
|
+
factId: objectId,
|
|
116
|
+
manageLabelPermissionsRequestInner,
|
|
117
|
+
});
|
|
118
|
+
case "label":
|
|
119
|
+
return ActionsApi_ManageLabelPermissions(axios, basePath, {
|
|
120
|
+
workspaceId,
|
|
121
|
+
labelId: objectId,
|
|
122
|
+
manageLabelPermissionsRequestInner,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
// WorkspaceUser and UserAssignee carry the same fields. Same for groups. Pass through
|
|
127
|
+
// rather than introduce parallel converters.
|
|
128
|
+
const workspaceUserToAssignee = (u) => u;
|
|
129
|
+
const workspaceUserGroupToAssignee = (g) => g;
|
|
@@ -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 });
|
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.4",
|
|
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/sdk-backend-
|
|
38
|
-
"@gooddata/
|
|
39
|
-
"@gooddata/sdk-code-convertors": "11.40.0-alpha.
|
|
40
|
-
"@gooddata/sdk-model": "11.40.0-alpha.
|
|
41
|
-
"@gooddata/util": "11.40.0-alpha.
|
|
36
|
+
"@gooddata/sdk-backend-base": "11.40.0-alpha.4",
|
|
37
|
+
"@gooddata/sdk-backend-spi": "11.40.0-alpha.4",
|
|
38
|
+
"@gooddata/api-client-tiger": "11.40.0-alpha.4",
|
|
39
|
+
"@gooddata/sdk-code-convertors": "11.40.0-alpha.4",
|
|
40
|
+
"@gooddata/sdk-model": "11.40.0-alpha.4",
|
|
41
|
+
"@gooddata/util": "11.40.0-alpha.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@gooddata/fixtures": "3.3.12",
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
"eslint-plugin-no-barrel-files": "1.2.2",
|
|
61
61
|
"eslint-plugin-sonarjs": "3.0.6",
|
|
62
62
|
"npm-run-all": "^4.1.5",
|
|
63
|
-
"oxfmt": "0.
|
|
64
|
-
"oxlint": "
|
|
65
|
-
"oxlint-tsgolint": "0.
|
|
63
|
+
"oxfmt": "0.52.0",
|
|
64
|
+
"oxlint": "1.51.0",
|
|
65
|
+
"oxlint-tsgolint": "0.15.0",
|
|
66
66
|
"typescript": "5.9.3",
|
|
67
|
-
"vitest": "4.1.
|
|
68
|
-
"@gooddata/catalog-export": "11.40.0-alpha.
|
|
69
|
-
"@gooddata/eslint-config": "11.40.0-alpha.
|
|
70
|
-
"@gooddata/oxlint-config": "11.40.0-alpha.
|
|
71
|
-
"@gooddata/reference-workspace": "11.40.0-alpha.
|
|
67
|
+
"vitest": "4.1.8",
|
|
68
|
+
"@gooddata/catalog-export": "11.40.0-alpha.4",
|
|
69
|
+
"@gooddata/eslint-config": "11.40.0-alpha.4",
|
|
70
|
+
"@gooddata/oxlint-config": "11.40.0-alpha.4",
|
|
71
|
+
"@gooddata/reference-workspace": "11.40.0-alpha.4"
|
|
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
|
-
}
|