app-devtools 0.1.0
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/.eslintignore +3 -0
- package/.eslintrc.cjs +112 -0
- package/.gitattributes +22 -0
- package/.prettierrc +10 -0
- package/.quokka.ts +115 -0
- package/.vscode/settings.json +7 -0
- package/.vscode/snippets.code-snippets +75 -0
- package/.vscode/tasks.json +17 -0
- package/index.html +46 -0
- package/package.json +66 -0
- package/pnpm-lock.yaml +5313 -0
- package/scripts/check-if-is-sync.sh +6 -0
- package/scripts/filterFetchRequests.ts +60 -0
- package/src/Root.tsx +11 -0
- package/src/assets/icons/caret-down.svg +11 -0
- package/src/assets/icons/network.svg +6 -0
- package/src/assets/icons/search.svg +3 -0
- package/src/assets/icons/send.svg +3 -0
- package/src/assets/icons/settings.svg +3 -0
- package/src/components/ButtonElement.tsx +18 -0
- package/src/components/Icon.tsx +44 -0
- package/src/components/Section.tsx +57 -0
- package/src/components/Select.tsx +101 -0
- package/src/components/ValueVisualizer.tsx +397 -0
- package/src/config/icons.tsx +23 -0
- package/src/initializeApp.tsx +28 -0
- package/src/initializeDevTools.ts +33 -0
- package/src/main.ts +42 -0
- package/src/mocks/mockedRequests.json +28391 -0
- package/src/pages/api-explorer/ApiExplorerMenu.tsx +136 -0
- package/src/pages/api-explorer/ApiExplorerMenuItem.tsx +208 -0
- package/src/pages/api-explorer/Diff.tsx +223 -0
- package/src/pages/api-explorer/RequestDetails.tsx +264 -0
- package/src/pages/api-explorer/Timeline.tsx +174 -0
- package/src/pages/api-explorer/api-explorer.tsx +21 -0
- package/src/pages/api-explorer/getRequestPayload.tsx +15 -0
- package/src/pages/app/App.tsx +79 -0
- package/src/stores/callsStore.ts +267 -0
- package/src/stores/uiStore.ts +15 -0
- package/src/style/globalStyle.ts +54 -0
- package/src/style/helpers/allowTextSelection.ts +7 -0
- package/src/style/helpers/anchorColor.ts +9 -0
- package/src/style/helpers/centerContent.ts +5 -0
- package/src/style/helpers/circle.ts +7 -0
- package/src/style/helpers/ellipsis.ts +8 -0
- package/src/style/helpers/fillContainer.ts +7 -0
- package/src/style/helpers/gradientBorder.ts +28 -0
- package/src/style/helpers/gradientText.ts +8 -0
- package/src/style/helpers/inline.ts +34 -0
- package/src/style/helpers/mountAnim.ts +26 -0
- package/src/style/helpers/multilineEllipsis.ts +8 -0
- package/src/style/helpers/outline.ts +5 -0
- package/src/style/helpers/responsiveSize.ts +27 -0
- package/src/style/helpers/stack.ts +36 -0
- package/src/style/helpers/transition.ts +63 -0
- package/src/style/mediaQueries.ts +6 -0
- package/src/style/reset.ts +75 -0
- package/src/style/scrollBar.ts +37 -0
- package/src/style/theme.ts +35 -0
- package/src/types/global.d.ts +8 -0
- package/src/utils/initializeScreenLogger.ts +12 -0
- package/tsconfig.json +36 -0
- package/tsconfig.prod.json +10 -0
- package/tsup.config.ts +7 -0
- package/utils/arrayUtils.ts +29 -0
- package/utils/assertions.ts +7 -0
- package/utils/autoIncrementId.ts +5 -0
- package/utils/createThemev2.ts +64 -0
- package/utils/cx.ts +27 -0
- package/utils/getDiff.ts +15 -0
- package/utils/hexToRgb.ts +14 -0
- package/utils/objectUtils.ts +3 -0
- package/utils/parseUnit.ts +10 -0
- package/utils/solid.ts +76 -0
- package/utils/truncateText.ts +7 -0
- package/utils/tryExpression.ts +14 -0
- package/utils/typed.ts +23 -0
- package/utils/typings.ts +40 -0
- package/utils/urlPattern.ts +25 -0
- package/vite.config.ts +46 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import ButtonElement from '@src/components/ButtonElement'
|
|
2
|
+
import Icon from '@src/components/Icon'
|
|
3
|
+
import { allowTextSelection } from '@src/style/helpers/allowTextSelection'
|
|
4
|
+
import { ellipsis } from '@src/style/helpers/ellipsis'
|
|
5
|
+
import { inline } from '@src/style/helpers/inline'
|
|
6
|
+
import { multilineEllipsis } from '@src/style/helpers/multilineEllipsis'
|
|
7
|
+
import { stack } from '@src/style/helpers/stack'
|
|
8
|
+
import { colors, fonts } from '@src/style/theme'
|
|
9
|
+
import { JSXElement } from 'solid-js'
|
|
10
|
+
import { css } from 'solid-styled-components'
|
|
11
|
+
|
|
12
|
+
const containerStyle = css`
|
|
13
|
+
&&& {
|
|
14
|
+
font-family: ${fonts.decorative};
|
|
15
|
+
font-size: 13px;
|
|
16
|
+
${allowTextSelection};
|
|
17
|
+
${stack({ gap: 2 })};
|
|
18
|
+
padding-left: 8px;
|
|
19
|
+
|
|
20
|
+
.expand-button {
|
|
21
|
+
margin-left: -16px;
|
|
22
|
+
width: 16px;
|
|
23
|
+
display: inline-block;
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
color: ${colors.white.alpha(0.5)};
|
|
26
|
+
|
|
27
|
+
&:not(.expanded) .icon {
|
|
28
|
+
transform: rotate(-90deg);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.show-all {
|
|
33
|
+
color: ${colors.white.alpha(0.5)};
|
|
34
|
+
text-align: left;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.childs {
|
|
38
|
+
${stack({ gap: 2 })};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.delimiter {
|
|
42
|
+
color: ${colors.white.alpha(0.5)};
|
|
43
|
+
margin-top: 1px;
|
|
44
|
+
margin-bottom: 1px;
|
|
45
|
+
|
|
46
|
+
&.end {
|
|
47
|
+
&::after {
|
|
48
|
+
content: ',';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.childs {
|
|
54
|
+
padding-left: 20px;
|
|
55
|
+
grid-column: 1 / span 3;
|
|
56
|
+
border-left: 1px solid ${colors.white.alpha(0.05)};
|
|
57
|
+
|
|
58
|
+
> .value {
|
|
59
|
+
&::after {
|
|
60
|
+
content: ',';
|
|
61
|
+
opacity: 0.5;
|
|
62
|
+
color: ${colors.white.var};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.child {
|
|
68
|
+
display: grid;
|
|
69
|
+
grid-template-columns: auto auto 1fr;
|
|
70
|
+
|
|
71
|
+
.key {
|
|
72
|
+
color: #a5d6ff;
|
|
73
|
+
margin-right: 5px;
|
|
74
|
+
${inline({ align: 'top' })};
|
|
75
|
+
|
|
76
|
+
span {
|
|
77
|
+
flex-shrink: 1;
|
|
78
|
+
${ellipsis};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.index {
|
|
82
|
+
color: ${colors.success.alpha(0.7)};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&::after {
|
|
86
|
+
content: ':';
|
|
87
|
+
color: ${colors.secondary.alpha(0.5)};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.string-quotes {
|
|
93
|
+
opacity: 0.7;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.value {
|
|
97
|
+
word-wrap: break-word;
|
|
98
|
+
${multilineEllipsis(5)};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-type='number'] {
|
|
102
|
+
color: ${colors.primary.var};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-type='boolean'] {
|
|
106
|
+
color: ${colors.warning.var};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-type='object'],
|
|
110
|
+
[data-type='undefined'] {
|
|
111
|
+
color: ${colors.white.alpha(0.6)};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.collapsed {
|
|
115
|
+
color: ${colors.white.alpha(0.5)};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`
|
|
119
|
+
|
|
120
|
+
const numberFormatter = new Intl.NumberFormat('en-US')
|
|
121
|
+
|
|
122
|
+
const compactMaxChilds = 14
|
|
123
|
+
|
|
124
|
+
type ValueVisualizerProps = {
|
|
125
|
+
value: unknown
|
|
126
|
+
compact?: boolean
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const ValueItem = (props: {
|
|
130
|
+
value: unknown
|
|
131
|
+
indent: number
|
|
132
|
+
key?: string
|
|
133
|
+
index?: number
|
|
134
|
+
compact: boolean
|
|
135
|
+
}) => {
|
|
136
|
+
let expanded = $signal(props.indent > 0 && props.compact ? false : true)
|
|
137
|
+
let showAllChilds = $signal(!props.compact)
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
{(() => {
|
|
142
|
+
const value = props.value
|
|
143
|
+
const valueIsArray = Array.isArray(value)
|
|
144
|
+
const valueIsObject =
|
|
145
|
+
!valueIsArray && typeof value === 'object' && value !== null
|
|
146
|
+
|
|
147
|
+
const hasKey = props.key !== undefined || props.index !== undefined
|
|
148
|
+
|
|
149
|
+
const showExpandButton =
|
|
150
|
+
(valueIsArray && value.length > 0) ||
|
|
151
|
+
(valueIsObject && Object.keys(value).length > 0)
|
|
152
|
+
|
|
153
|
+
const toggleExpanded = showExpandButton && (
|
|
154
|
+
<ButtonElement
|
|
155
|
+
onClick={() => {
|
|
156
|
+
expanded = !expanded
|
|
157
|
+
}}
|
|
158
|
+
classList={{
|
|
159
|
+
expanded,
|
|
160
|
+
}}
|
|
161
|
+
class="expand-button"
|
|
162
|
+
>
|
|
163
|
+
<Icon
|
|
164
|
+
name="caret-down"
|
|
165
|
+
size={14}
|
|
166
|
+
/>
|
|
167
|
+
</ButtonElement>
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<>
|
|
172
|
+
{hasKey && (
|
|
173
|
+
<div
|
|
174
|
+
class="key"
|
|
175
|
+
title={`${
|
|
176
|
+
props.key ? `${props.key}\n` : ''
|
|
177
|
+
}Shift + Click to copy value`}
|
|
178
|
+
classList={{
|
|
179
|
+
index: props.index !== undefined,
|
|
180
|
+
}}
|
|
181
|
+
onClick={(e) => {
|
|
182
|
+
if (e.shiftKey) {
|
|
183
|
+
copyToClipboard(JSON.stringify(value))
|
|
184
|
+
}
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
{valueIsArray || valueIsObject ? toggleExpanded : null}
|
|
188
|
+
<span>{props.key || props.index}</span>
|
|
189
|
+
</div>
|
|
190
|
+
)}
|
|
191
|
+
|
|
192
|
+
{hasKey && showExpandButton && !expanded ? (
|
|
193
|
+
<div class="collapsed">
|
|
194
|
+
{valueIsArray
|
|
195
|
+
? `[…] ${value.length} items`
|
|
196
|
+
: `{…} ${Object.keys(value).length} properties`}
|
|
197
|
+
</div>
|
|
198
|
+
) : (
|
|
199
|
+
((): JSXElement => {
|
|
200
|
+
if (valueIsArray && value.length === 0) {
|
|
201
|
+
return <div class="delimiter">[]</div>
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (valueIsObject && Object.keys(value).length === 0) {
|
|
205
|
+
return <div class="delimiter">{`{}`}</div>
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (valueIsArray) {
|
|
209
|
+
return (
|
|
210
|
+
<>
|
|
211
|
+
<div
|
|
212
|
+
class="delimiter"
|
|
213
|
+
title={
|
|
214
|
+
!hasKey ? 'Shift + Click to copy value' : undefined
|
|
215
|
+
}
|
|
216
|
+
onClick={
|
|
217
|
+
!hasKey
|
|
218
|
+
? (e) => {
|
|
219
|
+
if (e.shiftKey) {
|
|
220
|
+
copyToClipboard(JSON.stringify(value))
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
: undefined
|
|
224
|
+
}
|
|
225
|
+
>
|
|
226
|
+
{!hasKey && toggleExpanded}
|
|
227
|
+
|
|
228
|
+
{expanded ? '[' : `[…] ${value.length} items`}
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
{expanded && (
|
|
232
|
+
<>
|
|
233
|
+
<div class="childs">
|
|
234
|
+
{(() => {
|
|
235
|
+
let items = value
|
|
236
|
+
const totalSize = items.length
|
|
237
|
+
|
|
238
|
+
if (!showAllChilds) {
|
|
239
|
+
items = items.slice(0, compactMaxChilds)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return (
|
|
243
|
+
<>
|
|
244
|
+
{items.map((item, index) => (
|
|
245
|
+
<div class="child">
|
|
246
|
+
<ValueItem
|
|
247
|
+
value={item}
|
|
248
|
+
indent={props.indent + 1}
|
|
249
|
+
index={index}
|
|
250
|
+
compact={props.compact}
|
|
251
|
+
/>
|
|
252
|
+
</div>
|
|
253
|
+
))}
|
|
254
|
+
|
|
255
|
+
{!showAllChilds &&
|
|
256
|
+
totalSize > compactMaxChilds && (
|
|
257
|
+
<ButtonElement
|
|
258
|
+
onClick={() => {
|
|
259
|
+
showAllChilds = true
|
|
260
|
+
}}
|
|
261
|
+
class="show-all"
|
|
262
|
+
>
|
|
263
|
+
…show all (+
|
|
264
|
+
{totalSize - compactMaxChilds})
|
|
265
|
+
</ButtonElement>
|
|
266
|
+
)}
|
|
267
|
+
</>
|
|
268
|
+
)
|
|
269
|
+
})()}
|
|
270
|
+
</div>
|
|
271
|
+
<div class="delimiter end">]</div>
|
|
272
|
+
</>
|
|
273
|
+
)}
|
|
274
|
+
</>
|
|
275
|
+
)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (valueIsObject) {
|
|
279
|
+
return (
|
|
280
|
+
<>
|
|
281
|
+
<div
|
|
282
|
+
class="delimiter"
|
|
283
|
+
title={
|
|
284
|
+
!hasKey ? 'Shift + Click to copy value' : undefined
|
|
285
|
+
}
|
|
286
|
+
onClick={
|
|
287
|
+
!hasKey
|
|
288
|
+
? (e) => {
|
|
289
|
+
if (e.shiftKey) {
|
|
290
|
+
copyToClipboard(JSON.stringify(value))
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
: undefined
|
|
294
|
+
}
|
|
295
|
+
>
|
|
296
|
+
{!hasKey && toggleExpanded}
|
|
297
|
+
|
|
298
|
+
{expanded
|
|
299
|
+
? '{'
|
|
300
|
+
: `{…} ${Object.keys(value).length} properties`}
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
{expanded && (
|
|
304
|
+
<>
|
|
305
|
+
<div class="childs">
|
|
306
|
+
{(() => {
|
|
307
|
+
let entries = Object.entries(value)
|
|
308
|
+
const totalSize = entries.length
|
|
309
|
+
|
|
310
|
+
if (!showAllChilds) {
|
|
311
|
+
entries = entries.slice(0, compactMaxChilds)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return (
|
|
315
|
+
<>
|
|
316
|
+
{entries.map(([key, objValue]) => (
|
|
317
|
+
<div class="child">
|
|
318
|
+
<ValueItem
|
|
319
|
+
value={objValue}
|
|
320
|
+
key={key}
|
|
321
|
+
indent={props.indent + 1}
|
|
322
|
+
compact={props.compact}
|
|
323
|
+
/>
|
|
324
|
+
</div>
|
|
325
|
+
))}
|
|
326
|
+
|
|
327
|
+
{!showAllChilds &&
|
|
328
|
+
totalSize > compactMaxChilds && (
|
|
329
|
+
<ButtonElement
|
|
330
|
+
onClick={() => {
|
|
331
|
+
showAllChilds = true
|
|
332
|
+
}}
|
|
333
|
+
class="show-all"
|
|
334
|
+
>
|
|
335
|
+
…show all (+
|
|
336
|
+
{totalSize - compactMaxChilds})
|
|
337
|
+
</ButtonElement>
|
|
338
|
+
)}
|
|
339
|
+
</>
|
|
340
|
+
)
|
|
341
|
+
})()}
|
|
342
|
+
</div>
|
|
343
|
+
<div class="delimiter end">{'}'}</div>
|
|
344
|
+
</>
|
|
345
|
+
)}
|
|
346
|
+
</>
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return (
|
|
351
|
+
<div
|
|
352
|
+
class="value"
|
|
353
|
+
data-type={typeof value}
|
|
354
|
+
title="Shift + Click to copy value"
|
|
355
|
+
onClick={(e) => {
|
|
356
|
+
if (e.shiftKey) {
|
|
357
|
+
copyToClipboard(String(value))
|
|
358
|
+
}
|
|
359
|
+
}}
|
|
360
|
+
>
|
|
361
|
+
{typeof value === 'string' && (
|
|
362
|
+
<span class="string-quotes">"</span>
|
|
363
|
+
)}
|
|
364
|
+
{typeof value === 'number'
|
|
365
|
+
? numberFormatter.format(value)
|
|
366
|
+
: String(value)}
|
|
367
|
+
{typeof value === 'string' && (
|
|
368
|
+
<span class="string-quotes">"</span>
|
|
369
|
+
)}
|
|
370
|
+
</div>
|
|
371
|
+
)
|
|
372
|
+
})()
|
|
373
|
+
)}
|
|
374
|
+
</>
|
|
375
|
+
)
|
|
376
|
+
})()}
|
|
377
|
+
</>
|
|
378
|
+
)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export const ValueVisualizer = (props: ValueVisualizerProps) => {
|
|
382
|
+
return (
|
|
383
|
+
<div class={containerStyle}>
|
|
384
|
+
<ValueItem
|
|
385
|
+
value={props.value}
|
|
386
|
+
indent={0}
|
|
387
|
+
compact={!!props.compact}
|
|
388
|
+
/>
|
|
389
|
+
</div>
|
|
390
|
+
)
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
async function copyToClipboard(text: string) {
|
|
394
|
+
await navigator.clipboard.writeText(text)
|
|
395
|
+
|
|
396
|
+
alert('Copied to clipboard')
|
|
397
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type Icons =
|
|
2
|
+
| 'network'
|
|
3
|
+
| 'search'
|
|
4
|
+
| 'settings'
|
|
5
|
+
| 'send'
|
|
6
|
+
| 'caret-down'
|
|
7
|
+
|
|
8
|
+
const test = import.meta.glob('/src/assets/icons/*.svg', {
|
|
9
|
+
eager: true,
|
|
10
|
+
as: 'raw',
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export function getIconSvg(icon: Icons): string {
|
|
14
|
+
const svg = test[`/src/assets/icons/${icon}.svg`]
|
|
15
|
+
|
|
16
|
+
if (import.meta.env.DEV) {
|
|
17
|
+
if (!svg) {
|
|
18
|
+
throw new Error(`Icon ${icon} not found`)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return svg as unknown as string
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import '@src/utils/initializeScreenLogger'
|
|
2
|
+
import dayjs from 'dayjs'
|
|
3
|
+
import relativeTime from 'dayjs/plugin/relativeTime'
|
|
4
|
+
import { render } from 'solid-js/web'
|
|
5
|
+
import Root from '@src/Root'
|
|
6
|
+
|
|
7
|
+
let unmount: () => void = () => {}
|
|
8
|
+
|
|
9
|
+
export function initializeApp() {
|
|
10
|
+
dayjs.extend(relativeTime)
|
|
11
|
+
|
|
12
|
+
if (navigator.platform.indexOf('Win') > -1) {
|
|
13
|
+
document.body.classList.add('windows')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const devToolsRoot =
|
|
17
|
+
document.getElementById('dev-tools-root') || document.createElement('div')
|
|
18
|
+
|
|
19
|
+
devToolsRoot.id = 'dev-tools-root'
|
|
20
|
+
|
|
21
|
+
document.body.appendChild(devToolsRoot)
|
|
22
|
+
|
|
23
|
+
unmount = render(() => <Root />, devToolsRoot)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function unmountApp() {
|
|
27
|
+
unmount()
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { initializeApp } from '@src/initializeApp'
|
|
2
|
+
import { Config, setConfig } from '@src/stores/callsStore'
|
|
3
|
+
|
|
4
|
+
import tinykeys from 'tinykeys'
|
|
5
|
+
|
|
6
|
+
export function initializeDevTools({
|
|
7
|
+
callsProcessor,
|
|
8
|
+
shortcut = '$mod+D',
|
|
9
|
+
}: {
|
|
10
|
+
callsProcessor: Config['callsProcessor']
|
|
11
|
+
shortcut?: string
|
|
12
|
+
}) {
|
|
13
|
+
tinykeys(window, {
|
|
14
|
+
[shortcut]: (e) => {
|
|
15
|
+
e.preventDefault()
|
|
16
|
+
|
|
17
|
+
const active = document.activeElement
|
|
18
|
+
const enteringText =
|
|
19
|
+
active instanceof HTMLElement &&
|
|
20
|
+
(active.isContentEditable ||
|
|
21
|
+
active.tagName === 'INPUT' ||
|
|
22
|
+
active.tagName === 'TEXTAREA')
|
|
23
|
+
|
|
24
|
+
if (enteringText) return
|
|
25
|
+
|
|
26
|
+
initializeApp()
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
setConfig({
|
|
31
|
+
callsProcessor,
|
|
32
|
+
})
|
|
33
|
+
}
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { initializeApp } from '@src/initializeApp'
|
|
2
|
+
import { initializeDevTools } from '@src/initializeDevTools'
|
|
3
|
+
import { addCall } from '@src/stores/callsStore'
|
|
4
|
+
|
|
5
|
+
export { initializeDevTools, addCall }
|
|
6
|
+
|
|
7
|
+
if (import.meta.env.DEV) {
|
|
8
|
+
initializeApp()
|
|
9
|
+
|
|
10
|
+
initializeDevTools({
|
|
11
|
+
callsProcessor: [
|
|
12
|
+
{
|
|
13
|
+
match: '/objectProperties/index',
|
|
14
|
+
callName: 'table fields',
|
|
15
|
+
payloadAlias(payload: { object_type: string }) {
|
|
16
|
+
return `table: ${payload.object_type}`
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
match: '/v3/tab/:id/views',
|
|
21
|
+
// callName: 'tab views',
|
|
22
|
+
payloadAlias(_, request) {
|
|
23
|
+
return `tab: ${request.pathParams?.id}`
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
match: '/v3/tabs/:id',
|
|
28
|
+
callName: 'tab config',
|
|
29
|
+
payloadAlias(_, request) {
|
|
30
|
+
return `tab: ${request.pathParams?.id}`
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
match: '/v3/low-code-functions/list-triggers/:id',
|
|
35
|
+
callName: 'low code triggers',
|
|
36
|
+
payloadAlias(_, request) {
|
|
37
|
+
return `tab: ${request.pathParams?.id}`
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
})
|
|
42
|
+
}
|