Spaces:
Runtime error
Runtime error
Download src/validate/settings.schema.ts from oex2003/evolution-api: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/oex2003/evolution-api/resolve/refs%2Fpr%2F1/src/validate/settings.schema.ts
- Command line
-
hf download hf://spaces/oex2003/evolution-api@refs/pr/1/src/validate/settings.schema.ts
-
curl -L -o settings.schema.ts https://huggingface.co/spaces/oex2003/evolution-api/resolve/refs%2Fpr%2F1/src/validate/settings.schema.ts
1.09 kB
| import { JSONSchema7 } from 'json-schema'; | |
| import { v4 } from 'uuid'; | |
| const isNotEmpty = (...propertyNames: string[]): JSONSchema7 => { | |
| const properties = {}; | |
| propertyNames.forEach( | |
| (property) => | |
| (properties[property] = { | |
| minLength: 1, | |
| description: `The "${property}" cannot be empty`, | |
| }), | |
| ); | |
| return { | |
| if: { | |
| propertyNames: { | |
| enum: [...propertyNames], | |
| }, | |
| }, | |
| then: { properties }, | |
| }; | |
| }; | |
| export const settingsSchema: JSONSchema7 = { | |
| $id: v4(), | |
| type: 'object', | |
| properties: { | |
| rejectCall: { type: 'boolean' }, | |
| msgCall: { type: 'string' }, | |
| groupsIgnore: { type: 'boolean' }, | |
| alwaysOnline: { type: 'boolean' }, | |
| readMessages: { type: 'boolean' }, | |
| readStatus: { type: 'boolean' }, | |
| syncFullHistory: { type: 'boolean' }, | |
| wavoipToken: { type: 'string' }, | |
| }, | |
| required: ['rejectCall', 'groupsIgnore', 'alwaysOnline', 'readMessages', 'readStatus', 'syncFullHistory'], | |
| ...isNotEmpty('rejectCall', 'groupsIgnore', 'alwaysOnline', 'readMessages', 'readStatus', 'syncFullHistory'), | |
| }; | |