@emeryld/rrroutes-openapi 2.2.27 → 2.2.28

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.
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare function FiltersBar({ title, subtitle, actions, children, sticky, raw, }: {
3
+ title: string;
4
+ subtitle?: string;
5
+ actions?: ReactNode;
6
+ children: ReactNode;
7
+ sticky?: boolean;
8
+ raw?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export declare function FilterBlock({ label, hint, span, children, }: {
11
+ label: string;
12
+ hint?: string;
13
+ span?: number;
14
+ children: ReactNode;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export declare function SortControl<T extends string>({ value, direction, options, onChange, onToggleDirection, }: {
17
+ value: T;
18
+ direction: 'asc' | 'desc';
19
+ options: {
20
+ label: string;
21
+ value: T;
22
+ }[];
23
+ onChange?: (value: T) => void;
24
+ onToggleDirection: () => void;
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type HistoryFilters } from '../historyStore.js';
2
2
  type HistoryViewProps = {
3
3
  onFiltersChange?: (next: HistoryFilters) => void;
4
+ availableMethods: string[];
4
5
  };
5
- export declare function HistoryView({ onFiltersChange }: HistoryViewProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function HistoryView({ onFiltersChange, availableMethods }: HistoryViewProps): import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -0,0 +1 @@
1
+ export declare function LogsView(): import("react/jsx-runtime").JSX.Element;
@@ -16,7 +16,7 @@ export declare function createInputsFromPreset(leaf: SerializableLeaf, preset?:
16
16
  export declare function PlaygroundOverlay({ leaf, onClose, inputs, onInputsChange, onClearInputs, baseUrlSuffix, }: {
17
17
  leaf: SerializableLeaf | null;
18
18
  onClose: () => void;
19
- inputs?: PlaygroundInputs;
19
+ inputs: PlaygroundInputs;
20
20
  onInputsChange: (state: PlaygroundInputs) => void;
21
21
  onClearInputs: (next: PlaygroundInputs) => void;
22
22
  baseUrlSuffix?: string;
@@ -24,7 +24,7 @@ export declare function PlaygroundOverlay({ leaf, onClose, inputs, onInputsChang
24
24
  export declare function PlaygroundPanel(props: PlaygroundPanelProps): import("react/jsx-runtime").JSX.Element;
25
25
  type PlaygroundPanelProps = {
26
26
  leaf: SerializableLeaf;
27
- inputs?: PlaygroundInputs;
27
+ inputs: PlaygroundInputs;
28
28
  onInputsChange: (state: PlaygroundInputs) => void;
29
29
  onClearInputs: (next: PlaygroundInputs) => void;
30
30
  onClose?: () => void;
@@ -1,28 +1,21 @@
1
1
  import { type ReactNode } from 'react';
2
- export type HistoryEntry = {
3
- id: string;
4
- timestamp: number;
5
- method: string;
6
- path: string;
7
- fullUrl: string;
2
+ import type { HistoryFeedEntry, WebhookPaths } from '../webhooks.js';
3
+ export type HistoryEntry = HistoryFeedEntry & {
8
4
  params: Record<string, string>;
9
5
  query: Record<string, string>;
10
6
  body: string;
11
7
  output: string;
12
- status?: number;
13
- durationMs: number;
14
- error?: string;
15
8
  };
16
- export type HistoryInput = Omit<HistoryEntry, 'id' | 'timestamp'>;
17
9
  export type HistoryFilters = {
18
10
  methods: Set<string>;
19
11
  path: string;
20
- minDurationMs: number | null;
21
- maxDurationMs: number | null;
22
- includeErrors: boolean;
23
- includeSuccesses: boolean;
12
+ status: string;
13
+ text: string;
14
+ from?: string;
15
+ to?: string;
24
16
  sortBy: HistorySortKey;
25
17
  sortDir: HistorySortDirection;
18
+ pageSize: number;
26
19
  };
27
20
  export type HistorySeed = Partial<HistoryEntry> & {
28
21
  method: string;
@@ -31,18 +24,28 @@ export type HistorySeed = Partial<HistoryEntry> & {
31
24
  durationMs: number;
32
25
  timestamp?: number;
33
26
  };
27
+ type HistoryPageState = {
28
+ cursor: string | null;
29
+ nextCursor?: string | null;
30
+ prevCursor?: string | null;
31
+ total?: number;
32
+ };
34
33
  type HistoryContextValue = {
35
34
  entries: HistoryEntry[];
36
- addEntry: (entry: HistoryInput) => void;
37
- clearHistory: () => void;
35
+ loading: boolean;
36
+ error?: string;
38
37
  filters: HistoryFilters;
39
38
  setFilters: (next: HistoryFilters) => void;
40
39
  updateFilters: (partial: Partial<HistoryFilters>) => void;
41
40
  statsByRoute: Map<string, EndpointHistoryStats>;
41
+ page: HistoryPageState;
42
+ setCursor: (cursor: string | null) => void;
43
+ refresh: () => Promise<void>;
42
44
  };
43
- export declare function HistoryProvider({ children, initialEntries, }: {
45
+ export declare function HistoryProvider({ children, initialEntries, webhookPaths, }: {
44
46
  children: ReactNode;
45
47
  initialEntries?: HistorySeed[];
48
+ webhookPaths?: WebhookPaths;
46
49
  }): import("react/jsx-runtime").JSX.Element;
47
50
  export declare function useHistoryStore(): HistoryContextValue;
48
51
  export declare function filtersToSearchParams(filters: HistoryFilters): URLSearchParams;
@@ -0,0 +1,50 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { LogFeedEntry, LogType, WebhookPaths } from '../webhooks.js';
3
+ export type LogEntry = LogFeedEntry & {
4
+ tags: string[];
5
+ metadata?: Record<string, unknown>;
6
+ };
7
+ export type LogFilters = {
8
+ types: Set<LogType>;
9
+ tags: Set<string>;
10
+ requestId: string;
11
+ text: string;
12
+ from?: string;
13
+ to?: string;
14
+ sortBy: LogSortKey;
15
+ sortDir: LogSortDirection;
16
+ pageSize: number;
17
+ };
18
+ export type LogSortDirection = 'asc' | 'desc';
19
+ export type LogSortKey = 'timestamp';
20
+ type LogsPageState = {
21
+ cursor: string | null;
22
+ nextCursor?: string | null;
23
+ prevCursor?: string | null;
24
+ total?: number;
25
+ };
26
+ type LogsContextValue = {
27
+ entries: LogEntry[];
28
+ loading: boolean;
29
+ error?: string;
30
+ filters: LogFilters;
31
+ setFilters: (next: LogFilters) => void;
32
+ updateFilters: (partial: Partial<LogFilters>) => void;
33
+ page: LogsPageState;
34
+ setCursor: (cursor: string | null) => void;
35
+ refresh: () => Promise<void>;
36
+ };
37
+ export declare function LogsProvider({ children, webhookPaths, initialEntries, }: {
38
+ children: ReactNode;
39
+ webhookPaths?: WebhookPaths;
40
+ initialEntries?: LogSeed[];
41
+ }): import("react/jsx-runtime").JSX.Element;
42
+ export declare function useLogsStore(): LogsContextValue;
43
+ export declare function defaultLogFiltersState(): LogFilters;
44
+ export declare function mergeLogFilters(base: LogFilters, partial?: Partial<LogFilters>): LogFilters;
45
+ export type LogSeed = Partial<LogFeedEntry> & {
46
+ type: LogType;
47
+ message: string;
48
+ timestamp: number;
49
+ };
50
+ export {};
@@ -0,0 +1,181 @@
1
+ import { z } from 'zod';
2
+ export type WebhookPage<T> = {
3
+ items: T[];
4
+ nextCursor?: string;
5
+ prevCursor?: string;
6
+ total?: number;
7
+ };
8
+ export type WebhookPaths = {
9
+ history: string;
10
+ logs: string;
11
+ };
12
+ export type HistoryFeedEntry = {
13
+ id: string;
14
+ requestId?: string;
15
+ timestamp: number;
16
+ method: string;
17
+ path: string;
18
+ fullUrl?: string;
19
+ params?: Record<string, string>;
20
+ query?: Record<string, string>;
21
+ body?: string;
22
+ output?: string;
23
+ status?: number;
24
+ durationMs: number;
25
+ error?: string;
26
+ };
27
+ export type HistoryFeedQuery = {
28
+ cursor?: string;
29
+ limit?: number;
30
+ methods?: string[];
31
+ path?: string;
32
+ status?: string;
33
+ from?: number;
34
+ to?: number;
35
+ text?: string;
36
+ sortBy?: 'timestamp' | 'path' | 'duration';
37
+ sortDir?: 'asc' | 'desc';
38
+ };
39
+ export type LogType = 'debug' | 'info' | 'warn' | 'error' | 'system';
40
+ export type LogFeedEntry = {
41
+ id: string;
42
+ type: LogType;
43
+ message: string;
44
+ timestamp: number;
45
+ requestId?: string;
46
+ tags?: string[];
47
+ metadata?: Record<string, unknown>;
48
+ };
49
+ export type LogFeedQuery = {
50
+ cursor?: string;
51
+ limit?: number;
52
+ types?: LogType[];
53
+ tags?: string[];
54
+ requestId?: string;
55
+ text?: string;
56
+ from?: number;
57
+ to?: number;
58
+ sortDir?: 'asc' | 'desc';
59
+ };
60
+ export declare const logTypeSchema: z.ZodEnum<{
61
+ error: "error";
62
+ debug: "debug";
63
+ info: "info";
64
+ warn: "warn";
65
+ system: "system";
66
+ }>;
67
+ export declare const historyFeedEntrySchema: z.ZodObject<{
68
+ id: z.ZodString;
69
+ requestId: z.ZodOptional<z.ZodString>;
70
+ timestamp: z.ZodNumber;
71
+ method: z.ZodString;
72
+ path: z.ZodString;
73
+ fullUrl: z.ZodOptional<z.ZodString>;
74
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
75
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
76
+ body: z.ZodOptional<z.ZodString>;
77
+ output: z.ZodOptional<z.ZodString>;
78
+ status: z.ZodOptional<z.ZodNumber>;
79
+ durationMs: z.ZodNumber;
80
+ error: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>;
82
+ export declare const logFeedEntrySchema: z.ZodObject<{
83
+ id: z.ZodString;
84
+ type: z.ZodEnum<{
85
+ error: "error";
86
+ debug: "debug";
87
+ info: "info";
88
+ warn: "warn";
89
+ system: "system";
90
+ }>;
91
+ message: z.ZodString;
92
+ timestamp: z.ZodNumber;
93
+ requestId: z.ZodOptional<z.ZodString>;
94
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
96
+ }, z.core.$strip>;
97
+ export declare const historyFeedQuerySchema: z.ZodObject<{
98
+ cursor: z.ZodOptional<z.ZodString>;
99
+ limit: z.ZodOptional<z.ZodNumber>;
100
+ methods: z.ZodOptional<z.ZodArray<z.ZodString>>;
101
+ path: z.ZodOptional<z.ZodString>;
102
+ status: z.ZodOptional<z.ZodString>;
103
+ text: z.ZodOptional<z.ZodString>;
104
+ from: z.ZodOptional<z.ZodNumber>;
105
+ to: z.ZodOptional<z.ZodNumber>;
106
+ sortBy: z.ZodOptional<z.ZodEnum<{
107
+ path: "path";
108
+ timestamp: "timestamp";
109
+ duration: "duration";
110
+ }>>;
111
+ sortDir: z.ZodOptional<z.ZodEnum<{
112
+ asc: "asc";
113
+ desc: "desc";
114
+ }>>;
115
+ }, z.core.$strip>;
116
+ export declare const logFeedQuerySchema: z.ZodObject<{
117
+ cursor: z.ZodOptional<z.ZodString>;
118
+ limit: z.ZodOptional<z.ZodNumber>;
119
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
120
+ error: "error";
121
+ debug: "debug";
122
+ info: "info";
123
+ warn: "warn";
124
+ system: "system";
125
+ }>>>;
126
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
127
+ requestId: z.ZodOptional<z.ZodString>;
128
+ text: z.ZodOptional<z.ZodString>;
129
+ from: z.ZodOptional<z.ZodNumber>;
130
+ to: z.ZodOptional<z.ZodNumber>;
131
+ sortDir: z.ZodOptional<z.ZodEnum<{
132
+ asc: "asc";
133
+ desc: "desc";
134
+ }>>;
135
+ }, z.core.$strip>;
136
+ export declare const webhookPageSchema: <T extends z.ZodTypeAny>(itemSchema: T) => z.ZodObject<{
137
+ items: z.ZodDefault<z.ZodArray<T>>;
138
+ nextCursor: z.ZodOptional<z.ZodString>;
139
+ prevCursor: z.ZodOptional<z.ZodString>;
140
+ total: z.ZodOptional<z.ZodNumber>;
141
+ }, z.core.$strip>;
142
+ export declare const historyWebhookResponseSchema: z.ZodObject<{
143
+ items: z.ZodDefault<z.ZodArray<z.ZodObject<{
144
+ id: z.ZodString;
145
+ requestId: z.ZodOptional<z.ZodString>;
146
+ timestamp: z.ZodNumber;
147
+ method: z.ZodString;
148
+ path: z.ZodString;
149
+ fullUrl: z.ZodOptional<z.ZodString>;
150
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
151
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
152
+ body: z.ZodOptional<z.ZodString>;
153
+ output: z.ZodOptional<z.ZodString>;
154
+ status: z.ZodOptional<z.ZodNumber>;
155
+ durationMs: z.ZodNumber;
156
+ error: z.ZodOptional<z.ZodString>;
157
+ }, z.core.$strip>>>;
158
+ nextCursor: z.ZodOptional<z.ZodString>;
159
+ prevCursor: z.ZodOptional<z.ZodString>;
160
+ total: z.ZodOptional<z.ZodNumber>;
161
+ }, z.core.$strip>;
162
+ export declare const logWebhookResponseSchema: z.ZodObject<{
163
+ items: z.ZodDefault<z.ZodArray<z.ZodObject<{
164
+ id: z.ZodString;
165
+ type: z.ZodEnum<{
166
+ error: "error";
167
+ debug: "debug";
168
+ info: "info";
169
+ warn: "warn";
170
+ system: "system";
171
+ }>;
172
+ message: z.ZodString;
173
+ timestamp: z.ZodNumber;
174
+ requestId: z.ZodOptional<z.ZodString>;
175
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
176
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, z.core.$strip>>>;
178
+ nextCursor: z.ZodOptional<z.ZodString>;
179
+ prevCursor: z.ZodOptional<z.ZodString>;
180
+ total: z.ZodOptional<z.ZodNumber>;
181
+ }, z.core.$strip>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-openapi",
3
- "version": "2.2.27",
3
+ "version": "2.2.28",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",