@zeit/schemas
Advanced tools
Comparing version 2.20.0 to 2.21.0
{ | ||
"name": "@zeit/schemas", | ||
"version": "2.20.0", | ||
"version": "2.21.0", | ||
"description": "All schemas used for validation that are shared between our projects", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -11,3 +11,3 @@ /* eslint camelcase: 0 */ | ||
const isValid = ajv.validate(User, { | ||
username: null, | ||
username: null | ||
}); | ||
@@ -22,3 +22,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
username: '!!!', | ||
username: '!!!' | ||
}); | ||
@@ -36,3 +36,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
username: '', | ||
username: '' | ||
}); | ||
@@ -55,3 +55,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
username: 'a'.repeat(50), | ||
username: 'a'.repeat(50) | ||
}); | ||
@@ -75,3 +75,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
name: '', | ||
name: '' | ||
}); | ||
@@ -89,3 +89,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
name: 'a'.repeat(50), | ||
name: 'a'.repeat(50) | ||
}); | ||
@@ -108,3 +108,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
billingChecked: null, | ||
billingChecked: null | ||
}); | ||
@@ -124,3 +124,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
avatar: 'abc', | ||
avatar: 'abc' | ||
}); | ||
@@ -138,3 +138,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
avatar: 'a'.repeat(50), | ||
avatar: 'a'.repeat(50) | ||
}); | ||
@@ -152,3 +152,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
avatar: 'n'.repeat(40), | ||
avatar: 'n'.repeat(40) | ||
}); | ||
@@ -171,3 +171,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
email: `${'n'.repeat(256)}@zeit.co`, | ||
email: `${'n'.repeat(256)}@zeit.co` | ||
}); | ||
@@ -187,3 +187,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
platformVersion: 0, | ||
platformVersion: 0 | ||
}); | ||
@@ -203,3 +203,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
platformVersion: 3, | ||
platformVersion: 3 | ||
}); | ||
@@ -227,3 +227,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
importFlowGitProvider: 'test', | ||
importFlowGitProvider: 'test' | ||
}); | ||
@@ -235,3 +235,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
importFlowGitProvider: 10, | ||
importFlowGitProvider: 10 | ||
}); | ||
@@ -251,3 +251,3 @@ assert.equal(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
importFlowGitNamespace: 10, | ||
importFlowGitNamespace: 10 | ||
}); | ||
@@ -259,3 +259,3 @@ assert.strictEqual(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
importFlowGitNamespace: true, | ||
importFlowGitNamespace: true | ||
}); | ||
@@ -279,3 +279,3 @@ assert.strictEqual(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
importFlowGitNamespaceId: true, | ||
importFlowGitNamespaceId: true | ||
}); | ||
@@ -291,3 +291,3 @@ assert.strictEqual(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
scopeId: null, | ||
scopeId: null | ||
}); | ||
@@ -311,3 +311,3 @@ assert.strictEqual(isValid, false); | ||
const isValid = ajv.validate(User, { | ||
gitNamespaceId: true, | ||
gitNamespaceId: true | ||
}); | ||
@@ -325,1 +325,14 @@ assert.strictEqual(isValid, false); | ||
}; | ||
exports.test_dismissedToasts_valid = () => { | ||
assert(ajv.validate(User, { dismissedToasts: {} })); | ||
}; | ||
exports.test_dismissedToasts_valid = () => { | ||
assert(ajv.validate(User, { dismissedToasts: { exampleToast: { exampleScopeId: 1656442351576 } } })); | ||
}; | ||
exports.test_dismissedToasts_valid = () => { | ||
const isValid = ajv.validate(User, { dismissedToasts: []}); | ||
assert.strictEqual(isValid, false); | ||
}; |
@@ -5,3 +5,3 @@ const Username = { | ||
maxLength: 48, | ||
pattern: '^[a-z0-9][a-z0-9-]*[a-z0-9]$', | ||
pattern: '^[a-z0-9][a-z0-9-]*[a-z0-9]$' | ||
}; | ||
@@ -12,3 +12,3 @@ | ||
minLength: 1, | ||
maxLength: 32, | ||
maxLength: 32 | ||
}; | ||
@@ -19,3 +19,3 @@ | ||
minLength: 5, | ||
maxLength: 256, | ||
maxLength: 256 | ||
}; | ||
@@ -26,8 +26,8 @@ | ||
{ | ||
enum: ['github', 'gitlab', 'bitbucket'], | ||
'enum': ['github', 'gitlab', 'bitbucket'] | ||
}, | ||
{ | ||
type: 'null', | ||
}, | ||
], | ||
type: 'null' | ||
} | ||
] | ||
}; | ||
@@ -38,8 +38,8 @@ | ||
{ | ||
type: 'string', | ||
type: 'string' | ||
}, | ||
{ | ||
type: 'null', | ||
}, | ||
], | ||
type: 'null' | ||
} | ||
] | ||
}; | ||
@@ -50,15 +50,15 @@ | ||
{ | ||
type: 'string', | ||
type: 'string' | ||
}, | ||
{ | ||
type: 'number', | ||
type: 'number' | ||
}, | ||
{ | ||
type: 'null', | ||
}, | ||
], | ||
type: 'null' | ||
} | ||
] | ||
}; | ||
const ScopeId = { | ||
type: 'string', | ||
type: 'string' | ||
}; | ||
@@ -69,11 +69,11 @@ | ||
{ | ||
type: 'string', | ||
type: 'string' | ||
}, | ||
{ | ||
type: 'number', | ||
type: 'number' | ||
}, | ||
{ | ||
type: 'null', | ||
}, | ||
], | ||
type: 'null' | ||
} | ||
] | ||
}; | ||
@@ -85,3 +85,3 @@ | ||
// A `null` platform version means to always use the latest | ||
type: 'null', | ||
type: 'null' | ||
}, | ||
@@ -91,5 +91,5 @@ { | ||
minimum: 1, | ||
maximum: 2, | ||
}, | ||
], | ||
maximum: 2 | ||
} | ||
] | ||
}; | ||
@@ -101,7 +101,7 @@ | ||
maxLength: 40, | ||
pattern: '^[0-9a-f]+$', | ||
pattern: '^[0-9a-f]+$' | ||
}; | ||
const Bio = { | ||
type: 'string', | ||
type: 'string' | ||
}; | ||
@@ -112,3 +112,3 @@ | ||
minLength: 4, | ||
maxLength: 40, | ||
maxLength: 40 | ||
}; | ||
@@ -120,9 +120,9 @@ | ||
service: { | ||
type: 'string', | ||
type: 'string' | ||
}, | ||
link: { | ||
type: 'string', | ||
}, | ||
type: 'string' | ||
} | ||
}, | ||
additionalProperties: false, | ||
additionalProperties: false | ||
}; | ||
@@ -136,3 +136,3 @@ | ||
items: Profile, | ||
additionalProperties: false, | ||
additionalProperties: false | ||
}; | ||
@@ -144,8 +144,22 @@ | ||
enabled: { | ||
type: 'boolean', | ||
}, | ||
type: 'boolean' | ||
} | ||
}, | ||
additionalProperties: false, | ||
additionalProperties: false | ||
}; | ||
// Record<ToastName, Record<Scope, Date>> | ||
const DismissedToasts = { | ||
type: 'object', | ||
patternProperties: { | ||
'^.*$': { | ||
'^.*$': { | ||
type: 'number' | ||
} | ||
} | ||
}, | ||
additionalProperties: false | ||
}; | ||
const User = { | ||
@@ -170,3 +184,4 @@ type: 'object', | ||
remoteCaching: RemoteCaching, | ||
}, | ||
dismissedToasts: DismissedToasts | ||
} | ||
}; | ||
@@ -186,2 +201,3 @@ | ||
GitNamespaceId, | ||
DismissedToasts | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
28722
1139