mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-27 03:52:41 +00:00
feat: upgrade prettier to v3
This commit is contained in:
@@ -39,8 +39,8 @@ export type RecursivePartial<T> = {
|
||||
[P in keyof T]?: T[P] extends Array<infer U>
|
||||
? Array<RecursivePartial<U>>
|
||||
: T[P] extends object
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
};
|
||||
|
||||
chai.should();
|
||||
|
||||
@@ -95,7 +95,11 @@ export class Client {
|
||||
*
|
||||
* TODO: remove headers/version
|
||||
*/
|
||||
constructor(protected httpClient: HttpClientInterface, protected url: string, protected version?: string) {
|
||||
constructor(
|
||||
protected httpClient: HttpClientInterface,
|
||||
protected url: string,
|
||||
protected version?: string,
|
||||
) {
|
||||
// cut trailing slash if needed
|
||||
this.url = this.url.replace(/\/$/, '');
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ export type RecursivePartial<T> = {
|
||||
[P in keyof T]?: T[P] extends Array<infer U>
|
||||
? Array<RecursivePartial<U>>
|
||||
: T[P] extends object
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
};
|
||||
|
||||
async function invokeIndexRoute(): Promise<RecursivePartial<HttpClientResponse<SCIndexResponse>>> {
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
* iteratee is invoked with one argument: (value).
|
||||
*/
|
||||
export function keyBy<T>(collection: T[], key: (item: T) => string | number): Record<string, T> {
|
||||
return collection.reduce((accumulator, item) => {
|
||||
accumulator[key(item)] = item;
|
||||
return accumulator;
|
||||
}, {} as Record<string | number, T>);
|
||||
return collection.reduce(
|
||||
(accumulator, item) => {
|
||||
accumulator[key(item)] = item;
|
||||
return accumulator;
|
||||
},
|
||||
{} as Record<string | number, T>,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,15 @@
|
||||
* Pick a set of properties from an object
|
||||
*/
|
||||
export function pick<T extends object, U extends keyof T>(object: T, keys: U[]): Pick<T, U> {
|
||||
return keys.reduce((accumulator, key) => {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
accumulator[key] = object[key];
|
||||
}
|
||||
return accumulator;
|
||||
}, {} as Pick<T, U>);
|
||||
return keys.reduce(
|
||||
(accumulator, key) => {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
accumulator[key] = object[key];
|
||||
}
|
||||
return accumulator;
|
||||
},
|
||||
{} as Pick<T, U>,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,10 +35,13 @@ export function pickBy<T extends object, U extends keyof T>(
|
||||
object: T,
|
||||
predicate: (value: T[U], key: U) => boolean,
|
||||
): Pick<T, U> {
|
||||
return (Object.keys(object) as U[]).reduce((accumulator, key) => {
|
||||
if (predicate(object[key], key)) {
|
||||
accumulator[key] = object[key];
|
||||
}
|
||||
return accumulator;
|
||||
}, {} as Pick<T, U>);
|
||||
return (Object.keys(object) as U[]).reduce(
|
||||
(accumulator, key) => {
|
||||
if (predicate(object[key], key)) {
|
||||
accumulator[key] = object[key];
|
||||
}
|
||||
return accumulator;
|
||||
},
|
||||
{} as Pick<T, U>,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,12 @@
|
||||
*/
|
||||
export function uniqBy<T>(array: T[], transform: (item: T) => string | number): T[] {
|
||||
return Object.values(
|
||||
array.reduce((accumulator, current) => {
|
||||
accumulator[transform(current)] = current;
|
||||
return accumulator;
|
||||
}, {} as Record<string | number, T>),
|
||||
array.reduce(
|
||||
(accumulator, current) => {
|
||||
accumulator[transform(current)] = current;
|
||||
return accumulator;
|
||||
},
|
||||
{} as Record<string | number, T>,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>OpenStApps API</title>
|
||||
|
||||
@@ -691,8 +691,8 @@ type RecursivePartial<T> = {
|
||||
[P in keyof T]-?: T[P] extends Array<infer U>
|
||||
? Array<RecursivePartial<U>>
|
||||
: T[P] extends object
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -148,66 +148,66 @@ export type SCThingsField = keyof SCThings | string;
|
||||
export type SCAssociatedThingWithoutReferences<THING extends SCThings> = THING extends SCAssessment
|
||||
? SCAssessmentWithoutReferences
|
||||
: THING extends SCAcademicEvent
|
||||
? SCAcademicEventWithoutReferences
|
||||
: THING extends SCArticle
|
||||
? SCArticleWithoutReferences
|
||||
: THING extends SCBook
|
||||
? SCBookWithoutReferences
|
||||
: THING extends SCBuilding
|
||||
? SCBuildingWithoutReferences
|
||||
: THING extends SCCatalog
|
||||
? SCCatalogWithoutReferences
|
||||
: THING extends SCContactPoint
|
||||
? SCContactPointWithoutReferences
|
||||
: THING extends SCCourseOfStudy
|
||||
? SCCourseOfStudyWithoutReferences
|
||||
: THING extends SCCertification
|
||||
? SCCertificationWithoutReferences
|
||||
: THING extends SCDateSeries
|
||||
? SCDateSeriesWithoutReferences
|
||||
: THING extends SCDiff
|
||||
? SCDiffWithoutReferences
|
||||
: THING extends SCDish
|
||||
? SCDishWithoutReferences
|
||||
: THING extends SCFavorite
|
||||
? SCFavoriteWithoutReferences
|
||||
: THING extends SCFloor
|
||||
? SCFloorWithoutReferences
|
||||
: THING extends SCIdCard
|
||||
? SCIdCardWithoutReferences
|
||||
: THING extends SCJobPosting
|
||||
? SCJobPostingWithoutReferences
|
||||
: THING extends SCMessage
|
||||
? SCMessageWithoutReferences
|
||||
: THING extends SCOrganization
|
||||
? SCOrganizationWithoutReferences
|
||||
: THING extends SCPeriodical
|
||||
? SCPeriodicalWithoutReferences
|
||||
: THING extends SCPerson
|
||||
? SCPersonWithoutReferences
|
||||
: THING extends SCPointOfInterest
|
||||
? SCPointOfInterestWithoutReferences
|
||||
: THING extends SCPublicationEvent
|
||||
? SCPublicationEventWithoutReferences
|
||||
: THING extends SCRoom
|
||||
? SCRoomWithoutReferences
|
||||
: THING extends SCSemester
|
||||
? SCSemesterWithoutReferences
|
||||
: THING extends SCSetting
|
||||
? SCSettingWithoutReferences
|
||||
: THING extends SCSportCourse
|
||||
? SCSportCourseWithoutReferences
|
||||
: THING extends SCStudyModule
|
||||
? SCStudyModuleWithoutReferences
|
||||
: THING extends SCTicket
|
||||
? SCTicketWithoutReferences
|
||||
: THING extends SCToDo
|
||||
? SCToDoWithoutReferences
|
||||
: THING extends SCTour
|
||||
? SCTourWithoutReferences
|
||||
: THING extends SCVideo
|
||||
? SCVideoWithoutReferences
|
||||
: never;
|
||||
? SCAcademicEventWithoutReferences
|
||||
: THING extends SCArticle
|
||||
? SCArticleWithoutReferences
|
||||
: THING extends SCBook
|
||||
? SCBookWithoutReferences
|
||||
: THING extends SCBuilding
|
||||
? SCBuildingWithoutReferences
|
||||
: THING extends SCCatalog
|
||||
? SCCatalogWithoutReferences
|
||||
: THING extends SCContactPoint
|
||||
? SCContactPointWithoutReferences
|
||||
: THING extends SCCourseOfStudy
|
||||
? SCCourseOfStudyWithoutReferences
|
||||
: THING extends SCCertification
|
||||
? SCCertificationWithoutReferences
|
||||
: THING extends SCDateSeries
|
||||
? SCDateSeriesWithoutReferences
|
||||
: THING extends SCDiff
|
||||
? SCDiffWithoutReferences
|
||||
: THING extends SCDish
|
||||
? SCDishWithoutReferences
|
||||
: THING extends SCFavorite
|
||||
? SCFavoriteWithoutReferences
|
||||
: THING extends SCFloor
|
||||
? SCFloorWithoutReferences
|
||||
: THING extends SCIdCard
|
||||
? SCIdCardWithoutReferences
|
||||
: THING extends SCJobPosting
|
||||
? SCJobPostingWithoutReferences
|
||||
: THING extends SCMessage
|
||||
? SCMessageWithoutReferences
|
||||
: THING extends SCOrganization
|
||||
? SCOrganizationWithoutReferences
|
||||
: THING extends SCPeriodical
|
||||
? SCPeriodicalWithoutReferences
|
||||
: THING extends SCPerson
|
||||
? SCPersonWithoutReferences
|
||||
: THING extends SCPointOfInterest
|
||||
? SCPointOfInterestWithoutReferences
|
||||
: THING extends SCPublicationEvent
|
||||
? SCPublicationEventWithoutReferences
|
||||
: THING extends SCRoom
|
||||
? SCRoomWithoutReferences
|
||||
: THING extends SCSemester
|
||||
? SCSemesterWithoutReferences
|
||||
: THING extends SCSetting
|
||||
? SCSettingWithoutReferences
|
||||
: THING extends SCSportCourse
|
||||
? SCSportCourseWithoutReferences
|
||||
: THING extends SCStudyModule
|
||||
? SCStudyModuleWithoutReferences
|
||||
: THING extends SCTicket
|
||||
? SCTicketWithoutReferences
|
||||
: THING extends SCToDo
|
||||
? SCToDoWithoutReferences
|
||||
: THING extends SCTour
|
||||
? SCTourWithoutReferences
|
||||
: THING extends SCVideo
|
||||
? SCVideoWithoutReferences
|
||||
: never;
|
||||
|
||||
/**
|
||||
* Thing for a thing without references
|
||||
@@ -215,63 +215,63 @@ export type SCAssociatedThingWithoutReferences<THING extends SCThings> = THING e
|
||||
export type SCAssociatedThing<THING extends SCThings> = THING extends SCAssessmentWithoutReferences
|
||||
? SCAssessment
|
||||
: THING extends SCAcademicEventWithoutReferences
|
||||
? SCAcademicEvent
|
||||
: THING extends SCArticleWithoutReferences
|
||||
? SCArticle
|
||||
: THING extends SCBookWithoutReferences
|
||||
? SCBook
|
||||
: THING extends SCBuildingWithoutReferences
|
||||
? SCBuilding
|
||||
: THING extends SCCatalogWithoutReferences
|
||||
? SCCatalog
|
||||
: THING extends SCContactPointWithoutReferences
|
||||
? SCContactPoint
|
||||
: THING extends SCCourseOfStudyWithoutReferences
|
||||
? SCCourseOfStudy
|
||||
: THING extends SCCertificationWithoutReferences
|
||||
? SCCertification
|
||||
: THING extends SCDateSeriesWithoutReferences
|
||||
? SCDateSeries
|
||||
: THING extends SCDiffWithoutReferences
|
||||
? SCDiff
|
||||
: THING extends SCDishWithoutReferences
|
||||
? SCDish
|
||||
: THING extends SCJobPostingWithoutReferences
|
||||
? SCJobPosting
|
||||
: THING extends SCFavoriteWithoutReferences
|
||||
? SCFavorite
|
||||
: THING extends SCFloorWithoutReferences
|
||||
? SCFloor
|
||||
: THING extends SCIdCardWithoutReferences
|
||||
? SCIdCard
|
||||
: THING extends SCMessageWithoutReferences
|
||||
? SCMessage
|
||||
: THING extends SCOrganizationWithoutReferences
|
||||
? SCOrganization
|
||||
: THING extends SCPeriodicalWithoutReferences
|
||||
? SCPeriodical
|
||||
: THING extends SCPersonWithoutReferences
|
||||
? SCPerson
|
||||
: THING extends SCPointOfInterestWithoutReferences
|
||||
? SCPointOfInterest
|
||||
: THING extends SCPublicationEventWithoutReferences
|
||||
? SCPublicationEvent
|
||||
: THING extends SCRoomWithoutReferences
|
||||
? SCRoom
|
||||
: THING extends SCSemesterWithoutReferences
|
||||
? SCSemester
|
||||
: THING extends SCSettingWithoutReferences
|
||||
? SCSetting
|
||||
: THING extends SCSportCourseWithoutReferences
|
||||
? SCSportCourse
|
||||
: THING extends SCStudyModuleWithoutReferences
|
||||
? SCStudyModule
|
||||
: THING extends SCTicketWithoutReferences
|
||||
? SCTicket
|
||||
: THING extends SCToDoWithoutReferences
|
||||
? SCToDo
|
||||
: THING extends SCTourWithoutReferences
|
||||
? SCTour
|
||||
: THING extends SCVideoWithoutReferences
|
||||
? SCVideo
|
||||
: never;
|
||||
? SCAcademicEvent
|
||||
: THING extends SCArticleWithoutReferences
|
||||
? SCArticle
|
||||
: THING extends SCBookWithoutReferences
|
||||
? SCBook
|
||||
: THING extends SCBuildingWithoutReferences
|
||||
? SCBuilding
|
||||
: THING extends SCCatalogWithoutReferences
|
||||
? SCCatalog
|
||||
: THING extends SCContactPointWithoutReferences
|
||||
? SCContactPoint
|
||||
: THING extends SCCourseOfStudyWithoutReferences
|
||||
? SCCourseOfStudy
|
||||
: THING extends SCCertificationWithoutReferences
|
||||
? SCCertification
|
||||
: THING extends SCDateSeriesWithoutReferences
|
||||
? SCDateSeries
|
||||
: THING extends SCDiffWithoutReferences
|
||||
? SCDiff
|
||||
: THING extends SCDishWithoutReferences
|
||||
? SCDish
|
||||
: THING extends SCJobPostingWithoutReferences
|
||||
? SCJobPosting
|
||||
: THING extends SCFavoriteWithoutReferences
|
||||
? SCFavorite
|
||||
: THING extends SCFloorWithoutReferences
|
||||
? SCFloor
|
||||
: THING extends SCIdCardWithoutReferences
|
||||
? SCIdCard
|
||||
: THING extends SCMessageWithoutReferences
|
||||
? SCMessage
|
||||
: THING extends SCOrganizationWithoutReferences
|
||||
? SCOrganization
|
||||
: THING extends SCPeriodicalWithoutReferences
|
||||
? SCPeriodical
|
||||
: THING extends SCPersonWithoutReferences
|
||||
? SCPerson
|
||||
: THING extends SCPointOfInterestWithoutReferences
|
||||
? SCPointOfInterest
|
||||
: THING extends SCPublicationEventWithoutReferences
|
||||
? SCPublicationEvent
|
||||
: THING extends SCRoomWithoutReferences
|
||||
? SCRoom
|
||||
: THING extends SCSemesterWithoutReferences
|
||||
? SCSemester
|
||||
: THING extends SCSettingWithoutReferences
|
||||
? SCSetting
|
||||
: THING extends SCSportCourseWithoutReferences
|
||||
? SCSportCourse
|
||||
: THING extends SCStudyModuleWithoutReferences
|
||||
? SCStudyModule
|
||||
: THING extends SCTicketWithoutReferences
|
||||
? SCTicket
|
||||
: THING extends SCToDoWithoutReferences
|
||||
? SCToDo
|
||||
: THING extends SCTourWithoutReferences
|
||||
? SCTour
|
||||
: THING extends SCVideoWithoutReferences
|
||||
? SCVideo
|
||||
: never;
|
||||
|
||||
@@ -45,7 +45,12 @@ export abstract class SCError implements SCErrorResponse {
|
||||
* @param statusCode HTTP status code to return this error with
|
||||
* @param stack Set to true if a stack trace should be created
|
||||
*/
|
||||
constructor(public name: string, public message: string, public statusCode: number, stack = false) {
|
||||
constructor(
|
||||
public name: string,
|
||||
public message: string,
|
||||
public statusCode: number,
|
||||
stack = false,
|
||||
) {
|
||||
// generate stacktrace if needed
|
||||
if (stack) {
|
||||
// eslint-disable-next-line unicorn/error-message
|
||||
|
||||
@@ -193,24 +193,24 @@ export type SCResponses =
|
||||
export type SCAssociatedResponse<REQUEST> = REQUEST extends SCBookAvailabilityRequest
|
||||
? SCBookAvailabilityResponse
|
||||
: REQUEST extends SCBulkRequest
|
||||
? SCBulkResponse
|
||||
: REQUEST extends SCBulkAddRequest
|
||||
? SCBulkAddResponse
|
||||
: REQUEST extends SCBulkDoneRequest
|
||||
? SCBulkDoneResponse
|
||||
: REQUEST extends SCFeedbackRequest
|
||||
? SCFeedbackResponse
|
||||
: REQUEST extends SCRatingRequest
|
||||
? SCRatingResponse
|
||||
: REQUEST extends SCIndexRequest
|
||||
? SCIndexResponse
|
||||
: REQUEST extends SCMultiSearchRequest
|
||||
? SCMultiSearchResponse
|
||||
: REQUEST extends SCSearchRequest
|
||||
? SCSearchResponse
|
||||
: REQUEST extends SCThingUpdateRequest
|
||||
? SCThingUpdateResponse
|
||||
: never;
|
||||
? SCBulkResponse
|
||||
: REQUEST extends SCBulkAddRequest
|
||||
? SCBulkAddResponse
|
||||
: REQUEST extends SCBulkDoneRequest
|
||||
? SCBulkDoneResponse
|
||||
: REQUEST extends SCFeedbackRequest
|
||||
? SCFeedbackResponse
|
||||
: REQUEST extends SCRatingRequest
|
||||
? SCRatingResponse
|
||||
: REQUEST extends SCIndexRequest
|
||||
? SCIndexResponse
|
||||
: REQUEST extends SCMultiSearchRequest
|
||||
? SCMultiSearchResponse
|
||||
: REQUEST extends SCSearchRequest
|
||||
? SCSearchResponse
|
||||
: REQUEST extends SCThingUpdateRequest
|
||||
? SCThingUpdateResponse
|
||||
: never;
|
||||
|
||||
/**
|
||||
* Associated request for a response
|
||||
@@ -218,24 +218,24 @@ export type SCAssociatedResponse<REQUEST> = REQUEST extends SCBookAvailabilityRe
|
||||
export type SCAssociatedRequest<RESPONSE> = RESPONSE extends SCBookAvailabilityResponse
|
||||
? SCBookAvailabilityRequest
|
||||
: RESPONSE extends SCBulkResponse
|
||||
? SCBulkRequest
|
||||
: RESPONSE extends SCBulkAddResponse
|
||||
? SCBulkAddRequest
|
||||
: RESPONSE extends SCBulkDoneResponse
|
||||
? SCBulkDoneRequest
|
||||
: RESPONSE extends SCFeedbackResponse
|
||||
? SCFeedbackRequest
|
||||
: RESPONSE extends SCRatingResponse
|
||||
? SCRatingRequest
|
||||
: RESPONSE extends SCIndexResponse
|
||||
? SCIndexRequest
|
||||
: RESPONSE extends SCMultiSearchResponse
|
||||
? SCMultiSearchRequest
|
||||
: RESPONSE extends SCSearchResponse
|
||||
? SCSearchRequest
|
||||
: RESPONSE extends SCThingUpdateResponse
|
||||
? SCThingUpdateRequest
|
||||
: never;
|
||||
? SCBulkRequest
|
||||
: RESPONSE extends SCBulkAddResponse
|
||||
? SCBulkAddRequest
|
||||
: RESPONSE extends SCBulkDoneResponse
|
||||
? SCBulkDoneRequest
|
||||
: RESPONSE extends SCFeedbackResponse
|
||||
? SCFeedbackRequest
|
||||
: RESPONSE extends SCRatingResponse
|
||||
? SCRatingRequest
|
||||
: RESPONSE extends SCIndexResponse
|
||||
? SCIndexRequest
|
||||
: RESPONSE extends SCMultiSearchResponse
|
||||
? SCMultiSearchRequest
|
||||
: RESPONSE extends SCSearchResponse
|
||||
? SCSearchRequest
|
||||
: RESPONSE extends SCThingUpdateResponse
|
||||
? SCThingUpdateRequest
|
||||
: never;
|
||||
|
||||
/**
|
||||
* Associated request for a route
|
||||
@@ -243,24 +243,24 @@ export type SCAssociatedRequest<RESPONSE> = RESPONSE extends SCBookAvailabilityR
|
||||
export type SCAssignedRequest<ROUTE extends SCAbstractRoute> = ROUTE extends SCBookAvailabilityRoute
|
||||
? SCBookAvailabilityRequest
|
||||
: ROUTE extends SCBulkRoute
|
||||
? SCBulkRequest
|
||||
: ROUTE extends SCBulkAddRoute
|
||||
? SCBulkAddRequest
|
||||
: ROUTE extends SCBulkDoneRoute
|
||||
? SCBulkDoneRequest
|
||||
: ROUTE extends SCFeedbackRoute
|
||||
? SCFeedbackRequest
|
||||
: ROUTE extends SCRatingRoute
|
||||
? SCRatingRequest
|
||||
: ROUTE extends SCIndexRoute
|
||||
? SCIndexRequest
|
||||
: ROUTE extends SCMultiSearchRoute
|
||||
? SCMultiSearchRequest
|
||||
: ROUTE extends SCSearchRoute
|
||||
? SCSearchRequest
|
||||
: ROUTE extends SCThingUpdateRoute
|
||||
? SCThingUpdateRequest
|
||||
: never;
|
||||
? SCBulkRequest
|
||||
: ROUTE extends SCBulkAddRoute
|
||||
? SCBulkAddRequest
|
||||
: ROUTE extends SCBulkDoneRoute
|
||||
? SCBulkDoneRequest
|
||||
: ROUTE extends SCFeedbackRoute
|
||||
? SCFeedbackRequest
|
||||
: ROUTE extends SCRatingRoute
|
||||
? SCRatingRequest
|
||||
: ROUTE extends SCIndexRoute
|
||||
? SCIndexRequest
|
||||
: ROUTE extends SCMultiSearchRoute
|
||||
? SCMultiSearchRequest
|
||||
: ROUTE extends SCSearchRoute
|
||||
? SCSearchRequest
|
||||
: ROUTE extends SCThingUpdateRoute
|
||||
? SCThingUpdateRequest
|
||||
: never;
|
||||
|
||||
/**
|
||||
* Associated response for a route
|
||||
@@ -268,21 +268,21 @@ export type SCAssignedRequest<ROUTE extends SCAbstractRoute> = ROUTE extends SCB
|
||||
export type SCAssignedResponse<ROUTE extends SCAbstractRoute> = ROUTE extends SCBookAvailabilityRoute
|
||||
? SCBookAvailabilityResponse
|
||||
: ROUTE extends SCBulkRoute
|
||||
? SCBulkResponse
|
||||
: ROUTE extends SCBulkAddRoute
|
||||
? SCBulkAddResponse
|
||||
: ROUTE extends SCBulkDoneRoute
|
||||
? SCBulkDoneResponse
|
||||
: ROUTE extends SCFeedbackRoute
|
||||
? SCFeedbackResponse
|
||||
: ROUTE extends SCRatingRoute
|
||||
? SCRatingResponse
|
||||
: ROUTE extends SCIndexRoute
|
||||
? SCIndexResponse
|
||||
: ROUTE extends SCMultiSearchRoute
|
||||
? SCMultiSearchResponse
|
||||
: ROUTE extends SCSearchRoute
|
||||
? SCSearchResponse
|
||||
: ROUTE extends SCThingUpdateRoute
|
||||
? SCThingUpdateResponse
|
||||
: never;
|
||||
? SCBulkResponse
|
||||
: ROUTE extends SCBulkAddRoute
|
||||
? SCBulkAddResponse
|
||||
: ROUTE extends SCBulkDoneRoute
|
||||
? SCBulkDoneResponse
|
||||
: ROUTE extends SCFeedbackRoute
|
||||
? SCFeedbackResponse
|
||||
: ROUTE extends SCRatingRoute
|
||||
? SCRatingResponse
|
||||
: ROUTE extends SCIndexRoute
|
||||
? SCIndexResponse
|
||||
: ROUTE extends SCMultiSearchRoute
|
||||
? SCMultiSearchResponse
|
||||
: ROUTE extends SCSearchRoute
|
||||
? SCSearchResponse
|
||||
: ROUTE extends SCThingUpdateRoute
|
||||
? SCThingUpdateResponse
|
||||
: never;
|
||||
|
||||
@@ -117,8 +117,8 @@ describe('Features', () => {
|
||||
.map(it => project.definitions[it] as LightweightDefinition)
|
||||
.some(it => it.name === 'SCThing' || hasSCThingReferences(it))
|
||||
: definition
|
||||
? typeHasSCThingReferences(definition.type)
|
||||
: false;
|
||||
? typeHasSCThingReferences(definition.type)
|
||||
: false;
|
||||
|
||||
for (const thing of things) {
|
||||
expect(hasSCThingReferences(thing)).to.be.false;
|
||||
|
||||
@@ -86,8 +86,8 @@ export function resolvePropertyName(name?: ts.PropertyName): string | undefined
|
||||
return name === undefined
|
||||
? undefined
|
||||
: ts.isComputedPropertyName(name)
|
||||
? 'UNSUPPORTED_IDENTIFIER_TYPE'
|
||||
: name.getText();
|
||||
? 'UNSUPPORTED_IDENTIFIER_TYPE'
|
||||
: name.getText();
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
||||
@@ -72,7 +72,10 @@ class LightweightDefinitionBuilder {
|
||||
|
||||
readonly typeChecker: ts.TypeChecker;
|
||||
|
||||
constructor(sourcePath: string | string[], readonly includeComments: boolean) {
|
||||
constructor(
|
||||
sourcePath: string | string[],
|
||||
readonly includeComments: boolean,
|
||||
) {
|
||||
const rootNames = Array.isArray(sourcePath)
|
||||
? sourcePath
|
||||
: expandPathToFilesSync(path.resolve(sourcePath), it => it.endsWith('.ts'));
|
||||
|
||||
@@ -23,8 +23,8 @@ export type RecursivePartial<T> = {
|
||||
[P in keyof T]?: T[P] extends Array<infer U>
|
||||
? Array<RecursivePartial<U>>
|
||||
: T[P] extends object
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
? RecursivePartial<T[P]>
|
||||
: T[P];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user