Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

View File

@@ -0,0 +1,91 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://crm.local/contracts/omni-inbound-envelope.v1.json",
"title": "OmniInboundEnvelopeV1",
"type": "object",
"additionalProperties": false,
"required": [
"version",
"idempotencyKey",
"provider",
"channel",
"direction",
"providerEventId",
"providerMessageId",
"eventType",
"occurredAt",
"receivedAt",
"payloadRaw",
"payloadNormalized"
],
"properties": {
"version": {
"const": 1
},
"idempotencyKey": {
"type": "string",
"minLength": 1,
"maxLength": 512
},
"provider": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"channel": {
"type": "string",
"enum": ["TELEGRAM", "WHATSAPP", "INSTAGRAM", "PHONE", "EMAIL", "INTERNAL"]
},
"direction": {
"const": "IN"
},
"providerEventId": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"providerMessageId": {
"type": ["string", "null"],
"maxLength": 256
},
"eventType": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"occurredAt": {
"type": "string",
"format": "date-time"
},
"receivedAt": {
"type": "string",
"format": "date-time"
},
"payloadRaw": {
"type": ["object", "array", "string", "number", "boolean", "null"]
},
"payloadNormalized": {
"type": "object",
"additionalProperties": true,
"required": ["threadExternalId", "contactExternalId", "text", "businessConnectionId"],
"properties": {
"threadExternalId": {
"type": ["string", "null"],
"maxLength": 256
},
"contactExternalId": {
"type": ["string", "null"],
"maxLength": 256
},
"text": {
"type": ["string", "null"],
"maxLength": 4096
},
"businessConnectionId": {
"type": ["string", "null"],
"maxLength": 256
}
}
}
}
}