diff --git a/public/connect/schemas/catalog.json b/public/connect/schemas/catalog.json index 3da4280..8aef714 100644 --- a/public/connect/schemas/catalog.json +++ b/public/connect/schemas/catalog.json @@ -5,7 +5,11 @@ "data_contract": "./data-contract.schema.json", "event_action_interop": "./interop/v0.1/profile.schema.json", "connect_protocol": "./connect-protocol.v1.schema.json", - "encrypted_relay": "./encrypted-relay.v1.schema.json", + "connect_problem": "./connect-problem.v1.schema.json", + "connect_problem_catalog": "./connect-problems.v1.catalog.json", + "mdbase_query_v0_3": "./mdbase-query.v0.3.schema.json", + "encrypted_relay": "./encrypted-relay.v2.schema.json", + "files": "./files.v1.schema.json", "notification_webhook": "./notification-webhook.v1.schema.json", "sync": "./sync.v1.schema.json" } diff --git a/public/connect/schemas/connect-problem.v1.schema.json b/public/connect/schemas/connect-problem.v1.schema.json new file mode 100644 index 0000000..159d551 --- /dev/null +++ b/public/connect/schemas/connect-problem.v1.schema.json @@ -0,0 +1,4692 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://schemas.mdbase.dev/connect/problem/v1", + "title": "mdbase connect problem v1", + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "access_denied" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "return_to": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "access_paused" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "resume_connector_access" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "application_identity_unavailable" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_application" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "approval_window_blocked" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "user_code", + "verification_uri", + "verification_uri_complete", + "expires_at", + "interval_seconds" + ], + "properties": { + "user_code": { + "type": "string" + }, + "verification_uri": { + "type": "string" + }, + "verification_uri_complete": { + "type": "string" + }, + "expires_at": { + "type": "integer" + }, + "interval_seconds": { + "type": "integer" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "authority_authorization_changed" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "authorization_binding_incompatible" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_application" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "contract", + "required", + "supported", + "peer" + ], + "properties": { + "contract": { + "type": "string" + }, + "required": { + "type": "array", + "items": { + "type": "integer" + } + }, + "supported": { + "type": "array", + "items": { + "type": "integer" + } + }, + "peer": { + "type": "string" + }, + "operation": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "authorization_cancelled" + }, + "category": { + "const": "cancellation" + }, + "recovery": { + "const": "none" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "authorization_expired" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "authorization_replayed" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "browser_required" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "none" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "callback_url_required" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "capability_contract_incompatible" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_application" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "contract", + "required", + "supported", + "peer" + ], + "properties": { + "contract": { + "type": "string" + }, + "required": { + "type": "array", + "items": { + "type": "integer" + } + }, + "supported": { + "type": "array", + "items": { + "type": "integer" + } + }, + "peer": { + "type": "string" + }, + "operation": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "change_cursor_reset" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_access_denied" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_configuration_invalid" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "repair_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "diagnostics" + ], + "properties": { + "diagnostics": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_contracts_missing" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "contracts" + ], + "properties": { + "contracts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "version" + ], + "properties": { + "id": { + "type": "string" + }, + "version": { + "type": "string" + } + } + } + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_incompatible" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_invalid" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "repair_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "diagnostics" + ], + "properties": { + "diagnostics": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_kind_unsupported" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_mismatch" + }, + "category": { + "const": "selection" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_not_found" + }, + "category": { + "const": "selection" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_not_ready" + }, + "category": { + "const": "selection" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_not_selected" + }, + "category": { + "const": "selection" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_type_registry_invalid" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "repair_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "diagnostics" + ], + "properties": { + "diagnostics": { + "type": "array", + "items": { + "type": "object" + } + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "collection_version_unsupported" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "current_version", + "required_version" + ], + "properties": { + "current_version": { + "type": "string" + }, + "required_version": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "concurrent_modification" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "connector_identity_changed" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "connector_offline" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "connector_name": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "connector_upgrade_required" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_connector" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "device_authorization_failed" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "direct_operation_rejected" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "discovery_failed" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "durable_mutation_unsupported" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_connector" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "contract", + "required", + "supported", + "peer" + ], + "properties": { + "contract": { + "type": "string" + }, + "required": { + "type": "array", + "items": { + "type": "integer" + } + }, + "supported": { + "type": "array", + "items": { + "type": "integer" + } + }, + "peer": { + "type": "string" + }, + "operation": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "encrypted_relay_rejected" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "encryption_required" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "expired_token" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_changed_during_move" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_changed_during_read" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_move_failed" + }, + "category": { + "const": "internal" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_mutation_conflict" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "resolve_conflict" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_not_found" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_source_mismatch" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_upload_incomplete" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "hosted_provider_unavailable" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "insufficient_access" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "required_operations", + "granted_operations", + "missing_operations" + ], + "properties": { + "required_operations": { + "type": "array", + "items": { + "type": "string" + } + }, + "granted_operations": { + "type": "array", + "items": { + "type": "string" + } + }, + "missing_operations": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_application_authorization" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_application_manifest" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "issues" + ], + "properties": { + "issues": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "required": [ + "path", + "keyword", + "message", + "params" + ], + "properties": { + "path": { + "type": "string" + }, + "keyword": { + "type": "string" + }, + "message": { + "type": "string" + }, + "params": { + "type": "object" + } + } + } + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_callback" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_device_authorization_response" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_encrypted_response" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_loopback_url" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_mutation_id" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_operation_response" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_path" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_preflight" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_push_payload" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_push_subscription" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_request" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_token_response" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "managed_fcm_not_declared" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "manifest_load_failed" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "manifest_required" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "missing_grant_key" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "mutation_recovery_expired" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "none" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "mutation_request_conflict" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "resolve_conflict" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "request_id" + ], + "properties": { + "request_id": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "no_pending_mutation" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "not_authorized" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "not_remote_authority" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "notification_criterion_not_declared" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "notification_reauthorization_required" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "notification_registration_failed" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "notification_unregistration_failed" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "notifications_not_declared" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "notifications_unavailable" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "operation_cancelled" + }, + "category": { + "const": "cancellation" + }, + "recovery": { + "const": "none" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "operation_failed" + }, + "category": { + "const": "internal" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "operation_invalid" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "diagnostics" + ], + "properties": { + "diagnostics": { + "type": "array", + "items": { + "type": "object" + } + }, + "partial_result": true + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "operation_outcome_unknown" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "resolve_outcome" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "request_id" + ], + "properties": { + "request_id": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "path_occupied" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "resolve_conflict" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "pending_mutation_unresolved" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "resolve_outcome" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "query_snapshot_changed" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "rate_limited" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "retry_after_ms": { + "type": "integer" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "reconnect_required" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "redirect_uri_required" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "reference_updates_unsupported" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "registry_backup_invalid" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "registry_busy" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "registry_corrupt" + }, + "category": { + "const": "integrity" + }, + "recovery": { + "const": "repair_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "registry_migration_failed" + }, + "category": { + "const": "internal" + }, + "recovery": { + "const": "contact_support" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "registry_schema_incompatible" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_connector" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "relay_authorization_expired" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "relay_unavailable" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "sandbox_unsupported" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "scope_denied" + }, + "category": { + "const": "authorization" + }, + "recovery": { + "const": "reauthorize" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "stale_file_revision" + }, + "category": { + "const": "conflict" + }, + "recovery": { + "const": "refresh" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "storage_required" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "none" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "sync_failed" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "temporarily_unavailable" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "timeout" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "token_exchange_failed" + }, + "category": { + "const": "availability" + }, + "recovery": { + "const": "retry" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message", + "details" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "transport_protocol_incompatible" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_connector" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + }, + "details": { + "type": "object", + "additionalProperties": false, + "required": [ + "contract", + "required", + "supported", + "peer" + ], + "properties": { + "contract": { + "type": "string" + }, + "required": { + "type": "array", + "items": { + "type": "integer" + } + }, + "supported": { + "type": "array", + "items": { + "type": "integer" + } + }, + "peer": { + "type": "string" + }, + "operation": { + "type": "string" + } + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "type_pack_provision_failed" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "repair_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "unknown_collection" + }, + "category": { + "const": "selection" + }, + "recovery": { + "const": "choose_collection" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "unsafe_file_path" + }, + "category": { + "const": "validation" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "unsupported_encryption" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "upgrade_application" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "unsupported_operation" + }, + "category": { + "const": "compatibility" + }, + "recovery": { + "const": "fix_request" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "server_code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "unknown" + }, + "server_code": { + "type": "string", + "minLength": 1 + }, + "category": { + "const": "unknown" + }, + "recovery": { + "const": "none" + }, + "message": { + "type": "string", + "minLength": 1 + }, + "details": true, + "operation_outcome": { + "enum": [ + "not_sent", + "rejected", + "unknown" + ] + }, + "trace_id": { + "type": "string", + "minLength": 1 + } + } + } + ] +} diff --git a/public/connect/schemas/connect-problems.v1.catalog.json b/public/connect/schemas/connect-problems.v1.catalog.json new file mode 100644 index 0000000..bffce07 --- /dev/null +++ b/public/connect/schemas/connect-problems.v1.catalog.json @@ -0,0 +1,340 @@ +{ + "problem_version": 1, + "categories": [ + "authorization", + "availability", + "cancellation", + "compatibility", + "conflict", + "integrity", + "internal", + "selection", + "validation" + ], + "recovery_actions": [ + "choose_collection", + "contact_support", + "fix_request", + "none", + "reauthorize", + "refresh", + "repair_collection", + "resume_connector_access", + "resolve_conflict", + "resolve_outcome", + "retry", + "upgrade_application", + "upgrade_collection", + "upgrade_connector" + ], + "codes": { + "access_denied": { + "category": "authorization", + "recovery": "reauthorize", + "details": { + "required": [], + "properties": { "return_to": { "type": "string" } } + } + }, + "access_paused": { "category": "availability", "recovery": "resume_connector_access" }, + "application_identity_unavailable": { "category": "compatibility", "recovery": "upgrade_application" }, + "approval_window_blocked": { + "category": "authorization", + "recovery": "reauthorize", + "details": { + "required": ["user_code", "verification_uri", "verification_uri_complete", "expires_at", "interval_seconds"], + "properties": { + "user_code": { "type": "string" }, + "verification_uri": { "type": "string" }, + "verification_uri_complete": { "type": "string" }, + "expires_at": { "type": "integer" }, + "interval_seconds": { "type": "integer" } + } + } + }, + "authority_authorization_changed": { "category": "authorization", "recovery": "reauthorize" }, + "authorization_binding_incompatible": { + "category": "compatibility", + "recovery": "upgrade_application", + "details": { + "required": ["contract", "required", "supported", "peer"], + "properties": { + "contract": { "type": "string" }, + "required": { "type": "array", "items": { "type": "integer" } }, + "supported": { "type": "array", "items": { "type": "integer" } }, + "peer": { "type": "string" }, + "operation": { "type": "string" } + } + } + }, + "authorization_cancelled": { "category": "cancellation", "recovery": "none" }, + "authorization_expired": { "category": "authorization", "recovery": "reauthorize" }, + "authorization_replayed": { "category": "integrity", "recovery": "reauthorize" }, + "browser_required": { "category": "compatibility", "recovery": "none" }, + "callback_url_required": { "category": "validation", "recovery": "fix_request" }, + "capability_contract_incompatible": { + "category": "compatibility", + "recovery": "upgrade_application", + "details": { + "required": ["contract", "required", "supported", "peer"], + "properties": { + "contract": { "type": "string" }, + "required": { "type": "array", "items": { "type": "integer" } }, + "supported": { "type": "array", "items": { "type": "integer" } }, + "peer": { "type": "string" }, + "operation": { "type": "string" } + } + } + }, + "change_cursor_reset": { "category": "conflict", "recovery": "refresh" }, + "collection_access_denied": { "category": "authorization", "recovery": "reauthorize" }, + "collection_configuration_invalid": { + "category": "validation", + "recovery": "repair_collection", + "details": { + "required": ["diagnostics"], + "properties": { + "diagnostics": { "type": "array", "items": { "type": "object" } } + } + } + }, + "collection_contracts_missing": { + "category": "compatibility", + "recovery": "choose_collection", + "details": { + "required": ["contracts"], + "properties": { + "contracts": { + "type": "array", + "items": { + "type": "object", + "required": ["id", "version"], + "properties": { + "id": { "type": "string" }, + "version": { "type": "string" } + } + } + } + } + } + }, + "collection_incompatible": { "category": "compatibility", "recovery": "choose_collection" }, + "collection_invalid": { + "category": "validation", + "recovery": "repair_collection", + "details": { + "required": ["diagnostics"], + "properties": { + "diagnostics": { "type": "array", "items": { "type": "object" } } + } + } + }, + "collection_kind_unsupported": { "category": "compatibility", "recovery": "choose_collection" }, + "collection_mismatch": { "category": "selection", "recovery": "choose_collection" }, + "collection_not_found": { "category": "selection", "recovery": "choose_collection" }, + "collection_not_ready": { "category": "selection", "recovery": "choose_collection" }, + "collection_not_selected": { "category": "selection", "recovery": "choose_collection" }, + "collection_type_registry_invalid": { + "category": "validation", + "recovery": "repair_collection", + "details": { + "required": ["diagnostics"], + "properties": { + "diagnostics": { "type": "array", "items": { "type": "object" } } + } + } + }, + "collection_version_unsupported": { + "category": "compatibility", + "recovery": "upgrade_collection", + "details": { + "required": ["current_version", "required_version"], + "properties": { + "current_version": { "type": "string" }, + "required_version": { "type": "string" } + } + } + }, + "concurrent_modification": { "category": "conflict", "recovery": "refresh" }, + "connector_identity_changed": { "category": "integrity", "recovery": "reauthorize" }, + "connector_offline": { + "category": "availability", + "recovery": "retry", + "details": { + "required": [], + "properties": { + "connector_name": { "type": "string" } + } + } + }, + "connector_upgrade_required": { "category": "compatibility", "recovery": "upgrade_connector" }, + "device_authorization_failed": { "category": "authorization", "recovery": "reauthorize" }, + "direct_operation_rejected": { "category": "authorization", "recovery": "reauthorize" }, + "discovery_failed": { "category": "availability", "recovery": "retry" }, + "durable_mutation_unsupported": { + "category": "compatibility", + "recovery": "upgrade_connector", + "details": { + "required": ["contract", "required", "supported", "peer"], + "properties": { + "contract": { "type": "string" }, + "required": { "type": "array", "items": { "type": "integer" } }, + "supported": { "type": "array", "items": { "type": "integer" } }, + "peer": { "type": "string" }, + "operation": { "type": "string" } + } + } + }, + "encrypted_relay_rejected": { "category": "authorization", "recovery": "reauthorize" }, + "encryption_required": { "category": "authorization", "recovery": "reauthorize" }, + "expired_token": { "category": "authorization", "recovery": "reauthorize" }, + "file_changed_during_move": { "category": "conflict", "recovery": "refresh" }, + "file_changed_during_read": { "category": "conflict", "recovery": "refresh" }, + "file_move_failed": { "category": "internal", "recovery": "contact_support" }, + "file_mutation_conflict": { "category": "conflict", "recovery": "resolve_conflict" }, + "file_not_found": { "category": "conflict", "recovery": "refresh" }, + "file_source_mismatch": { "category": "conflict", "recovery": "refresh" }, + "file_upload_incomplete": { "category": "conflict", "recovery": "retry" }, + "hosted_provider_unavailable": { "category": "availability", "recovery": "retry" }, + "insufficient_access": { + "category": "authorization", + "recovery": "reauthorize", + "details": { + "required": ["required_operations", "granted_operations", "missing_operations"], + "properties": { + "required_operations": { "type": "array", "items": { "type": "string" } }, + "granted_operations": { "type": "array", "items": { "type": "string" } }, + "missing_operations": { "type": "array", "items": { "type": "string" } } + } + } + }, + "invalid_application_authorization": { "category": "validation", "recovery": "fix_request" }, + "invalid_application_manifest": { + "category": "validation", + "recovery": "fix_request", + "details": { + "required": ["issues"], + "properties": { + "issues": { + "type": "array", + "items": { + "type": "object", + "required": ["path", "keyword", "message", "params"], + "properties": { + "path": { "type": "string" }, + "keyword": { "type": "string" }, + "message": { "type": "string" }, + "params": { "type": "object" } + } + } + } + } + } + }, + "invalid_callback": { "category": "validation", "recovery": "fix_request" }, + "invalid_device_authorization_response": { "category": "integrity", "recovery": "contact_support" }, + "invalid_encrypted_response": { "category": "integrity", "recovery": "contact_support" }, + "invalid_loopback_url": { "category": "validation", "recovery": "fix_request" }, + "invalid_mutation_id": { "category": "validation", "recovery": "fix_request" }, + "invalid_operation_response": { "category": "integrity", "recovery": "contact_support" }, + "invalid_path": { "category": "validation", "recovery": "fix_request" }, + "invalid_preflight": { "category": "conflict", "recovery": "refresh" }, + "invalid_push_payload": { "category": "validation", "recovery": "fix_request" }, + "invalid_push_subscription": { "category": "validation", "recovery": "fix_request" }, + "invalid_request": { "category": "validation", "recovery": "fix_request" }, + "invalid_token_response": { "category": "integrity", "recovery": "contact_support" }, + "managed_fcm_not_declared": { "category": "compatibility", "recovery": "fix_request" }, + "manifest_load_failed": { "category": "availability", "recovery": "retry" }, + "manifest_required": { "category": "validation", "recovery": "fix_request" }, + "missing_grant_key": { "category": "authorization", "recovery": "reauthorize" }, + "mutation_recovery_expired": { "category": "compatibility", "recovery": "none" }, + "mutation_request_conflict": { + "category": "conflict", + "recovery": "resolve_conflict", + "details": { + "required": ["request_id"], + "properties": { "request_id": { "type": "string" } } + } + }, + "no_pending_mutation": { "category": "conflict", "recovery": "refresh" }, + "not_authorized": { "category": "authorization", "recovery": "reauthorize" }, + "not_remote_authority": { "category": "compatibility", "recovery": "choose_collection" }, + "notification_criterion_not_declared": { "category": "validation", "recovery": "fix_request" }, + "notification_reauthorization_required": { "category": "authorization", "recovery": "reauthorize" }, + "notification_registration_failed": { "category": "availability", "recovery": "retry" }, + "notification_unregistration_failed": { "category": "availability", "recovery": "retry" }, + "notifications_not_declared": { "category": "compatibility", "recovery": "fix_request" }, + "notifications_unavailable": { "category": "availability", "recovery": "retry" }, + "operation_cancelled": { "category": "cancellation", "recovery": "none" }, + "operation_failed": { "category": "internal", "recovery": "contact_support" }, + "operation_invalid": { + "category": "validation", + "recovery": "fix_request", + "details": { + "required": ["diagnostics"], + "properties": { + "diagnostics": { "type": "array", "items": { "type": "object" } }, + "partial_result": {} + } + } + }, + "operation_outcome_unknown": { + "category": "conflict", + "recovery": "resolve_outcome", + "details": { + "required": ["request_id"], + "properties": { "request_id": { "type": "string" } } + } + }, + "path_occupied": { "category": "conflict", "recovery": "resolve_conflict" }, + "pending_mutation_unresolved": { "category": "conflict", "recovery": "resolve_outcome" }, + "query_snapshot_changed": { "category": "conflict", "recovery": "refresh" }, + "rate_limited": { + "category": "availability", + "recovery": "retry", + "details": { + "required": [], + "properties": { + "retry_after_ms": { "type": "integer" } + } + } + }, + "reconnect_required": { "category": "authorization", "recovery": "reauthorize" }, + "redirect_uri_required": { "category": "validation", "recovery": "fix_request" }, + "reference_updates_unsupported": { "category": "compatibility", "recovery": "fix_request" }, + "registry_backup_invalid": { "category": "integrity", "recovery": "contact_support" }, + "registry_busy": { "category": "availability", "recovery": "retry" }, + "registry_corrupt": { "category": "integrity", "recovery": "repair_collection" }, + "registry_migration_failed": { "category": "internal", "recovery": "contact_support" }, + "registry_schema_incompatible": { "category": "compatibility", "recovery": "upgrade_connector" }, + "relay_authorization_expired": { "category": "authorization", "recovery": "reauthorize" }, + "relay_unavailable": { "category": "availability", "recovery": "retry" }, + "sandbox_unsupported": { "category": "compatibility", "recovery": "fix_request" }, + "scope_denied": { "category": "authorization", "recovery": "reauthorize" }, + "stale_file_revision": { "category": "conflict", "recovery": "refresh" }, + "storage_required": { "category": "compatibility", "recovery": "none" }, + "sync_failed": { "category": "availability", "recovery": "retry" }, + "temporarily_unavailable": { "category": "availability", "recovery": "retry" }, + "timeout": { "category": "availability", "recovery": "retry" }, + "token_exchange_failed": { "category": "availability", "recovery": "retry" }, + "transport_protocol_incompatible": { + "category": "compatibility", + "recovery": "upgrade_connector", + "details": { + "required": ["contract", "required", "supported", "peer"], + "properties": { + "contract": { "type": "string" }, + "required": { "type": "array", "items": { "type": "integer" } }, + "supported": { "type": "array", "items": { "type": "integer" } }, + "peer": { "type": "string" }, + "operation": { "type": "string" } + } + } + }, + "type_pack_provision_failed": { "category": "validation", "recovery": "repair_collection" }, + "unknown_collection": { "category": "selection", "recovery": "choose_collection" }, + "unsafe_file_path": { "category": "validation", "recovery": "fix_request" }, + "unsupported_encryption": { "category": "compatibility", "recovery": "upgrade_application" }, + "unsupported_operation": { "category": "compatibility", "recovery": "fix_request" } + } +} diff --git a/public/connect/schemas/connect-protocol.v1.schema.json b/public/connect/schemas/connect-protocol.v1.schema.json index 96e9863..54ec962 100644 --- a/public/connect/schemas/connect-protocol.v1.schema.json +++ b/public/connect/schemas/connect-protocol.v1.schema.json @@ -4,9 +4,13 @@ "title": "mdbase connect protocol 1", "description": "Canonical wire shapes shared by applications, the control plane, and connectors.", "oneOf": [ + { "$ref": "#/$defs/relayHello" }, + { "$ref": "#/$defs/relayWelcome" }, + { "$ref": "#/$defs/relayIncompatible" }, { "$ref": "#/$defs/relayOperationRequest" }, { "$ref": "#/$defs/relayOperationResponse" }, { "$ref": "#/$defs/relayPolicySnapshot" }, + { "$ref": "#/$defs/relayPolicyApplied" }, { "$ref": "#/$defs/authorizationOfferRequest" }, { "$ref": "#/$defs/authorizationOfferResponse" }, { "$ref": "#/$defs/authorizationActivationRequest" }, @@ -18,15 +22,44 @@ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "operation": { - "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "install_type_pack", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "sync"] + "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "assess_collection_setup", "apply_collection_setup", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "sync"] + }, + "connectContractRequirements": { + "type": "object", + "additionalProperties": false, + "required": ["operation_transport", "authorization_binding", "semantic_capabilities"], + "properties": { + "operation_transport": { "type": "integer", "minimum": 1 }, + "authorization_binding": { "type": "integer", "minimum": 1 }, + "semantic_capabilities": { "type": "integer", "minimum": 1 }, + "durable_mutation": { "type": "integer", "minimum": 1 } + } + }, + "connectContractSupport": { + "type": "object", + "additionalProperties": false, + "required": ["operation_transport", "authorization_binding", "semantic_capabilities", "durable_mutation"], + "properties": { + "operation_transport": { "$ref": "#/$defs/versionSet" }, + "authorization_binding": { "$ref": "#/$defs/versionSet" }, + "semantic_capabilities": { "$ref": "#/$defs/versionSet" }, + "durable_mutation": { "$ref": "#/$defs/versionSet" } + } + }, + "versionSet": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { "type": "integer", "minimum": 1 } }, "contractRequirement": { "type": "object", "additionalProperties": false, - "required": ["id", "version"], + "required": ["id", "version", "digest"], "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$" }, - "version": { "$ref": "#/$defs/semanticVersion" } + "version": { "$ref": "#/$defs/semanticVersion" }, + "digest": { "$ref": "#/$defs/digest" } } }, "semanticVersion": { @@ -75,13 +108,69 @@ "diagnostics": { "type": "array", "items": { "$ref": "#/$defs/diagnostic" } } } }, + "relayHello": { + "type": "object", + "additionalProperties": false, + "required": ["type", "protocol_version", "connector_version", "capabilities", "contract_support"], + "properties": { + "type": { "const": "relay_hello" }, + "protocol_version": { "const": 1 }, + "connector_version": { "type": "string", "minLength": 1, "maxLength": 100 }, + "capabilities": { + "type": "array", + "uniqueItems": true, + "items": { "type": "string", "minLength": 1, "maxLength": 100 } + }, + "contract_support": { "$ref": "#/$defs/connectContractSupport" } + } + }, + "relayWelcome": { + "type": "object", + "additionalProperties": false, + "required": ["type", "protocol_version", "session_id", "capabilities", "contract_support"], + "properties": { + "type": { "const": "relay_welcome" }, + "protocol_version": { "const": 1 }, + "session_id": { "type": "string", "minLength": 1, "maxLength": 100 }, + "capabilities": { + "type": "array", + "uniqueItems": true, + "items": { "type": "string", "minLength": 1, "maxLength": 100 } + }, + "contract_support": { "$ref": "#/$defs/connectContractSupport" } + } + }, + "relayIncompatible": { + "type": "object", + "additionalProperties": false, + "required": ["type", "protocol_version", "code", "message", "minimum_connector_version", "update_url"], + "properties": { + "type": { "const": "relay_incompatible" }, + "protocol_version": { "const": 1 }, + "code": { "enum": ["connector_upgrade_required", "transport_protocol_incompatible", "authorization_binding_incompatible", "capability_contract_incompatible", "durable_mutation_unsupported"] }, + "message": { "type": "string", "minLength": 1 }, + "details": { + "type": "object", + "additionalProperties": false, + "required": ["contract", "required", "supported", "peer"], + "properties": { + "contract": { "enum": ["operation_transport", "authorization_binding", "semantic_capabilities", "durable_mutation"] }, + "required": { "$ref": "#/$defs/versionSet" }, + "supported": { "type": "array", "uniqueItems": true, "items": { "type": "integer", "minimum": 1 } }, + "peer": { "const": "connector" } + } + }, + "minimum_connector_version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?$" }, + "update_url": { "type": "string", "format": "uri", "pattern": "^https://" } + } + }, "relayOperationRequest": { "type": "object", "additionalProperties": false, "required": ["type", "protocol_version", "request_id", "grant_id", "collection_id", "application_id", "operation", "input"], "properties": { "type": { "const": "operation_request" }, - "protocol_version": { "const": 1 }, + "protocol_version": { "const": 2 }, "request_id": { "$ref": "#/$defs/uuid" }, "grant_id": { "$ref": "#/$defs/uuid" }, "collection_id": { "$ref": "#/$defs/uuid" }, @@ -90,25 +179,52 @@ "input": true } }, + "operationHttpRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "request_id", "input"], + "properties": { + "protocol_version": { "const": 2 }, + "request_id": { "$ref": "#/$defs/uuid" }, + "input": true + } + }, + "operationHttpResponse": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "request_id", "ok"], + "properties": { + "protocol_version": { "const": 2 }, + "request_id": { "$ref": "#/$defs/uuid" }, + "ok": { "type": "boolean" }, + "result": true, + "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" } + }, + "allOf": [ + { + "if": { "properties": { "ok": { "const": true } }, "required": ["ok"] }, + "then": { + "required": ["result"], + "not": { "properties": { "problem": true }, "required": ["problem"] } + }, + "else": { + "required": ["problem"], + "not": { "properties": { "result": true }, "required": ["result"] } + } + } + ] + }, "relayOperationResponse": { "type": "object", "additionalProperties": false, "required": ["type", "protocol_version", "request_id", "ok"], "properties": { "type": { "const": "operation_response" }, - "protocol_version": { "const": 1 }, + "protocol_version": { "const": 2 }, "request_id": { "$ref": "#/$defs/uuid" }, "ok": { "type": "boolean" }, "result": true, - "error": { - "type": "object", - "additionalProperties": false, - "required": ["code", "message"], - "properties": { - "code": { "type": "string", "minLength": 1 }, - "message": { "type": "string" } - } - } + "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" } }, "allOf": [ { @@ -116,11 +232,11 @@ "then": { "properties": { "result": true }, "required": ["result"], - "not": { "properties": { "error": true }, "required": ["error"] } + "not": { "properties": { "problem": true }, "required": ["problem"] } }, "else": { - "properties": { "error": true }, - "required": ["error"], + "properties": { "problem": true }, + "required": ["problem"], "not": { "properties": { "result": true }, "required": ["result"] } } } @@ -129,7 +245,7 @@ "grantPolicy": { "type": "object", "additionalProperties": false, - "required": ["id", "application_id", "collection_id", "operations", "scope", "application_name", "application_homepage", "collection_name", "created_at"], + "required": ["id", "application_id", "collection_id", "operations", "scope", "application_name", "application_distribution", "application_homepage", "application_origin", "collection_name", "created_at", "encryption", "application_authorization"], "properties": { "id": { "$ref": "#/$defs/uuid" }, "application_id": { "$ref": "#/$defs/uuid" }, @@ -154,9 +270,59 @@ "items": { "$ref": "#/$defs/notificationCriterion" } }, "created_at": { "type": "string", "format": "date-time" }, - "encryption": { "$ref": "#/$defs/grantEncryption" } + "encryption": { "$ref": "#/$defs/grantEncryption" }, + "file_capability": { + "$ref": "https://mdbase.dev/connect/schemas/files.v1.json#/$defs/fileCapability" + }, + "application_authorization": { "$ref": "#/$defs/applicationAuthorizationProof" } + } + }, + "applicationAuthorizationProof": { + "type": "object", + "additionalProperties": false, + "required": ["binding", "signature"], + "properties": { + "binding": { "$ref": "#/$defs/applicationAuthorizationBinding" }, + "signature": { "type": "string", "pattern": "^[A-Za-z0-9_-]{86}$" } } }, + "applicationAuthorizationBinding": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "authorization_id", "application_id", "application_declaration_id", "application_manifest_digest", "application_installation_id", "installation_signing_public_key", "grant_agreement_public_key", "grant_signing_public_key", "flow", "authorization_nonce", "issued_at", "expires_at", "code_challenge", "contracts", "requested_operations"], + "properties": { + "protocol_version": { "const": 4 }, + "authorization_id": { "$ref": "#/$defs/uuid" }, + "application_id": { "$ref": "#/$defs/uuid" }, + "application_declaration_id": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)+$" }, + "application_manifest_digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, + "application_installation_id": { "$ref": "#/$defs/uuid" }, + "installation_signing_public_key": { "$ref": "#/$defs/p256PublicKey" }, + "grant_agreement_public_key": { "$ref": "#/$defs/p256PublicKey" }, + "grant_signing_public_key": { "$ref": "#/$defs/p256PublicKey" }, + "flow": { "enum": ["authorization_code", "device_code"] }, + "authorization_nonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }, + "issued_at": { "type": "string", "format": "date-time" }, + "expires_at": { "type": "string", "format": "date-time" }, + "redirect_uri": { "type": "string", "format": "uri" }, + "state": { "type": "string", "maxLength": 500 }, + "code_challenge": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }, + "contracts": { "$ref": "#/$defs/connectContractRequirements" }, + "requested_operations": { + "type": "array", + "uniqueItems": true, + "items": { "$ref": "#/$defs/operation" } + }, + "requested_files": { + "$ref": "https://mdbase.dev/connect/schemas/files.v1.json#/$defs/applicationFileRequirement" + }, + "collection_id": { "$ref": "#/$defs/uuid" } + } + }, + "p256PublicKey": { + "type": "string", + "pattern": "^[A-Za-z0-9_-]{87}$" + }, "authorizationCollectionOffer": { "type": "object", "additionalProperties": false, @@ -169,6 +335,11 @@ "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/collectionContract" } + }, + "types": { + "type": "array", + "maxItems": 100, + "items": { "$ref": "#/$defs/authorizationTypeCandidate" } } } }, @@ -182,7 +353,16 @@ "maxItems": 20, "items": { "$ref": "#/$defs/contractRequirement" } }, - "access": { "enum": ["contract", "full_collection"] } + "configuration": { + "type": "array", + "maxItems": 100, + "items": { "$ref": "#/$defs/configurationRequirement" } + }, + "access": { "enum": ["contract", "full_collection"] }, + "collection_kind": { "const": "hosted" }, + "files": { + "$ref": "https://mdbase.dev/connect/schemas/files.v1.json#/$defs/applicationFileRequirement" + } } }, "typePackProvision": { @@ -225,9 +405,10 @@ "typePackManifestResource": { "type": "object", "additionalProperties": false, - "required": ["kind", "source", "target", "digest"], + "required": ["kind", "mode", "source", "target", "digest"], "properties": { "kind": { "enum": ["contract", "type", "schema"] }, + "mode": { "enum": ["managed", "seed"] }, "source": { "type": "string", "minLength": 1, "maxLength": 500 }, "target": { "type": "string", "minLength": 1, "maxLength": 500 }, "digest": { "$ref": "#/$defs/digest" } @@ -251,9 +432,46 @@ "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/typePackProvision" } + }, + "configuration": { + "type": "array", + "maxItems": 100, + "items": { "$ref": "#/$defs/configurationProvision" } } } }, + "configurationRequirement": { + "type": "object", + "additionalProperties": false, + "required": ["id", "path", "predicate", "value"], + "properties": { + "id": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, + "path": { "type": "string", "pattern": "^/x-[^/]+(?:/.*)?$", "maxLength": 1024 }, + "predicate": { "const": "contains" }, + "value": { "oneOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "type": "null" } + ] } + } + }, + "configurationProvision": { + "type": "object", + "additionalProperties": false, + "required": ["requirement", "operation", "path", "value"], + "properties": { + "requirement": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, + "operation": { "const": "set_add" }, + "path": { "type": "string", "pattern": "^/x-[^/]+(?:/.*)?$", "maxLength": 1024 }, + "value": { "oneOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "type": "null" } + ] } + } + }, "authorizationOfferRequest": { "type": "object", "additionalProperties": false, @@ -262,7 +480,9 @@ "type": { "const": "authorization_offer_request" }, "protocol_version": { "const": 1 }, "request_id": { "$ref": "#/$defs/uuid" }, - "authorization_id": { "$ref": "#/$defs/uuid" } + "authorization_id": { "$ref": "#/$defs/uuid" }, + "requirements": { "$ref": "#/$defs/applicationRequirements" }, + "provisions": { "$ref": "#/$defs/applicationProvisions" } } }, "authorizationOfferResponse": { @@ -284,22 +504,29 @@ "authorizationActivationRequest": { "type": "object", "additionalProperties": false, - "required": ["type", "protocol_version", "request_id", "authorization_id", "collection_id", "requirements", "provisions", "grant"], + "required": ["type", "protocol_version", "request_id", "authorization_id", "application_declaration_id", "application_manifest_digest", "collection_id", "requirements", "provisions", "contract_setups", "grant"], "properties": { "type": { "const": "authorization_activation_request" }, "protocol_version": { "const": 1 }, "request_id": { "$ref": "#/$defs/uuid" }, "authorization_id": { "$ref": "#/$defs/uuid" }, + "application_declaration_id": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)+$" }, + "application_manifest_digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "collection_id": { "$ref": "#/$defs/uuid" }, "requirements": { "$ref": "#/$defs/applicationRequirements" }, "provisions": { "$ref": "#/$defs/applicationProvisions" }, + "contract_setups": { + "type": "array", + "maxItems": 20, + "items": { "$ref": "#/$defs/contractSetupChoice" } + }, "grant": { "$ref": "#/$defs/grantPolicy" } } }, "authorizationActivationResponse": { "type": "object", "additionalProperties": false, - "required": ["type", "protocol_version", "request_id", "ok", "contracts"], + "required": ["type", "protocol_version", "request_id", "ok", "contracts", "contract_setups"], "properties": { "type": { "const": "authorization_activation_response" }, "protocol_version": { "const": 1 }, @@ -310,6 +537,13 @@ "maxItems": 100, "items": { "$ref": "#/$defs/collectionContract" } }, + "contract_setups": { + "type": "array", + "maxItems": 20, + "items": { "$ref": "#/$defs/contractSetupChoice" } + }, + "setup_assessment": true, + "provision_receipt": true, "error": { "type": "object", "additionalProperties": false, @@ -363,7 +597,7 @@ "grantEncryption": { "type": "object", "additionalProperties": false, - "required": ["protocol_version", "suite", "key_id", "scope_epoch", "connector_id", "collection_id", "application_public_key", "connector_public_key"], + "required": ["protocol_version", "suite", "key_id", "scope_epoch", "connector_id", "collection_id", "application_agreement_public_key", "connector_agreement_public_key"], "properties": { "protocol_version": { "const": 1 }, "suite": { "const": "P256-HKDF-SHA256-AES256GCM" }, @@ -371,20 +605,51 @@ "scope_epoch": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "connector_id": { "$ref": "#/$defs/uuid" }, "collection_id": { "$ref": "#/$defs/uuid" }, - "application_public_key": { "type": "string", "minLength": 80, "maxLength": 200, "pattern": "^[A-Za-z0-9_-]+$" }, - "connector_public_key": { "type": "string", "minLength": 80, "maxLength": 200, "pattern": "^[A-Za-z0-9_-]+$" } + "application_agreement_public_key": { "type": "string", "minLength": 80, "maxLength": 200, "pattern": "^[A-Za-z0-9_-]+$" }, + "connector_agreement_public_key": { "type": "string", "minLength": 80, "maxLength": 200, "pattern": "^[A-Za-z0-9_-]+$" } } }, "relayPolicySnapshot": { "type": "object", "additionalProperties": false, - "required": ["type", "protocol_version", "grants"], + "required": ["type", "protocol_version", "request_id", "revision", "grants"], "properties": { "type": { "const": "policy_snapshot" }, "protocol_version": { "const": 1 }, + "request_id": { "$ref": "#/$defs/uuid" }, + "revision": { "$ref": "#/$defs/digest" }, "grants": { "type": "array", "items": { "$ref": "#/$defs/grantPolicy" } } } }, + "relayPolicyApplied": { + "type": "object", + "additionalProperties": false, + "required": ["type", "protocol_version", "request_id", "revision", "ok"], + "properties": { + "type": { "const": "policy_applied" }, + "protocol_version": { "const": 1 }, + "request_id": { "$ref": "#/$defs/uuid" }, + "revision": { "$ref": "#/$defs/digest" }, + "ok": { "type": "boolean" }, + "error": { + "type": "object", + "additionalProperties": false, + "required": ["code", "message"], + "properties": { + "code": { "type": "string", "minLength": 1 }, + "message": { "type": "string" }, + "details": true + } + } + }, + "allOf": [ + { + "if": { "properties": { "ok": { "const": true } }, "required": ["ok"] }, + "then": { "not": { "properties": { "error": true }, "required": ["error"] } }, + "else": { "required": ["error"] } + } + ] + }, "collectionDescription": { "type": "object", "additionalProperties": false, @@ -409,6 +674,7 @@ "name": { "type": "string", "minLength": 1 }, "version": { "type": "integer", "minimum": 1 }, "description": { "type": "string" }, + "revision": { "$ref": "#/$defs/digest" }, "path": { "type": "string", "minLength": 1, "description": "Collection-relative source path." }, "definition": { "type": "object", "description": "Complete portable type frontmatter, including extension declarations." }, "schema": { "type": "object" }, @@ -417,6 +683,19 @@ "extensions": { "type": "object" } } }, + "authorizationTypeCandidate": { + "type": "object", + "additionalProperties": false, + "required": ["name", "revision", "schema", "extensions"], + "properties": { + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "version": { "type": "integer", "minimum": 1 }, + "description": { "type": "string" }, + "revision": { "$ref": "#/$defs/digest" }, + "schema": { "type": "object" }, + "extensions": { "type": "object", "maxProperties": 0 } + } + }, "collectionContract": { "type": "object", "additionalProperties": false, @@ -451,6 +730,36 @@ "binding": { "type": "object" } } }, + "contractSetupChoice": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": ["contract", "mode"], + "properties": { + "contract": { "$ref": "#/$defs/contractRequirement" }, + "mode": { "const": "starter" } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["contract", "mode", "type_name", "type_revision", "fields"], + "properties": { + "contract": { "$ref": "#/$defs/contractRequirement" }, + "mode": { "const": "existing" }, + "type_name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "type_revision": { "$ref": "#/$defs/digest" }, + "fields": { + "type": "object", + "maxProperties": 100, + "additionalProperties": { "type": "string", "minLength": 1, "maxLength": 500 } + }, + "binding": { "type": "object" } + } + } + ] + }, "changesPage": { "type": "object", "additionalProperties": false, diff --git a/public/connect/schemas/encrypted-relay.v1.schema.json b/public/connect/schemas/encrypted-relay.v1.schema.json index 4d639c5..c4234a9 100644 --- a/public/connect/schemas/encrypted-relay.v1.schema.json +++ b/public/connect/schemas/encrypted-relay.v1.schema.json @@ -14,7 +14,7 @@ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "operation": { - "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "install_type_pack", "list_timers", "put_timer", "cancel_timer", "reconcile_timers"] + "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "assess_collection_setup", "apply_collection_setup", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "file_control"] }, "envelope": { "type": "object", @@ -51,20 +51,12 @@ "rejected": { "type": "object", "additionalProperties": false, - "required": ["type", "protocol_version", "request_id", "error"], + "required": ["type", "protocol_version", "request_id", "problem"], "properties": { "type": { "const": "encrypted_operation_rejected" }, "protocol_version": { "const": 1 }, "request_id": { "$ref": "#/$defs/uuid" }, - "error": { - "type": "object", - "additionalProperties": false, - "required": ["code", "message"], - "properties": { - "code": { "const": "encrypted_relay_rejected" }, - "message": { "type": "string" } - } - } + "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" } } } } diff --git a/public/connect/schemas/encrypted-relay.v2.schema.json b/public/connect/schemas/encrypted-relay.v2.schema.json new file mode 100644 index 0000000..b09e43f --- /dev/null +++ b/public/connect/schemas/encrypted-relay.v2.schema.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://mdbase.dev/connect/schemas/encrypted-relay.v2.json", + "title": "mdbase connect encrypted operation transport 2", + "description": "Opaque authenticated operation envelopes routed between an application and authority.", + "oneOf": [ + { "$ref": "#/$defs/request" }, + { "$ref": "#/$defs/response" }, + { "$ref": "#/$defs/rejected" } + ], + "$defs": { + "uuid": { + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + "operation": { + "enum": ["describe", "changes", "read", "query", "list_views", "execute_view", "read_view_source", "create_view_source", "update_view_source", "delete_view_source", "validate", "create", "update", "delete", "rename", "read_type", "create_type", "update_type", "assess_type_pack", "apply_type_pack", "assess_collection_setup", "apply_collection_setup", "list_timers", "put_timer", "cancel_timer", "reconcile_timers", "sync", "file_control"] + }, + "envelope": { + "type": "object", + "additionalProperties": false, + "required": ["type", "protocol_version", "suite", "request_id", "grant_id", "application_id", "connector_id", "collection_id", "operation", "scope_epoch", "key_id", "counter", "ciphertext"], + "properties": { + "type": { "enum": ["encrypted_operation_request", "encrypted_operation_response"] }, + "protocol_version": { "const": 2 }, + "suite": { "const": "P256-HKDF-SHA256-AES256GCM" }, + "request_id": { "$ref": "#/$defs/uuid" }, + "grant_id": { "$ref": "#/$defs/uuid" }, + "application_id": { "$ref": "#/$defs/uuid" }, + "connector_id": { "$ref": "#/$defs/uuid" }, + "collection_id": { "$ref": "#/$defs/uuid" }, + "operation": { "$ref": "#/$defs/operation" }, + "scope_epoch": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, + "key_id": { "type": "string", "minLength": 1, "maxLength": 200 }, + "counter": { "type": "string", "pattern": "^[1-9][0-9]{0,19}$" }, + "ciphertext": { "type": "string", "minLength": 1, "maxLength": 2800000, "pattern": "^[A-Za-z0-9_-]+$" } + } + }, + "request": { + "allOf": [ + { "$ref": "#/$defs/envelope" }, + { "type": "object", "properties": { "type": { "const": "encrypted_operation_request" } } } + ] + }, + "response": { + "allOf": [ + { "$ref": "#/$defs/envelope" }, + { "type": "object", "properties": { "type": { "const": "encrypted_operation_response" } } } + ] + }, + "rejected": { + "type": "object", + "additionalProperties": false, + "required": ["type", "protocol_version", "request_id", "problem"], + "properties": { + "type": { "const": "encrypted_operation_rejected" }, + "protocol_version": { "const": 2 }, + "request_id": { "$ref": "#/$defs/uuid" }, + "problem": { "$ref": "https://schemas.mdbase.dev/connect/problem/v1" } + } + } + } +} diff --git a/public/connect/schemas/files.v1.schema.json b/public/connect/schemas/files.v1.schema.json new file mode 100644 index 0000000..9c69cb8 --- /dev/null +++ b/public/connect/schemas/files.v1.schema.json @@ -0,0 +1,507 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://mdbase.dev/connect/schemas/files.v1.json", + "title": "mdbase connect collection file protocol 1", + "oneOf": [ + { "$ref": "#/$defs/applicationFileRequirement" }, + { "$ref": "#/$defs/selectiveSyncPolicy" }, + { "$ref": "#/$defs/fileCapability" }, + { "$ref": "#/$defs/fileDescriptor" }, + { "$ref": "#/$defs/listFilesRequest" }, + { "$ref": "#/$defs/listFilesPage" }, + { "$ref": "#/$defs/openUploadRequest" }, + { "$ref": "#/$defs/openDownloadRequest" }, + { "$ref": "#/$defs/moveFileRequest" }, + { "$ref": "#/$defs/moveFileReceipt" }, + { "$ref": "#/$defs/deleteFileRequest" }, + { "$ref": "#/$defs/deleteFileReceipt" }, + { "$ref": "#/$defs/transferSession" }, + { "$ref": "#/$defs/transferStatus" }, + { "$ref": "#/$defs/prepareUploadPartRequest" }, + { "$ref": "#/$defs/preparedPart" }, + { "$ref": "#/$defs/commitUploadRequest" }, + { "$ref": "#/$defs/commitUploadReceipt" }, + { "$ref": "#/$defs/abortTransferRequest" }, + { "$ref": "#/$defs/getTransferStatusRequest" } + ], + "$defs": { + "uuid": { "type": "string", "format": "uuid" }, + "digest": { + "type": "string", + "pattern": "^sha256:[0-9a-f]{64}$" + }, + "path": { + "type": "string", + "minLength": 1, + "maxLength": 1024, + "pattern": "^(?!/)(?!\\.)(?!.*//)(?!.*\\\\)(?!.*/\\.)(?!(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*\\/(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*/$).+$" + }, + "mediaClass": { + "enum": ["image", "audio", "video", "pdf", "other"] + }, + "selectiveSyncPolicy": { + "type": "object", + "additionalProperties": false, + "required": ["file_classes", "excluded_folders"], + "properties": { + "file_classes": { + "type": "array", + "maxItems": 5, + "uniqueItems": true, + "items": { "$ref": "#/$defs/mediaClass" } + }, + "excluded_folders": { + "type": "array", + "maxItems": 100, + "uniqueItems": true, + "items": { "$ref": "#/$defs/path" } + } + } + }, + "fileDescriptor": { + "type": "object", + "additionalProperties": false, + "required": [ + "file_id", + "path", + "revision", + "content_digest", + "size", + "media_class", + "modified_at" + ], + "properties": { + "file_id": { "$ref": "#/$defs/uuid" }, + "path": { "$ref": "#/$defs/path" }, + "revision": { "type": "string", "minLength": 1, "maxLength": 255 }, + "content_digest": { "$ref": "#/$defs/digest" }, + "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "media_type": { "type": "string", "minLength": 1, "maxLength": 255 }, + "media_class": { "$ref": "#/$defs/mediaClass" }, + "modified_at": { "type": "string", "format": "date-time" } + } + }, + "fileAction": { + "enum": ["list", "read", "add", "replace", "move", "delete"] + }, + "fileScope": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": ["kind", "folders"], + "properties": { + "kind": { "const": "selected_folders" }, + "folders": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "uniqueItems": true, + "items": { "$ref": "#/$defs/path" } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["kind"], + "properties": { "kind": { "const": "collection" } } + } + ] + }, + "applicationFileRequirement": { + "type": "object", + "additionalProperties": false, + "required": ["actions", "scope"], + "properties": { + "actions": { + "type": "array", + "minItems": 1, + "maxItems": 6, + "uniqueItems": true, + "items": { "$ref": "#/$defs/fileAction" } + }, + "scope": { "$ref": "#/$defs/fileScope" } + } + }, + "fileCapability": { + "type": "object", + "additionalProperties": false, + "required": ["kind", "protocol_version", "actions", "scope"], + "properties": { + "kind": { "const": "files" }, + "protocol_version": { "const": 1 }, + "actions": { + "type": "array", + "minItems": 1, + "maxItems": 6, + "uniqueItems": true, + "items": { "$ref": "#/$defs/fileAction" } + }, + "scope": { "$ref": "#/$defs/fileScope" } + } + }, + "listFilesRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "list_files" }, + "folder": { "$ref": "#/$defs/path" }, + "after": { "type": "string", "minLength": 1 }, + "limit": { "type": "integer", "minimum": 1, "maximum": 1000 } + } + }, + "listFilesPage": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "files"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "files_page" }, + "files": { "type": "array", "items": { "$ref": "#/$defs/fileDescriptor" } }, + "next": { "type": "string", "minLength": 1 } + } + }, + "openUploadRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id", "path", "size", "content_digest"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "open_file_upload" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "path": { "$ref": "#/$defs/path" }, + "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "content_digest": { "$ref": "#/$defs/digest" }, + "media_type": { "type": "string", "minLength": 1, "maxLength": 255 }, + "if_revision": { "type": "string", "minLength": 1, "maxLength": 255 } + } + }, + "openDownloadRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id", "file_id"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "open_file_download" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "revision": { "type": "string", "minLength": 1, "maxLength": 255 } + } + }, + "moveFileRequest": { + "type": "object", + "additionalProperties": false, + "required": [ + "protocol_version", "type", "mutation_id", "file_id", "if_revision", "from_path", "path", "update_references" + ], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "move_file" }, + "mutation_id": { "$ref": "#/$defs/uuid" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "if_revision": { "type": "string", "minLength": 1, "maxLength": 255 }, + "from_path": { "$ref": "#/$defs/path" }, + "path": { "$ref": "#/$defs/path" }, + "update_references": { "type": "boolean" } + } + }, + "moveFileReceipt": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "mutation_id", "file"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_moved" }, + "mutation_id": { "$ref": "#/$defs/uuid" }, + "file": { "$ref": "#/$defs/fileDescriptor" } + } + }, + "deleteFileRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "mutation_id", "file_id", "if_revision", "path"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "delete_file" }, + "mutation_id": { "$ref": "#/$defs/uuid" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "if_revision": { "type": "string", "minLength": 1, "maxLength": 255 }, + "path": { "$ref": "#/$defs/path" } + } + }, + "deleteFileReceipt": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "mutation_id", "file_id", "previous_path", "revision"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_deleted" }, + "mutation_id": { "$ref": "#/$defs/uuid" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "previous_path": { "$ref": "#/$defs/path" }, + "revision": { "type": "string", "minLength": 1, "maxLength": 255 } + } + }, + "transferProtection": { + "enum": ["grant_aead_v1", "transport_tls"] + }, + "transferStrategy": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": ["kind"], + "properties": { "kind": { "const": "object_put" } } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["kind", "chunk_size"], + "properties": { + "kind": { "const": "framed_chunks" }, + "chunk_size": { "type": "integer", "minimum": 65536, "maximum": 4194304 } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["kind", "part_size"], + "properties": { + "kind": { "const": "object_multipart" }, + "part_size": { "type": "integer", "minimum": 5242880, "maximum": 5368709120 } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["kind", "part_size"], + "properties": { + "kind": { "const": "object_ranges" }, + "part_size": { "type": "integer", "minimum": 65536, "maximum": 5368709120 } + } + } + ] + }, + "transferSession": { + "type": "object", + "additionalProperties": false, + "required": [ + "protocol_version", + "type", + "transfer_id", + "direction", + "protection", + "strategy", + "total_size", + "expires_at", + "received" + ], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_transfer" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "direction": { "enum": ["upload", "download"] }, + "protection": { "$ref": "#/$defs/transferProtection" }, + "strategy": { "$ref": "#/$defs/transferStrategy" }, + "total_size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "expires_at": { "type": "string", "format": "date-time" }, + "received": { + "type": "array", + "uniqueItems": true, + "items": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } + }, + "uploaded_parts": { + "type": "array", + "maxItems": 10000, + "items": { "$ref": "#/$defs/uploadedPart" } + } + } + }, + "transferStatus": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id", "state", "received", "received_bytes", "uploaded_parts"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_transfer_status" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "state": { "enum": ["open", "committed", "aborted", "expired"] }, + "received": { + "type": "array", + "uniqueItems": true, + "items": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } + }, + "received_bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "uploaded_parts": { + "type": "array", + "maxItems": 10000, + "items": { "$ref": "#/$defs/uploadedPart" } + } + } + }, + "prepareUploadPartRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id", "part_number", "content_length"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "prepare_file_upload_part" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "part_number": { "type": "integer", "minimum": 1, "maximum": 10000 }, + "content_length": { "type": "integer", "minimum": 0, "maximum": 5368709120 } + } + }, + "preparedPart": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id", "part_index", "offset", "content_length", "method", "url", "headers", "expires_at"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_part" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "part_index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "offset": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "content_length": { "type": "integer", "minimum": 0, "maximum": 5368709120 }, + "method": { "const": "PUT" }, + "url": { "type": "string", "format": "uri", "pattern": "^https://" }, + "headers": { + "type": "object", + "additionalProperties": { "type": "string" } + }, + "expires_at": { "type": "string", "format": "date-time" } + } + }, + "uploadedPart": { + "type": "object", + "additionalProperties": false, + "required": ["part_number", "etag"], + "properties": { + "part_number": { "type": "integer", "minimum": 1, "maximum": 10000 }, + "etag": { "type": "string", "minLength": 1, "maxLength": 255 } + } + }, + "commitUploadRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "commit_file_upload" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "parts": { + "type": "array", + "minItems": 1, + "maxItems": 10000, + "items": { "$ref": "#/$defs/uploadedPart" } + } + } + }, + "commitUploadReceipt": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id", "file"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_upload_committed" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "file": { "$ref": "#/$defs/fileDescriptor" } + } + }, + "abortTransferRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "abort_file_transfer" }, + "transfer_id": { "$ref": "#/$defs/uuid" } + } + }, + "relayFileHeader": { + "type": "object", + "additionalProperties": false, + "required": [ + "protocol_version", + "type", + "request_id", + "grant_id", + "transfer_id", + "chunk_index" + ], + "properties": { + "protocol_version": { "const": 1 }, + "type": { + "enum": [ + "upload_chunk", + "upload_acknowledged", + "download_request", + "download_chunk", + "rejected" + ] + }, + "request_id": { "$ref": "#/$defs/uuid" }, + "grant_id": { "$ref": "#/$defs/uuid" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "chunk_index": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991 + } + } + }, + "frameHeader": { + "type": "object", + "additionalProperties": false, + "required": [ + "protocol_version", + "protection", + "grant_id", + "authority_id", + "collection_id", + "transfer_id", + "direction", + "chunk_size", + "chunk_index", + "offset", + "plaintext_length", + "total_size", + "scope_epoch" + ], + "properties": { + "protocol_version": { "const": 1 }, + "protection": { "$ref": "#/$defs/transferProtection" }, + "grant_id": { "$ref": "#/$defs/uuid" }, + "authority_id": { "$ref": "#/$defs/uuid" }, + "collection_id": { "$ref": "#/$defs/uuid" }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "direction": { "enum": ["upload", "download"] }, + "chunk_size": { "type": "integer", "minimum": 65536, "maximum": 4194304 }, + "chunk_index": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "offset": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "plaintext_length": { "type": "integer", "minimum": 0, "maximum": 4194304 }, + "total_size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "scope_epoch": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, + "key_id": { "type": "string", "minLength": 1, "maxLength": 255 } + }, + "allOf": [ + { + "if": { "properties": { "protection": { "const": "grant_aead_v1" } } }, + "then": { "required": ["key_id"] } + } + ] + }, + "getTransferStatusRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "transfer_id"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "get_file_transfer_status" }, + "transfer_id": { "$ref": "#/$defs/uuid" } + } + } + } +} diff --git a/public/connect/schemas/mdbase-app.schema.json b/public/connect/schemas/mdbase-app.schema.json index 4044b1d..c026f7d 100644 --- a/public/connect/schemas/mdbase-app.schema.json +++ b/public/connect/schemas/mdbase-app.schema.json @@ -39,6 +39,11 @@ "additionalProperties": false, "required": ["type_packs"], "properties": { + "configuration": { + "type": "array", + "maxItems": 50, + "items": { "$ref": "#/$defs/configurationProvision" } + }, "type_packs": { "type": "array", "maxItems": 20, @@ -93,21 +98,23 @@ "contract": { "type": "object", "additionalProperties": false, - "required": ["id", "version"], + "required": ["id", "version", "digest"], "properties": { "id": { "$ref": "#/$defs/identifier" }, "version": { "type": "string", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$" - } + }, + "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } } }, "requirements": { "type": "object", "additionalProperties": false, "required": ["contracts"], - "properties": { - "access": { + "properties": { + "capabilities": { "$ref": "#/$defs/capabilityRequirements" }, + "access": { "enum": ["contract", "full_collection"], "description": "Access boundary requested after compatibility and provisioning checks." }, @@ -115,6 +122,12 @@ "const": "hosted", "description": "Require a durable provider-backed collection with direct sync support." }, + "files": { "$ref": "#/$defs/fileRequirement" }, + "configuration": { + "type": "array", + "maxItems": 50, + "items": { "$ref": "#/$defs/configurationRequirement" } + }, "contracts": { "type": "array", "maxItems": 20, @@ -123,6 +136,151 @@ } } }, + "capabilityRequirements": { + "type": "object", + "additionalProperties": false, + "required": ["contract_version", "required"], + "properties": { + "contract_version": { "const": 1 }, + "required": { + "type": "array", + "maxItems": 32, + "uniqueItems": true, + "items": { "$ref": "#/$defs/applicationCapability" } + }, + "optional": { + "type": "array", + "maxItems": 32, + "uniqueItems": true, + "items": { "$ref": "#/$defs/applicationCapability" } + } + } + }, + "configurationValue": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "type": "null" } + ] + }, + "configurationRequirement": { + "type": "object", + "additionalProperties": false, + "required": ["id", "path", "predicate", "value"], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" + }, + "path": { "type": "string", "minLength": 1, "maxLength": 1024 }, + "predicate": { "const": "contains" }, + "value": { "$ref": "#/$defs/configurationValue" } + } + }, + "configurationProvision": { + "type": "object", + "additionalProperties": false, + "required": ["requirement", "operation", "path", "value"], + "properties": { + "requirement": { + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" + }, + "operation": { "const": "set_add" }, + "path": { "type": "string", "minLength": 1, "maxLength": 1024 }, + "value": { "$ref": "#/$defs/configurationValue" } + } + }, + "applicationCapability": { + "enum": [ + "collection.inspect", + "records.watch", + "records.read", + "records.query", + "records.validate", + "records.create", + "records.update", + "records.delete", + "records.rename", + "views.list", + "views.execute", + "views.source.read", + "views.source.create", + "views.source.update", + "views.source.delete", + "definitions.contracts.current", + "definitions.read", + "definitions.create", + "definitions.update", + "definitions.type-pack.inspect", + "definitions.type-pack.apply", + "collection.setup.apply", + "timers.list", + "timers.put", + "timers.cancel", + "timers.reconcile", + "sync.offline-replica", + "notifications.background-delivery", + "files.list", + "files.read", + "files.add", + "files.replace", + "files.move", + "files.delete" + ] + }, + "fileRequirement": { + "type": "object", + "additionalProperties": false, + "required": ["actions", "scope"], + "properties": { + "actions": { + "type": "array", + "minItems": 1, + "maxItems": 6, + "uniqueItems": true, + "items": { + "enum": ["list", "read", "add", "replace", "move", "delete"] + } + }, + "scope": { "$ref": "#/$defs/fileScope" } + } + }, + "fileScope": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": ["kind", "folders"], + "properties": { + "kind": { "const": "selected_folders" }, + "folders": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "maxLength": 1024, + "pattern": "^(?!/)(?!\\.)(?!.*//)(?!.*\\\\)(?!.*/\\.)(?!(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*\\/(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*/$).+$" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["kind"], + "properties": { "kind": { "const": "collection" } } + } + ] + }, "typePackProvision": { "type": "object", "additionalProperties": false, @@ -165,9 +323,10 @@ "typePackManifestResource": { "type": "object", "additionalProperties": false, - "required": ["kind", "source", "target", "digest"], + "required": ["kind", "mode", "source", "target", "digest"], "properties": { "kind": { "enum": ["contract", "type", "schema"] }, + "mode": { "enum": ["managed", "seed"] }, "source": { "type": "string", "minLength": 1, "maxLength": 240 }, "target": { "type": "string", "minLength": 1, "maxLength": 240 }, "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } diff --git a/public/connect/schemas/mdbase-app.v1.json b/public/connect/schemas/mdbase-app.v1.json index 4044b1d..c026f7d 100644 --- a/public/connect/schemas/mdbase-app.v1.json +++ b/public/connect/schemas/mdbase-app.v1.json @@ -39,6 +39,11 @@ "additionalProperties": false, "required": ["type_packs"], "properties": { + "configuration": { + "type": "array", + "maxItems": 50, + "items": { "$ref": "#/$defs/configurationProvision" } + }, "type_packs": { "type": "array", "maxItems": 20, @@ -93,21 +98,23 @@ "contract": { "type": "object", "additionalProperties": false, - "required": ["id", "version"], + "required": ["id", "version", "digest"], "properties": { "id": { "$ref": "#/$defs/identifier" }, "version": { "type": "string", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$" - } + }, + "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } } }, "requirements": { "type": "object", "additionalProperties": false, "required": ["contracts"], - "properties": { - "access": { + "properties": { + "capabilities": { "$ref": "#/$defs/capabilityRequirements" }, + "access": { "enum": ["contract", "full_collection"], "description": "Access boundary requested after compatibility and provisioning checks." }, @@ -115,6 +122,12 @@ "const": "hosted", "description": "Require a durable provider-backed collection with direct sync support." }, + "files": { "$ref": "#/$defs/fileRequirement" }, + "configuration": { + "type": "array", + "maxItems": 50, + "items": { "$ref": "#/$defs/configurationRequirement" } + }, "contracts": { "type": "array", "maxItems": 20, @@ -123,6 +136,151 @@ } } }, + "capabilityRequirements": { + "type": "object", + "additionalProperties": false, + "required": ["contract_version", "required"], + "properties": { + "contract_version": { "const": 1 }, + "required": { + "type": "array", + "maxItems": 32, + "uniqueItems": true, + "items": { "$ref": "#/$defs/applicationCapability" } + }, + "optional": { + "type": "array", + "maxItems": 32, + "uniqueItems": true, + "items": { "$ref": "#/$defs/applicationCapability" } + } + } + }, + "configurationValue": { + "anyOf": [ + { "type": "string" }, + { "type": "number" }, + { "type": "boolean" }, + { "type": "null" } + ] + }, + "configurationRequirement": { + "type": "object", + "additionalProperties": false, + "required": ["id", "path", "predicate", "value"], + "properties": { + "id": { + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" + }, + "path": { "type": "string", "minLength": 1, "maxLength": 1024 }, + "predicate": { "const": "contains" }, + "value": { "$ref": "#/$defs/configurationValue" } + } + }, + "configurationProvision": { + "type": "object", + "additionalProperties": false, + "required": ["requirement", "operation", "path", "value"], + "properties": { + "requirement": { + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" + }, + "operation": { "const": "set_add" }, + "path": { "type": "string", "minLength": 1, "maxLength": 1024 }, + "value": { "$ref": "#/$defs/configurationValue" } + } + }, + "applicationCapability": { + "enum": [ + "collection.inspect", + "records.watch", + "records.read", + "records.query", + "records.validate", + "records.create", + "records.update", + "records.delete", + "records.rename", + "views.list", + "views.execute", + "views.source.read", + "views.source.create", + "views.source.update", + "views.source.delete", + "definitions.contracts.current", + "definitions.read", + "definitions.create", + "definitions.update", + "definitions.type-pack.inspect", + "definitions.type-pack.apply", + "collection.setup.apply", + "timers.list", + "timers.put", + "timers.cancel", + "timers.reconcile", + "sync.offline-replica", + "notifications.background-delivery", + "files.list", + "files.read", + "files.add", + "files.replace", + "files.move", + "files.delete" + ] + }, + "fileRequirement": { + "type": "object", + "additionalProperties": false, + "required": ["actions", "scope"], + "properties": { + "actions": { + "type": "array", + "minItems": 1, + "maxItems": 6, + "uniqueItems": true, + "items": { + "enum": ["list", "read", "add", "replace", "move", "delete"] + } + }, + "scope": { "$ref": "#/$defs/fileScope" } + } + }, + "fileScope": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": ["kind", "folders"], + "properties": { + "kind": { "const": "selected_folders" }, + "folders": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "maxLength": 1024, + "pattern": "^(?!/)(?!\\.)(?!.*//)(?!.*\\\\)(?!.*/\\.)(?!(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*\\/(?:_contracts|_schemas|_types|_views|node_modules)(?:/|$))(?!.*/$).+$" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["kind"], + "properties": { "kind": { "const": "collection" } } + } + ] + }, "typePackProvision": { "type": "object", "additionalProperties": false, @@ -165,9 +323,10 @@ "typePackManifestResource": { "type": "object", "additionalProperties": false, - "required": ["kind", "source", "target", "digest"], + "required": ["kind", "mode", "source", "target", "digest"], "properties": { "kind": { "enum": ["contract", "type", "schema"] }, + "mode": { "enum": ["managed", "seed"] }, "source": { "type": "string", "minLength": 1, "maxLength": 240 }, "target": { "type": "string", "minLength": 1, "maxLength": 240 }, "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } diff --git a/public/connect/schemas/mdbase-query.v0.3.schema.json b/public/connect/schemas/mdbase-query.v0.3.schema.json new file mode 100644 index 0000000..2fec377 --- /dev/null +++ b/public/connect/schemas/mdbase-query.v0.3.schema.json @@ -0,0 +1,171 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://mdbase.dev/schemas/v0.3/query.schema.json", + "title": "mdbase v0.3 query object", + "type": "object", + "properties": { + "types": { "$ref": "#/$defs/typeList" }, + "context": { "$ref": "#/$defs/queryContext" }, + "projections": { "$ref": "#/$defs/projectionSet" }, + "where": { "$ref": "#/$defs/expression" }, + "select": { "$ref": "#/$defs/select" }, + "order_by": { "$ref": "#/$defs/orderBy" }, + "group_by": { "$ref": "#/$defs/groupBy" }, + "summary_functions": { "$ref": "#/$defs/summaryFunctionSet" }, + "summaries": { "$ref": "#/$defs/summaries" }, + "limit": { "type": "integer", "minimum": 0 }, + "offset": { "type": "integer", "minimum": 0 }, + "include_body": { "type": "boolean", "default": false }, + "frontmatter_mode": { + "enum": ["effective", "persisted", "both"], + "default": "effective" + } + }, + "patternProperties": { + "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": { "$ref": "#/$defs/extension" } + }, + "additionalProperties": false, + "$defs": { + "identifier": { + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9._:-]*$" + }, + "typeName": { + "type": "string", + "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,127}$" + }, + "fieldName": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_:-]*$" + }, + "expression": { + "type": "string", + "minLength": 1 + }, + "extension": { + "type": "object", + "additionalProperties": true + }, + "typeList": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { "$ref": "#/$defs/typeName" } + }, + "queryContext": { + "type": "object", + "required": ["this"], + "properties": { + "this": { + "type": "object", + "required": ["path"], + "properties": { + "path": { "type": "string", "minLength": 1 } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "projectionSet": { + "type": "object", + "propertyNames": { "$ref": "#/$defs/fieldName" }, + "additionalProperties": { "$ref": "#/$defs/projection" } + }, + "projection": { + "type": "object", + "required": ["expr"], + "properties": { + "expr": { "$ref": "#/$defs/expression" }, + "description": { "type": "string" } + }, + "patternProperties": { + "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": { "$ref": "#/$defs/extension" } + }, + "additionalProperties": false + }, + "select": { + "type": "array", + "minItems": 1, + "items": { + "oneOf": [ + { "type": "string", "minLength": 1 }, + { "$ref": "#/$defs/selectExpression" } + ] + } + }, + "selectExpression": { + "type": "object", + "required": ["name", "expr"], + "properties": { + "name": { "$ref": "#/$defs/fieldName" }, + "expr": { "$ref": "#/$defs/expression" }, + "label": { "type": "string" }, + "description": { "type": "string" } + }, + "patternProperties": { + "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": { "$ref": "#/$defs/extension" } + }, + "additionalProperties": false + }, + "orderBy": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": ["field"], + "properties": { + "field": { "type": "string", "minLength": 1 }, + "direction": { "enum": ["asc", "desc"], "default": "asc" } + }, + "additionalProperties": false + } + }, + "groupBy": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": ["field"], + "properties": { + "field": { "type": "string", "minLength": 1 }, + "direction": { "enum": ["asc", "desc"], "default": "asc" } + }, + "additionalProperties": false + } + }, + "summaryFunctionSet": { + "type": "object", + "propertyNames": { "$ref": "#/$defs/fieldName" }, + "additionalProperties": { "$ref": "#/$defs/summaryFunction" } + }, + "summaryFunction": { + "type": "object", + "required": ["expr"], + "properties": { + "expr": { "$ref": "#/$defs/expression" }, + "description": { "type": "string" } + }, + "patternProperties": { + "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": { "$ref": "#/$defs/extension" } + }, + "additionalProperties": false + }, + "summaries": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/$defs/summary" } + }, + "summary": { + "type": "object", + "required": ["field", "function"], + "properties": { + "field": { "type": "string", "minLength": 1 }, + "function": { "$ref": "#/$defs/identifier" }, + "name": { "$ref": "#/$defs/fieldName" }, + "label": { "type": "string" } + }, + "additionalProperties": false + } + } +} diff --git a/public/connect/schemas/operation-catalog.v1.json b/public/connect/schemas/operation-catalog.v1.json new file mode 100644 index 0000000..9786e6b --- /dev/null +++ b/public/connect/schemas/operation-catalog.v1.json @@ -0,0 +1,42 @@ +{ + "catalog_version": 1, + "collection_operations": [ + { "id": "describe", "input_schema_version": 1, "mutation": "never" }, + { "id": "changes", "input_schema_version": 1, "mutation": "never" }, + { "id": "read", "input_schema_version": 1, "mutation": "never" }, + { "id": "query", "input_schema_version": 1, "mutation": "never" }, + { "id": "list_views", "input_schema_version": 1, "mutation": "never" }, + { "id": "execute_view", "input_schema_version": 1, "mutation": "never" }, + { "id": "read_view_source", "input_schema_version": 1, "mutation": "never" }, + { "id": "create_view_source", "input_schema_version": 1, "mutation": "always" }, + { "id": "update_view_source", "input_schema_version": 1, "mutation": "always" }, + { "id": "delete_view_source", "input_schema_version": 1, "mutation": "always" }, + { "id": "validate", "input_schema_version": 1, "mutation": "never" }, + { "id": "create", "input_schema_version": 1, "mutation": "always" }, + { "id": "update", "input_schema_version": 1, "mutation": "always" }, + { "id": "delete", "input_schema_version": 1, "mutation": "always" }, + { "id": "rename", "input_schema_version": 1, "mutation": "always" }, + { "id": "read_type", "input_schema_version": 1, "mutation": "never" }, + { "id": "create_type", "input_schema_version": 1, "mutation": "always" }, + { "id": "update_type", "input_schema_version": 1, "mutation": "always" }, + { "id": "assess_type_pack", "input_schema_version": 1, "mutation": "never" }, + { "id": "apply_type_pack", "input_schema_version": 1, "mutation": "always" }, + { "id": "assess_collection_setup", "input_schema_version": 1, "mutation": "never" }, + { "id": "apply_collection_setup", "input_schema_version": 1, "mutation": "always" }, + { "id": "list_timers", "input_schema_version": 1, "mutation": "never" }, + { "id": "put_timer", "input_schema_version": 1, "mutation": "always" }, + { "id": "cancel_timer", "input_schema_version": 1, "mutation": "always" }, + { "id": "reconcile_timers", "input_schema_version": 1, "mutation": "always" }, + { "id": "sync", "input_schema_version": 1, "mutation": "sync_action" } + ], + "file_control_messages": [ + { "id": "list_files", "input_schema_version": 1, "mutation": false }, + { "id": "open_file_upload", "input_schema_version": 1, "mutation": true }, + { "id": "open_file_download", "input_schema_version": 1, "mutation": false }, + { "id": "move_file", "input_schema_version": 1, "mutation": true }, + { "id": "delete_file", "input_schema_version": 1, "mutation": true }, + { "id": "get_file_transfer_status", "input_schema_version": 1, "mutation": false }, + { "id": "commit_file_upload", "input_schema_version": 1, "mutation": true }, + { "id": "abort_file_transfer", "input_schema_version": 1, "mutation": true } + ] +} diff --git a/public/connect/schemas/sync.v1.schema.json b/public/connect/schemas/sync.v1.schema.json index a845a45..baa2c55 100644 --- a/public/connect/schemas/sync.v1.schema.json +++ b/public/connect/schemas/sync.v1.schema.json @@ -5,6 +5,7 @@ "oneOf": [ { "$ref": "#/$defs/session" }, { "$ref": "#/$defs/snapshotPage" }, + { "$ref": "#/$defs/fileSnapshotPage" }, { "$ref": "#/$defs/changesPage" }, { "$ref": "#/$defs/mutation" }, { "$ref": "#/$defs/receipt" } @@ -19,6 +20,9 @@ "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }, + "fileDescriptor": { + "$ref": "https://mdbase.dev/connect/schemas/files.v1.json#/$defs/fileDescriptor" + }, "collectionType": { "type": "object", "additionalProperties": false, @@ -85,30 +89,46 @@ "required": ["path", "kind", "revision", "document"], "properties": { "path": { "type": "string", "minLength": 1 }, - "kind": { "enum": ["configuration", "type", "contract", "schema", "view"] }, - "revision": { "type": "string", "minLength": 1 }, + "kind": { "enum": ["configuration", "lock", "type", "contract", "schema", "view"] }, + "revision": { "$ref": "#/$defs/digest" }, "document": { "type": "string" } } }, "record": { "type": "object", "additionalProperties": false, - "required": ["record_id", "path", "revision", "frontmatter", "body", "types"], + "required": ["record_id", "path", "document", "revision", "frontmatter", "body", "types"], "properties": { "record_id": { "$ref": "#/$defs/uuid" }, "path": { "type": "string", "minLength": 1 }, - "revision": { "type": "string", "minLength": 1 }, + "document": { "type": "string" }, + "revision": { "$ref": "#/$defs/digest" }, "frontmatter": { "type": "object" }, "body": { "type": "string" }, "types": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } } } }, + "snapshotRecord": { + "type": "object", + "additionalProperties": false, + "required": ["record_id", "path", "document", "revision", "frontmatter", "body", "types"], + "properties": { + "record_id": { "$ref": "#/$defs/uuid" }, + "path": { "type": "string", "minLength": 1 }, + "revision": { "$ref": "#/$defs/digest" }, + "frontmatter": { "type": "object" }, + "body": { "type": "string" }, + "types": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }, + "document": { "type": "string" } + } + }, "session": { "type": "object", "additionalProperties": false, - "required": ["protocol_version", "session_id", "replica_id", "collection_id", "mode", "scope_epoch", "retained_after", "head", "snapshot_id", "resources"], + "required": ["protocol_version", "protocol_profile", "session_id", "replica_id", "collection_id", "mode", "scope_epoch", "retained_after", "head", "snapshot_id", "resources"], "properties": { "protocol_version": { "const": 1 }, + "protocol_profile": { "const": "exact_document_v1" }, "session_id": { "$ref": "#/$defs/uuid" }, "replica_id": { "$ref": "#/$defs/uuid" }, "collection_id": { "$ref": "#/$defs/uuid" }, @@ -129,7 +149,21 @@ "snapshot_id": { "$ref": "#/$defs/uuid" }, "scope_epoch": { "type": "integer", "minimum": 1 }, "cursor": { "type": "integer", "minimum": 0 }, - "records": { "type": "array", "items": { "$ref": "#/$defs/record" } }, + "records": { "type": "array", "items": { "$ref": "#/$defs/snapshotRecord" } }, + "next_page": { "type": "string", "pattern": "^[1-9][0-9]*$" } + } + }, + "fileSnapshotPage": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "snapshot_id", "scope_epoch", "cursor", "files"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_snapshot_page" }, + "snapshot_id": { "$ref": "#/$defs/uuid" }, + "scope_epoch": { "type": "integer", "minimum": 1 }, + "cursor": { "type": "integer", "minimum": 0 }, + "files": { "type": "array", "items": { "$ref": "#/$defs/fileDescriptor" } }, "next_page": { "type": "string", "pattern": "^[1-9][0-9]*$" } } }, @@ -155,6 +189,28 @@ "revision": { "type": "string", "minLength": 1 } } }, + "filePut": { + "type": "object", + "additionalProperties": false, + "required": ["sequence", "type", "file"], + "properties": { + "sequence": { "type": "integer", "minimum": 1 }, + "type": { "const": "file_put" }, + "file": { "$ref": "#/$defs/fileDescriptor" } + } + }, + "fileRemove": { + "type": "object", + "additionalProperties": false, + "required": ["sequence", "type", "file_id", "previous_path", "revision"], + "properties": { + "sequence": { "type": "integer", "minimum": 1 }, + "type": { "const": "file_remove" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "previous_path": { "type": "string", "minLength": 1 }, + "revision": { "type": "string", "minLength": 1 } + } + }, "changesPage": { "type": "object", "additionalProperties": false, @@ -162,30 +218,143 @@ "properties": { "protocol_version": { "const": 1 }, "scope_epoch": { "type": "integer", "minimum": 1 }, - "events": { "type": "array", "items": { "oneOf": [{ "$ref": "#/$defs/put" }, { "$ref": "#/$defs/remove" }] } }, + "events": { + "type": "array", + "items": { + "oneOf": [ + { "$ref": "#/$defs/put" }, + { "$ref": "#/$defs/remove" }, + { "$ref": "#/$defs/filePut" }, + { "$ref": "#/$defs/fileRemove" } + ] + } + }, "cursor": { "type": "integer", "minimum": 0 }, "head": { "type": "integer", "minimum": 0 }, "has_more": { "type": "boolean" }, "reset_required": { "type": "boolean" } } }, - "mutation": { + "recordPutMutation": { "type": "object", "additionalProperties": false, - "required": ["mutation_id", "replica_id", "scope_epoch", "operation", "record_id", "input", "created_at"], + "required": ["mutation_id", "replica_id", "scope_epoch", "operation", "record_id", "path", "document", "created_at"], "properties": { "mutation_id": { "$ref": "#/$defs/uuid" }, "replica_id": { "$ref": "#/$defs/uuid" }, "scope_epoch": { "type": "integer", "minimum": 1 }, - "operation": { "enum": ["create", "update", "rename", "delete"] }, + "operation": { "const": "put" }, "record_id": { "$ref": "#/$defs/uuid" }, "base_revision": { "type": "string", "minLength": 1 }, - "input": { "type": "object" }, + "path": { "type": "string", "minLength": 1 }, + "document": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "causal_predecessor": { "$ref": "#/$defs/uuid" } } }, - "receipt": { + "recordDeleteMutation": { + "type": "object", + "additionalProperties": false, + "required": ["mutation_id", "replica_id", "scope_epoch", "operation", "record_id", "base_revision", "created_at"], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "replica_id": { "$ref": "#/$defs/uuid" }, + "scope_epoch": { "type": "integer", "minimum": 1 }, + "operation": { "const": "delete" }, + "record_id": { "$ref": "#/$defs/uuid" }, + "base_revision": { "type": "string", "minLength": 1 }, + "created_at": { "type": "string", "format": "date-time" }, + "causal_predecessor": { "$ref": "#/$defs/uuid" } + } + }, + "recordMoveMutation": { + "type": "object", + "additionalProperties": false, + "required": ["mutation_id", "replica_id", "scope_epoch", "operation", "record_id", "base_revision", "path", "created_at"], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "replica_id": { "$ref": "#/$defs/uuid" }, + "scope_epoch": { "type": "integer", "minimum": 1 }, + "operation": { "const": "move" }, + "record_id": { "$ref": "#/$defs/uuid" }, + "base_revision": { "type": "string", "minLength": 1 }, + "path": { "type": "string", "minLength": 1 }, + "created_at": { "type": "string", "format": "date-time" }, + "causal_predecessor": { "$ref": "#/$defs/uuid" } + } + }, + "filePutMutation": { + "type": "object", + "additionalProperties": false, + "required": [ + "mutation_id", "replica_id", "scope_epoch", "operation", "file_id", + "path", "transfer_id", "content_digest", "size", "created_at" + ], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "replica_id": { "$ref": "#/$defs/uuid" }, + "scope_epoch": { "type": "integer", "minimum": 1 }, + "operation": { "const": "file_put" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "base_revision": { "type": "string", "minLength": 1 }, + "path": { "type": "string", "minLength": 1 }, + "transfer_id": { "$ref": "#/$defs/uuid" }, + "content_digest": { "$ref": "#/$defs/digest" }, + "size": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "media_type": { "type": "string", "minLength": 1, "maxLength": 255 }, + "created_at": { "type": "string", "format": "date-time" }, + "causal_predecessor": { "$ref": "#/$defs/uuid" } + } + }, + "fileMoveMutation": { + "type": "object", + "additionalProperties": false, + "required": [ + "mutation_id", "replica_id", "scope_epoch", "operation", "file_id", + "base_revision", "path", "update_references", "created_at" + ], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "replica_id": { "$ref": "#/$defs/uuid" }, + "scope_epoch": { "type": "integer", "minimum": 1 }, + "operation": { "const": "file_move" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "base_revision": { "type": "string", "minLength": 1 }, + "path": { "type": "string", "minLength": 1 }, + "update_references": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" }, + "causal_predecessor": { "$ref": "#/$defs/uuid" } + } + }, + "fileDeleteMutation": { + "type": "object", + "additionalProperties": false, + "required": [ + "mutation_id", "replica_id", "scope_epoch", "operation", "file_id", + "base_revision", "created_at" + ], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "replica_id": { "$ref": "#/$defs/uuid" }, + "scope_epoch": { "type": "integer", "minimum": 1 }, + "operation": { "const": "file_delete" }, + "file_id": { "$ref": "#/$defs/uuid" }, + "base_revision": { "type": "string", "minLength": 1 }, + "created_at": { "type": "string", "format": "date-time" }, + "causal_predecessor": { "$ref": "#/$defs/uuid" } + } + }, + "mutation": { + "oneOf": [ + { "$ref": "#/$defs/recordPutMutation" }, + { "$ref": "#/$defs/recordMoveMutation" }, + { "$ref": "#/$defs/recordDeleteMutation" }, + { "$ref": "#/$defs/filePutMutation" }, + { "$ref": "#/$defs/fileMoveMutation" }, + { "$ref": "#/$defs/fileDeleteMutation" } + ] + }, + "recordReceipt": { "oneOf": [ { "type": "object", @@ -211,7 +380,13 @@ "required": ["record_id", "mutation"], "properties": { "record_id": { "$ref": "#/$defs/uuid" }, - "mutation": { "$ref": "#/$defs/mutation" }, + "mutation": { + "oneOf": [ + { "$ref": "#/$defs/recordPutMutation" }, + { "$ref": "#/$defs/recordMoveMutation" }, + { "$ref": "#/$defs/recordDeleteMutation" } + ] + }, "current": { "$ref": "#/$defs/record" }, "current_revision": { "type": "string" } } @@ -237,6 +412,72 @@ } } ] + }, + "fileConflict": { + "type": "object", + "additionalProperties": false, + "required": ["file_id", "mutation"], + "properties": { + "file_id": { "$ref": "#/$defs/uuid" }, + "mutation": { + "oneOf": [ + { "$ref": "#/$defs/filePutMutation" }, + { "$ref": "#/$defs/fileMoveMutation" }, + { "$ref": "#/$defs/fileDeleteMutation" } + ] + }, + "current": { "$ref": "#/$defs/fileDescriptor" }, + "current_revision": { "type": "string", "minLength": 1 } + } + }, + "fileReceipt": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": ["mutation_id", "status", "sequence"], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "status": { "enum": ["file_applied", "file_previously_applied"] }, + "sequence": { "type": "integer", "minimum": 1 }, + "file": { "$ref": "#/$defs/fileDescriptor" } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["mutation_id", "status", "conflict"], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "status": { "const": "file_conflicted" }, + "conflict": { "$ref": "#/$defs/fileConflict" } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["mutation_id", "status", "error"], + "properties": { + "mutation_id": { "$ref": "#/$defs/uuid" }, + "status": { "const": "file_rejected" }, + "error": { + "type": "object", + "additionalProperties": false, + "required": ["code", "message"], + "properties": { + "code": { "type": "string", "minLength": 1 }, + "message": { "type": "string" } + } + } + } + } + ] + }, + "receipt": { + "oneOf": [ + { "$ref": "#/$defs/recordReceipt" }, + { "$ref": "#/$defs/fileReceipt" } + ] } } } diff --git a/public/mdbase-theme.css b/public/mdbase-theme.css index 2eaf03d..b70e4ad 100644 --- a/public/mdbase-theme.css +++ b/public/mdbase-theme.css @@ -7,6 +7,7 @@ --color-canvas: oklch(99.5% 0.002 255); --color-surface: oklch(99.5% 0.002 255); --color-surface-subtle: oklch(97.5% 0.004 255); + --color-selected: oklch(96.4% 0.016 238); --color-text: oklch(21% 0.018 255); --color-text-soft: oklch(39% 0.016 255); --color-text-muted: oklch(54% 0.014 255); @@ -21,6 +22,7 @@ --color-scrim: oklch(20% 0.006 250 / 0.22); --paper: var(--color-surface); --hover: var(--color-surface-subtle); + --selected: var(--color-selected); --ink: var(--color-text); --ink-soft: var(--color-text-soft); --muted: var(--color-text-muted); @@ -42,6 +44,7 @@ --color-canvas: oklch(17.5% 0.012 255); --color-surface: oklch(19.5% 0.012 255); --color-surface-subtle: oklch(23.5% 0.014 255); + --color-selected: oklch(27% 0.035 238); --color-text: oklch(92% 0.008 255); --color-text-soft: oklch(80% 0.01 255); --color-text-muted: oklch(68% 0.012 255); @@ -62,6 +65,7 @@ --color-canvas: oklch(17.5% 0.012 255); --color-surface: oklch(19.5% 0.012 255); --color-surface-subtle: oklch(23.5% 0.014 255); + --color-selected: oklch(27% 0.035 238); --color-text: oklch(92% 0.008 255); --color-text-soft: oklch(80% 0.01 255); --color-text-muted: oklch(68% 0.012 255); diff --git a/site-sources.json b/site-sources.json index 9321a00..afcf58a 100644 --- a/site-sources.json +++ b/site-sources.json @@ -5,7 +5,7 @@ }, "connect": { "repository": "mdbase-dev/mdbase-connect", - "ref": "1f332e95784942163652100d4edf78216efa5419" + "ref": "673e9e1ddab2a2a50a7cdb1506fd2a15ac4b61ef" }, "contracts": { "repository": "mdbase-dev/mdbase-contracts", diff --git a/src/components/DocsLayout.astro b/src/components/DocsLayout.astro index fb555f0..b334452 100644 --- a/src/components/DocsLayout.astro +++ b/src/components/DocsLayout.astro @@ -65,8 +65,8 @@ const docGroups = [
- @mdbase/connect - 0.1.0-beta.12 + @mdbase-dev/connect + 0.1.0-beta.55
diff --git a/src/data/conformance.json b/src/data/conformance.json index d818d2d..7416114 100644 --- a/src/data/conformance.json +++ b/src/data/conformance.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-07-29", + "generated_at": "2026-08-10", "spec_version": "0.3.0", "implementations": [ { diff --git a/src/pages/downloads/index.astro b/src/pages/downloads/index.astro index 3dcdf1d..4935dd7 100644 --- a/src/pages/downloads/index.astro +++ b/src/pages/downloads/index.astro @@ -1,7 +1,7 @@ --- import BaseLayout from "../../layouts/BaseLayout.astro"; -const version = "0.1.0-beta.46"; +const version = "0.1.0-beta.54"; const tag = `v${version}`; const releaseBase = `https://github.com/mdbase-dev/mdbase-connect/releases/download/${tag}`; const releasePage = `https://github.com/mdbase-dev/mdbase-connect/releases/tag/${tag}`; @@ -95,7 +95,7 @@ const cliDownloads = [

Version {version} - Published + Published
diff --git a/src/pages/sdk/api/index.astro b/src/pages/sdk/api/index.astro index 7c382b1..a5f8e09 100644 --- a/src/pages/sdk/api/index.astro +++ b/src/pages/sdk/api/index.astro @@ -33,7 +33,7 @@ const error = `try { ) { return client.queryAll({ @@ -25,7 +25,7 @@ export async function listOpenTasks(client: MdbaseCollectionClient) { ]} >

- @mdbase/connect is the browser and native-shell SDK for + @mdbase-dev/connect is the browser and native-shell SDK for applications that operate on one user-approved local or hosted mdbase collection. The application asks for exact operations. Connect selects the route and the collection authority checks the current grant. @@ -109,12 +109,12 @@ export async function listOpenTasks(client: MdbaseCollectionClient) { createSandbox() Fast frontend tests for CRUD, revisions, pagination, defaults, and change cursors - @mdbase/connect-dev + @mdbase-dev/connect-dev OfflineReplica Offline-first applications backed by any sync-capable authority - @mdbase/connect-sync + @mdbase-dev/connect-sync @@ -158,23 +158,23 @@ export async function listOpenTasks(client: MdbaseCollectionClient) { - @mdbase/connect + @mdbase-dev/connect Authorization, routes, operations, notifications, and authority-neutral sync handoff - @mdbase/connect-dev + @mdbase-dev/connect-dev Manifest validation, contract validation, and deterministic sandbox transport - @mdbase/connect-protocol + @mdbase-dev/connect-protocol Shared TypeScript types and canonical JSON Schemas - @mdbase/connect-sync + @mdbase-dev/connect-sync Authority-neutral replication state machine, IndexedDB replica, conflicts, and offline mutations - @mdbase/connect-webhooks + @mdbase-dev/connect-webhooks Server-side verification for signed notification webhooks diff --git a/src/pages/sdk/notifications/index.astro b/src/pages/sdk/notifications/index.astro index e1240bc..5976040 100644 --- a/src/pages/sdk/notifications/index.astro +++ b/src/pages/sdk/notifications/index.astro @@ -33,7 +33,7 @@ await connection.registerNotifications({ criteria: ["task.changed"] });`; -const serviceWorker = `import { showMdbasePushNotification } from "@mdbase/connect"; +const serviceWorker = `import { showMdbasePushNotification } from "@mdbase-dev/connect"; self.addEventListener("push", (event) => { event.waitUntil( @@ -54,7 +54,7 @@ const timers = `await connection.reconcileTimers({ }] });`; -const webhook = `import { verifyNotificationWebhook } from "@mdbase/connect-webhooks"; +const webhook = `import { verifyNotificationWebhook } from "@mdbase-dev/connect-webhooks"; const event = verifyNotificationWebhook({ body: rawRequestBody, diff --git a/src/pages/sdk/offline-sync/index.astro b/src/pages/sdk/offline-sync/index.astro index 741c8a2..ff29e2b 100644 --- a/src/pages/sdk/offline-sync/index.astro +++ b/src/pages/sdk/offline-sync/index.astro @@ -6,7 +6,7 @@ const createReplica = `import { IndexedDbReplicaStore, OfflineReplica, type ReplicaData -} from "@mdbase/connect-sync"; +} from "@mdbase-dev/connect-sync"; const sync = connection.sync(); if (!sync) { @@ -76,7 +76,7 @@ const promote = `mdbase-mirror promote ./worklog-mirror`;

Add both packages: - @mdbase/connect and @mdbase/connect-sync. + @mdbase-dev/connect and @mdbase-dev/connect-sync.

Create a persistent replica

diff --git a/src/pages/sdk/portable-apps/index.astro b/src/pages/sdk/portable-apps/index.astro index fe95d26..ab62a03 100644 --- a/src/pages/sdk/portable-apps/index.astro +++ b/src/pages/sdk/portable-apps/index.astro @@ -15,8 +15,8 @@ const manifest = `{ }`; const browserBundle = ``; const application = ` @@ -69,13 +69,11 @@ const application = ` >

Release status

- Implemented in Connect v1; npm publication is pending. + Available in the production Connect SDK.

The production service accepts the portable manifest and device flow. - The version-pinned CDN URL below becomes available when - {" "}@mdbase/connect and - {" "}@mdbase/connect-protocol are published. Until then, build - the browser artifact from the Connect repository for development. + The version-pinned CDN URL below uses the beta.55 package, matching the + production service release.

@@ -151,7 +149,7 @@ const application = ` dist/browser/integrity.json dist/browser/mdbase-connect.min.js.sha384`} language="text" - label="@mdbase/connect package" + label="@mdbase-dev/connect package" />

Use an exact package version and copy the integrity value from that same diff --git a/src/pages/sdk/quickstart/index.astro b/src/pages/sdk/quickstart/index.astro index e0881e0..816718d 100644 --- a/src/pages/sdk/quickstart/index.astro +++ b/src/pages/sdk/quickstart/index.astro @@ -13,8 +13,8 @@ const download = `curl -fsSLo packages/devkit/sandbox-quickstart.mjs \\ node packages/devkit/sandbox-quickstart.mjs`; -const example = `import { unwrapOperation } from "@mdbase/connect"; -import { createSandbox } from "@mdbase/connect-dev"; +const example = `import { unwrapOperation } from "@mdbase-dev/connect"; +import { createSandbox } from "@mdbase-dev/connect-dev"; const { client, transport } = createSandbox({ records: [{ diff --git a/src/pages/sdk/testing/index.astro b/src/pages/sdk/testing/index.astro index 72d3a70..dbd8c99 100644 --- a/src/pages/sdk/testing/index.astro +++ b/src/pages/sdk/testing/index.astro @@ -2,8 +2,8 @@ import DocsLayout from "../../../components/DocsLayout.astro"; import CodeBlock from "../../../components/CodeBlock.astro"; -const sandbox = `import { createSandbox } from "@mdbase/connect-dev"; -import type { JsonObject } from "@mdbase/connect"; +const sandbox = `import { createSandbox } from "@mdbase-dev/connect-dev"; +import type { JsonObject } from "@mdbase-dev/connect"; interface Task extends JsonObject { type: "task";