diff --git a/.github/workflows/npm_publish_initia_registry.yml b/.github/workflows/npm_publish_initia_registry.yml index 9eed39d..c4ad687 100644 --- a/.github/workflows/npm_publish_initia_registry.yml +++ b/.github/workflows/npm_publish_initia_registry.yml @@ -4,7 +4,7 @@ on: push: branches: ["main"] paths: - - package/package.json + - _package/package.json jobs: build: @@ -17,10 +17,10 @@ jobs: node-version: "20.x" registry-url: "https://registry.npmjs.org" - run: npm ci - working-directory: ./package + working-directory: ./_package - run: npm run build - working-directory: ./package + working-directory: ./_package - run: npm publish - working-directory: ./package + working-directory: ./_package env: NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }} diff --git a/_package/src/types/Chain.ts b/_package/src/types/Chain.ts index 90d88fa..ec5f9d5 100644 --- a/_package/src/types/Chain.ts +++ b/_package/src/types/Chain.ts @@ -228,13 +228,11 @@ export interface Chain { */ ibc_channels?: | { - channel?: { - chain_id: string; - port_id: string; - channel_id: string; - version: string; - }[]; - } + chain_id: string; + port_id: string; + channel_id: string; + version: string; + }[] | { channel?: { chain_id: string; diff --git a/_package/src/zods/Chain.ts b/_package/src/zods/Chain.ts index b262982..9945781 100644 --- a/_package/src/zods/Chain.ts +++ b/_package/src/zods/Chain.ts @@ -499,22 +499,16 @@ export const ChainSchema = z .any() .superRefine((x, ctx) => { const schemas = [ - z - .object({ - channel: z - .array( - z - .object({ - chain_id: z.string(), - port_id: z.string(), - channel_id: z.string(), - version: z.string(), - }) - .strict() - ) - .optional(), - }) - .strict(), + z.array( + z + .object({ + chain_id: z.string(), + port_id: z.string(), + channel_id: z.string(), + version: z.string(), + }) + .strict() + ), z .object({ channel: z diff --git a/chain.schema.json b/chain.schema.json index b3db16e..98499f3 100644 --- a/chain.schema.json +++ b/chain.schema.json @@ -640,36 +640,31 @@ }, "ibc_channels": { "oneOf": [ - { - "type": "object", - "properties": { - "channel": { - "type": "array", - "items": { - "type": "object", - "required": [ - "chain_id", - "port_id", - "channel_id", - "version" - ], - "properties": { - "chain_id": { - "type": "string" - }, - "port_id": { - "type": "string" - }, - "channel_id": { - "type": "string" - }, - "version": { - "type": "string" - } - }, - "additionalProperties": false + { + "type": "array", + "items": { + "type": "object", + "required": [ + "chain_id", + "port_id", + "channel_id", + "version" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "port_id": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "version": { + "type": "string" } - } + }, + "additionalProperties": false }, "additionalProperties": false },