chore: relax filter limits

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
Ricardo Arturo Cabral Mejía 2022-12-15 11:48:34 -05:00
parent 88e1d61936
commit 50de2c167a
2 changed files with 3 additions and 3 deletions

View File

@ -9,4 +9,4 @@ export const filterSchema = Schema.object({
since: Schema.number().min(0).multiple(1),
until: Schema.number().min(0).multiple(1),
limit: Schema.number().min(1).multiple(1).max(10000),
}).pattern(/^#[a-z]$/, Schema.array().items(Schema.string().max(1024)).max(100))
}).pattern(/^#[a-z]$/, Schema.array().items(Schema.string().max(1024)).max(256))

View File

@ -32,7 +32,7 @@ describe('NIP-01', () => {
const cases = {
ids: [
{ message: 'must be an array', transform: assocPath(['ids'], null) },
{ message: 'must contain less than or equal to 256 items', transform: assocPath(['ids'], range(0, 257).map(() => 'f')) },
{ message: 'must contain less than or equal to 1000 items', transform: assocPath(['ids'], range(0, 1001).map(() => 'f')) },
],
prefixOrId: [
{ message: 'length must be less than or equal to 64 characters long', transform: assocPath(['ids', 0], 'f'.repeat(65)) },
@ -41,7 +41,7 @@ describe('NIP-01', () => {
],
authors: [
{ message: 'must be an array', transform: assocPath(['authors'], null) },
{ message: 'must contain less than or equal to 256 items', transform: assocPath(['authors'], range(0, 257).map(() => 'f')) },
{ message: 'must contain less than or equal to 1000 items', transform: assocPath(['authors'], range(0, 1001).map(() => 'f')) },
],
prefixOrAuthor: [
{ message: 'length must be less than or equal to 64 characters long', transform: assocPath(['authors', 0], 'f'.repeat(65)) },