-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for
GroupJobTokenScopes
and moved JobTokenScopes
t…
…o `ProjectJobTokenScopes`(#3643)
- Loading branch information
1 parent
dc4c9d7
commit 8525268
Showing
13 changed files
with
188 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
yarn dlx --no-install lint-staged | ||
yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { BaseResourceOptions } from '@gitbeaker/requester-utils'; | ||
import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure'; | ||
import type { AllowListSchema } from '../templates/ResourceJobTokenScopes'; | ||
import { ResourceJobTokenScopes } from '../templates/ResourceJobTokenScopes'; | ||
|
||
export interface GroupJobTokenScopes<C extends boolean = false> extends ResourceJobTokenScopes<C> { | ||
addToInboundAllowList<E extends boolean = false>( | ||
groupId: string | number, | ||
targetGroupId: string | number, | ||
options?: Sudo & ShowExpanded<E>, | ||
): Promise<GitlabAPIResponse<AllowListSchema, C, E, void>>; | ||
|
||
removeFromInboundAllowList<E extends boolean = false>( | ||
groupId: string | number, | ||
targetGroupId: string | number, | ||
options?: Sudo & ShowExpanded<E>, | ||
): Promise<GitlabAPIResponse<void, C, E, void>>; | ||
} | ||
|
||
export class GroupJobTokenScopes<C extends boolean = false> extends ResourceJobTokenScopes<C> { | ||
constructor(options: BaseResourceOptions<C>) { | ||
/* istanbul ignore next */ | ||
super('groups', options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import type { BaseResourceOptions } from '@gitbeaker/requester-utils'; | ||
import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure'; | ||
import type { SimpleProjectSchema } from './Projects'; | ||
import type { AllowListSchema, JobTokenScopeSchema } from '../templates/ResourceJobTokenScopes'; | ||
import { ResourceJobTokenScopes } from '../templates/ResourceJobTokenScopes'; | ||
|
||
export interface ProjectJobTokenScopes<C extends boolean = false> | ||
extends ResourceJobTokenScopes<C> { | ||
edit<E extends boolean = false>( | ||
projectId: string | number, | ||
enabled: boolean, | ||
options?: Sudo & ShowExpanded<E>, | ||
): Promise<GitlabAPIResponse<JobTokenScopeSchema, C, E, void>>; | ||
|
||
show<E extends boolean = false>( | ||
projectId: string | number, | ||
options?: Sudo & ShowExpanded<E>, | ||
): Promise<GitlabAPIResponse<JobTokenScopeSchema, C, E, void>>; | ||
|
||
showInboundAllowList<E extends boolean = false>( | ||
projectId: string | number, | ||
options?: Sudo & ShowExpanded<E>, | ||
): Promise<GitlabAPIResponse<SimpleProjectSchema[], C, E, void>>; | ||
|
||
addToInboundAllowList<E extends boolean = false>( | ||
projectId: string | number, | ||
targetProjectId: string | number, | ||
options?: Sudo & ShowExpanded<E>, | ||
): Promise<GitlabAPIResponse<AllowListSchema, C, E, void>>; | ||
|
||
removeFromInboundAllowList<E extends boolean = false>( | ||
projectId: string | number, | ||
targetProjectId: string | number, | ||
options?: Sudo & ShowExpanded<E>, | ||
): Promise<GitlabAPIResponse<void, C, E, void>>; | ||
} | ||
|
||
export class ProjectJobTokenScopes<C extends boolean = false> extends ResourceJobTokenScopes<C> { | ||
constructor(options: BaseResourceOptions<C>) { | ||
/* istanbul ignore next */ | ||
super('projects', options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.