Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow external image uris #23

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@initia/initia-registry-types",
"version": "0.0.10",
"version": "0.0.11",
"description": "The package provides TypeScript type definitions and Zod integration for initia-registry.",
"types": "./dist/types/index.d.ts",
"exports": {
Expand Down
24 changes: 4 additions & 20 deletions _package/src/zods/AssetList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,11 @@ export const AssetListSchema = z
.object({
png: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
)
)
.regex(new RegExp("^https://.+\\.png$"))
.optional(),
svg: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
)
)
.regex(new RegExp("^https://.+\\.svg$"))
.optional(),
})
.strict()
Expand Down Expand Up @@ -249,19 +241,11 @@ export const AssetListSchema = z
.optional(),
png: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
)
)
.regex(new RegExp("^https://.+\\.png$"))
.optional(),
svg: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
)
)
.regex(new RegExp("^https://.+\\.svg$"))
.optional(),
theme: z
.object({
Expand Down
36 changes: 4 additions & 32 deletions _package/src/zods/Chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,8 @@ export const ChainSchema = z
"The (primary) key used to identify an object within the Chain Registry."
)
.optional(),
png: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
)
)
.optional(),
svg: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
)
)
.optional(),
png: z.string().regex(new RegExp("^https://.+\\.png$")).optional(),
svg: z.string().regex(new RegExp("^https://.+\\.svg$")).optional(),
theme: z
.object({
primary_color_hex: z
Expand Down Expand Up @@ -308,22 +294,8 @@ export const ChainSchema = z
.optional(),
logo_URIs: z
.object({
png: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
)
)
.optional(),
svg: z
.string()
.regex(
new RegExp(
"^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
)
)
.optional(),
png: z.string().regex(new RegExp("^https://.+\\.png$")).optional(),
svg: z.string().regex(new RegExp("^https://.+\\.svg$")).optional(),
})
.strict()
.optional(),
Expand Down
9 changes: 4 additions & 5 deletions assetlist.schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$id": "https://osmosis.zone/assetlists.schema.json",
"$schema": "https://json-schema.org/draft-07/schema",
"title": "Asset Lists",
"description": "Asset lists are a similar mechanism to allow frontends and other UIs to fetch metadata associated with Cosmos SDK denoms, especially for assets sent over IBC.",
Expand Down Expand Up @@ -106,12 +105,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
"pattern": "^https://.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
"pattern": "^https://.+\\.svg$"
}
},
"additionalProperties": false
Expand All @@ -127,12 +126,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
"pattern": "^https://.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
"pattern": "^https://.+\\.svg$"
},
"theme": {
"type": "object",
Expand Down
9 changes: 4 additions & 5 deletions chain.schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$id": "https://sikka.tech/chain.schema.json",
"$schema": "https://json-schema.org/draft-07/schema",
"title": "Cosmos Chain",
"description": "Cosmos Chain.json is a metadata file that contains information about a cosmos sdk based chain.",
Expand Down Expand Up @@ -425,12 +424,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
"pattern": "^https://.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
"pattern": "^https://.+\\.svg$"
},
"theme": {
"type": "object",
Expand Down Expand Up @@ -486,12 +485,12 @@
"png": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.png$"
"pattern": "^https://.+\\.png$"
},
"svg": {
"type": "string",
"format": "uri-reference",
"pattern": "^https://raw\\.githubusercontent\\.com/initia-labs/initia-registry/.+\\.svg$"
"pattern": "^https://.+\\.svg$"
}
},
"additionalProperties": false
Expand Down
Loading