diff --git a/public/connect/schemas/application-capability-catalog.v1.json b/public/connect/schemas/application-capability-catalog.v1.json new file mode 100644 index 0000000..f827e77 --- /dev/null +++ b/public/connect/schemas/application-capability-catalog.v1.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "catalog_version": 1, + "capabilities": [ + { "id": "collection.inspect", "operations": ["describe"] }, + { "id": "records.watch", "operations": ["changes"] }, + { "id": "records.read", "operations": ["read"] }, + { "id": "records.query", "operations": ["query"] }, + { "id": "records.validate", "operations": ["validate"] }, + { "id": "records.create", "operations": ["create"] }, + { "id": "records.update", "operations": ["update"] }, + { "id": "records.delete", "operations": ["delete"] }, + { "id": "records.rename", "operations": ["rename"] }, + { "id": "views.list", "operations": ["list_views"] }, + { "id": "views.execute", "operations": ["execute_view"] }, + { "id": "views.source.read", "operations": ["read_view_source"] }, + { "id": "views.source.create", "operations": ["create_view_source"] }, + { "id": "views.source.update", "operations": ["update_view_source"] }, + { "id": "views.source.delete", "operations": ["delete_view_source"] }, + { "id": "definitions.contracts.current", "operations": [] }, + { "id": "definitions.read", "operations": ["read_type"] }, + { "id": "definitions.create", "operations": ["create_type"] }, + { "id": "definitions.update", "operations": ["update_type"] }, + { "id": "definitions.type-pack.inspect", "operations": ["assess_type_pack"] }, + { "id": "definitions.type-pack.apply", "operations": ["assess_type_pack", "apply_type_pack"] }, + { "id": "collection.setup.apply", "operations": ["assess_collection_setup", "apply_collection_setup"] }, + { "id": "timers.list", "operations": ["list_timers"] }, + { "id": "timers.put", "operations": ["put_timer"] }, + { "id": "timers.cancel", "operations": ["cancel_timer"] }, + { "id": "timers.reconcile", "operations": ["reconcile_timers"] }, + { "id": "sync.offline-replica", "operations": ["sync"] }, + { "id": "notifications.background-delivery", "operations": [] }, + { "id": "files.list", "operations": [] }, + { "id": "files.read", "operations": [] }, + { "id": "files.add", "operations": [] }, + { "id": "files.replace", "operations": [] }, + { "id": "files.move", "operations": [] }, + { "id": "files.delete", "operations": [] } + ] +} diff --git a/public/connect/schemas/application-capability-catalog.v2.json b/public/connect/schemas/application-capability-catalog.v2.json new file mode 100644 index 0000000..a8d50de --- /dev/null +++ b/public/connect/schemas/application-capability-catalog.v2.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "catalog_version": 2, + "capabilities": [ + { + "id": "collection.read", + "operations": [ + "describe", + "changes", + "read", + "query", + "list_views", + "execute_view", + "read_view_source", + "validate", + "read_type" + ] + }, + { + "id": "records.create", + "operations": ["create"] + }, + { + "id": "records.edit", + "operations": ["update", "rename"] + }, + { + "id": "records.delete", + "operations": ["delete"] + }, + { + "id": "views.manage", + "operations": [ + "create_view_source", + "update_view_source", + "delete_view_source" + ] + }, + { + "id": "definitions.manage", + "operations": [ + "create_type", + "update_type", + "assess_type_pack", + "apply_type_pack" + ] + }, + { + "id": "background.schedule", + "operations": [ + "list_timers", + "put_timer", + "cancel_timer", + "reconcile_timers" + ] + }, + { + "id": "offline.replica", + "operations": ["sync"] + } + ], + "structured_authorities": { + "application_setup": [ + "assess_collection_setup", + "apply_collection_setup" + ] + } +} diff --git a/public/connect/schemas/catalog.json b/public/connect/schemas/catalog.json index 8aef714..4e77eb6 100644 --- a/public/connect/schemas/catalog.json +++ b/public/connect/schemas/catalog.json @@ -8,7 +8,8 @@ "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", + "encrypted_relay": "./encrypted-relay.v3.schema.json", + "encrypted_relay_legacy_v2": "./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/change-events.v1.json b/public/connect/schemas/change-events.v1.json new file mode 100644 index 0000000..ef40ee0 --- /dev/null +++ b/public/connect/schemas/change-events.v1.json @@ -0,0 +1,48 @@ +{ + "version": 1, + "events": { + "mdbase.record.created": "record.created", + "mdbase.record.modified": "record.updated", + "mdbase.record.deleted": "record.deleted", + "mdbase.record.renamed": "record.renamed", + "mdbase.type.changed": "schema.changed", + "mdbase.config.changed": "config.changed", + "mdbase.contract.changed": "contract.changed", + "mdbase.view.changed": "view.changed", + "mdbase.view_source.changed": "view.changed", + "mdbase.resource.changed": "file.changed", + "mdbase.file.put": "file.put", + "mdbase.file.remove": "file.removed", + "file_put": "file.put", + "file_remove": "file.removed", + "mdbase.collection.invalidated": "gap" + }, + "payloads": { + "RecordChangePayload": { + "path": "string", + "from": "string", + "to": "string", + "previous_revision": "string", + "revision": "string", + "previous_types": "strings", + "types": "strings", + "changed_fields": "strings", + "body_changed": "boolean", + "before": "object", + "after": "object" + }, + "ResourceChangePayload": { + "name": "string", + "path": "string", + "previous_revision": "string", + "revision": "string", + "reason": "string" + }, + "FileChangePayload": { + "file": "file", + "file_id": "string", + "previous_path": "string", + "revision": "string" + } + } +} diff --git a/public/connect/schemas/connect-problem.v1.schema.json b/public/connect/schemas/connect-problem.v1.schema.json index 159d551..d6dd0cb 100644 --- a/public/connect/schemas/connect-problem.v1.schema.json +++ b/public/connect/schemas/connect-problem.v1.schema.json @@ -93,6 +93,46 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "application_declaration_mismatch" + }, + "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, @@ -1244,6 +1284,46 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "connector_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, @@ -1374,6 +1454,46 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "cursor_capacity_exhausted" + }, + "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, @@ -1768,6 +1888,86 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "file_index_warming" + }, + "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": "file_list_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, @@ -1968,6 +2168,86 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "fresh_request_required" + }, + "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": "generation_expired" + }, + "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, @@ -2595,6 +2875,46 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "invalid_read_cursor" + }, + "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, @@ -2675,6 +2995,46 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "legacy_scope_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, @@ -4128,6 +4488,126 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "problem_version", + "code", + "category", + "recovery", + "message" + ], + "properties": { + "problem_version": { + "const": 1 + }, + "code": { + "const": "session_destroyed" + }, + "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": "session_not_started" + }, + "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": "session_starting" + }, + "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, diff --git a/public/connect/schemas/connect-problems.v1.catalog.json b/public/connect/schemas/connect-problems.v1.catalog.json index bffce07..808a84f 100644 --- a/public/connect/schemas/connect-problems.v1.catalog.json +++ b/public/connect/schemas/connect-problems.v1.catalog.json @@ -37,6 +37,7 @@ } }, "access_paused": { "category": "availability", "recovery": "resume_connector_access" }, + "application_declaration_mismatch": { "category": "authorization", "recovery": "reauthorize" }, "application_identity_unavailable": { "category": "compatibility", "recovery": "upgrade_application" }, "approval_window_blocked": { "category": "authorization", @@ -156,6 +157,7 @@ } }, "concurrent_modification": { "category": "conflict", "recovery": "refresh" }, + "connector_busy": { "category": "availability", "recovery": "retry" }, "connector_identity_changed": { "category": "integrity", "recovery": "reauthorize" }, "connector_offline": { "category": "availability", @@ -168,6 +170,7 @@ } }, "connector_upgrade_required": { "category": "compatibility", "recovery": "upgrade_connector" }, + "cursor_capacity_exhausted": { "category": "availability", "recovery": "retry" }, "device_authorization_failed": { "category": "authorization", "recovery": "reauthorize" }, "direct_operation_rejected": { "category": "authorization", "recovery": "reauthorize" }, "discovery_failed": { "category": "availability", "recovery": "retry" }, @@ -190,11 +193,15 @@ "expired_token": { "category": "authorization", "recovery": "reauthorize" }, "file_changed_during_move": { "category": "conflict", "recovery": "refresh" }, "file_changed_during_read": { "category": "conflict", "recovery": "refresh" }, + "file_index_warming": { "category": "availability", "recovery": "retry" }, + "file_list_changed": { "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" }, + "fresh_request_required": { "category": "availability", "recovery": "retry" }, + "generation_expired": { "category": "conflict", "recovery": "refresh" }, "hosted_provider_unavailable": { "category": "availability", "recovery": "retry" }, "insufficient_access": { "category": "authorization", @@ -241,8 +248,10 @@ "invalid_preflight": { "category": "conflict", "recovery": "refresh" }, "invalid_push_payload": { "category": "validation", "recovery": "fix_request" }, "invalid_push_subscription": { "category": "validation", "recovery": "fix_request" }, + "invalid_read_cursor": { "category": "validation", "recovery": "fix_request" }, "invalid_request": { "category": "validation", "recovery": "fix_request" }, "invalid_token_response": { "category": "integrity", "recovery": "contact_support" }, + "legacy_scope_reauthorization_required": { "category": "authorization", "recovery": "reauthorize" }, "managed_fcm_not_declared": { "category": "compatibility", "recovery": "fix_request" }, "manifest_load_failed": { "category": "availability", "recovery": "retry" }, "manifest_required": { "category": "validation", "recovery": "fix_request" }, @@ -311,6 +320,9 @@ "relay_unavailable": { "category": "availability", "recovery": "retry" }, "sandbox_unsupported": { "category": "compatibility", "recovery": "fix_request" }, "scope_denied": { "category": "authorization", "recovery": "reauthorize" }, + "session_destroyed": { "category": "cancellation", "recovery": "none" }, + "session_not_started": { "category": "validation", "recovery": "fix_request" }, + "session_starting": { "category": "availability", "recovery": "retry" }, "stale_file_revision": { "category": "conflict", "recovery": "refresh" }, "storage_required": { "category": "compatibility", "recovery": "none" }, "sync_failed": { "category": "availability", "recovery": "retry" }, diff --git a/public/connect/schemas/connect-protocol.v1.schema.json b/public/connect/schemas/connect-protocol.v1.schema.json index 54ec962..4659ad1 100644 --- a/public/connect/schemas/connect-protocol.v1.schema.json +++ b/public/connect/schemas/connect-protocol.v1.schema.json @@ -170,7 +170,7 @@ "required": ["type", "protocol_version", "request_id", "grant_id", "collection_id", "application_id", "operation", "input"], "properties": { "type": { "const": "operation_request" }, - "protocol_version": { "const": 2 }, + "protocol_version": { "const": 3 }, "request_id": { "$ref": "#/$defs/uuid" }, "grant_id": { "$ref": "#/$defs/uuid" }, "collection_id": { "$ref": "#/$defs/uuid" }, @@ -184,7 +184,7 @@ "additionalProperties": false, "required": ["protocol_version", "request_id", "input"], "properties": { - "protocol_version": { "const": 2 }, + "protocol_version": { "const": 3 }, "request_id": { "$ref": "#/$defs/uuid" }, "input": true } @@ -194,7 +194,7 @@ "additionalProperties": false, "required": ["protocol_version", "request_id", "ok"], "properties": { - "protocol_version": { "const": 2 }, + "protocol_version": { "const": 3 }, "request_id": { "$ref": "#/$defs/uuid" }, "ok": { "type": "boolean" }, "result": true, @@ -220,7 +220,7 @@ "required": ["type", "protocol_version", "request_id", "ok"], "properties": { "type": { "const": "operation_response" }, - "protocol_version": { "const": 2 }, + "protocol_version": { "const": 3 }, "request_id": { "$ref": "#/$defs/uuid" }, "ok": { "type": "boolean" }, "result": true, @@ -274,6 +274,7 @@ "file_capability": { "$ref": "https://mdbase.dev/connect/schemas/files.v1.json#/$defs/fileCapability" }, + "application_declaration": {}, "application_authorization": { "$ref": "#/$defs/applicationAuthorizationProof" } } }, @@ -409,11 +410,27 @@ "properties": { "kind": { "enum": ["contract", "type", "schema"] }, "mode": { "enum": ["managed", "seed"] }, + "upgrade_from": { + "oneOf": [ + { "$ref": "#/$defs/typePackUpgradeBaseline" }, + { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/typePackUpgradeBaseline" } } + ] + }, "source": { "type": "string", "minLength": 1, "maxLength": 500 }, "target": { "type": "string", "minLength": 1, "maxLength": 500 }, "digest": { "$ref": "#/$defs/digest" } } }, + "typePackUpgradeBaseline": { + "type": "object", + "additionalProperties": false, + "required": ["digest", "document"], + "properties": { + "digest": { "$ref": "#/$defs/digest" }, + "document": { "type": "string", "maxLength": 262144 }, + "version": { "type": "integer", "minimum": 1 } + } + }, "typePackSourceResource": { "type": "object", "additionalProperties": false, @@ -446,7 +463,7 @@ "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 }, + "path": { "type": "string", "pattern": "^(?:/settings/record_extensions|/x-[^/]+(?:/.*)?)$", "maxLength": 1024 }, "predicate": { "const": "contains" }, "value": { "oneOf": [ { "type": "string" }, @@ -463,7 +480,7 @@ "properties": { "requirement": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, "operation": { "const": "set_add" }, - "path": { "type": "string", "pattern": "^/x-[^/]+(?:/.*)?$", "maxLength": 1024 }, + "path": { "type": "string", "pattern": "^(?:/settings/record_extensions|/x-[^/]+(?:/.*)?)$", "maxLength": 1024 }, "value": { "oneOf": [ { "type": "string" }, { "type": "number" }, @@ -613,11 +630,24 @@ "type": "object", "additionalProperties": false, "required": ["type", "protocol_version", "request_id", "revision", "grants"], + "oneOf": [ + { "required": ["connector_id", "sequence", "lease_issued_at_ms", "lease_expires_at_ms"] }, + { "not": { "anyOf": [ + { "required": ["connector_id"] }, + { "required": ["sequence"] }, + { "required": ["lease_issued_at_ms"] }, + { "required": ["lease_expires_at_ms"] } + ] } } + ], "properties": { "type": { "const": "policy_snapshot" }, "protocol_version": { "const": 1 }, "request_id": { "$ref": "#/$defs/uuid" }, "revision": { "$ref": "#/$defs/digest" }, + "connector_id": { "$ref": "#/$defs/uuid" }, + "sequence": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, + "lease_issued_at_ms": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, + "lease_expires_at_ms": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "grants": { "type": "array", "items": { "$ref": "#/$defs/grantPolicy" } } } }, @@ -660,12 +690,96 @@ "display_name": { "type": "string", "minLength": 1 }, "spec_version": { "type": "string", "minLength": 1 }, "operations": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/operation" } }, + "authority_capabilities": { "type": "array", "items": { "type": "string" } }, "change_cursor": { "type": "integer", "minimum": 0 }, "types": { "type": "array", "items": { "$ref": "#/$defs/collectionType" } }, "contracts": { "type": "array", "items": { "$ref": "#/$defs/collectionContract" } }, "configuration": { "type": "object", "description": "Canonical portable collection settings. Extension and implementation-specific values are omitted." } } }, + "dataContractSelector": { + "type": "object", "additionalProperties": false, + "required": ["id", "version"], + "properties": { + "id": { "type": "string" }, "version": { "type": "string" }, "type": { "type": "string" } + } + }, + "readInput": { + "type": "object", "additionalProperties": false, + "properties": { + "path": { "type": "string", "minLength": 1 }, + "paths": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "type": "string", "minLength": 1 } }, + "include_body": { "type": "boolean", "description": "Batch default true; point-read defaults unchanged." }, + "include_document": { "type": "boolean", "default": false }, + "contract": { "$ref": "#/$defs/dataContractSelector" } + }, + "oneOf": [{ "required": ["path"] }, { "required": ["paths"] }], + "allOf": [{ "if": { "required": ["contract"] }, "then": { "properties": { "include_document": { "const": false } } } }] + }, + "recordDocument": { + "type": "object", "additionalProperties": false, + "required": ["path", "revision", "types", "frontmatter", "effective_frontmatter", "file"], + "properties": { + "path": { "type": "string" }, "revision": { "type": "string" }, + "types": { "type": "array", "items": { "type": "string" } }, + "frontmatter": { "type": "object" }, "effective_frontmatter": { "type": "object" }, + "body": { "type": "string" }, "document": { "type": "string" }, + "file": { "type": "object" }, "contract": { "type": "object" } + } + }, + "readManyDocumentItem": { + "oneOf": [ + { + "type": "object", "additionalProperties": false, "required": ["path", "status", "record"], + "properties": { "path": { "type": "string" }, "status": { "const": "found" }, "record": { "$ref": "#/$defs/recordDocument" } } + }, + { + "type": "object", "additionalProperties": false, "required": ["path", "status"], + "properties": { "path": { "type": "string" }, "status": { "const": "missing" } } + }, + { + "type": "object", "additionalProperties": false, "required": ["path", "status", "error"], + "properties": { + "path": { "type": "string" }, "status": { "const": "error" }, + "error": { + "type": "object", "additionalProperties": false, "required": ["code", "message"], + "properties": { "code": { "type": "string" }, "message": { "type": "string" } } + } + } + } + ] + }, + "readManyDocumentsResult": { + "description": "Ordered items including duplicates. Serialized operation envelope maximum 8 MiB; overflow fails explicitly and asks callers to split, never truncates.", + "type": "object", "additionalProperties": false, "required": ["items"], + "properties": { "items": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/readManyDocumentItem" } } } + }, + "queryRecord": { + "type": "object", "additionalProperties": false, "required": ["path", "types", "file"], + "properties": { + "path": { "type": "string" }, "revision": { "type": "string" }, + "types": { "type": "array", "items": { "type": "string" } }, + "frontmatter": { "type": "object" }, "effective_frontmatter": { "type": "object" }, + "body": { "type": "string" }, "values": { "type": "object" }, + "file": { "type": "object" }, "contract": { "type": "object" } + } + }, + "queryMetadataRecord": { + "type": "object", "additionalProperties": false, "required": ["path", "types", "revision", "values"], + "properties": { + "path": { "type": "string" }, "revision": { "type": "string" }, + "types": { "type": "array", "items": { "type": "string" } }, + "values": { "type": "object" }, "contract": { "type": "object" } + } + }, + "queryMetadataResult": { + "type": "object", "additionalProperties": false, "required": ["output", "results"], + "properties": { + "output": { "const": "metadata" }, + "results": { "type": "array", "items": { "$ref": "#/$defs/queryMetadataRecord" } }, + "meta": { "type": "object" } + } + }, "collectionType": { "type": "object", "additionalProperties": false, diff --git a/public/connect/schemas/encrypted-relay.v3.schema.json b/public/connect/schemas/encrypted-relay.v3.schema.json new file mode 100644 index 0000000..477b102 --- /dev/null +++ b/public/connect/schemas/encrypted-relay.v3.schema.json @@ -0,0 +1,64 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://mdbase.dev/connect/schemas/encrypted-relay.v3.json", + "title": "mdbase connect encrypted operation transport 3", + "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": 3 }, + "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}$" }, + "deadline_unix_ms": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, + "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": 3 }, + "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 index 9c69cb8..29c9e26 100644 --- a/public/connect/schemas/files.v1.schema.json +++ b/public/connect/schemas/files.v1.schema.json @@ -9,6 +9,8 @@ { "$ref": "#/$defs/fileDescriptor" }, { "$ref": "#/$defs/listFilesRequest" }, { "$ref": "#/$defs/listFilesPage" }, + { "$ref": "#/$defs/statFileRequest" }, + { "$ref": "#/$defs/fileStat" }, { "$ref": "#/$defs/openUploadRequest" }, { "$ref": "#/$defs/openDownloadRequest" }, { "$ref": "#/$defs/moveFileRequest" }, @@ -161,7 +163,30 @@ "protocol_version": { "const": 1 }, "type": { "const": "files_page" }, "files": { "type": "array", "items": { "$ref": "#/$defs/fileDescriptor" } }, - "next": { "type": "string", "minLength": 1 } + "next": { "type": "string", "minLength": 1 }, + "authority_capabilities": { "type": "array", "items": { "type": "string" } } + } + }, + "statFileRequest": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "stat_file" }, + "path": { "$ref": "#/$defs/path" }, + "file_id": { "$ref": "#/$defs/uuid" } + }, + "oneOf": [{ "required": ["path"] }, { "required": ["file_id"] }] + }, + "fileStat": { + "type": "object", + "additionalProperties": false, + "required": ["protocol_version", "type", "file"], + "properties": { + "protocol_version": { "const": 1 }, + "type": { "const": "file_stat" }, + "file": { "oneOf": [{ "$ref": "#/$defs/fileDescriptor" }, { "type": "null" }] } } }, "openUploadRequest": { @@ -317,8 +342,27 @@ "type": "array", "maxItems": 10000, "items": { "$ref": "#/$defs/uploadedPart" } - } - } + }, + "prepared_upload_part": { "$ref": "#/$defs/preparedPart" } + }, + "allOf": [{ + "if": { "required": ["prepared_upload_part"] }, + "then": { "properties": { + "direction": { "const": "upload" }, + "protection": { "const": "transport_tls" }, + "strategy": { "type": "object", "properties": { "kind": { "const": "object_put" } } }, + "prepared_upload_part": { "type": "object", "properties": { + "part_index": { "const": 0 }, + "offset": { "const": 0 }, + "method": { "const": "PUT" }, + "headers": { + "type": "object", + "required": ["if-none-match"], + "properties": { "if-none-match": { "const": "*" } } + } + } } + } } + }] }, "transferStatus": { "type": "object", diff --git a/public/connect/schemas/mdbase-app.legacy-v1.schema.json b/public/connect/schemas/mdbase-app.legacy-v1.schema.json new file mode 100644 index 0000000..a119c28 --- /dev/null +++ b/public/connect/schemas/mdbase-app.legacy-v1.schema.json @@ -0,0 +1,405 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://mdbase.dev/connect/schemas/mdbase-app.legacy-v1.json", + "title": "mdbase connect bundled application manifest v1", + "type": "object", + "additionalProperties": false, + "required": ["manifest_version", "id", "name"], + "properties": { + "manifest_version": { "const": 1 }, + "distribution": { + "enum": ["web", "portable"], + "description": "Portable declarations use device authorization and do not claim a browser origin." + }, + "id": { + "type": "string", + "minLength": 5, + "maxLength": 150, + "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*){2,}$", + "description": "Stable reverse-domain application identifier. This is presentation metadata, not publisher authentication." + }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "homepage": { "type": "string", "format": "uri", "pattern": "^https://" }, + "project_url": { "type": "string", "format": "uri", "pattern": "^https://" }, + "icon": { "type": "string", "format": "uri", "pattern": "^https://" }, + "redirect_uris": { + "type": "array", + "minItems": 1, + "maxItems": 10, + "uniqueItems": true, + "items": { + "type": "string", + "format": "uri", + "description": "An HTTPS URI on the homepage origin or a private-use scheme derived from the application ID." + } + }, + "requirements": { "$ref": "#/$defs/requirements" }, + "provisions": { + "type": "object", + "additionalProperties": false, + "required": ["type_packs"], + "properties": { + "configuration": { + "type": "array", + "maxItems": 50, + "items": { "$ref": "#/$defs/configurationProvision" } + }, + "type_packs": { + "type": "array", + "maxItems": 20, + "items": { "$ref": "#/$defs/typePackProvision" } + } + } + }, + "notifications": { + "type": "object", + "additionalProperties": false, + "required": ["criteria"], + "properties": { + "criteria": { + "type": "array", + "maxItems": 50, + "items": { "$ref": "#/$defs/notificationCriterion" } + }, + "native_delivery": { "$ref": "#/$defs/nativeNotificationDelivery" } + } + } + }, + "oneOf": [ + { + "required": ["homepage", "redirect_uris"], + "properties": { + "distribution": { "const": "web" }, + "homepage": true, + "redirect_uris": true, + "project_url": false + } + }, + { + "required": ["distribution"], + "properties": { + "distribution": { "const": "portable" }, + "homepage": false, + "redirect_uris": false + } + } + ], + "$defs": { + "identifier": { + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$" + }, + "duration": { + "type": "string", + "pattern": "^[0-9]+(ms|s|m|h|d)$" + }, + "contract": { + "type": "object", + "additionalProperties": false, + "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": ["access", "contracts"], + "properties": { + "capabilities": { "$ref": "#/$defs/capabilityRequirements" }, + "access": { + "const": "full_collection", + "description": "Compatibility declaration for collection-level application authorization." + }, + "collection_kind": { + "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, + "uniqueItems": true, + "items": { "$ref": "#/$defs/contract" } + } + } + }, + "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, + "required": ["manifest", "resources", "provides"], + "properties": { + "manifest": { "$ref": "#/$defs/typePackManifest" }, + "resources": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "items": { "$ref": "#/$defs/typePackSourceResource" } + }, + "provides": { + "type": "array", + "maxItems": 20, + "uniqueItems": true, + "items": { "$ref": "#/$defs/contract" } + } + } + }, + "typePackManifest": { + "type": "object", + "required": ["kind", "id", "version", "resources"], + "properties": { + "kind": { "const": "mdbase.type-pack" }, + "id": { "$ref": "#/$defs/identifier" }, + "version": { "$ref": "#/$defs/contract/properties/version" }, + "name": { "type": "string", "minLength": 1, "maxLength": 100 }, + "description": { "type": "string", "maxLength": 500 }, + "resources": { + "type": "array", + "minItems": 1, + "maxItems": 100, + "items": { "$ref": "#/$defs/typePackManifestResource" } + } + }, + "patternProperties": { "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": true }, + "additionalProperties": false + }, + "typePackManifestResource": { + "type": "object", + "additionalProperties": false, + "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}$" } + } + }, + "typePackSourceResource": { + "type": "object", + "additionalProperties": false, + "required": ["source", "document"], + "properties": { + "source": { "type": "string", "minLength": 1, "maxLength": 240 }, + "document": { "type": "string", "maxLength": 262144 } + } + }, + "notificationCriterion": { + "type": "object", + "additionalProperties": false, + "required": ["id", "event", "presentation"], + "properties": { + "id": { "$ref": "#/$defs/identifier" }, + "event": { "$ref": "#/$defs/contract" }, + "if": { + "type": "object", + "additionalProperties": false, + "required": ["$expr"], + "properties": { + "$expr": { "type": "string", "minLength": 1, "maxLength": 4096 } + } + }, + "debounce": { "$ref": "#/$defs/duration" }, + "minimum_interval": { "$ref": "#/$defs/duration" }, + "presentation": { + "type": "object", + "additionalProperties": false, + "required": ["title"], + "properties": { + "title": { "type": "string", "minLength": 1, "maxLength": 80 }, + "body": { "type": "string", "maxLength": 160 }, + "tag": { "type": "string", "minLength": 1, "maxLength": 80 } + } + } + } + }, + "nativeNotificationDelivery": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "required": ["mode", "firebase_project_id"], + "properties": { + "mode": { "const": "managed_fcm" }, + "firebase_project_id": { + "type": "string", + "minLength": 6, + "maxLength": 63, + "pattern": "^[a-z][a-z0-9-]*[a-z0-9]$" + } + } + }, + { + "type": "object", + "additionalProperties": false, + "required": ["mode", "url"], + "properties": { + "mode": { "const": "webhook" }, + "url": { + "type": "string", + "format": "uri", + "pattern": "^https://" + } + } + } + ] + } + } +} diff --git a/public/connect/schemas/mdbase-app.schema.json b/public/connect/schemas/mdbase-app.schema.json index c026f7d..8b40da6 100644 --- a/public/connect/schemas/mdbase-app.schema.json +++ b/public/connect/schemas/mdbase-app.schema.json @@ -111,17 +111,28 @@ "requirements": { "type": "object", "additionalProperties": false, - "required": ["contracts"], + "required": ["access", "contracts"], "properties": { "capabilities": { "$ref": "#/$defs/capabilityRequirements" }, "access": { - "enum": ["contract", "full_collection"], - "description": "Access boundary requested after compatibility and provisioning checks." - }, + "const": "full_collection", + "description": "Compatibility declaration for collection-level application authorization." + }, "collection_kind": { "const": "hosted", "description": "Require a durable provider-backed collection with direct sync support." }, + "people": { + "type": "object", + "additionalProperties": false, + "required": ["version"], + "anyOf": [{ "required": ["required"] }, { "required": ["optional"] }], + "properties": { + "version": { "const": 1 }, + "required": { "$ref": "#/$defs/peoplePermissions" }, + "optional": { "$ref": "#/$defs/peoplePermissions" } + } + }, "files": { "$ref": "#/$defs/fileRequirement" }, "configuration": { "type": "array", @@ -141,7 +152,7 @@ "additionalProperties": false, "required": ["contract_version", "required"], "properties": { - "contract_version": { "const": 1 }, + "contract_version": { "const": 2 }, "required": { "type": "array", "maxItems": 32, @@ -198,59 +209,39 @@ }, "applicationCapability": { "enum": [ - "collection.inspect", - "records.watch", - "records.read", - "records.query", - "records.validate", + "collection.read", "records.create", - "records.update", + "records.edit", "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" + "views.manage", + "definitions.manage", + "background.schedule", + "offline.replica" ] }, + "peoplePermissions": { + "type": "array", "minItems": 1, "uniqueItems": true, + "items": { "enum": ["identity", "members"] } + }, "fileRequirement": { "type": "object", "additionalProperties": false, - "required": ["actions", "scope"], + "required": ["required", "scope"], "properties": { - "actions": { - "type": "array", - "minItems": 1, - "maxItems": 6, - "uniqueItems": true, - "items": { - "enum": ["list", "read", "add", "replace", "move", "delete"] - } - }, + "required": { "$ref": "#/$defs/fileActions" }, + "optional": { "$ref": "#/$defs/fileActions" }, "scope": { "$ref": "#/$defs/fileScope" } } }, + "fileActions": { + "type": "array", + "minItems": 1, + "maxItems": 6, + "uniqueItems": true, + "items": { + "enum": ["list", "read", "add", "replace", "move", "delete"] + } + }, "fileScope": { "oneOf": [ { @@ -327,11 +318,27 @@ "properties": { "kind": { "enum": ["contract", "type", "schema"] }, "mode": { "enum": ["managed", "seed"] }, + "upgrade_from": { + "oneOf": [ + { "$ref": "#/$defs/typePackUpgradeBaseline" }, + { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/typePackUpgradeBaseline" } } + ] + }, "source": { "type": "string", "minLength": 1, "maxLength": 240 }, "target": { "type": "string", "minLength": 1, "maxLength": 240 }, "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } } }, + "typePackUpgradeBaseline": { + "type": "object", + "additionalProperties": false, + "required": ["digest", "document"], + "properties": { + "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }, + "document": { "type": "string", "maxLength": 262144 }, + "version": { "type": "integer", "minimum": 1 } + } + }, "typePackSourceResource": { "type": "object", "additionalProperties": false, diff --git a/public/connect/schemas/mdbase-app.v1.json b/public/connect/schemas/mdbase-app.v1.json index c026f7d..8b40da6 100644 --- a/public/connect/schemas/mdbase-app.v1.json +++ b/public/connect/schemas/mdbase-app.v1.json @@ -111,17 +111,28 @@ "requirements": { "type": "object", "additionalProperties": false, - "required": ["contracts"], + "required": ["access", "contracts"], "properties": { "capabilities": { "$ref": "#/$defs/capabilityRequirements" }, "access": { - "enum": ["contract", "full_collection"], - "description": "Access boundary requested after compatibility and provisioning checks." - }, + "const": "full_collection", + "description": "Compatibility declaration for collection-level application authorization." + }, "collection_kind": { "const": "hosted", "description": "Require a durable provider-backed collection with direct sync support." }, + "people": { + "type": "object", + "additionalProperties": false, + "required": ["version"], + "anyOf": [{ "required": ["required"] }, { "required": ["optional"] }], + "properties": { + "version": { "const": 1 }, + "required": { "$ref": "#/$defs/peoplePermissions" }, + "optional": { "$ref": "#/$defs/peoplePermissions" } + } + }, "files": { "$ref": "#/$defs/fileRequirement" }, "configuration": { "type": "array", @@ -141,7 +152,7 @@ "additionalProperties": false, "required": ["contract_version", "required"], "properties": { - "contract_version": { "const": 1 }, + "contract_version": { "const": 2 }, "required": { "type": "array", "maxItems": 32, @@ -198,59 +209,39 @@ }, "applicationCapability": { "enum": [ - "collection.inspect", - "records.watch", - "records.read", - "records.query", - "records.validate", + "collection.read", "records.create", - "records.update", + "records.edit", "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" + "views.manage", + "definitions.manage", + "background.schedule", + "offline.replica" ] }, + "peoplePermissions": { + "type": "array", "minItems": 1, "uniqueItems": true, + "items": { "enum": ["identity", "members"] } + }, "fileRequirement": { "type": "object", "additionalProperties": false, - "required": ["actions", "scope"], + "required": ["required", "scope"], "properties": { - "actions": { - "type": "array", - "minItems": 1, - "maxItems": 6, - "uniqueItems": true, - "items": { - "enum": ["list", "read", "add", "replace", "move", "delete"] - } - }, + "required": { "$ref": "#/$defs/fileActions" }, + "optional": { "$ref": "#/$defs/fileActions" }, "scope": { "$ref": "#/$defs/fileScope" } } }, + "fileActions": { + "type": "array", + "minItems": 1, + "maxItems": 6, + "uniqueItems": true, + "items": { + "enum": ["list", "read", "add", "replace", "move", "delete"] + } + }, "fileScope": { "oneOf": [ { @@ -327,11 +318,27 @@ "properties": { "kind": { "enum": ["contract", "type", "schema"] }, "mode": { "enum": ["managed", "seed"] }, + "upgrade_from": { + "oneOf": [ + { "$ref": "#/$defs/typePackUpgradeBaseline" }, + { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/typePackUpgradeBaseline" } } + ] + }, "source": { "type": "string", "minLength": 1, "maxLength": 240 }, "target": { "type": "string", "minLength": 1, "maxLength": 240 }, "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } } }, + "typePackUpgradeBaseline": { + "type": "object", + "additionalProperties": false, + "required": ["digest", "document"], + "properties": { + "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }, + "document": { "type": "string", "maxLength": 262144 }, + "version": { "type": "integer", "minimum": 1 } + } + }, "typePackSourceResource": { "type": "object", "additionalProperties": false, diff --git a/public/connect/schemas/mdbase-query.v0.3.schema.json b/public/connect/schemas/mdbase-query.v0.3.schema.json index 2fec377..0d2f1bd 100644 --- a/public/connect/schemas/mdbase-query.v0.3.schema.json +++ b/public/connect/schemas/mdbase-query.v0.3.schema.json @@ -16,6 +16,7 @@ "limit": { "type": "integer", "minimum": 0 }, "offset": { "type": "integer", "minimum": 0 }, "include_body": { "type": "boolean", "default": false }, + "output": { "const": "metadata" }, "frontmatter_mode": { "enum": ["effective", "persisted", "both"], "default": "effective" @@ -25,6 +26,10 @@ "^x-[A-Za-z][A-Za-z0-9._:-]{0,127}$": { "$ref": "#/$defs/extension" } }, "additionalProperties": false, + "allOf": [{ + "if": { "required": ["output"], "properties": { "output": { "const": "metadata" } } }, + "then": { "properties": { "include_body": { "const": false } } } + }], "$defs": { "identifier": { "type": "string", diff --git a/public/connect/schemas/operation-catalog.v1.json b/public/connect/schemas/operation-catalog.v1.json index 9786e6b..913f393 100644 --- a/public/connect/schemas/operation-catalog.v1.json +++ b/public/connect/schemas/operation-catalog.v1.json @@ -14,8 +14,8 @@ { "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": "delete", "input_schema_version": 1, "mutation": "always", "dry_run": "nonmutating" }, + { "id": "rename", "input_schema_version": 1, "mutation": "always", "dry_run": "nonmutating" }, { "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" }, @@ -23,14 +23,15 @@ { "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": "list_timers", "input_schema_version": 1, "mutation": "never", "requires_timer_criterion": true }, + { "id": "put_timer", "input_schema_version": 1, "mutation": "always", "requires_timer_criterion": true }, + { "id": "cancel_timer", "input_schema_version": 1, "mutation": "always", "requires_timer_criterion": true }, + { "id": "reconcile_timers", "input_schema_version": 1, "mutation": "always", "requires_timer_criterion": true }, { "id": "sync", "input_schema_version": 1, "mutation": "sync_action" } ], "file_control_messages": [ { "id": "list_files", "input_schema_version": 1, "mutation": false }, + { "id": "stat_file", "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 }, diff --git a/public/connect/schemas/operation-mutation-classification.v1.json b/public/connect/schemas/operation-mutation-classification.v1.json new file mode 100644 index 0000000..fbf7332 --- /dev/null +++ b/public/connect/schemas/operation-mutation-classification.v1.json @@ -0,0 +1,554 @@ +{ + "catalog_version": 1, + "cases": [ + { + "operation": "describe", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "describe", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "changes", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "changes", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "read", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "read", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "query", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "query", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "list_views", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "list_views", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "execute_view", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "execute_view", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "read_view_source", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "read_view_source", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "create_view_source", + "input": {}, + "schema_version": 1, + "identifier": "create_view_source" + }, + { + "operation": "create_view_source", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "create_view_source" + }, + { + "operation": "update_view_source", + "input": {}, + "schema_version": 1, + "identifier": "update_view_source" + }, + { + "operation": "update_view_source", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "update_view_source" + }, + { + "operation": "delete_view_source", + "input": {}, + "schema_version": 1, + "identifier": "delete_view_source" + }, + { + "operation": "delete_view_source", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "delete_view_source" + }, + { + "operation": "validate", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "validate", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "create", + "input": {}, + "schema_version": 1, + "identifier": "create" + }, + { + "operation": "create", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "create" + }, + { + "operation": "update", + "input": {}, + "schema_version": 1, + "identifier": "update" + }, + { + "operation": "update", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "update" + }, + { + "operation": "delete", + "input": {}, + "schema_version": 1, + "identifier": "delete" + }, + { + "operation": "delete", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "rename", + "input": {}, + "schema_version": 1, + "identifier": "rename" + }, + { + "operation": "rename", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "read_type", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "read_type", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "create_type", + "input": {}, + "schema_version": 1, + "identifier": "create_type" + }, + { + "operation": "create_type", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "create_type" + }, + { + "operation": "update_type", + "input": {}, + "schema_version": 1, + "identifier": "update_type" + }, + { + "operation": "update_type", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "update_type" + }, + { + "operation": "assess_type_pack", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "assess_type_pack", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "apply_type_pack", + "input": {}, + "schema_version": 1, + "identifier": "apply_type_pack" + }, + { + "operation": "apply_type_pack", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "apply_type_pack" + }, + { + "operation": "assess_collection_setup", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "assess_collection_setup", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "apply_collection_setup", + "input": {}, + "schema_version": 1, + "identifier": "apply_collection_setup" + }, + { + "operation": "apply_collection_setup", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "apply_collection_setup" + }, + { + "operation": "list_timers", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "list_timers", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "put_timer", + "input": {}, + "schema_version": 1, + "identifier": "put_timer" + }, + { + "operation": "put_timer", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "put_timer" + }, + { + "operation": "cancel_timer", + "input": {}, + "schema_version": 1, + "identifier": "cancel_timer" + }, + { + "operation": "cancel_timer", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "cancel_timer" + }, + { + "operation": "reconcile_timers", + "input": {}, + "schema_version": 1, + "identifier": "reconcile_timers" + }, + { + "operation": "reconcile_timers", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": "reconcile_timers" + }, + { + "operation": "sync", + "input": {}, + "schema_version": 1, + "identifier": null + }, + { + "operation": "sync", + "input": { + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "sync", + "input": { + "action": "changes", + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "sync", + "input": { + "action": "mutate", + "dry_run": true + }, + "schema_version": 1, + "identifier": "sync:mutate" + }, + { + "operation": "file_control", + "input": { + "type": "list_files" + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "list_files", + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "stat_file" + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "stat_file", + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "open_file_upload" + }, + "schema_version": 1, + "identifier": "file_control:open_file_upload" + }, + { + "operation": "file_control", + "input": { + "type": "open_file_upload", + "dry_run": true + }, + "schema_version": 1, + "identifier": "file_control:open_file_upload" + }, + { + "operation": "file_control", + "input": { + "type": "open_file_download" + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "open_file_download", + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "move_file" + }, + "schema_version": 1, + "identifier": "file_control:move_file" + }, + { + "operation": "file_control", + "input": { + "type": "move_file", + "dry_run": true + }, + "schema_version": 1, + "identifier": "file_control:move_file" + }, + { + "operation": "file_control", + "input": { + "type": "delete_file" + }, + "schema_version": 1, + "identifier": "file_control:delete_file" + }, + { + "operation": "file_control", + "input": { + "type": "delete_file", + "dry_run": true + }, + "schema_version": 1, + "identifier": "file_control:delete_file" + }, + { + "operation": "file_control", + "input": { + "type": "get_file_transfer_status" + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "get_file_transfer_status", + "dry_run": true + }, + "schema_version": 1, + "identifier": null + }, + { + "operation": "file_control", + "input": { + "type": "commit_file_upload" + }, + "schema_version": 1, + "identifier": "file_control:commit_file_upload" + }, + { + "operation": "file_control", + "input": { + "type": "commit_file_upload", + "dry_run": true + }, + "schema_version": 1, + "identifier": "file_control:commit_file_upload" + }, + { + "operation": "file_control", + "input": { + "type": "abort_file_transfer" + }, + "schema_version": 1, + "identifier": "file_control:abort_file_transfer" + }, + { + "operation": "file_control", + "input": { + "type": "abort_file_transfer", + "dry_run": true + }, + "schema_version": 1, + "identifier": "file_control:abort_file_transfer" + } + ] +} diff --git a/site-sources.json b/site-sources.json index 58879fc..e3363da 100644 --- a/site-sources.json +++ b/site-sources.json @@ -1,7 +1,7 @@ { "specification": { "repository": "mdbase-dev/mdbase-spec", - "ref": "bad38995b4e8d16028f857a07ed22200edabefcb" + "ref": "eabae2143275a0619b02d564961fa74b8037185e" }, "connect": { "repository": "mdbase-dev/mdbase-connect", diff --git a/src/data/conformance.json b/src/data/conformance.json index 395fada..390d3c0 100644 --- a/src/data/conformance.json +++ b/src/data/conformance.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-09-27", + "generated_at": "2026-10-03", "spec_version": "0.3.0", "implementations": [ {