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/typescript migration #862

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
aee317d
fix: setup typescript and webpack
sroucheray Dec 7, 2022
f4f585b
feat: color-utils.js to typescript
sroucheray Dec 7, 2022
218c429
feat: common-utils.js to typescript
sroucheray Dec 7, 2022
7c61e56
feat: *-styles.js to typescript
sroucheray Dec 7, 2022
a96fe06
common
sroucheray Dec 7, 2022
60bf221
feat: spec-parser.js renaming spec-parser.ts
sroucheray Dec 8, 2022
7aeeb12
feat: spec-parser.js add typings
sroucheray Dec 8, 2022
b1ec061
feat: spec-parser.js format file, rename internal variables
sroucheray Dec 8, 2022
3f337e8
rapidoc typings
sroucheray Dec 8, 2022
16e84a9
color-utils
sroucheray Dec 8, 2022
b8ed6e8
feat: theme.js to typescript
sroucheray Dec 8, 2022
ad332fa
feat: schema-utils.js to typescript
sroucheray Dec 9, 2022
b228c5b
feat: logo-template.js to typescript
sroucheray Dec 9, 2022
31f2c9d
feat: header-template.js to typescript
sroucheray Dec 9, 2022
ed68c6e
feat: overview-template.js to typescript
sroucheray Dec 9, 2022
96d7c83
feat: json-schema-viewer-template.js to typescript
sroucheray Dec 9, 2022
46e8bb6
feat: advanced-search-template.js to typescript
sroucheray Dec 9, 2022
45a2066
feat: callback-template.js to typescript
sroucheray Dec 10, 2022
4fb2088
feat: code-sample-template.js to typescript
sroucheray Dec 10, 2022
9cf82e2
feat: tag-input.js to typescript
sroucheray Dec 10, 2022
c7eedf6
fix: improve schema-utils.ts typings
sroucheray Dec 10, 2022
e957f77
feat: dialog-box.js to typescript
sroucheray Dec 10, 2022
fb44af4
feat: json-tree.js to typescript
sroucheray Dec 10, 2022
3605436
feat: schema-table.js to typescript
sroucheray Dec 10, 2022
1dfdf2f
feat: server-template.js to typescript
sroucheray Dec 12, 2022
42f3b8a
feat: security-scheme.js to typescript
sroucheray Dec 12, 2022
513c15c
feat: endpoint-template.js to typescript
sroucheray Dec 12, 2022
3a2b2a7
feat: component-template.js to typescript
sroucheray Dec 12, 2022
2049eb7
fix: update typings
sroucheray Dec 12, 2022
0b1339a
endpoint-template.ts
sroucheray Dec 12, 2022
9cf374f
feat: navbar-template.js to typescript
sroucheray Dec 12, 2022
78c4af3
feat: expanded-endpoint-template.js to typescript
sroucheray Dec 12, 2022
11b6780
feat: focused-endpoint-template.js to typescript
sroucheray Dec 12, 2022
3871667
feat: main-body-template.js to typescript
sroucheray Dec 12, 2022
4fdc757
tag input
sroucheray Dec 12, 2022
39ac15d
fix: improve typings
sroucheray Dec 12, 2022
398d8aa
header
sroucheray Dec 12, 2022
3caa922
common utils
sroucheray Dec 12, 2022
bcee3ef
color utils
sroucheray Dec 12, 2022
7a25986
fix: theme.ts
sroucheray Dec 12, 2022
9b67546
feat: json-schema-viewer.js to typescript
sroucheray Dec 12, 2022
8be1a92
fix: improve json-schema-viewer-template.ts
sroucheray Dec 12, 2022
0e2ece4
fix: improve overview-template.ts
sroucheray Dec 12, 2022
5cc4bbd
fix: improve spec-parser.ts
sroucheray Dec 12, 2022
3bda9cb
fix: typings for navbar-template.ts
sroucheray Dec 12, 2022
cf8a7e1
feat: schema-tree.js to typescript
sroucheray Dec 12, 2022
1d173ab
fix: improve main-body-template.ts
sroucheray Dec 12, 2022
0e44473
fix: improve security-scheme-template.ts
sroucheray Dec 12, 2022
3e4bd4d
fix: export interface from schema-utils.ts
sroucheray Dec 12, 2022
108416e
fix: improve rapidoc.d.ts
sroucheray Dec 13, 2022
573e07e
fix: improve common-utils.ts
sroucheray Dec 13, 2022
0808fee
feat: oauth-receiver.js to typescript
sroucheray Dec 13, 2022
f69511f
fix: advance-search-template.ts
sroucheray Dec 13, 2022
334f564
fix: security-scheme-template.ts
sroucheray Dec 13, 2022
08e066f
feat: rapidoc.js to typescript
sroucheray Dec 13, 2022
155f777
fix: migrate to ts remaining js files
sroucheray Dec 13, 2022
579eef1
fix: update config
sroucheray Dec 13, 2022
2a736bc
feat: build project
sroucheray Dec 13, 2022
f7c825d
fix: use customElement decorator and cleanup types
sroucheray Dec 13, 2022
5ac4fdf
Merge remote-tracking branch 'rapidoc/master' into feat/typescript-mi…
sroucheray Dec 13, 2022
66e1706
fix: typo
sroucheray Dec 29, 2022
dd725e4
fix: remove default selected mime type, let it to undefined
sroucheray Dec 29, 2022
da05c01
fix: properly set fetch responseStatus to error when it occurres
sroucheray Dec 29, 2022
ddb1523
fix: add missing html template tag
sroucheray Dec 30, 2022
8ca5450
fix: update curl syntax when clear or fill request parameters
sroucheray Dec 30, 2022
9f81c55
fix: make toolbar-btn border-radius using CSS property
sroucheray Dec 30, 2022
4fc3964
fix: add CSS class to security scheme html block
sroucheray Dec 30, 2022
5f6d543
Merge remote-tracking branch 'rapidoc/master' into feat/typescript-mi…
sroucheray Jan 16, 2023
7413a25
Add btn-copy, btn-tab and select as custom element parts
sroucheray Jan 16, 2023
c2cb259
Fix undefined error detected by Typescript
sroucheray Jan 16, 2023
f5cce00
fix anchor in markdown links when there is a base tag in HTML document
sroucheray Jan 16, 2023
8b45535
chore: update doc with select and btn-tab parts
sroucheray Jan 17, 2023
80aa594
fix: align vertically params to input field in parameter template
sroucheray Jan 17, 2023
7afc9dd
fix anchor link eventual missing title
sroucheray Jan 17, 2023
bea7e0f
fix pathOrHookObj parsing error
sroucheray Jan 30, 2023
fc6425c
Merge branch 'master' into feat/typescript-migration
sroucheray Jan 30, 2023
1c7657e
Merge remote-tracking branch 'rapidoc/master' into feat/typescript-mi…
sroucheray Mar 14, 2023
5e48af0
Merge branch 'master' into feat/typescript-migration
sroucheray Aug 25, 2023
a310c11
fix: schema.additionalProperties can be a "primitive" true value
sroucheray Aug 25, 2023
8cf6aca
generated build
sroucheray Aug 25, 2023
6799379
fix: endpoint body handles properly internal links
nubinub Mar 6, 2024
9f8afe0
Merge pull request #1 from PerfectMemory/fix/endpoint-body-links
sroucheray Mar 6, 2024
b6bdc69
Merge remote-tracking branch 'rapidoc/master' into feat/typescript-mi…
sroucheray Mar 7, 2024
94c62fd
generate build
sroucheray Mar 7, 2024
81c0cba
Revert "add fetched-try event to support developers the ability to mo…
nubinub Mar 15, 2024
f712b6a
generate build
nubinub Mar 15, 2024
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
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
docEl.addEventListener('before-try', (e) => {
e.detail.request.headers.append('AAA-BBB', 'CCC DDDD');
});
});</script><body><rapi-doc spec-url="./specs/temp.yaml" id="thedoc" theme="dark" render-style="view" schema-style="table" show-method-in-nav-bar="true" use-path-in-nav-bar="true" show-components="true" show-info="true" show-header="true" allow-search="false" allow-advanced-search="true" allow-spec-url-load="false" allow-spec-file-download="true" allow-server-selection="true" allow-authentication="true" update-route="false" match-type="regex" persist-auth="true"></rapi-doc></body></html>
});</script><body><rapi-doc spec-url="./specs/temp.yaml" id="thedoc" theme="dark" render-style="view" schema-style="table" show-method-in-nav-bar="true" use-path-in-nav-bar="true" show-components="true" show-info="true" show-header="true" allow-search="false" allow-advanced-search="true" allow-spec-url-load="false" allow-spec-file-download="true" allow-server-selection="true" allow-authentication="true" update-route="false" match-type="regex" persist-auth="true" scroll-behavior="smooth"></rapi-doc></body></html>
Binary file modified dist/index.html.gz
Binary file not shown.
1,438 changes: 716 additions & 722 deletions dist/rapidoc-min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/rapidoc-min.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/

/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
Expand Down
Binary file modified dist/rapidoc-min.js.LICENSE.txt.gz
Binary file not shown.
Binary file modified dist/rapidoc-min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/rapidoc-min.js.map

Large diffs are not rendered by default.

Binary file modified dist/rapidoc-min.js.map.gz
Binary file not shown.
35,597 changes: 17,873 additions & 17,724 deletions dist/rapidoc.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/report.html

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions dist/types/components/api-request.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { LitElement, TemplateResult } from 'lit';
import { NormalizedExample } from '../utils/schema-utils';
import './json-tree';
import './schema-tree';
import './tag-input';
import { OpenAPIV3 } from 'openapi-types';
import { HTTPMethods, RapiDocSchema, RapiDocSecurityScheme } from '@rapidoc-types';
export default class ApiRequest extends LitElement {
serverUrl?: string;
servers?: OpenAPIV3.ServerObject[];
method: HTTPMethods;
path?: string;
security?: [];
parameters?: (OpenAPIV3.ParameterObject & {
'x-fill-example'?: string;
})[];
request_body?: OpenAPIV3.RequestBodyObject;
api_keys?: RapiDocSecurityScheme[];
parser?: object;
accept?: string;
callback?: string;
webhook?: string;
responseMessage: string | TemplateResult<1>;
responseText: string;
responseHeaders: string;
responseStatus: 'success' | 'error';
responseUrl: string;
curlSyntax: string;
fillRequestFieldsWithExample?: string;
allowTry?: string;
showCurlBeforeTry?: string;
renderStyle: 'read' | 'view' | 'focused';
schemaStyle?: string;
activeSchemaTab?: string;
activeParameterSchemaTabs: any;
schemaExpandLevel?: number;
schemaDescriptionExpanded?: string;
allowSchemaDescriptionExpandToggle?: string;
schemaHideReadOnly?: string;
schemaHideWriteOnly?: string;
fetchCredentials?: 'include' | 'omit' | 'same-origin';
activeResponseTab?: 'response' | 'headers' | 'curl';
selectedRequestBodyType: string;
selectedRequestBodyExample: string;
responseIsBlob?: any;
responseBlobUrl?: string | undefined;
respContentDisposition: string;
responseBlobType?: 'download' | 'view' | 'image' | '';
static get styles(): import("lit").CSSResult[];
render(): TemplateResult<1>;
updated(): Promise<void>;
saveExampleState(): Promise<void>;
updateExamplesFromDataAttr(): Promise<void>;
renderExample(example: NormalizedExample, paramType: string, paramName: string): TemplateResult<1>;
renderShortFormatExamples(examples: NormalizedExample[], paramType: string, paramName: string): TemplateResult<1>;
renderLongFormatExamples(exampleList: NormalizedExample[], paramType: string, paramName: string): TemplateResult<1>;
exampleListTemplate(paramName: string, paramType: string, exampleList?: NormalizedExample[]): TemplateResult<1>;
inputParametersTemplate(paramType: 'path' | 'query' | 'header' | 'cookie'): "" | TemplateResult<1>;
beforeNavigationFocusedMode(): Promise<void>;
afterNavigationFocusedMode(): Promise<void>;
onSelectExample(e: Event): void;
onMimeTypeChange(e: Event): void;
requestBodyTemplate(): "" | TemplateResult<1>;
formDataParamAsObjectTemplate(fieldName: string, fieldSchema: RapiDocSchema, mimeType: string | string[]): TemplateResult<1>;
formDataTemplate(schema: RapiDocSchema, mimeType: string, exampleValue?: string): TemplateResult<1>;
curlSyntaxTemplate(display?: string): TemplateResult<1>;
apiResponseTabTemplate(): TemplateResult<1>;
apiCallTemplate(): TemplateResult<1>;
onFillRequestData(e: Event): Promise<void>;
onClearRequestData(e: Event): Promise<void>;
buildFetchURL(requestPanelEl: HTMLElement): string;
buildFetchHeaders(requestPanelEl: HTMLElement): Headers;
buildFetchBodyOptions(requestPanelEl: HTMLElement): RequestInit;
onTryClick(e: Event): Promise<void>;
liveCURLSyntaxUpdate(requestPanelEl: HTMLElement): void;
onGenerateCURLClick(e: Event): void;
getRequestPanel(e: Event): Element | null;
applyCURLSyntax(requestPanelEl: HTMLElement): void;
generateCURLSyntax(fetchUrl: string, fetchHeaders: Headers, fetchOptions: RequestInit, requestPanelEl: HTMLElement): string;
onAddRemoveFileInput(e: Event, pname: string, ptype: string): void;
clearResponseData(): void;
disconnectedCallback(): void;
}
//# sourceMappingURL=api-request.d.ts.map
Binary file added dist/types/components/api-request.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/components/api-request.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/components/api-request.d.ts.map.gz
Binary file not shown.
52 changes: 52 additions & 0 deletions dist/types/components/api-response.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { LitElement } from 'lit';
import { ObjectNotationSchema } from '../utils/schema-utils';
import './json-tree';
import './schema-tree';
import './schema-table';
import { OpenAPIV3 } from 'openapi-types';
import { RapiDocSchema } from '@rapidoc-types';
export default class ApiResponse extends LitElement {
callback?: string;
webhook?: string;
responses?: {
[key: string]: OpenAPIV3.ResponseObject;
};
parser?: object;
schemaStyle?: string;
renderStyle?: string;
selectedStatus: string;
selectedMimeType?: string;
activeSchemaTab: 'example' | 'schema';
schemaExpandLevel?: number;
schemaDescriptionExpanded?: string;
allowSchemaDescriptionExpandToggle?: string;
schemaHideReadOnly?: string;
schemaHideWriteOnly?: string;
private headersForEachRespStatus;
private mimeResponsesForEachStatus;
static get styles(): import("lit").CSSResult[];
render(): import("lit-html").TemplateResult<1>;
resetSelection(): void;
responseTemplate(): "" | import("lit-html").TemplateResult<1>;
responseHeaderListTemplate(respHeaders: {
name: string;
description: string;
schema: RapiDocSchema;
}[]): import("lit-html").TemplateResult<1>;
mimeTypeDropdownTemplate(mimeTypes: string[]): import("lit-html").TemplateResult<1>;
onSelectExample(e: Event): void;
mimeExampleTemplate(mimeRespDetails: {
selectedExample: string;
examples: {
exampleId: string;
exampleFormat: 'json';
exampleSummary: string;
exampleDescription: string;
exampleValue: string;
}[];
}): import("lit-html").TemplateResult<1>;
mimeSchemaTemplate(mimeRespDetails: {
schemaTree: ObjectNotationSchema;
}): import("lit-html").TemplateResult<1>;
}
//# sourceMappingURL=api-response.d.ts.map
Binary file added dist/types/components/api-response.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/components/api-response.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/components/api-response.d.ts.map.gz
Binary file not shown.
11 changes: 11 additions & 0 deletions dist/types/components/dialog-box.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { LitElement } from 'lit';
export default class DialogBox extends LitElement {
heading?: string | null;
show?: string | null;
static get styles(): import("lit").CSSResult[];
connectedCallback(): void;
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
render(): import("lit-html").TemplateResult<1>;
onClose(): void;
}
//# sourceMappingURL=dialog-box.d.ts.map
Binary file added dist/types/components/dialog-box.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/components/dialog-box.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/components/dialog-box.d.ts.map.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions dist/types/components/json-tree.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { LitElement, TemplateResult } from 'lit';
export default class JsonTree extends LitElement {
data?: any;
renderStyle?: string;
static get styles(): import("lit").CSSResult[];
render(): TemplateResult<1>;
generateTree(data: any, isLast?: boolean): TemplateResult<1>;
toggleExpand(e: MouseEvent): void;
}
//# sourceMappingURL=json-tree.d.ts.map
Binary file added dist/types/components/json-tree.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/components/json-tree.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/components/json-tree.d.ts.map.gz
Binary file not shown.
16 changes: 16 additions & 0 deletions dist/types/components/schema-table.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { LitElement, TemplateResult } from 'lit';
export default class SchemaTable extends LitElement {
schemaExpandLevel: number;
schemaDescriptionExpanded?: string;
allowSchemaDescriptionExpandToggle?: string;
schemaHideReadOnly?: string;
schemaHideWriteOnly?: string;
data?: any;
connectedCallback(): void;
static get styles(): import("lit").CSSResult[];
render(): TemplateResult<1>;
generateTree(data: any, dataType?: string, arrayType?: string, key?: string, description?: string, schemaLevel?: number, indentLevel?: number, readOrWrite?: string): any;
handleAllEvents(e: MouseEvent): void;
toggleObjectExpand(e: MouseEvent): void;
}
//# sourceMappingURL=schema-table.d.ts.map
Binary file added dist/types/components/schema-table.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/components/schema-table.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/components/schema-table.d.ts.map.gz
Binary file not shown.
17 changes: 17 additions & 0 deletions dist/types/components/schema-tree.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { LitElement, TemplateResult } from 'lit';
import { ObjectNotationSchema } from '../utils/schema-utils';
export default class SchemaTree extends LitElement {
data?: ObjectNotationSchema;
schemaExpandLevel: number;
schemaDescriptionExpanded?: string;
allowSchemaDescriptionExpandToggle?: string;
schemaHideReadOnly?: string;
schemaHideWriteOnly?: string;
connectedCallback(): void;
static get styles(): import("lit").CSSResult[];
render(): TemplateResult<1>;
generateTree(data: ObjectNotationSchema, dataType?: string, arrayType?: string, key?: string, description?: string, schemaLevel?: number, indentLevel?: number, readOrWrite?: string): TemplateResult<any> | undefined;
handleAllEvents(e: MouseEvent): void;
toggleObjectExpand(e: MouseEvent): void;
}
//# sourceMappingURL=schema-tree.d.ts.map
Binary file added dist/types/components/schema-tree.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/components/schema-tree.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/components/schema-tree.d.ts.map.gz
Binary file not shown.
12 changes: 12 additions & 0 deletions dist/types/components/tag-input.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { LitElement, TemplateResult } from 'lit';
export default class TagInput extends LitElement {
placeholder?: string;
value?: string[];
render(): TemplateResult<1>;
attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void;
afterPaste(e: ClipboardEvent): void;
afterKeyDown(e: KeyboardEvent): void;
onBlur(e: Event): void;
static get styles(): import("lit").CSSResult[];
}
//# sourceMappingURL=tag-input.d.ts.map
Binary file added dist/types/components/tag-input.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/components/tag-input.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/components/tag-input.d.ts.map.gz
Binary file not shown.
9 changes: 9 additions & 0 deletions dist/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import RapiDoc from './rapidoc';
import OAuthReceiver from './oauth-receiver';
import JsonSchemaViewer from './json-schema-viewer';
declare const _default: {
RapiDoc: typeof RapiDoc;
};
export default _default;
export { /* RapiDocMini, */ OAuthReceiver, JsonSchemaViewer };
//# sourceMappingURL=index.d.ts.map
Binary file added dist/types/index.d.ts.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dist/types/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/types/index.d.ts.map.gz
Binary file not shown.
Loading