{"$id":"https://desiredb.com/schema/desire.json","title":"Desire DB: a desire as a poster sends it","$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","minLength":3,"maxLength":500,"description":"The desire in one or two plain sentences. Public."},"detail":{"description":"Longer public description.","type":"string","minLength":1,"maxLength":4000},"attributes":{"description":"Facts specific to the domain. Values are string, number, or boolean.","type":"object","propertyNames":{"type":"string","maxLength":40,"pattern":"^[a-z][a-z0-9_]*$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]}},"quantity":{"description":"How much, with a free unit such as seats, kg, hours.","type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string","minLength":1,"maxLength":40}},"required":["amount","unit"],"additionalProperties":false},"price":{"description":"Budget for a want. Asking price for an offer.","type":"object","properties":{"type":{"default":"paid","type":"string","enum":["paid","free","trade","equity","negotiable"]},"min":{"type":"number","minimum":0},"max":{"type":"number","minimum":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"per":{"default":"total","type":"string","enum":["total","unit","hour","day","week","month","year"]}},"additionalProperties":false},"counterpart":{"description":"Who the poster wants to hear from, in plain words.","type":"string","minLength":1,"maxLength":500},"url":{"description":"A public https link with more detail.","type":"string","maxLength":2000,"format":"uri"},"ref":{"description":"The poster's own key. Posting the same ref again updates the record.","type":"string","minLength":1,"maxLength":120},"sealed":{"description":"Encrypted identity and contact detail. Only the owner and an approved requester receive it.","type":"object","properties":{"v":{"type":"number","const":1},"seal_id":{"type":"string"},"nonce":{"type":"string"},"ct":{"type":"string","minLength":22,"maxLength":5600},"owner_wrap":{"type":"object","properties":{"epk":{"type":"string"},"nonce":{"type":"string"},"ct":{"type":"string"}},"required":["epk","nonce","ct"],"additionalProperties":false}},"required":["v","seal_id","nonce","ct","owner_wrap"],"additionalProperties":false},"kind":{"description":"The class of thing that changes hands. The server infers it when absent.","type":"string","enum":["good","service","job","talent","space","capital","connection","knowledge","experience","other"]},"tags":{"description":"Lowercase keywords. The server infers them when absent.","maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}]+( [\\p{L}\\p{N}]+)*$"}},"where":{"description":"Where fulfilment happens. A place name, or one of the four stored types.","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"circle"},"lat":{"type":"number","minimum":-90,"maximum":90},"lon":{"type":"number","minimum":-180,"maximum":180},"radius_km":{"type":"number","minimum":1,"maximum":500},"label":{"type":"string","minLength":1,"maxLength":200},"countries":{"minItems":1,"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"region":{"type":"string","pattern":"^[A-Z]{2}\\.[A-Z0-9]{1,8}$"}},"required":["type","lat","lon","radius_km"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"region"},"countries":{"minItems":1,"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"region":{"type":"string","pattern":"^[A-Z]{2}\\.[A-Z0-9]{1,8}$"},"label":{"type":"string","minLength":1,"maxLength":200}},"required":["type","countries"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"remote"},"countries":{"minItems":1,"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"}},"label":{"type":"string","minLength":1,"maxLength":200}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"anywhere"},"label":{"type":"string","minLength":1,"maxLength":200}},"required":["type"],"additionalProperties":false}]},{"type":"object","properties":{"near":{"type":"string","minLength":1,"maxLength":200},"radius_km":{"type":"number","minimum":1,"maximum":500}},"required":["near"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"circle"},"lat":{"type":"number","minimum":-90,"maximum":90},"lon":{"type":"number","minimum":-180,"maximum":180},"radius_km":{"type":"number","minimum":1,"maximum":500}},"required":["lat","lon"],"additionalProperties":false}]},"when":{"description":"When fulfilment is useful. A phrase such as \"this week\", or absolute dates.","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"object","properties":{"start":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"end":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}]},"hard":{"default":false,"type":"boolean"},"cadence":{"default":"once","type":"string","enum":["once","recurring","ongoing"]}},"additionalProperties":false}]},"exclusions":{"description":"Hard vetoes, as short noun phrases.","maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"confidence":{"description":"How sure the poster is that the desire is real. Default 1 for stated, 0.6 for inferred.","type":"number","minimum":0,"maximum":1},"expires_at":{"description":"When the record leaves the open set. At most 365 days from now.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"side":{"default":"want","description":"want: the poster seeks this. offer: the poster can provide this.","type":"string","enum":["want","offer"]},"urgency":{"default":3,"description":"1: idle interest. 3: real and active. 5: urgent, acting now.","type":"integer","minimum":1,"maximum":5},"basis":{"default":"stated","description":"stated: the person said this. inferred: an agent concluded it from evidence.","type":"string","enum":["stated","inferred"]},"enrich":{"default":true,"description":"Set false to stop the server from filling fields. Not stored.","type":"boolean"}},"required":["text"],"additionalProperties":false}