Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(): add shim file for browsers #1505

Merged
merged 2 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions lib/extra/swagger-shim.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/* eslint-disable @typescript-eslint/no-empty-function */
export function ApiProperty() {
return () => {};
}
export function ApiPropertyOptional() {
return () => {};
}
export function ApiResponseProperty() {
return () => {};
}
export function ApiBasicAuth() {
return () => {};
}
export function ApiBearerAuth() {
return () => {};
}
export function ApiBody() {
return () => {};
}
export function ApiConsumes() {
return () => {};
}
export function ApiCookieAuth() {
return () => {};
}
export function ApiExcludeEndpoint() {
return () => {};
}
export function ApiExcludeController() {
return () => {};
}
export function ApiExtraModels() {
return () => {};
}
export function ApiHeader() {
return () => {};
}
export function ApiHeaders() {
return () => {};
}
export function ApiHideProperty() {
return () => {};
}
export function ApiOAuth2() {
return () => {};
}
export function ApiOperation() {
return () => {};
}
export function ApiParam() {
return () => {};
}
export function ApiProduces() {
return () => {};
}
export function ApiQuery() {
return () => {};
}
export function ApiResponse() {
return () => {};
}
export function ApiOkResponse() {
return () => {};
}
export function ApiCreatedResponse() {
return () => {};
}
export function ApiAcceptedResponse() {
return () => {};
}
export function ApiNoContentResponse() {
return () => {};
}
export function ApiMovedPermanentlyResponse() {
return () => {};
}
export function ApiFoundResponse() {
return () => {};
}
export function ApiBadRequestResponse() {
return () => {};
}
export function ApiUnauthorizedResponse() {
return () => {};
}
export function ApiTooManyRequestsResponse() {
return () => {};
}
export function ApiNotFoundResponse() {
return () => {};
}
export function ApiInternalServerErrorResponse() {
return () => {};
}
export function ApiBadGatewayResponse() {
return () => {};
}
export function ApiConflictResponse() {
return () => {};
}
export function ApiForbiddenResponse() {
return () => {};
}
export function ApiGatewayTimeoutResponse() {
return () => {};
}
export function ApiGoneResponse() {
return () => {};
}
export function ApiMethodNotAllowedResponse() {
return () => {};
}
export function ApiNotAcceptableResponse() {
return () => {};
}
export function ApiNotImplementedResponse() {
return () => {};
}
export function ApiPreconditionFailedResponse() {
return () => {};
}
export function ApiPayloadTooLargeResponse() {
return () => {};
}
export function ApiRequestTimeoutResponse() {
return () => {};
}
export function ApiServiceUnavailableResponse() {
return () => {};
}
export function ApiUnprocessableEntityResponse() {
return () => {};
}
export function ApiUnsupportedMediaTypeResponse() {
return () => {};
}
export function ApiDefaultResponse() {
return () => {};
}
export function ApiSecurity() {
return () => {};
}
export function ApiTags() {
return () => {};
}
export function ApiExtension() {
return () => {};
}
export function DocumentBuilder() {
return () => {};
}
export function SwaggerModule() {
return () => {};
}
export function IntersectionType() {
return () => {};
}
export function OmitType() {
return () => {};
}
export function PartialType() {
return () => {};
}
export function PickType() {
return () => {};
}
19 changes: 19 additions & 0 deletions test/extra/shim.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Shim from '../../lib/extra/swagger-shim';
import * as Actual from '../../lib';

describe('Shim file', () => {
it('contains all types export by package', () => {
const exceptions = ['getSchemaPath', 'refs'];

const shimExportNames = Object.keys(Shim);
const packageExportNames = Object.keys(Actual);

const exportsMissingInShim = packageExportNames.filter(
(exportName) =>
shimExportNames.indexOf(exportName) === -1 &&
exceptions.indexOf(exportName) === -1
);

expect(exportsMissingInShim).toEqual([]);
});
});