gitlab-fetch
Advanced tools
Comparing version 0.3.1-dev.10243722 to 0.3.1-dev.10445991
# Changelog | ||
## develop | ||
* Add pagination parameters to operations which return lists. | ||
@@ -5,0 +6,0 @@ ## 0.3.0 |
import { AbstractApi, Config } from '../common'; | ||
import { Branch } from '../models'; | ||
import { PaginationParams } from './pagination'; | ||
export interface ProtectBranchParams { | ||
@@ -10,3 +11,3 @@ developers_can_push?: boolean; | ||
constructor(config: Config, namespace: string, projectName: string); | ||
getAll(): Promise<Branch[]>; | ||
getAll(params?: PaginationParams): Promise<Branch[]>; | ||
get(name: string): Promise<Branch>; | ||
@@ -13,0 +14,0 @@ protect(name: string, params?: ProtectBranchParams): Promise<Branch>; |
@@ -9,4 +9,4 @@ "use strict"; | ||
} | ||
getAll() { | ||
return this.fetch('GET', undefined); | ||
getAll(params = {}) { | ||
return this.fetch('GET', undefined, params); | ||
} | ||
@@ -13,0 +13,0 @@ get(name) { |
import { AbstractApi, Config } from '../common'; | ||
import { Commit, Diff, Comment, CommitStatus } from '../models'; | ||
export interface ListCommitsParams { | ||
import { PaginationParams } from './pagination'; | ||
export interface ListCommitsParams extends PaginationParams { | ||
ref_name?: string; | ||
@@ -13,3 +14,3 @@ since?: string; | ||
} | ||
export interface GetCommitStatusParams { | ||
export interface GetCommitStatusParams extends PaginationParams { | ||
ref?: string; | ||
@@ -65,3 +66,3 @@ stage?: string; | ||
cherryPick(sha: string, branch: string): Promise<Commit>; | ||
getDiff(ref: string): Promise<Diff[]>; | ||
getDiff(ref: string, params?: PaginationParams): Promise<Diff[]>; | ||
getComments(ref: string): Promise<Comment[]>; | ||
@@ -68,0 +69,0 @@ createComment(ref: string, note: string, params?: CreateCommitCommentParams): Promise<Comment>; |
@@ -26,4 +26,4 @@ "use strict"; | ||
} | ||
getDiff(ref) { | ||
return this.fetch('GET', `/${encodeURIComponent(ref)}/diff`); | ||
getDiff(ref, params = {}) { | ||
return this.fetch('GET', `/${encodeURIComponent(ref)}/diff`, params); | ||
} | ||
@@ -30,0 +30,0 @@ getComments(ref) { |
import { AbstractApi, Config } from '../common'; | ||
import { Hook } from '../models'; | ||
import { PaginationParams } from './pagination'; | ||
export interface AddHookParams { | ||
@@ -20,3 +21,3 @@ push_events?: boolean; | ||
constructor(config: Config, namespace: string, projectName: string); | ||
getHooks(): Promise<Hook[]>; | ||
getHooks(params?: PaginationParams): Promise<Hook[]>; | ||
getHook(hookId: number): Promise<Hook>; | ||
@@ -23,0 +24,0 @@ addHook(url: string, params?: AddHookParams): Promise<Hook>; |
@@ -9,4 +9,4 @@ "use strict"; | ||
} | ||
getHooks() { | ||
return this.fetch('GET', undefined); | ||
getHooks(params = {}) { | ||
return this.fetch('GET', undefined, params); | ||
} | ||
@@ -13,0 +13,0 @@ getHook(hookId) { |
import { AbstractApi, Config } from '../common'; | ||
import { Label } from '../models'; | ||
import { PaginationParams } from './pagination'; | ||
export interface CreateLabelParams { | ||
@@ -14,3 +15,3 @@ description?: string; | ||
constructor(config: Config, namespace: string, projectName: string); | ||
getAll(): Promise<Label[]>; | ||
getAll(params?: PaginationParams): Promise<Label[]>; | ||
create(name: string, color: string, params?: CreateLabelParams): Promise<Label>; | ||
@@ -17,0 +18,0 @@ edit(name: string, params?: EditLabelParams): Promise<Label>; |
@@ -9,4 +9,4 @@ "use strict"; | ||
} | ||
getAll() { | ||
return this.fetch('GET', undefined); | ||
getAll(params = {}) { | ||
return this.fetch('GET', undefined, params); | ||
} | ||
@@ -13,0 +13,0 @@ create(name, color, params = {}) { |
import { AbstractApi, Config } from '../common'; | ||
import { MergeRequestSummary, MergeRequest, Commit, Issue, Todo, MergeRequestVersionSummary, MergeRequestVersion } from '../models'; | ||
export interface ListMergeRequestsParams { | ||
import { PaginationParams } from './pagination'; | ||
export interface ListMergeRequestsParams extends PaginationParams { | ||
iids?: number[]; | ||
@@ -33,5 +34,5 @@ state?: 'all' | 'merged' | 'opened' | 'closed'; | ||
get(iid: number): Promise<MergeRequest>; | ||
getCommits(iid: number): Promise<Commit[]>; | ||
getCommits(iid: number, params?: PaginationParams): Promise<Commit[]>; | ||
getChanges(iid: number): Promise<MergeRequest>; | ||
getIssues(iid: number): Promise<Issue[]>; | ||
getIssues(iid: number, params?: PaginationParams): Promise<Issue[]>; | ||
getVersions(iid: number): Promise<MergeRequestVersionSummary>; | ||
@@ -38,0 +39,0 @@ getVersion(iid: number, versionId: number): Promise<MergeRequestVersion>; |
@@ -15,4 +15,4 @@ "use strict"; | ||
} | ||
getCommits(iid) { | ||
return this.fetch('GET', `/${iid}/commits`); | ||
getCommits(iid, params = {}) { | ||
return this.fetch('GET', `/${iid}/commits`, params); | ||
} | ||
@@ -22,4 +22,4 @@ getChanges(iid) { | ||
} | ||
getIssues(iid) { | ||
return this.fetch('GET', `/${iid}/closes_issues`); | ||
getIssues(iid, params = {}) { | ||
return this.fetch('GET', `/${iid}/closes_issues`, params); | ||
} | ||
@@ -26,0 +26,0 @@ getVersions(iid) { |
import { AbstractApi, Config } from '../common'; | ||
import { Project, UserSummary, Visibility, Event, UploadedFile } from '../models'; | ||
import { PaginationParams } from './pagination'; | ||
export interface EditProjectParams { | ||
@@ -39,4 +40,4 @@ name?: string; | ||
unarchive(): Promise<Project>; | ||
getUsers(): Promise<UserSummary[]>; | ||
getEvents(): Promise<Event[]>; | ||
getUsers(params?: PaginationParams): Promise<UserSummary[]>; | ||
getEvents(params?: PaginationParams): Promise<Event[]>; | ||
uploadFile(file: string): Promise<UploadedFile>; | ||
@@ -43,0 +44,0 @@ share(groupId: number, groupAccess: number, params?: ShareProjectParams): Promise<void>; |
@@ -40,7 +40,7 @@ "use strict"; | ||
} | ||
getUsers() { | ||
return this.fetch('GET', '/users'); | ||
getUsers(params = {}) { | ||
return this.fetch('GET', '/users', params); | ||
} | ||
getEvents() { | ||
return this.fetch('GET', '/events'); | ||
getEvents(params = {}) { | ||
return this.fetch('GET', '/events', params); | ||
} | ||
@@ -47,0 +47,0 @@ uploadFile(file) { |
import { AbstractApi, Config } from '../common'; | ||
import { Project, Visibility } from '../models'; | ||
export interface ListProjectsParams { | ||
import { PaginationParams } from './pagination'; | ||
export interface ListProjectsParams extends PaginationParams { | ||
archived?: boolean; | ||
@@ -5,0 +6,0 @@ visibility?: Visibility; |
/// <reference types="node" /> | ||
import { AbstractApi, Config } from '../common'; | ||
import { RepositoryFile, RepositoryTreeEntry, CompareRepository, Contributor } from '../models'; | ||
export interface GetTreeParams { | ||
import { PaginationParams } from './pagination'; | ||
export interface GetTreeParams extends PaginationParams { | ||
path?: string; | ||
@@ -31,3 +32,3 @@ recursive?: boolean; | ||
compare(from: string, to: string): Promise<CompareRepository>; | ||
getContributors(): Promise<Contributor[]>; | ||
getContributors(params?: PaginationParams): Promise<Contributor[]>; | ||
} |
@@ -69,4 +69,4 @@ "use strict"; | ||
} | ||
getContributors() { | ||
return this.fetch('GET', '/contributors'); | ||
getContributors(params = {}) { | ||
return this.fetch('GET', '/contributors', params); | ||
} | ||
@@ -73,0 +73,0 @@ } |
import { AbstractApi, Config } from '../common'; | ||
import { Tag, Release } from '../models'; | ||
import { PaginationParams } from './pagination'; | ||
export interface CreateTagParams { | ||
@@ -10,3 +11,3 @@ message?: string; | ||
constructor(config: Config, namespace: string, projectName: string); | ||
getAll(): Promise<Tag[]>; | ||
getAll(params?: PaginationParams): Promise<Tag[]>; | ||
get(name: string): Promise<Tag>; | ||
@@ -13,0 +14,0 @@ create(name: string, ref: string, params?: CreateTagParams): Promise<Tag>; |
@@ -9,4 +9,4 @@ "use strict"; | ||
} | ||
getAll() { | ||
return this.fetch('GET', undefined); | ||
getAll(params = {}) { | ||
return this.fetch('GET', undefined, params); | ||
} | ||
@@ -13,0 +13,0 @@ get(name) { |
import { AbstractApi, Config } from '../common'; | ||
import { User, UserSummary } from '../models'; | ||
export interface GetUsersParams { | ||
import { PaginationParams } from './pagination'; | ||
export interface GetUsersParams extends PaginationParams { | ||
active?: boolean; | ||
@@ -19,3 +20,3 @@ blocked?: boolean; | ||
delete(id: number): Promise<void>; | ||
getSSHKeys(): Promise<Object[]>; | ||
getSSHKeys(params?: PaginationParams): Promise<Object[]>; | ||
} |
@@ -20,4 +20,4 @@ "use strict"; | ||
} | ||
getSSHKeys() { | ||
return this.fetch('GET', '/keys', undefined, { baseApiPath: '/user' }); | ||
getSSHKeys(params = {}) { | ||
return this.fetch('GET', '/keys', undefined, Object.assign({}, params, { baseApiPath: '/user' })); | ||
} | ||
@@ -24,0 +24,0 @@ } |
{ | ||
"name": "gitlab-fetch", | ||
"version": "0.3.1-dev.10243722", | ||
"version": "0.3.1-dev.10445991", | ||
"author": "Jay Anslow <jay@anslow.me.uk>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80100
123
1473