Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
8765397
chore: changed z-index at custom overlay
skdud4659 Feb 11, 2025
003068a
chore: merge master into develop after 2.0.dev314 version tagging
admin-cloudforet Feb 12, 2025
753da45
chore: merge master into develop after 2.0.dev315 version tagging
admin-cloudforet Feb 13, 2025
92c39da
Merge pull request #5635 from skdud4659/feature/_feedback
skdud4659 Feb 13, 2025
5e751d8
feat(api-clients): create api-clients directory (common, dashboard)
piggggggggy Jan 31, 2025
3136ab2
feat(api-clients): refactor directory (add-ons, cost-analysis, opsflow)
piggggggggy Jan 31, 2025
a29e9e8
feat(api-clients): create dashboard api hook
piggggggggy Jan 31, 2025
5b6e46f
feat(dashboard-query): create dashboard query composable
piggggggggy Feb 2, 2025
3534c1f
feat(dashboard): apply dashboard query
piggggggggy Feb 2, 2025
d24db6c
chore: small fix
piggggggggy Feb 2, 2025
b885b44
fix(dashboard): remove dashboard data getters in dashboard-page-contr…
piggggggggy Feb 2, 2025
e0789d2
feat(mutation): apply mutation and sync query data in clone modal
piggggggggy Feb 2, 2025
6dde871
feat(dashboard): apply mutation (single-create, delete)
piggggggggy Feb 2, 2025
14f0965
feat(dashboard): apply mutations
piggggggggy Feb 2, 2025
018e73f
feat(dashboard-store): remove dashboard global store usage
piggggggggy Feb 2, 2025
717d1c1
fix(dashboard-type): apply global dashboard type (folder, dashboard)
piggggggggy Feb 3, 2025
465edfc
feat(dashboard): apply dashboard-query mutation (dashboard-global-modal)
piggggggggy Feb 3, 2025
650e5de
fix(use-query-key): apply global options
piggggggggy Feb 4, 2025
b8a21ab
feat(dashboard): create button manageable composable and widget helper
piggggggggy Feb 4, 2025
e686838
feat(dashboard-detail): create dashboard detail page query composable
piggggggggy Feb 4, 2025
cf75d04
feat(dashboard-detail-page): apply dashboard-detail query
piggggggggy Feb 4, 2025
435e8de
feat(widget): apply dashboard-detail query
piggggggggy Feb 4, 2025
a59aede
fix(dashbaord-detail-store): remove unused getters and actions
piggggggggy Feb 4, 2025
e98b7b8
chore: small fix
piggggggggy Feb 5, 2025
6b3489b
fix(dashboard-variable): apply new query architecture
piggggggggy Feb 6, 2025
da91c64
fix(use-query-key): refactor use-query-key composable
piggggggggy Feb 6, 2025
d13eb7c
refactor(dashboard-query): refactor query composables
piggggggggy Feb 6, 2025
14b39ed
fix(widget): replace widget api fetching to composables
piggggggggy Feb 6, 2025
da8a4a1
fix(data-table-api): refactor dataTable api composable
piggggggggy Feb 7, 2025
302ab78
feat(dashboard-widget-form-query): create dashboard-widget-form-query…
piggggggggy Feb 7, 2025
0944f45
feat(data-table-update): create data-table-cascade updating query com…
piggggggggy Feb 7, 2025
577fd6f
fix(widget-field): apply form query to widget-field
piggggggggy Feb 7, 2025
b12c222
feat(widget-form): apply widget form query
piggggggggy Feb 7, 2025
f4bba6c
feat(widget-generate-store): remove server state and actions
piggggggggy Feb 7, 2025
8897b0e
chore: small fix
piggggggggy Feb 7, 2025
027058b
chore: small fix
piggggggggy Feb 8, 2025
7c433a2
fix: apply dataTable query
piggggggggy Feb 8, 2025
f02b222
chore: small fix
piggggggggy Feb 8, 2025
67c8d14
fix(query): refactor api and widget query composables
piggggggggy Feb 10, 2025
985ee98
chore: small fix
piggggggggy Feb 10, 2025
647d6ba
feat(widget): apply widget form query composables
piggggggggy Feb 10, 2025
0ab91fd
fix(data-table): apply widget form query composables
piggggggggy Feb 10, 2025
87f773b
chore: small fix
piggggggggy Feb 10, 2025
deee7f4
chore: fix bug
piggggggggy Feb 10, 2025
b7b88ef
chore: solve widget load bug
piggggggggy Feb 10, 2025
c38ffa7
chore: solve bug
piggggggggy Feb 10, 2025
c6f7f16
fix: fixed bookmark name edit bug
skdud4659 Feb 13, 2025
fe8097b
chore: merge master into develop after 2.0.dev316 version tagging
admin-cloudforet Feb 13, 2025
af2884a
chore: merge master into develop after 2.0.dev317 version tagging
admin-cloudforet Feb 14, 2025
c88eac7
Merge pull request #5642 from skdud4659/feature/fix
skdud4659 Feb 14, 2025
e742a89
fix(project): remove project v2 dir
piggggggggy Feb 15, 2025
80c9ebd
chore: edit project import path
piggggggggy Feb 15, 2025
46ca522
feat(project-dashboard): apply vue query to project dashboard
piggggggggy Feb 15, 2025
23c4dfc
feat(alert-manager-v2): create useIsAlertManagerV2Enabled composable
piggggggggy Feb 15, 2025
830ea09
fix(reference-store): apply alert-manager v2 enabled composable
piggggggggy Feb 15, 2025
44cab25
feat(project): apply alert-v2 branching
piggggggggy Feb 15, 2025
c600ee5
chore: small fix
piggggggggy Feb 15, 2025
a4d358b
Merge pull request #5646 from cloudforet-io/feature-dashboard-vue-query
piggggggggy Feb 15, 2025
6ab9f6d
feat(grant-scope): create useScopedQuery composable
piggggggggy Feb 17, 2025
be87efe
feat(scope-query): apply useScopedQuery to query composables
piggggggggy Feb 17, 2025
4a14c35
fix(widget): apply dataTable loading to widget loading
piggggggggy Feb 17, 2025
ecd25cd
refactor(project-dashboard): refactor dashboard component
piggggggggy Feb 17, 2025
08e37c6
chore: small fix
piggggggggy Feb 17, 2025
4620803
Merge pull request #5648 from cloudforet-io/feature-dashboard-vue-query
piggggggggy Feb 17, 2025
5a2edeb
chore: merge master into develop after 2.0.dev318 version tagging
admin-cloudforet Feb 18, 2025
13b83c5
feat(sanitize-options): apply advanced sanitizing to sanitizeWidgetOp…
piggggggggy Feb 20, 2025
a281324
feat(sanitize-options): apply advanced sanitize options helper
piggggggggy Feb 20, 2025
6a63a26
fix(widget-field): apply changed widget options architecture
piggggggggy Feb 20, 2025
c1f94d3
chore: small fix
piggggggggy Feb 20, 2025
1ceef66
Merge pull request #5651 from cloudforet-io/feature-dashboard-widget-…
piggggggggy Feb 20, 2025
ab8dc5b
fix(widget): solve widget draw chart bug
piggggggggy Feb 20, 2025
4c18eba
refactor(widget-helper): refactor sanitize options helper
piggggggggy Feb 20, 2025
85e44b4
Merge pull request #5652 from cloudforet-io/feature-dashboard-widget-…
piggggggggy Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions apps/web/src/api-clients/_common/composables/use-query-key.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { ComputedRef } from 'vue';
import { computed, reactive } from 'vue';


import type { QueryKey } from '@tanstack/vue-query';

import { useAppContextStore } from '@/store/app-context/app-context-store';
import { useUserWorkspaceStore } from '@/store/app-context/workspace/user-workspace-store';

/**
* Generates a computed query key for API requests, incorporating global parameters.
*
* @param primaryQueryKey - The primary key for the api query (e.g., 'private-dashboard/get'). It follows the `{api-resource-name}/{api-verb}` convention.
* @param additionalGlobalParams - Optional additional global parameters to include in the api query key.
* @returns A computed reference to the query key array.
*/

interface GlobalQueryParams {
workspaceId?: string;
isAdminMode?: boolean;
}
export const useAPIQueryKey = (
primaryQueryKey: string,
additionalGlobalParams?: Partial<GlobalQueryParams>,
): ComputedRef<QueryKey> => {
const appContextStore = useAppContextStore();
const userWorkspaceStore = useUserWorkspaceStore();

const _state = reactive({
currentWorkdpaceId: computed<string|undefined>(() => userWorkspaceStore.getters.currentWorkspaceId),
isAdminMode: computed<boolean>(() => appContextStore.getters.isAdminMode),
});

const globalQueryParams = reactive<GlobalQueryParams>({
workspaceId: _state.currentWorkdpaceId,
isAdminMode: _state.isAdminMode,
...additionalGlobalParams,
});

return computed<QueryKey>(() => [primaryQueryKey, { ...globalQueryParams }]);
};
79 changes: 79 additions & 0 deletions apps/web/src/api-clients/_common/composables/use-scoped-query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* useScopedQuery - A custom wrapper around `useQuery` to enforce scope-based API fetching.
*
* ## Why this hook exists?
* This hook was created to integrate **scope-based API access control** with Vue Query.
* It ensures that queries are only executed when the user's granted scope matches the required scope.
* Additionally, it automatically handles loading states and prevents unnecessary queries.
*
* ## Functionality
* - Extends `useQuery` with **grant scope validation**.
* - Runs queries only when **the user’s scope is valid** and the app is **ready**.
* - Uses Vue’s **reactivity** to dynamically compute the `enabled` state.
* - Supports both **static and reactive `enabled` values**.
*
* ## Parameters:
* - `options`: Standard **Vue Query options** (`UseQueryOptions`).
* - `requiredScopes`: A list of **required grant scopes** to determine if the query should execute.
*
* ## Supported Query Options:
* The following options are commonly used within our team:
* - `queryKey`: **Unique key** to identify the query in the cache.
* - `queryFn`: **Function** to fetch data from the API.
* - `select`: **Transform function** to modify response data.
* - `initialData`: **Default value** for the query when no data is available.
* - `staleTime`: **Cache duration** before the query becomes stale.
* - `enabled`: **Boolean or reactive ref** to control when the query should execute.
*
* ## Example Usage:
*
* const myQuery = useScopedQuery({
* queryKey: ['dashboard', dashboardId],
* queryFn: () => fetchDashboardData(dashboardId),
* select: (data) => data.results,
* initialData: { results: [] },
* staleTime: 1000 * 60 * 5, // 5 minutes
* enabled: computed(() => isUserAuthorized.value),
* }, ['DOMAIN', 'WORKSPACE']);
*
*/


import type { MaybeRef } from '@vueuse/core';
import { toValue } from '@vueuse/core';
import { computed, reactive } from 'vue';

import type {
UseQueryOptions,
} from '@tanstack/vue-query';
import { useQuery } from '@tanstack/vue-query';

import type { GrantScope } from '@/schema/identity/token/type';

import { useAppContextStore } from '@/store/app-context/app-context-store';
import { useUserStore } from '@/store/user/user-store';

export const useScopedQuery = <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData>(
options: UseQueryOptions<TQueryFnData, TError, TData>,
requiredScopes: GrantScope[] = [],
) => {
const appContextStore = useAppContextStore();
const userStore = useUserStore();

const _state = reactive({
currentGrantScope: computed<GrantScope>(() => userStore.state.currentGrantInfo?.scope || 'USER'),
isLoading: computed(() => appContextStore.getters.globalGrantLoading),
isValidScope: computed(() => requiredScopes.includes(_state.currentGrantScope)),
});

const queryEnabled = computed<boolean>(() => {
const _inheritedEnabled = options?.enabled as MaybeRef<boolean> | undefined;
if (_inheritedEnabled !== undefined && !toValue(_inheritedEnabled)) return false;
return _state.isValidScope && !_state.isLoading;
});

return useQuery<TQueryFnData, TError, TData>({
...options,
enabled: queryEnabled,
});
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RESOURCE_GROUP } from '@/schema/_common/constant';
import type { RESOURCE_GROUP } from '@/api-clients/_common/schema/constant';

export type ResourceGroupType = typeof RESOURCE_GROUP[keyof typeof RESOURCE_GROUP];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ListResponse } from '@/schema/_common/api-verbs/list';
import type { FavoriteModel } from '@/schema/add-ons/favorite/model';
import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list';
import type { FavoriteModel } from '@/api-clients/add-ons/favorite/schema/model';

import type { FavoriteType } from '@/common/modules/favorites/favorite-button/type';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Query } from '@cloudforet/core-lib/space-connector/type';

import type { ResourceGroupType } from '@/schema/_common/type';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';


export interface BudgetUsageAnalyzeParameters {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ResourceGroupType } from '@/schema/_common/type';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';

import type { Currency } from '@/store/display/type';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Tags } from '@/schema/_common/model';
import type { ResourceGroupType } from '@/schema/_common/type';
import type { Tags } from '@/api-clients/_common/schema/model';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type {
BudgetNotification, BudgetPlannedLimit, BudgetTimeUnit, ProviderFilter,
} from '@/schema/cost-analysis/budget/type';
} from '@/api-clients/cost-analysis/budget/schema/type';

export interface BudgetCreateParameters {
data_source_id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Query } from '@cloudforet/core-lib/space-connector/type';

import type { BudgetTimeUnit } from '@/schema/cost-analysis/budget/type';
import type { BudgetTimeUnit } from '@/api-clients/cost-analysis/budget/schema/type';

export interface BudgetListParameters {
query?: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BudgetNotification } from '@/schema/cost-analysis/budget/type';
import type { BudgetNotification } from '@/api-clients/cost-analysis/budget/schema/type';

export interface BudgetSetNotificationParameters {
budget_id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Tags } from '@/schema/_common/model';
import type { BudgetPlannedLimit } from '@/schema/cost-analysis/budget/type';
import type { Tags } from '@/api-clients/_common/schema/model';
import type { BudgetPlannedLimit } from '@/api-clients/cost-analysis/budget/schema/type';

export interface BudgetUpdateParameters {
budget_id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Tags } from '@/schema/_common/model';
import type { ResourceGroupType } from '@/schema/_common/type';
import type { Tags } from '@/api-clients/_common/schema/model';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type {
BudgetNotification, BudgetPlannedLimit, BudgetTimeUnit, ProviderFilter,
} from '@/schema/cost-analysis/budget/type';
} from '@/api-clients/cost-analysis/budget/schema/type';

import type { Currency } from '@/store/display/type';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Tags } from '@/api-clients/_common/schema/model';
import type { CostQuerySetOption } from '@/api-clients/cost-analysis/cost-query-set/schema/type';


export interface CostQuerySetCreateParameters {
data_source_id: string;
name: string;
options: CostQuerySetOption;
tags?: Tags;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Tags } from '@/api-clients/_common/schema/model';
import type { CostQuerySetOption } from '@/api-clients/cost-analysis/cost-query-set/schema/type';


export interface CostQuerySetUpdateParameters {
cost_query_set_id: string;
name?: string;
options?: CostQuerySetOption;
tags?: Tags;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Tags } from '@/schema/_common/model';
import type { CostQuerySetOption } from '@/schema/cost-analysis/cost-query-set/type';
import type { Tags } from '@/api-clients/_common/schema/model';
import type { CostQuerySetOption } from '@/api-clients/cost-analysis/cost-query-set/schema/type';


export interface CostQuerySetModel {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CostReportConfigStatus } from '@/schema/cost-analysis/cost-report-config/type';
import type { CostReportConfigStatus } from '@/api-clients/cost-analysis/cost-report-config/schema/type';
import type { RoleType } from '@/schema/identity/role/type';

import type { Currency } from '@/store/display/type';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Query } from '@cloudforet/core-lib/space-connector/type';

import type { CostReportStatus } from '@/schema/cost-analysis/cost-report/type';
import type { CostReportStatus } from '@/api-clients/cost-analysis/cost-report/schema/type';


export interface CostReportListParameters {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CostReportStatus } from '@/schema/cost-analysis/cost-report/type';
import type { CostReportStatus } from '@/api-clients/cost-analysis/cost-report/schema/type';

import type { Currency } from '@/store/display/type';

Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Tags } from '@/schema/_common/model';
import type { Tags } from '@/api-clients/_common/schema/model';

export interface CostModel {
cost_id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Query } from '@cloudforet/core-lib/space-connector/type';

import type { CostDataSourceState, CostDataSourceType } from '@/schema/cost-analysis/data-source/type';
import type { CostDataSourceState, CostDataSourceType } from '@/api-clients/cost-analysis/data-source/schema/type';


export interface CostDataSourceListParameters {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { JsonSchema } from '@cloudforet/mirinae/types/controls/forms/json-schema-form/type';

import type { ResourceGroupType } from '@/schema/_common/type';
import type {
CostDataSourceSecretType, CostDataSourceType, CostDataSourceSchedule,
} from '@/schema/cost-analysis/data-source/type';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type { CostDataSourceSecretType, CostDataSourceState, CostDataSourceType } from '@/api-clients/cost-analysis/data-source/schema/type';

Check failure on line 4 in apps/web/src/api-clients/cost-analysis/data-source/schema/model.ts

View workflow job for this annotation

GitHub Actions / review

'CostDataSourceState' is defined but never used


interface PluginInfoModel {
Expand Down Expand Up @@ -31,7 +29,7 @@
export interface CostDataSourceModel {
data_source_id: string;
name: string;
schedule: CostDataSourceSchedule;

Check warning on line 32 in apps/web/src/api-clients/cost-analysis/data-source/schema/model.ts

View workflow job for this annotation

GitHub Actions / review

'CostDataSourceSchedule' is not defined
data_source_type: CostDataSourceType;
provider: string;
secret_type: CostDataSourceSecretType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { COST_DATA_SOURCE_STATE, COST_DATA_SOURCE_TYPE, COST_DATA_SOURCE_SECRET_TYPE } from '@/schema/cost-analysis/data-source/constant';
import type { COST_DATA_SOURCE_STATE, COST_DATA_SOURCE_TYPE, COST_DATA_SOURCE_SECRET_TYPE } from './constant';

export type CostDataSourceState = typeof COST_DATA_SOURCE_STATE[keyof typeof COST_DATA_SOURCE_STATE];

Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ResourceGroupType } from '@/schema/_common/type';
import type { CostJobStatus } from '@/schema/cost-analysis/job/type';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type { CostJobStatus } from '@/api-clients/cost-analysis/job/schema/type';


interface SyncedAccount {
account_id: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import type {
REFRESH_INTERVAL_OPTIONS_MAP,
DASHBOARD_TYPE,
} from '@/schema/dashboard/_constants/dashboard-constant';
import type { DashboardGlobalVariable } from '@/schema/dashboard/_types/dashboard-global-variable-type';
} from '@/api-clients/dashboard/_constants/dashboard-constant';
import type { DashboardGlobalVariable } from '@/api-clients/dashboard/_types/dashboard-global-variable-type';
import type {
InheritOptions, WidgetOptions, WidgetSize,
} from '@/schema/dashboard/_types/widget-type';
import type { PrivateDashboardChangeFolderParameters } from '@/schema/dashboard/private-dashboard/api-verbs/change-folder';
import type { PrivateDashboardCreateParameters } from '@/schema/dashboard/private-dashboard/api-verbs/create';
import type { PrivateDashboardDeleteParameters } from '@/schema/dashboard/private-dashboard/api-verbs/delete';
import type { PrivateDashboardListParameters } from '@/schema/dashboard/private-dashboard/api-verbs/list';
import type { PrivateDashboardUpdateParameters } from '@/schema/dashboard/private-dashboard/api-verbs/update';
import type { PrivateDashboardModel } from '@/schema/dashboard/private-dashboard/model';
import type { PublicDashboardChangeFolderParameters } from '@/schema/dashboard/public-dashboard/api-verbs/change-folder';
import type { PublicDashboardCreateParameters } from '@/schema/dashboard/public-dashboard/api-verbs/create';
import type { PublicDashboardDeleteParameters } from '@/schema/dashboard/public-dashboard/api-verbs/delete';
import type { PublicDashboardListParameters } from '@/schema/dashboard/public-dashboard/api-verbs/list';
import type { PublicDashboardUpdateParameters } from '@/schema/dashboard/public-dashboard/api-verbs/update';
import type { PublicDashboardModel } from '@/schema/dashboard/public-dashboard/model';
} from '@/api-clients/dashboard/_types/widget-type';
import type { PrivateDashboardChangeFolderParameters } from '@/api-clients/dashboard/private-dashboard/schema/api-verbs/change-folder';
import type { PrivateDashboardCreateParameters } from '@/api-clients/dashboard/private-dashboard/schema/api-verbs/create';
import type { PrivateDashboardDeleteParameters } from '@/api-clients/dashboard/private-dashboard/schema/api-verbs/delete';
import type { PrivateDashboardGetParameters } from '@/api-clients/dashboard/private-dashboard/schema/api-verbs/get';
import type { PrivateDashboardListParameters } from '@/api-clients/dashboard/private-dashboard/schema/api-verbs/list';
import type { PrivateDashboardUpdateParameters } from '@/api-clients/dashboard/private-dashboard/schema/api-verbs/update';
import type { PrivateDashboardModel } from '@/api-clients/dashboard/private-dashboard/schema/model';
import type { PublicDashboardChangeFolderParameters } from '@/api-clients/dashboard/public-dashboard/schema/api-verbs/change-folder';
import type { PublicDashboardCreateParameters } from '@/api-clients/dashboard/public-dashboard/schema/api-verbs/create';
import type { PublicDashboardDeleteParameters } from '@/api-clients/dashboard/public-dashboard/schema/api-verbs/delete';
import type { PublicDashboardGetParameters } from '@/api-clients/dashboard/public-dashboard/schema/api-verbs/get';
import type { PublicDashboardListParameters } from '@/api-clients/dashboard/public-dashboard/schema/api-verbs/list';
import type { PublicDashboardUpdateParameters } from '@/api-clients/dashboard/public-dashboard/schema/api-verbs/update';
import type { PublicDashboardModel } from '@/api-clients/dashboard/public-dashboard/schema/model';

import type { VariableModelType } from '@/lib/variable-models';
import type { Value } from '@/lib/variable-models/_base/types';
Expand All @@ -27,12 +29,13 @@ export type DashboardFolderType = 'PUBLIC'|'PRIVATE';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export type DashboardModel = PublicDashboardModel & PrivateDashboardModel;
export type DashboardModel = PublicDashboardModel | PrivateDashboardModel;
export type DashboardCreateParams = PublicDashboardCreateParameters | PrivateDashboardCreateParameters;
export type DashboardChangeFolderParams = PublicDashboardChangeFolderParameters | PrivateDashboardChangeFolderParameters;
export type DashboardListParams = PublicDashboardListParameters | PrivateDashboardListParameters;
export type DashboardUpdateParams = PublicDashboardUpdateParameters | PrivateDashboardUpdateParameters;
export type DashboardDeleteParams = PublicDashboardDeleteParameters | PrivateDashboardDeleteParameters;
export type DashboardGetParams = PublicDashboardGetParameters | PrivateDashboardGetParameters;

// dashboard variable schema types
type VariableSelectionType = 'SINGLE' | 'MULTI';
Expand Down Expand Up @@ -67,8 +70,9 @@ export interface DashboardVariablesSchema {
}

export interface DashboardGlobalVariablesSchema {
properties: Record<string, DashboardGlobalVariable>;
properties: DashboardGlobalVariableSchemaProperties;
}
export type DashboardGlobalVariableSchemaProperties = Record<string, DashboardGlobalVariable>;

// dashboard variables types
export type DashboardVariables = SingleSelectDashboardVariables | MultiSelectDashboardVariables;
Expand Down
14 changes: 14 additions & 0 deletions apps/web/src/api-clients/dashboard/_types/folder-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { PrivateFolderCreateParameters } from '@/api-clients/dashboard/private-folder/schema/api-verbs/create';
import type { PrivateFolderDeleteParameters } from '@/api-clients/dashboard/private-folder/schema/api-verbs/delete';
import type { PrivateFolderUpdateParameters } from '@/api-clients/dashboard/private-folder/schema/api-verbs/update';
import type { PrivateFolderModel } from '@/api-clients/dashboard/private-folder/schema/model';
import type { PublicFolderCreateParameters } from '@/api-clients/dashboard/public-folder/schema/api-verbs/create';
import type { PublicFolderDeleteParameters } from '@/api-clients/dashboard/public-folder/schema/api-verbs/delete';
import type { PublicFolderUpdateParameters } from '@/api-clients/dashboard/public-folder/schema/api-verbs/update';
import type { PublicFolderModel } from '@/api-clients/dashboard/public-folder/schema/model';


export type FolderModel = PublicFolderModel | PrivateFolderModel;
export type FolderCreateParams = PublicFolderCreateParameters | PrivateFolderCreateParameters;
export type FolderUpdateParams = PublicFolderUpdateParameters | PrivateFolderUpdateParameters;
export type FolderDeleteParams = PublicFolderDeleteParameters | PrivateFolderDeleteParameters;
Loading
Loading