Skip to content

Commit a24465e

Browse files
committed
fix(ci): ignore wrangler artifacts and repair rpc types
1 parent cb10941 commit a24465e

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

app/components/RpcMethod.vue

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ const props = defineProps<{
88
}>()
99
1010
const serverUrl = ref('https://rpc.nimiqwatch.com')
11-
const params = reactive<Record<string, string | boolean>>({})
11+
const textParams = reactive<Record<string, string>>({})
12+
const booleanParams = reactive<Record<string, boolean>>({})
1213
const loading = ref(false)
1314
const response = ref<any>(null)
1415
const error = ref<string | null>(null)
1516
1617
watchEffect(() => {
1718
for (const input of props.method.input) {
18-
if (!(input.key in params)) {
19-
params[input.key] = input.type === 'boolean' ? false : ''
19+
if (input.type === 'boolean') {
20+
if (!(input.key in booleanParams)) {
21+
booleanParams[input.key] = false
22+
}
23+
}
24+
else if (!(input.key in textParams)) {
25+
textParams[input.key] = ''
2026
}
2127
}
2228
})
@@ -28,14 +34,13 @@ async function callRpc() {
2834
2935
try {
3036
const parsedParams = props.method.input.map((input) => {
31-
const value = params[input.key]
3237
if (input.type.includes('number')) {
33-
return Number(value)
38+
return Number(textParams[input.key])
3439
}
3540
if (input.type === 'boolean') {
36-
return Boolean(value)
41+
return booleanParams[input.key]
3742
}
38-
return value
43+
return textParams[input.key]
3944
})
4045
4146
const result = await $fetch('/api/rpc-proxy', {
@@ -103,11 +108,11 @@ async function callRpc() {
103108
>
104109
<USwitch
105110
v-if="input.type === 'boolean'"
106-
v-model="params[input.key]"
111+
v-model="booleanParams[input.key]"
107112
/>
108113
<UInput
109114
v-else
110-
v-model="params[input.key]"
115+
v-model="textParams[input.key]"
111116
:placeholder="input.type"
112117
/>
113118
</UFormField>

app/utils/rpc.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { MethodObject, OpenrpcDocument, TagObject } from '@open-rpc/meta-schema'
2-
import type { SidebarSection } from '../types/navigation'
32
import $RefParser from '@apidevtools/json-schema-ref-parser'
43
import { capitalizeFirstLetter, slugify, toHumanReadable } from './string'
54

@@ -67,8 +66,16 @@ export interface MethodIO {
6766
label: string
6867
}
6968

70-
export type NimiqRpcMethods = SidebarSection & {
69+
export interface RpcMethodNavigationItem {
7170
text: string
71+
link: string
72+
popular?: boolean
73+
}
74+
75+
export interface NimiqRpcMethods {
76+
icon: string
77+
text: string
78+
items: RpcMethodNavigationItem[]
7279
methods: NimiqRpcMethod[]
7380
}
7481

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import withNuxt from './.nuxt/eslint.config.mjs'
44
export default withNuxt(antfu({
55
typescript: true,
66
vue: true,
7-
ignores: ['.nuxt/', '.output/', '.pnpm-patch-docus/', '*.woff2', 'content/web-client/reference/'],
7+
ignores: ['.nuxt/', '.output/', '.pnpm-patch-docus/', '.wrangler/', '*.woff2', 'content/web-client/reference/'],
88
}, {
99
files: ['**/*.md'],
1010
rules: {

0 commit comments

Comments
 (0)