@emeryld/rrroutes-openapi 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -1
- package/dist/public/assets/docs.js +84 -84
- package/dist/web/v2/components/endpoints/EndpointDetailPanel.d.ts +1 -5
- package/dist/web/v2/components/endpoints/EndpointPlayground.d.ts +4 -11
- package/dist/web/v2/components/endpoints/PlaygroundEditor.d.ts +20 -0
- package/dist/web/v2/components/endpoints/PlaygroundTabs.d.ts +11 -0
- package/dist/web/v2/components/inputs/JsonInputWithTools.d.ts +10 -0
- package/dist/web/v2/pages/EndpointPlaygroundPage.d.ts +1 -0
- package/dist/web/v2/stores/clientStore.d.ts +5 -0
- package/dist/web/v2/stores/playgroundStore.d.ts +51 -11
- package/dist/web/v2/utils/endpoints.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import type { PlaygroundInputs } from '../../stores/clientStore.js';
|
|
2
|
-
import type { EndpointType } from '../../types/types.endpoint.js';
|
|
3
1
|
import { type EndpointTabKey } from '../../utils/endpoints.js';
|
|
4
2
|
type EndpointDetailPanelProps = {
|
|
5
3
|
endpointId?: string | null;
|
|
6
|
-
onOpenStandalone?: (endpoint: EndpointType, inputs: PlaygroundInputs) => void;
|
|
7
|
-
hidePlaygroundTab?: boolean;
|
|
8
4
|
activeTab?: EndpointTabKey;
|
|
9
5
|
onTabChange?: (tab: EndpointTabKey) => void;
|
|
10
6
|
};
|
|
11
|
-
export default function EndpointDetailPanel({ endpointId,
|
|
7
|
+
export default function EndpointDetailPanel({ endpointId, activeTab, onTabChange, }: EndpointDetailPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
12
8
|
export {};
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { PlaygroundInputs } from '../../stores/clientStore.js';
|
|
2
|
-
import {
|
|
3
|
-
import type { MethodType } from '../../types/types.base.js';
|
|
2
|
+
import { PlaygroundRouteMeta } from '../../stores/playgroundStore.js';
|
|
4
3
|
type EndpointPlaygroundProps = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
contract?: {
|
|
8
|
-
body?: SerializableSchema;
|
|
9
|
-
query?: SerializableSchema;
|
|
10
|
-
params?: SerializableSchema;
|
|
11
|
-
};
|
|
12
|
-
summary?: string;
|
|
4
|
+
initialRoute?: PlaygroundRouteMeta;
|
|
5
|
+
initialLabel?: string;
|
|
13
6
|
onOpenStandalone?: (inputs: PlaygroundInputs) => void;
|
|
14
7
|
};
|
|
15
|
-
export default function EndpointPlayground({
|
|
8
|
+
export default function EndpointPlayground({ initialRoute, initialLabel, onOpenStandalone, }: EndpointPlaygroundProps): import("react/jsx-runtime").JSX.Element;
|
|
16
9
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PlaygroundInputs } from '../../stores/clientStore.js';
|
|
2
|
+
import { PlaygroundKeyValueRow, PlaygroundTab } from '../../stores/playgroundStore.js';
|
|
3
|
+
import { SerializableSchema } from '../../types/types.endpoint.js';
|
|
4
|
+
import { type EndpointOption } from '../../utils/endpoints.js';
|
|
5
|
+
type PlaygroundEditorProps = {
|
|
6
|
+
tab: PlaygroundTab;
|
|
7
|
+
onUpdateTab: (updater: (prev: PlaygroundTab) => PlaygroundTab) => void;
|
|
8
|
+
onOpenStandalone?: (inputs: PlaygroundInputs) => void;
|
|
9
|
+
endpointOptions: EndpointOption[];
|
|
10
|
+
isOptionsLoading: boolean;
|
|
11
|
+
onSearchChange: (term: string) => void;
|
|
12
|
+
onEndpointSelect: (selection: EndpointOption | string | null) => void;
|
|
13
|
+
};
|
|
14
|
+
export default function PlaygroundEditor({ tab, onUpdateTab, onOpenStandalone, endpointOptions, isOptionsLoading, onSearchChange, onEndpointSelect, }: PlaygroundEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function mergeRows(baseRows: PlaygroundKeyValueRow[], values?: Record<string, unknown>): PlaygroundKeyValueRow[];
|
|
16
|
+
export declare function buildKeyValueRows(schema?: SerializableSchema): PlaygroundKeyValueRow[];
|
|
17
|
+
export declare function rowsToRecord(rows: PlaygroundKeyValueRow[]): Record<string, string>;
|
|
18
|
+
export declare function formatBodyValue(value: unknown, hasSchema: boolean): string;
|
|
19
|
+
export declare function scaffoldBodyFromSchema(schema?: SerializableSchema): unknown;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PlaygroundTab } from '../../stores/playgroundStore.js';
|
|
2
|
+
type PlaygroundTabsProps = {
|
|
3
|
+
tabs: PlaygroundTab[];
|
|
4
|
+
activeTabId: string | null;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
onSelect: (tabId: string) => void;
|
|
7
|
+
onAdd: () => void;
|
|
8
|
+
onClose: (tabId: string) => void;
|
|
9
|
+
};
|
|
10
|
+
export default function PlaygroundTabs({ tabs, activeTabId, isLoading, onSelect, onAdd, onClose, }: PlaygroundTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type JsonInputWithToolsProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (next: string) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
minRows?: number;
|
|
6
|
+
error?: boolean;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
};
|
|
9
|
+
export default function JsonInputWithTools({ value, onChange, placeholder, minRows, error, helperText, }: JsonInputWithToolsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function EndpointPlaygroundPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import type { MethodType } from '../types/types.base';
|
|
3
|
+
import type { SerializableSchema } from '../types/types.endpoint';
|
|
4
|
+
export type PlaygroundKeyValueRow = {
|
|
5
|
+
key: string;
|
|
6
|
+
value: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
typeHint?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
3
11
|
export type PlaygroundRunRecord = {
|
|
4
12
|
id: string;
|
|
5
13
|
method: MethodType;
|
|
@@ -17,7 +25,44 @@ export type PlaygroundRunRecord = {
|
|
|
17
25
|
headers?: Record<string, string>;
|
|
18
26
|
};
|
|
19
27
|
};
|
|
20
|
-
type
|
|
28
|
+
export type PlaygroundRouteContract = {
|
|
29
|
+
body?: SerializableSchema;
|
|
30
|
+
query?: SerializableSchema;
|
|
31
|
+
params?: SerializableSchema;
|
|
32
|
+
};
|
|
33
|
+
export type PlaygroundRouteMeta = {
|
|
34
|
+
method: MethodType;
|
|
35
|
+
path: string;
|
|
36
|
+
summary?: string;
|
|
37
|
+
contract?: PlaygroundRouteContract;
|
|
38
|
+
};
|
|
39
|
+
export type PlaygroundTab = {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
url: string;
|
|
43
|
+
method: MethodType;
|
|
44
|
+
params: PlaygroundKeyValueRow[];
|
|
45
|
+
query: PlaygroundKeyValueRow[];
|
|
46
|
+
headers: PlaygroundKeyValueRow[];
|
|
47
|
+
body: string;
|
|
48
|
+
latestResponse: PlaygroundRunRecord | null;
|
|
49
|
+
route?: PlaygroundRouteMeta;
|
|
50
|
+
};
|
|
51
|
+
export type PlaygroundTabsState = {
|
|
52
|
+
tabs: PlaygroundTab[];
|
|
53
|
+
activeTabId: string | null;
|
|
54
|
+
};
|
|
55
|
+
export type PlaygroundPrefill = {
|
|
56
|
+
method?: MethodType;
|
|
57
|
+
path?: string;
|
|
58
|
+
params?: Record<string, unknown>;
|
|
59
|
+
query?: Record<string, unknown>;
|
|
60
|
+
body?: unknown;
|
|
61
|
+
headers?: Record<string, unknown>;
|
|
62
|
+
leafKey?: string;
|
|
63
|
+
tabName?: string;
|
|
64
|
+
};
|
|
65
|
+
type PlaygroundContextValue = {
|
|
21
66
|
runs: PlaygroundRunRecord[];
|
|
22
67
|
addRun: (run: PlaygroundRunRecord) => void;
|
|
23
68
|
getLastRun: (args: {
|
|
@@ -31,17 +76,12 @@ type PlaygroundRunsContextValue = {
|
|
|
31
76
|
path?: string;
|
|
32
77
|
leafKey?: string;
|
|
33
78
|
}) => PlaygroundPrefill | null;
|
|
79
|
+
prefillVersion: number;
|
|
80
|
+
tabsState: PlaygroundTabsState;
|
|
81
|
+
updateTabsState: (updater: PlaygroundTabsState | ((prev: PlaygroundTabsState) => PlaygroundTabsState)) => void;
|
|
34
82
|
};
|
|
35
|
-
export
|
|
36
|
-
method?: MethodType;
|
|
37
|
-
path?: string;
|
|
38
|
-
params?: Record<string, unknown>;
|
|
39
|
-
query?: Record<string, unknown>;
|
|
40
|
-
body?: unknown;
|
|
41
|
-
leafKey?: string;
|
|
42
|
-
};
|
|
43
|
-
export declare function PlaygroundRunsProvider({ children, }: {
|
|
83
|
+
export declare function PlaygroundProvider({ children }: {
|
|
44
84
|
children: ReactNode;
|
|
45
85
|
}): import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
export declare function
|
|
86
|
+
export declare function usePlayground(): PlaygroundContextValue;
|
|
47
87
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EndpointType } from '../types/types.endpoint.js';
|
|
2
2
|
import { type MethodType } from '../types/types.base.js';
|
|
3
|
-
export type EndpointTabKey = 'request' | 'response' | 'meta' | 'metrics'
|
|
3
|
+
export type EndpointTabKey = 'request' | 'response' | 'meta' | 'metrics';
|
|
4
4
|
export type EndpointPanelLayout = 'split' | 'details' | 'playground';
|
|
5
5
|
export declare const ENDPOINT_TAB_QUERY_KEY = "tab";
|
|
6
6
|
export declare const ENDPOINT_LAYOUT_QUERY_KEY = "layout";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emeryld/rrroutes-openapi",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@emeryld/rrroutes-client": "^2.5.
|
|
20
|
+
"@emeryld/rrroutes-client": "^2.5.2",
|
|
21
21
|
"@emeryld/rrroutes-contract": "^2.5.0",
|
|
22
22
|
"@emotion/cache": "^11.14.0",
|
|
23
23
|
"@emotion/react": "^11.14.0",
|