Skip to content

Commit

Permalink
fix: Removing required options object in a few of the API methods (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Dec 4, 2019
1 parent 55e688c commit b709ef6
Show file tree
Hide file tree
Showing 39 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/core/services/CommitDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class CommitDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', 'commits', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/EpicDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class EpicDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', 'epics', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/EpicNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceNotes } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class EpicNotes extends ResourceNotes {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', 'epics', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GitLabCIYMLTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceTemplates } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GitLabCIYMLTemplates extends ResourceTemplates {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('gitlab_ci_ymls', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GitignoreTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceTemplates } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GitignoreTemplates extends ResourceTemplates {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('gitignores', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupAccessRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceAccessRequests } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GroupAccessRequests extends ResourceAccessRequests {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupBadges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceBadges } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GroupBadges extends ResourceBadges {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupCustomAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceCustomAttributes } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GroupCustomAttributes extends ResourceCustomAttributes {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupIssueBoards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceIssueBoards } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GroupIssueBoards extends ResourceIssueBoards {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BaseServiceOptions } from '../infrastructure';
import { ResourceLabels } from '../templates';

export class GroupLabels extends ResourceLabels {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceMembers } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GroupMembers extends ResourceMembers {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupMilestones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceMilestones } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GroupMilestones extends ResourceMilestones {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/GroupVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceVariables } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class GroupVariables extends ResourceVariables {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('groups', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/IssueAwardEmojis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceAwardEmojis } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class IssueAwardEmojis extends ResourceAwardEmojis {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('issues', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/IssueDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class IssueDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', 'issues', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/IssueNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceNotes } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class IssueNotes extends ResourceNotes {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', 'issues', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/Jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class Jobs extends BaseService {
showPipelineJobs(
projectId: string | number,
pipelineId: number,
options: { scope: JobScope } & Sudo,
options?: { scope?: JobScope } & Sudo,
) {
const [pId, ppId] = [projectId, pipelineId].map(encodeURIComponent);

Expand Down
2 changes: 1 addition & 1 deletion src/core/services/Labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BaseServiceOptions } from '../infrastructure';
import { ResourceLabels } from '../templates';

export class Labels extends ResourceLabels {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/LicenceTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceTemplates } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class LicenceTemplates extends ResourceTemplates {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('licences', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/Markdown.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BaseService, RequestHelper, Sudo } from '../infrastructure';

export class Markdown extends BaseService {
render(text: string, options: { gfm?: string; project?: string | number } & Sudo) {
render(text: string, options?: { gfm?: string; project?: string | number } & Sudo) {
return RequestHelper.post(this, 'markdown', { text, ...options });
}
}
2 changes: 1 addition & 1 deletion src/core/services/MergeRequestAwardEmojis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceAwardEmojis } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class MergeRequestAwardEmojis extends ResourceAwardEmojis {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('merge_requests', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/MergeRequestDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class MergeRequestDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', 'merge_requests', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/MergeRequestNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceNotes } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class MergeRequestNotes extends ResourceNotes {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', 'merge_requests', options);
}
}
10 changes: 5 additions & 5 deletions src/core/services/MergeRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class MergeRequests extends BaseService {
approve(
projectId: string | number,
mergerequestIId: number,
options: { sha?: string } & BaseRequestOptions,
options?: { sha?: string } & BaseRequestOptions,
) {
const [pId, mIId] = [projectId, mergerequestIId].map(encodeURIComponent);

Expand All @@ -118,7 +118,7 @@ export class MergeRequests extends BaseService {

approvals(
projectId: string | number,
{ mergerequestIId, ...options }: { mergerequestIId?: number } & BaseRequestOptions,
{ mergerequestIId, ...options }: { mergerequestIId?: number } & BaseRequestOptions = {},
) {
const pId = encodeURIComponent(projectId);

Expand All @@ -137,7 +137,7 @@ export class MergeRequests extends BaseService {
approvalState(
projectId: string | number,
mergerequestIId: number,
options: { sha?: string } & BaseRequestOptions,
options?: { sha?: string } & BaseRequestOptions,
) {
const [pId, mIId] = [projectId, mergerequestIId].map(encodeURIComponent);

Expand All @@ -152,7 +152,7 @@ export class MergeRequests extends BaseService {
projectId: string | number,
approverIds: number[],
approverGroupIds: (string | number)[],
{ mergerequestIId, ...options }: { mergerequestIId?: number } & BaseRequestOptions,
{ mergerequestIId, ...options }: { mergerequestIId?: number } & BaseRequestOptions = {},
) {
const pId = encodeURIComponent(projectId);

Expand Down Expand Up @@ -226,7 +226,7 @@ export class MergeRequests extends BaseService {

editApprovals(
projectId: string | number,
{ mergerequestIId, ...options }: { mergerequestIId?: number } & BaseRequestOptions,
{ mergerequestIId, ...options }: { mergerequestIId?: number } & BaseRequestOptions = {},
) {
const pId = encodeURIComponent(projectId);

Expand Down
2 changes: 1 addition & 1 deletion src/core/services/Namespaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class Namespaces extends BaseService {
return RequestHelper.get(this, 'namespaces', options);
}

show(namespaceId: string | number, options: { search?: string } & Sudo) {
show(namespaceId: string | number, options?: { search?: string } & Sudo) {
const nId = encodeURIComponent(namespaceId);

return RequestHelper.get(this, `namespaces/${nId}`, options);
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/ProjectAccessRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceAccessRequests } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectAccessRequests extends ResourceAccessRequests {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectBadges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceBadges } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectBadges extends ResourceBadges {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectCustomAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceCustomAttributes } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectCustomAttributes extends ResourceCustomAttributes {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectIssueBoards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceIssueBoards } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectIssueBoards extends ResourceIssueBoards {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceMembers } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectMembers extends ResourceMembers {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectMilestones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceMilestones } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectMilestones extends ResourceMilestones {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectSnippetAwardEmojis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceAwardEmojis } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectSnippetAwardEmojis extends ResourceAwardEmojis {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('issues', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectSnippetDiscussions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectSnippetDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', 'snippets', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectSnippetNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceNotes } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectSnippetNotes extends ResourceNotes {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', 'snippets', options);
}
}
2 changes: 1 addition & 1 deletion src/core/services/ProjectVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ResourceVariables } from '../templates';
import { BaseServiceOptions } from '../infrastructure';

export class ProjectVariables extends ResourceVariables {
constructor(options: BaseServiceOptions = {}) {
constructor(options: BaseServiceOptions) {
super('projects', options);
}
}
8 changes: 4 additions & 4 deletions src/core/services/ProtectedTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
} from '../infrastructure';

export class ProtectedTags extends BaseService {
all(projectId: string | number, options: PaginatedRequestOptions) {
all(projectId: string | number, options?: PaginatedRequestOptions) {
const pId = encodeURIComponent(projectId);

return RequestHelper.get(this, `projects/${pId}/protected_tags`, options);
}

protect(projectId: string | number, tagName: string, options: BaseRequestOptions) {
protect(projectId: string | number, tagName: string, options?: BaseRequestOptions) {
const pId = encodeURIComponent(projectId);

return RequestHelper.post(this, `projects/${pId}/protected_tags`, {
Expand All @@ -22,13 +22,13 @@ export class ProtectedTags extends BaseService {
});
}

show(projectId: string | number, tagName: string, options: Sudo) {
show(projectId: string | number, tagName: string, options?: Sudo) {
const [pId, tName] = [projectId, tagName].map(encodeURIComponent);

return RequestHelper.get(this, `projects/${pId}/protected_tags/${tName}`, options);
}

unprotect(projectId: string | number, tagName: string, options: Sudo) {
unprotect(projectId: string | number, tagName: string, options?: Sudo) {
const [pId, tName] = [projectId, tagName].map(encodeURIComponent);

return RequestHelper.del(this, `projects/${pId}/protected_tags/${tName}`, options);
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/PushRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class PushRules extends BaseService {
return RequestHelper.post(this, `projects/${pId}/push_rule`, options);
}

edit(projectId: string | number, options: BaseRequestOptions) {
edit(projectId: string | number, options?: BaseRequestOptions) {
const pId = encodeURIComponent(projectId);

try {
Expand Down
Loading

0 comments on commit b709ef6

Please sign in to comment.