Skip to content

Commit

Permalink
Changing project create types for path and name (#3528)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Jan 30, 2024
1 parent 03987a1 commit 3715191
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/core/src/infrastructure/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type Camelize<T> = { [K in keyof T as CamelizeString<K>]: Camelize<T[K]>

export type Simplify<T> = T extends infer S ? { [K in keyof S]: S[K] } : never;
export type Never<T> = Simplify<{ [P in keyof T]?: never }>;
export type SomeOf<T> = { [K in keyof T]: Pick<Required<T>, K> }[keyof T];
export type OneOf<T> = { [K in keyof T]: Simplify<Pick<T, K> & Never<Omit<T, K>>> }[keyof T];
export type OneOrNoneOf<T> = Never<T> | OneOf<T>;
export type AllOrNone<T extends Record<string, any>> = T | Partial<Record<keyof T, never>>;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/resources/Projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import type {
BaseRequestOptions,
GitlabAPIResponse,
MappedOmit,
OneOf,
PaginationRequestOptions,
PaginationTypes,
ShowExpanded,
SomeOf,
Sudo,
} from '../infrastructure';
import type { ProjectRemoteMirrorSchema } from './ProjectRemoteMirrors';
Expand Down Expand Up @@ -561,7 +561,7 @@ export class Projects<C extends boolean = false> extends BaseResource<C> {
userId,
avatar,
...options
}: OneOf<{ name: string; path: string }> &
}: SomeOf<{ name: string; path: string }> &
CreateProjectOptions &
Sudo &
ShowExpanded<E> = {} as any,
Expand Down

0 comments on commit 3715191

Please sign in to comment.