Skip to content

Commit

Permalink
Merge branch '312-fixing-global-recursiveness' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed May 21, 2019
2 parents 396c71c + 84ae6e6 commit 745cc19
Show file tree
Hide file tree
Showing 105 changed files with 313 additions and 651 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
},
"files": [
"dist",
"types"
"typings"
],
"main": "dist/index.js",
"module": "dist/index.es.js",
"browser": "dist/index.browser.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"scripts": {
"build": "rollup -c",
"build": "rollup -c && tsc",
"commit": "npx git-cz",
"coverage": "codecov",
"lint": "tslint -p . -t stylish",
Expand Down
1 change: 0 additions & 1 deletion src/infrastructure/BaseService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { KyRequester } from './KyRequester';
import { BaseServiceOptions, Requester } from '../../types/types';

export class BaseService {
public readonly url: string;
Expand Down
1 change: 0 additions & 1 deletion src/infrastructure/KyRequester.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Ky from 'ky-universal';
import { camelizeKeys, decamelizeKeys } from 'humps';
import { stringify } from 'query-string';
import { Requester, DefaultRequestOptions } from '../../types/types';
import { skipAllCaps } from './Utils';

const methods = ['get', 'post', 'put', 'delete'];
Expand Down
10 changes: 1 addition & 9 deletions src/infrastructure/RequestHelper.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import Li from 'li';
import {
PaginatedRequestOptions,
BaseRequestOptions,
GetResponse,
PostResponse,
PutResponse,
DelResponse,
} from '../../types/types';
import { BaseService } from './BaseService';

export async function get(
Expand All @@ -33,7 +25,7 @@ export async function get(

if (!query.page && underLimit && pagination.next) {
const { next } = Li.parse(headers.link);
const more = await get(service, next.replace(/.+\/api\/v\d\//, ''), { maxPages, sudo });
const more = await get(service, next.replace(/.+\/api\/v\d\//, ''), options);

return [...body, ...more];
}
Expand Down
2 changes: 0 additions & 2 deletions src/infrastructure/Utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Constructor, Bundle } from '../../types/types';

export function bundler<T extends { [name: string]: Constructor }, P extends keyof T>(services: T) {
return (function Bundle(options?: any) {
Object.entries(services || {}).forEach(([name, ser]) => {
Expand Down
3 changes: 1 addition & 2 deletions src/services/ApplicationSettings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { BaseRequestOptions, Sudo } from '../../types/types';

class ApplicationSettings extends BaseService {
all(options?: Sudo) {
Expand All @@ -11,4 +10,4 @@ class ApplicationSettings extends BaseService {
}
}

export default ApplicationSettings;
export default ApplicationSettings;
1 change: 0 additions & 1 deletion src/services/Branches.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { BaseRequestOptions, PaginatedRequestOptions, Sudo, ProjectId } from '../../types/types';

class Branches extends BaseService {
all(projectId: ProjectId, options?: { search?: string } & PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/BroadcastMessages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { BaseRequestOptions, PaginatedRequestOptions, BroadcastMessageId } from '../../types/types';

class BroadcastMessages extends BaseService {
all(options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/CommitDiscussions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class CommitDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions) {
Expand Down
7 changes: 0 additions & 7 deletions src/services/Commits.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
BaseRequestOptions,
PaginatedRequestOptions,
Sudo,
CommitAction,
ProjectId,
} from '../../types/types';

class Commits extends BaseService {
all(projectId: ProjectId, options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/DeployKeys.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, Sudo, ProjectId, KeyId } from '../../types/types';

class DeployKeys extends BaseService {
add(projectId: ProjectId, options?: Sudo) {
Expand Down
1 change: 0 additions & 1 deletion src/services/Deployments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, Sudo, ProjectId, DeploymentId } from '../../types/types';

class Deployments extends BaseService {
all(projectId: ProjectId, options?: PaginatedRequestOptions) {
Expand Down
7 changes: 0 additions & 7 deletions src/services/Environments.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
BaseRequestOptions,
PaginatedRequestOptions,
Sudo,
ProjectId,
EnvironmentId,
} from '../../types/types';

class Environments extends BaseService {
all(projectId: ProjectId, options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/EpicDiscussions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class EpicDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions) {
Expand Down
8 changes: 0 additions & 8 deletions src/services/EpicIssues.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
BaseRequestOptions,
PaginatedRequestOptions,
Sudo,
GroupId,
EpicId,
IssueId,
} from '../../types/types';

class EpicIssues extends BaseService {
all(groupId: GroupId, epicId: EpicId, options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/EpicNotes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceNotes } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class EpicNotes extends ResourceNotes {
constructor(options: BaseServiceOptions) {
Expand Down
7 changes: 0 additions & 7 deletions src/services/Epics.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
BaseRequestOptions,
PaginatedRequestOptions,
Sudo,
GroupId,
EpicId,
} from '../../types/types';

class Epics extends BaseService {
all(groupId: GroupId, options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/Events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, EventOptions } from '../../types/types';

class Events extends BaseService {
all(options?: PaginatedRequestOptions & EventOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/FeatureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, BaseRequestOptions } from '../../types/types';

class FeatureFlags extends BaseService {
all(options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GeoNodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, BaseRequestOptions, Sudo, GeonodeId } from '../../types/types';

class GeoNodes extends BaseService {
all(options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GitLabCIYMLTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceTemplates } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GitLabCIYMLTemplates extends ResourceTemplates {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GitignoreTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceTemplates } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GitignoreTemplates extends ResourceTemplates {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GroupAccessRequests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceAccessRequests } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GroupAccessRequests extends ResourceAccessRequests {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GroupBadges.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceBadges } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GroupBadges extends ResourceBadges {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GroupCustomAttributes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceCustomAttributes } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GroupCustomAttributes extends ResourceCustomAttributes {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GroupIssueBoards.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceIssueBoards } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GroupIssueBoards extends ResourceIssueBoards {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GroupMembers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceMembers } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GroupMembers extends ResourceMembers {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GroupMilestones.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceMilestones } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GroupMilestones extends ResourceMilestones {
constructor(options: BaseServiceOptions) {
Expand Down
6 changes: 0 additions & 6 deletions src/services/GroupProjects.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
PaginatedRequestOptions,
BaseRequestOptions,
GroupProjectId,
ProjectId,
} from '../../types/types';

class GroupProjects extends BaseService {
all(groupId: GroupProjectId, options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/GroupVariables.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceVariables } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class GroupVariables extends ResourceVariables {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/Groups.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, BaseRequestOptions, Sudo, GroupId } from '../../types/types';

class Groups extends BaseService {
all(options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/IssueAwardEmojis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceAwardEmojis } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class IssueAwardEmojis extends ResourceAwardEmojis {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/IssueDiscussions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class IssueDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/IssueNotes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceNotes } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class IssueNotes extends ResourceNotes {
constructor(options: BaseServiceOptions) {
Expand Down
7 changes: 0 additions & 7 deletions src/services/Issues.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
PaginatedRequestOptions,
BaseRequestOptions,
Sudo,
ProjectId,
IssueId,
} from '../../types/types';

class Issues extends BaseService {
addSpentTime(projectId: ProjectId, issueId: IssueId, duration: string, options?: Sudo) {
Expand Down
9 changes: 0 additions & 9 deletions src/services/Jobs.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
PaginatedRequestOptions,
BaseRequestOptions,
Sudo,
ProjectId,
JobId,
PipelineId,
JobScope,
} from '../../types/types';

class Jobs extends BaseService {
all(projectId: ProjectId, options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/Keys.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { Sudo, KeyId } from '../../types/types';

class Keys extends BaseService {
show(keyId: KeyId, options?: Sudo) {
Expand Down
7 changes: 0 additions & 7 deletions src/services/Labels.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
PaginatedRequestOptions,
BaseRequestOptions,
Sudo,
ProjectId,
LabelId,
} from '../../types/types';

class Labels extends BaseService {
all(projectId: ProjectId, options?: PaginatedRequestOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/Licence.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { Sudo } from '../../types/types';

class Licence extends BaseService {
all(options?: Sudo) {
Expand Down
1 change: 0 additions & 1 deletion src/services/LicenceTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceTemplates } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class LicenceTemplates extends ResourceTemplates {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/Lint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { Sudo } from '../../types/types';

class Lint extends BaseService {
lint(content: string, options?: Sudo) {
Expand Down
1 change: 0 additions & 1 deletion src/services/Markdown.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { Sudo, ProjectId } from '../../types/types';

class Markdown extends BaseService {
render(text: string, options: { gfm?: string; project?: ProjectId } & Sudo) {
Expand Down
1 change: 0 additions & 1 deletion src/services/MergeRequestAwardEmojis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceAwardEmojis } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class MergeRequestAwardEmojis extends ResourceAwardEmojis {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/MergeRequestDiscussions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceDiscussions } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class MergeRequestDiscussions extends ResourceDiscussions {
constructor(options: BaseServiceOptions) {
Expand Down
1 change: 0 additions & 1 deletion src/services/MergeRequestNotes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ResourceNotes } from '../templates';
import { BaseServiceOptions } from '../../types/types';

class MergeRequestNotes extends ResourceNotes {
constructor(options: BaseServiceOptions) {
Expand Down
13 changes: 0 additions & 13 deletions src/services/MergeRequests.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
PaginatedRequestOptions,
BaseRequestOptions,
Sudo,
ProjectId,
MergeRequestId,
GroupId,
UserId,
AcceptMergeRequestOptions,
CreateMergeRequestOptions,
UpdateMergeRequestOptions,
ShowMergeRequestOptions,
} from '../../types/types';

class MergeRequests extends BaseService {
accept(
Expand Down
1 change: 0 additions & 1 deletion src/services/Namespaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, Sudo, NamespaceId } from '../../types/types';

class Namespaces extends BaseService {
all(options?: PaginatedRequestOptions) {
Expand Down
7 changes: 0 additions & 7 deletions src/services/NotificationSettings.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import {
BaseRequestOptions,
PaginatedRequestOptions,
NotificationSettingLevel,
ProjectId,
GroupId,
} from '../../types/types';

class NotificationSettings extends BaseService {
all({
Expand Down
1 change: 0 additions & 1 deletion src/services/PagesDomains.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BaseService, RequestHelper } from '../infrastructure';
import { PaginatedRequestOptions, BaseRequestOptions, Sudo, ProjectId } from '../../types/types';

class PagesDomains extends BaseService {
all({ projectId, ...options }: { projectId?: ProjectId } & PaginatedRequestOptions = {}) {
Expand Down
Loading

0 comments on commit 745cc19

Please sign in to comment.