APIs: Fix pre-processing of getApiResources & update godoc for teams endpoints (#113536)
This commit is contained in:
@@ -4,3 +4,6 @@
|
|||||||
*_gen.go linguist-generated
|
*_gen.go linguist-generated
|
||||||
**/openapi_snapshots/*.json linguist-generated
|
**/openapi_snapshots/*.json linguist-generated
|
||||||
apps/**/pkg/apis/*_manifest.go linguist-generated
|
apps/**/pkg/apis/*_manifest.go linguist-generated
|
||||||
|
public/openapi3.json linguist-generated
|
||||||
|
public/api-merged.json linguist-generated
|
||||||
|
public/api-enterprise-spec.json linguist-generated
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/advisor.grafana.app/v0alpha1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listCheck: build.query<ListCheckApiResponse, ListCheckApiArg>({
|
listCheck: build.query<ListCheckApiResponse, ListCheckApiArg>({
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/correlations.grafana.app/v0alpha1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listCorrelation: build.query<ListCorrelationApiResponse, ListCorrelationApiArg>({
|
listCorrelation: build.query<ListCorrelationApiResponse, ListCorrelationApiArg>({
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/dashboard.grafana.app/v0alpha1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listDashboard: build.query<ListDashboardApiResponse, ListDashboardApiArg>({
|
listDashboard: build.query<ListDashboardApiResponse, ListDashboardApiArg>({
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/folder.grafana.app/v1beta1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listFolder: build.query<ListFolderApiResponse, ListFolderApiArg>({
|
listFolder: build.query<ListFolderApiResponse, ListFolderApiArg>({
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/iam.grafana.app/v0alpha1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
getDisplayMapping: build.query<GetDisplayMappingApiResponse, GetDisplayMappingApiArg>({
|
getDisplayMapping: build.query<GetDisplayMappingApiResponse, GetDisplayMappingApiArg>({
|
||||||
|
|||||||
@@ -108,13 +108,13 @@ const injectedRtkApi = api
|
|||||||
query: () => ({ url: `/access-control/status` }),
|
query: () => ({ url: `/access-control/status` }),
|
||||||
providesTags: ['access_control', 'enterprise'],
|
providesTags: ['access_control', 'enterprise'],
|
||||||
}),
|
}),
|
||||||
listTeamsRoles: build.mutation<ListTeamsRolesApiResponse, ListTeamsRolesApiArg>({
|
listTeamsRoles: build.query<ListTeamsRolesApiResponse, ListTeamsRolesApiArg>({
|
||||||
query: (queryArg) => ({
|
query: (queryArg) => ({
|
||||||
url: `/access-control/teams/roles/search`,
|
url: `/access-control/teams/roles/search`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: queryArg.rolesSearchQuery,
|
body: queryArg.rolesSearchQuery,
|
||||||
}),
|
}),
|
||||||
invalidatesTags: ['access_control', 'enterprise'],
|
providesTags: ['access_control', 'enterprise'],
|
||||||
}),
|
}),
|
||||||
listTeamRoles: build.query<ListTeamRolesApiResponse, ListTeamRolesApiArg>({
|
listTeamRoles: build.query<ListTeamRolesApiResponse, ListTeamRolesApiArg>({
|
||||||
query: (queryArg) => ({ url: `/access-control/teams/${queryArg.teamId}/roles` }),
|
query: (queryArg) => ({ url: `/access-control/teams/${queryArg.teamId}/roles` }),
|
||||||
@@ -129,7 +129,11 @@ const injectedRtkApi = api
|
|||||||
invalidatesTags: ['access_control', 'enterprise'],
|
invalidatesTags: ['access_control', 'enterprise'],
|
||||||
}),
|
}),
|
||||||
setTeamRoles: build.mutation<SetTeamRolesApiResponse, SetTeamRolesApiArg>({
|
setTeamRoles: build.mutation<SetTeamRolesApiResponse, SetTeamRolesApiArg>({
|
||||||
query: (queryArg) => ({ url: `/access-control/teams/${queryArg.teamId}/roles`, method: 'PUT' }),
|
query: (queryArg) => ({
|
||||||
|
url: `/access-control/teams/${queryArg.teamId}/roles`,
|
||||||
|
method: 'PUT',
|
||||||
|
body: queryArg.setTeamRolesCommand,
|
||||||
|
}),
|
||||||
invalidatesTags: ['access_control', 'enterprise'],
|
invalidatesTags: ['access_control', 'enterprise'],
|
||||||
}),
|
}),
|
||||||
removeTeamRole: build.mutation<RemoveTeamRoleApiResponse, RemoveTeamRoleApiArg>({
|
removeTeamRole: build.mutation<RemoveTeamRoleApiResponse, RemoveTeamRoleApiArg>({
|
||||||
@@ -1599,6 +1603,8 @@ const injectedRtkApi = api
|
|||||||
perpage: queryArg.perpage,
|
perpage: queryArg.perpage,
|
||||||
name: queryArg.name,
|
name: queryArg.name,
|
||||||
query: queryArg.query,
|
query: queryArg.query,
|
||||||
|
accesscontrol: queryArg.accesscontrol,
|
||||||
|
sort: queryArg.sort,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
providesTags: ['teams'],
|
providesTags: ['teams'],
|
||||||
@@ -2142,6 +2148,7 @@ export type SetTeamRolesApiResponse =
|
|||||||
/** status 200 An OKResponse is returned if the request was successful. */ SuccessResponseBody;
|
/** status 200 An OKResponse is returned if the request was successful. */ SuccessResponseBody;
|
||||||
export type SetTeamRolesApiArg = {
|
export type SetTeamRolesApiArg = {
|
||||||
teamId: number;
|
teamId: number;
|
||||||
|
setTeamRolesCommand: SetTeamRolesCommand;
|
||||||
};
|
};
|
||||||
export type RemoveTeamRoleApiResponse =
|
export type RemoveTeamRoleApiResponse =
|
||||||
/** status 200 An OKResponse is returned if the request was successful. */ SuccessResponseBody;
|
/** status 200 An OKResponse is returned if the request was successful. */ SuccessResponseBody;
|
||||||
@@ -3445,6 +3452,8 @@ export type SearchTeamsApiArg = {
|
|||||||
name?: string;
|
name?: string;
|
||||||
/** If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded. */
|
/** If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded. */
|
||||||
query?: string;
|
query?: string;
|
||||||
|
accesscontrol?: boolean;
|
||||||
|
sort?: string;
|
||||||
};
|
};
|
||||||
export type RemoveTeamGroupApiQueryApiResponse =
|
export type RemoveTeamGroupApiQueryApiResponse =
|
||||||
/** status 200 An OKResponse is returned if the request was successful. */ SuccessResponseBody;
|
/** status 200 An OKResponse is returned if the request was successful. */ SuccessResponseBody;
|
||||||
@@ -3880,26 +3889,26 @@ export type ErrorResponseBody = {
|
|||||||
For example, a 412 Precondition Failed error may include additional information of why that error happened. */
|
For example, a 412 Precondition Failed error may include additional information of why that error happened. */
|
||||||
status?: string;
|
status?: string;
|
||||||
};
|
};
|
||||||
export type PermissionIsTheModelForAccessControlPermissions = {
|
export type Permission = {
|
||||||
action?: string;
|
action?: string;
|
||||||
created?: string;
|
created?: string;
|
||||||
scope?: string;
|
scope?: string;
|
||||||
updated?: string;
|
updated?: string;
|
||||||
};
|
};
|
||||||
export type RoleDto = {
|
export type RoleDto = {
|
||||||
created?: string;
|
created: string;
|
||||||
delegatable?: boolean;
|
delegatable?: boolean;
|
||||||
description?: string;
|
description: string;
|
||||||
displayName?: string;
|
displayName: string;
|
||||||
global?: boolean;
|
global?: boolean;
|
||||||
group?: string;
|
group: string;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
mapped?: boolean;
|
mapped?: boolean;
|
||||||
name?: string;
|
name: string;
|
||||||
permissions?: PermissionIsTheModelForAccessControlPermissions[];
|
permissions?: Permission[];
|
||||||
uid?: string;
|
uid: string;
|
||||||
updated?: string;
|
updated: string;
|
||||||
version?: number;
|
version: number;
|
||||||
};
|
};
|
||||||
export type CreateRoleForm = {
|
export type CreateRoleForm = {
|
||||||
description?: string;
|
description?: string;
|
||||||
@@ -3908,7 +3917,7 @@ export type CreateRoleForm = {
|
|||||||
group?: string;
|
group?: string;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
name?: string;
|
name?: string;
|
||||||
permissions?: PermissionIsTheModelForAccessControlPermissions[];
|
permissions?: Permission[];
|
||||||
uid?: string;
|
uid?: string;
|
||||||
version?: number;
|
version?: number;
|
||||||
};
|
};
|
||||||
@@ -3922,7 +3931,7 @@ export type UpdateRoleCommand = {
|
|||||||
group: string;
|
group: string;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
name?: string;
|
name?: string;
|
||||||
permissions?: PermissionIsTheModelForAccessControlPermissions[];
|
permissions?: Permission[];
|
||||||
version?: number;
|
version?: number;
|
||||||
};
|
};
|
||||||
export type RoleAssignmentsDto = {
|
export type RoleAssignmentsDto = {
|
||||||
@@ -3946,6 +3955,10 @@ export type RolesSearchQuery = {
|
|||||||
export type AddTeamRoleCommand = {
|
export type AddTeamRoleCommand = {
|
||||||
roleUid?: string;
|
roleUid?: string;
|
||||||
};
|
};
|
||||||
|
export type SetTeamRolesCommand = {
|
||||||
|
includeHidden?: boolean;
|
||||||
|
roleUids?: string[];
|
||||||
|
};
|
||||||
export type AddUserRoleCommand = {
|
export type AddUserRoleCommand = {
|
||||||
global?: boolean;
|
global?: boolean;
|
||||||
roleUid?: string;
|
roleUid?: string;
|
||||||
@@ -6019,7 +6032,7 @@ export type CreateDashboardSnapshotCommand = {
|
|||||||
};
|
};
|
||||||
export type CreateTeamCommand = {
|
export type CreateTeamCommand = {
|
||||||
email?: string;
|
email?: string;
|
||||||
name?: string;
|
name: string;
|
||||||
};
|
};
|
||||||
export type TeamDto = {
|
export type TeamDto = {
|
||||||
accessControl?: {
|
accessControl?: {
|
||||||
@@ -6028,13 +6041,14 @@ export type TeamDto = {
|
|||||||
avatarUrl?: string;
|
avatarUrl?: string;
|
||||||
email?: string;
|
email?: string;
|
||||||
externalUID?: string;
|
externalUID?: string;
|
||||||
id?: number;
|
/** @deprecated Use UID instead */
|
||||||
isProvisioned?: boolean;
|
id: number;
|
||||||
memberCount?: number;
|
isProvisioned: boolean;
|
||||||
name?: string;
|
memberCount: number;
|
||||||
orgId?: number;
|
name: string;
|
||||||
|
orgId: number;
|
||||||
permission?: PermissionType;
|
permission?: PermissionType;
|
||||||
uid?: string;
|
uid: string;
|
||||||
};
|
};
|
||||||
export type SearchTeamQueryResult = {
|
export type SearchTeamQueryResult = {
|
||||||
page?: number;
|
page?: number;
|
||||||
@@ -6078,7 +6092,7 @@ export type TeamMemberDto = {
|
|||||||
userUID?: string;
|
userUID?: string;
|
||||||
};
|
};
|
||||||
export type AddTeamMemberCommand = {
|
export type AddTeamMemberCommand = {
|
||||||
userId?: number;
|
userId: number;
|
||||||
};
|
};
|
||||||
export type SetTeamMembershipsCommand = {
|
export type SetTeamMembershipsCommand = {
|
||||||
admins?: string[];
|
admins?: string[];
|
||||||
@@ -6515,7 +6529,8 @@ export const {
|
|||||||
useSetRoleAssignmentsMutation,
|
useSetRoleAssignmentsMutation,
|
||||||
useGetAccessControlStatusQuery,
|
useGetAccessControlStatusQuery,
|
||||||
useLazyGetAccessControlStatusQuery,
|
useLazyGetAccessControlStatusQuery,
|
||||||
useListTeamsRolesMutation,
|
useListTeamsRolesQuery,
|
||||||
|
useLazyListTeamsRolesQuery,
|
||||||
useListTeamRolesQuery,
|
useListTeamRolesQuery,
|
||||||
useLazyListTeamRolesQuery,
|
useLazyListTeamRolesQuery,
|
||||||
useAddTeamRoleMutation,
|
useAddTeamRoleMutation,
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/playlist.grafana.app/v0alpha1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listPlaylist: build.query<ListPlaylistApiResponse, ListPlaylistApiArg>({
|
listPlaylist: build.query<ListPlaylistApiResponse, ListPlaylistApiArg>({
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/preferences.grafana.app/v1alpha1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listPreferences: build.query<ListPreferencesApiResponse, ListPreferencesApiArg>({
|
listPreferences: build.query<ListPreferencesApiResponse, ListPreferencesApiArg>({
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/provisioning.grafana.app/v0alpha1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listJob: build.query<ListJobApiResponse, ListJobApiArg>({
|
listJob: build.query<ListJobApiResponse, ListJobApiArg>({
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
|||||||
.injectEndpoints({
|
.injectEndpoints({
|
||||||
endpoints: (build) => ({
|
endpoints: (build) => ({
|
||||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||||
query: () => ({ url: `/apis/shorturl.grafana.app/v1beta1/` }),
|
query: () => ({ url: `/` }),
|
||||||
providesTags: ['API Discovery'],
|
providesTags: ['API Discovery'],
|
||||||
}),
|
}),
|
||||||
listShortUrl: build.query<ListShortUrlApiResponse, ListShortUrlApiArg>({
|
listShortUrl: build.query<ListShortUrlApiResponse, ListShortUrlApiArg>({
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ const config: ConfigFile = {
|
|||||||
tag: true,
|
tag: true,
|
||||||
apiFile: '../clients/rtkq/legacy/baseAPI.ts',
|
apiFile: '../clients/rtkq/legacy/baseAPI.ts',
|
||||||
filterEndpoints: (_name, operation) => !operation.operation.deprecated,
|
filterEndpoints: (_name, operation) => !operation.operation.deprecated,
|
||||||
|
endpointOverrides: [
|
||||||
|
{
|
||||||
|
pattern: 'listTeamsRoles',
|
||||||
|
type: 'query',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'../clients/rtkq/migrate-to-cloud/endpoints.gen.ts': {
|
'../clients/rtkq/migrate-to-cloud/endpoints.gen.ts': {
|
||||||
schemaFile: path.join(basePath, 'public/openapi3.json'),
|
schemaFile: path.join(basePath, 'public/openapi3.json'),
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function processOpenAPISpec(spec: OpenAPIV3.Document) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Remove the specified part from the path key
|
// Remove the specified part from the path key
|
||||||
const newPathKey = path.replace(/^\/apis\/[^\/]+\/[^\/]+\/namespaces\/\{namespace}/, '');
|
const newPathKey = path.replace(/^\/apis\/[^\/]+\/[^\/]+/, '').replace(/^\/namespaces\/\{namespace}/, '');
|
||||||
|
|
||||||
// Process each method in the path (e.g., get, post)
|
// Process each method in the path (e.g., get, post)
|
||||||
const newPathItem: Record<string, unknown> = {};
|
const newPathItem: Record<string, unknown> = {};
|
||||||
|
|||||||
@@ -73,11 +73,17 @@ func (r Role) MarshalJSON() ([]byte, error) {
|
|||||||
|
|
||||||
// swagger:ignore
|
// swagger:ignore
|
||||||
type RoleDTO struct {
|
type RoleDTO struct {
|
||||||
Version int64 `json:"version"`
|
// required:true
|
||||||
UID string `xorm:"uid" json:"uid"`
|
Version int64 `json:"version"`
|
||||||
Name string `json:"name"`
|
// required:true
|
||||||
DisplayName string `json:"displayName,omitempty"`
|
UID string `xorm:"uid" json:"uid"`
|
||||||
Description string `json:"description"`
|
// required:true
|
||||||
|
Name string `json:"name"`
|
||||||
|
// required:true
|
||||||
|
DisplayName string `json:"displayName,omitempty"`
|
||||||
|
// required:true
|
||||||
|
Description string `json:"description"`
|
||||||
|
// required:true
|
||||||
Group string `xorm:"group_name" json:"group"`
|
Group string `xorm:"group_name" json:"group"`
|
||||||
Permissions []Permission `json:"permissions,omitempty"`
|
Permissions []Permission `json:"permissions,omitempty"`
|
||||||
Delegatable *bool `json:"delegatable,omitempty"`
|
Delegatable *bool `json:"delegatable,omitempty"`
|
||||||
@@ -87,7 +93,9 @@ type RoleDTO struct {
|
|||||||
ID int64 `json:"-" xorm:"pk autoincr 'id'"`
|
ID int64 `json:"-" xorm:"pk autoincr 'id'"`
|
||||||
OrgID int64 `json:"-" xorm:"org_id"`
|
OrgID int64 `json:"-" xorm:"org_id"`
|
||||||
|
|
||||||
|
// required:true
|
||||||
Updated time.Time `json:"updated"`
|
Updated time.Time `json:"updated"`
|
||||||
|
// required:true
|
||||||
Created time.Time `json:"created"`
|
Created time.Time `json:"created"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +201,7 @@ type BuiltinRole struct {
|
|||||||
Created time.Time
|
Created time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
// Permission is the model for access control permissions.
|
// Permission is the model for access control permissions
|
||||||
type Permission struct {
|
type Permission struct {
|
||||||
ID int64 `json:"-" xorm:"pk autoincr 'id'"`
|
ID int64 `json:"-" xorm:"pk autoincr 'id'"`
|
||||||
RoleID int64 `json:"-" xorm:"role_id"`
|
RoleID int64 `json:"-" xorm:"role_id"`
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ type Team struct {
|
|||||||
// COMMANDS
|
// COMMANDS
|
||||||
|
|
||||||
type CreateTeamCommand struct {
|
type CreateTeamCommand struct {
|
||||||
|
// required:true
|
||||||
Name string `json:"name" binding:"Required"`
|
Name string `json:"name" binding:"Required"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
ExternalUID string `json:"-"`
|
ExternalUID string `json:"-"`
|
||||||
@@ -94,14 +95,21 @@ type SearchTeamsQuery struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TeamDTO struct {
|
type TeamDTO struct {
|
||||||
ID int64 `json:"id" xorm:"id"`
|
// @deprecated Use UID instead
|
||||||
UID string `json:"uid" xorm:"uid"`
|
// required: true
|
||||||
OrgID int64 `json:"orgId" xorm:"org_id"`
|
ID int64 `json:"id" xorm:"id"`
|
||||||
Name string `json:"name"`
|
// required: true
|
||||||
Email string `json:"email"`
|
UID string `json:"uid" xorm:"uid"`
|
||||||
ExternalUID string `json:"externalUID" xorm:"external_uid"`
|
// required: true
|
||||||
IsProvisioned bool `json:"isProvisioned"`
|
OrgID int64 `json:"orgId" xorm:"org_id"`
|
||||||
AvatarURL string `json:"avatarUrl"`
|
// required: true
|
||||||
|
Name string `json:"name"`
|
||||||
|
Email string `json:"email"`
|
||||||
|
ExternalUID string `json:"externalUID" xorm:"external_uid"`
|
||||||
|
// required: true
|
||||||
|
IsProvisioned bool `json:"isProvisioned"`
|
||||||
|
AvatarURL string `json:"avatarUrl"`
|
||||||
|
// required: true
|
||||||
MemberCount int64 `json:"memberCount"`
|
MemberCount int64 `json:"memberCount"`
|
||||||
Permission PermissionType `json:"permission"`
|
Permission PermissionType `json:"permission"`
|
||||||
AccessControl map[string]bool `json:"accessControl"`
|
AccessControl map[string]bool `json:"accessControl"`
|
||||||
@@ -146,6 +154,7 @@ type TeamMember struct {
|
|||||||
// COMMANDS
|
// COMMANDS
|
||||||
|
|
||||||
type AddTeamMemberCommand struct {
|
type AddTeamMemberCommand struct {
|
||||||
|
// required:true
|
||||||
UserID int64 `json:"userId" binding:"Required"`
|
UserID int64 `json:"userId" binding:"Required"`
|
||||||
Permission PermissionType `json:"-"`
|
Permission PermissionType `json:"-"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,6 +344,13 @@ type SearchTeamsParams struct {
|
|||||||
// If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.
|
// If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.
|
||||||
// required:false
|
// required:false
|
||||||
Query string `json:"query"`
|
Query string `json:"query"`
|
||||||
|
// in:query
|
||||||
|
// required:false
|
||||||
|
// default: false
|
||||||
|
AccessControl bool `json:"accesscontrol"`
|
||||||
|
// in:query
|
||||||
|
// required:false
|
||||||
|
Sort string `json:"sort"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// swagger:parameters createTeam
|
// swagger:parameters createTeam
|
||||||
|
|||||||
Generated
+48
-1
@@ -406,6 +406,14 @@
|
|||||||
"name": "teamId",
|
"name": "teamId",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/SetTeamRolesCommand"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2577,6 +2585,9 @@
|
|||||||
},
|
},
|
||||||
"AddTeamMemberCommand": {
|
"AddTeamMemberCommand": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"userId"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"userId": {
|
"userId": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -3973,6 +3984,9 @@
|
|||||||
},
|
},
|
||||||
"CreateTeamCommand": {
|
"CreateTeamCommand": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -6162,8 +6176,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Permission": {
|
"Permission": {
|
||||||
|
"description": "Permission is the model for access control permissions",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Permission is the model for access control permissions.",
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"action": {
|
"action": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -7180,6 +7194,16 @@
|
|||||||
},
|
},
|
||||||
"RoleDTO": {
|
"RoleDTO": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"version",
|
||||||
|
"uid",
|
||||||
|
"name",
|
||||||
|
"displayName",
|
||||||
|
"description",
|
||||||
|
"group",
|
||||||
|
"updated",
|
||||||
|
"created"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"created": {
|
"created": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -7692,6 +7716,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"SetTeamRolesCommand": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"includeHidden": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"roleUids": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"SetUserRolesCommand": {
|
"SetUserRolesCommand": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -7865,6 +7903,14 @@
|
|||||||
},
|
},
|
||||||
"TeamDTO": {
|
"TeamDTO": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"uid",
|
||||||
|
"orgId",
|
||||||
|
"name",
|
||||||
|
"isProvisioned",
|
||||||
|
"memberCount"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"accessControl": {
|
"accessControl": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -7882,6 +7928,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
|
"description": "@deprecated Use UID instead",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+59
-1
@@ -406,6 +406,14 @@
|
|||||||
"name": "teamId",
|
"name": "teamId",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/SetTeamRolesCommand"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -9931,6 +9939,17 @@
|
|||||||
"description": "If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.",
|
"description": "If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.",
|
||||||
"name": "query",
|
"name": "query",
|
||||||
"in": "query"
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false,
|
||||||
|
"name": "accesscontrol",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "sort",
|
||||||
|
"in": "query"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -12750,6 +12769,9 @@
|
|||||||
},
|
},
|
||||||
"AddTeamMemberCommand": {
|
"AddTeamMemberCommand": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"userId"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"userId": {
|
"userId": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -14946,6 +14968,9 @@
|
|||||||
},
|
},
|
||||||
"CreateTeamCommand": {
|
"CreateTeamCommand": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"email": {
|
"email": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -18651,8 +18676,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Permission": {
|
"Permission": {
|
||||||
|
"description": "Permission is the model for access control permissions",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Permission is the model for access control permissions.",
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"action": {
|
"action": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -20562,6 +20587,16 @@
|
|||||||
},
|
},
|
||||||
"RoleDTO": {
|
"RoleDTO": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"version",
|
||||||
|
"uid",
|
||||||
|
"name",
|
||||||
|
"displayName",
|
||||||
|
"description",
|
||||||
|
"group",
|
||||||
|
"updated",
|
||||||
|
"created"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"created": {
|
"created": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -21449,6 +21484,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"SetTeamRolesCommand": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"includeHidden": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"roleUids": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"SetUserRolesCommand": {
|
"SetUserRolesCommand": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -21885,6 +21934,14 @@
|
|||||||
},
|
},
|
||||||
"TeamDTO": {
|
"TeamDTO": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"uid",
|
||||||
|
"orgId",
|
||||||
|
"name",
|
||||||
|
"isProvisioned",
|
||||||
|
"memberCount"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"accessControl": {
|
"accessControl": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@@ -21902,6 +21959,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
|
"description": "@deprecated Use UID instead",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+66
-1
@@ -2262,6 +2262,9 @@
|
|||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"required": [
|
||||||
|
"userId"
|
||||||
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"AddTeamRoleCommand": {
|
"AddTeamRoleCommand": {
|
||||||
@@ -4460,6 +4463,9 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"required": [
|
||||||
|
"name"
|
||||||
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"DashboardACLInfoDTO": {
|
"DashboardACLInfoDTO": {
|
||||||
@@ -8158,6 +8164,7 @@
|
|||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"Permission": {
|
"Permission": {
|
||||||
|
"description": "Permission is the model for access control permissions",
|
||||||
"properties": {
|
"properties": {
|
||||||
"action": {
|
"action": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -8174,7 +8181,6 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"title": "Permission is the model for access control permissions.",
|
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"PermissionDenied": {
|
"PermissionDenied": {
|
||||||
@@ -10115,6 +10121,16 @@
|
|||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"required": [
|
||||||
|
"version",
|
||||||
|
"uid",
|
||||||
|
"name",
|
||||||
|
"displayName",
|
||||||
|
"description",
|
||||||
|
"group",
|
||||||
|
"updated",
|
||||||
|
"created"
|
||||||
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"RolesSearchQuery": {
|
"RolesSearchQuery": {
|
||||||
@@ -10955,6 +10971,20 @@
|
|||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"SetTeamRolesCommand": {
|
||||||
|
"properties": {
|
||||||
|
"includeHidden": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"roleUids": {
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": "array"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"SetUserRolesCommand": {
|
"SetUserRolesCommand": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"global": {
|
"global": {
|
||||||
@@ -11407,6 +11437,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"id": {
|
"id": {
|
||||||
|
"description": "@deprecated Use UID instead",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
@@ -11431,6 +11462,14 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"uid",
|
||||||
|
"orgId",
|
||||||
|
"name",
|
||||||
|
"isProvisioned",
|
||||||
|
"memberCount"
|
||||||
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"TeamGroupDTO": {
|
"TeamGroupDTO": {
|
||||||
@@ -14207,6 +14246,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/SetTeamRolesCommand"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true,
|
||||||
|
"x-originalParamName": "body"
|
||||||
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/components/responses/okResponse"
|
"$ref": "#/components/responses/okResponse"
|
||||||
@@ -24515,6 +24565,21 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "accesscontrol",
|
||||||
|
"schema": {
|
||||||
|
"default": false,
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "query",
|
||||||
|
"name": "sort",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
|||||||
Reference in New Issue
Block a user