@mdbase-dev/sdk 0.1.0-beta.230 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/asset-pins.json +4 -4
- package/dist/application/entry.js +2 -1
- package/dist/application/entry.js.map +1 -1
- package/dist/application/manifest.d.ts +2 -2
- package/dist/application/startup-timing.d.ts +6 -0
- package/dist/application/startup-timing.js +14 -0
- package/dist/application/startup-timing.js.map +1 -1
- package/dist/application/worker-session.d.ts +2 -2
- package/dist/application/worker.js +198 -104
- package/dist/browser/mdbase-sdk.js +251 -129
- package/dist/browser/mdbase-sdk.min.js +56 -56
- package/dist/client.d.ts +18 -0
- package/dist/client.js +42 -3
- package/dist/client.js.map +1 -1
- package/dist/collection-api.d.ts +1 -0
- package/dist/collection-api.js.map +1 -1
- package/dist/describe-error.d.ts +1 -1
- package/dist/describe-error.js +2 -1
- package/dist/describe-error.js.map +1 -1
- package/dist/history.d.ts +66 -0
- package/dist/history.js +55 -0
- package/dist/history.js.map +1 -0
- package/dist/native/provenance.json +5 -5
- package/dist/native/runtime.wasm +0 -0
- package/dist/performance-mark.d.ts +2 -0
- package/dist/performance-mark.js +6 -0
- package/dist/performance-mark.js.map +1 -0
- package/dist/private.js +3 -2
- package/dist/private.js.map +1 -1
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/node_modules/@mdbase-dev/connect-protocol/LICENSE +21 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/application-contract.d.ts +28 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/application-contract.js +21 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/application-declaration.d.ts +1 -1
- package/node_modules/@mdbase-dev/connect-protocol/dist/capabilities.d.ts +1 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/capabilities.js +2 -1
- package/node_modules/@mdbase-dev/connect-protocol/dist/connect-problems.generated.d.ts +14 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/connect-problems.generated.js +16 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/index.d.ts +2 -1
- package/node_modules/@mdbase-dev/connect-protocol/dist/index.js +2 -1
- package/node_modules/@mdbase-dev/connect-protocol/dist/manifest-validators.generated.js +4 -4
- package/node_modules/@mdbase-dev/connect-protocol/dist/manifest.d.ts +5 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/manifest.js +19 -19
- package/node_modules/@mdbase-dev/connect-protocol/dist/operations.d.ts +1 -1
- package/node_modules/@mdbase-dev/connect-protocol/dist/operations.js +9 -3
- package/node_modules/@mdbase-dev/connect-protocol/dist/service-urls.d.ts +11 -0
- package/node_modules/@mdbase-dev/connect-protocol/dist/service-urls.js +51 -0
- package/node_modules/@mdbase-dev/connect-protocol/package.json +7 -7
- package/node_modules/@mdbase-dev/connect-protocol/schemas/application-capability-catalog.v2.json +4 -0
- package/node_modules/@mdbase-dev/connect-protocol/schemas/connect-problem.v1.schema.json +57 -0
- package/node_modules/@mdbase-dev/connect-protocol/schemas/connect-problems.v1.catalog.json +11 -0
- package/node_modules/@mdbase-dev/connect-protocol/schemas/connect-protocol.v1.schema.json +1 -1
- package/node_modules/@mdbase-dev/connect-protocol/schemas/mdbase-app.schema.json +2 -1
- package/node_modules/@mdbase-dev/connect-protocol/schemas/operation-catalog.v1.json +3 -1
- package/node_modules/@mdbase-dev/connect-protocol/schemas/operation-mutation-classification.v1.json +28 -0
- package/package.json +2 -2
- package/vendor/mdbase-connect-sdk-3d3f95b80c9a.json +13 -0
- package/vendor/mdbase-dev-connect-protocol-0.1.0-beta.152-3d3f95b80c9a.tgz +0 -0
- package/vendor/mdbase-connect-sdk-e6e66bcd172f.json +0 -13
- package/vendor/mdbase-dev-connect-protocol-0.1.0-beta.145-e6e66bcd172f.tgz +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/* eslint-disable */
|
|
5
5
|
"use strict";
|
|
6
6
|
export const appManifestValidator = validate20;
|
|
7
|
-
const schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://mdbase.dev/connect/schemas/mdbase-app.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 }, "platform": { "const": "native", "description": "Unverified native app; permits literal IPv4 loopback HTTP on any port." }, "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." } }, "installation_origins": { "type": "object", "additionalProperties": false, "properties": { "lab": { "$ref": "#/$defs/installationOriginPolicy" }, "staging": { "$ref": "#/$defs/installationOriginPolicy" }, "production": { "$ref": "#/$defs/installationOriginPolicy" } } }, "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" }, "platform": false, "homepage": false, "redirect_uris": false } }], "$defs": { "installationOriginPolicy": { "type": "object", "additionalProperties": false, "properties": { "app-runtime": { "$ref": "#/$defs/installationOrigins" }, "mobile": { "$ref": "#/$defs/installationOrigins" } } }, "installationOrigins": { "type": "array", "maxItems": 16, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 255, "format": "uri" } }, "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." }, "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", "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": 2 }, "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.read", "records.create", "records.edit", "records.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": ["required", "scope"], "properties": { "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": [{ "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"] }, "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, "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://" } } }] } } };
|
|
7
|
+
const schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://mdbase.dev/connect/schemas/mdbase-app.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 }, "platform": { "const": "native", "description": "Unverified native app; permits literal IPv4 loopback HTTP on any port." }, "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." } }, "installation_origins": { "type": "object", "additionalProperties": false, "properties": { "lab": { "$ref": "#/$defs/installationOriginPolicy" }, "staging": { "$ref": "#/$defs/installationOriginPolicy" }, "production": { "$ref": "#/$defs/installationOriginPolicy" } } }, "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" }, "platform": false, "homepage": false, "redirect_uris": false } }], "$defs": { "installationOriginPolicy": { "type": "object", "additionalProperties": false, "properties": { "app-runtime": { "$ref": "#/$defs/installationOrigins" }, "mobile": { "$ref": "#/$defs/installationOrigins" } } }, "installationOrigins": { "type": "array", "maxItems": 16, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 255, "format": "uri" } }, "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." }, "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", "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": 2 }, "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.read", "records.create", "records.edit", "records.delete", "views.manage", "definitions.manage", "background.schedule", "offline.replica", "history.read"] }, "peoplePermissions": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["identity", "members"] } }, "fileRequirement": { "type": "object", "additionalProperties": false, "required": ["required", "scope"], "properties": { "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": [{ "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"] }, "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, "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://" } } }] } } };
|
|
8
8
|
const schema63 = { "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://" } } }] };
|
|
9
9
|
const func1 = Object.prototype.hasOwnProperty;
|
|
10
10
|
const func2 = (function ucs2length(str) {
|
|
@@ -259,7 +259,7 @@ validate21.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": f
|
|
|
259
259
|
const schema35 = { "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." }, "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", "maxItems": 50, "items": { "$ref": "#/$defs/configurationRequirement" } }, "contracts": { "type": "array", "maxItems": 20, "uniqueItems": true, "items": { "$ref": "#/$defs/contract" } } } };
|
|
260
260
|
const schema39 = { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["identity", "members"] } };
|
|
261
261
|
const schema36 = { "type": "object", "additionalProperties": false, "required": ["contract_version", "required"], "properties": { "contract_version": { "const": 2 }, "required": { "type": "array", "maxItems": 32, "uniqueItems": true, "items": { "$ref": "#/$defs/applicationCapability" } }, "optional": { "type": "array", "maxItems": 32, "uniqueItems": true, "items": { "$ref": "#/$defs/applicationCapability" } } } };
|
|
262
|
-
const schema37 = { "enum": ["collection.read", "records.create", "records.edit", "records.delete", "views.manage", "definitions.manage", "background.schedule", "offline.replica"] };
|
|
262
|
+
const schema37 = { "enum": ["collection.read", "records.create", "records.edit", "records.delete", "views.manage", "definitions.manage", "background.schedule", "offline.replica", "history.read"] };
|
|
263
263
|
const func0 = (function equal(a, b) {
|
|
264
264
|
if (a === b)
|
|
265
265
|
return true;
|
|
@@ -364,7 +364,7 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
364
364
|
const len0 = data1.length;
|
|
365
365
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
366
366
|
let data2 = data1[i0];
|
|
367
|
-
if (!((((((((data2 === "collection.read") || (data2 === "records.create")) || (data2 === "records.edit")) || (data2 === "records.delete")) || (data2 === "views.manage")) || (data2 === "definitions.manage")) || (data2 === "background.schedule")) || (data2 === "offline.replica"))) {
|
|
367
|
+
if (!(((((((((data2 === "collection.read") || (data2 === "records.create")) || (data2 === "records.edit")) || (data2 === "records.delete")) || (data2 === "views.manage")) || (data2 === "definitions.manage")) || (data2 === "background.schedule")) || (data2 === "offline.replica")) || (data2 === "history.read"))) {
|
|
368
368
|
const err5 = { instancePath: instancePath + "/required/" + i0, schemaPath: "#/$defs/applicationCapability/enum", keyword: "enum", params: { allowedValues: schema37.enum }, message: "must be equal to one of the allowed values" };
|
|
369
369
|
if (vErrors === null) {
|
|
370
370
|
vErrors = [err5];
|
|
@@ -422,7 +422,7 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
422
422
|
const len1 = data3.length;
|
|
423
423
|
for (let i2 = 0; i2 < len1; i2++) {
|
|
424
424
|
let data4 = data3[i2];
|
|
425
|
-
if (!((((((((data4 === "collection.read") || (data4 === "records.create")) || (data4 === "records.edit")) || (data4 === "records.delete")) || (data4 === "views.manage")) || (data4 === "definitions.manage")) || (data4 === "background.schedule")) || (data4 === "offline.replica"))) {
|
|
425
|
+
if (!(((((((((data4 === "collection.read") || (data4 === "records.create")) || (data4 === "records.edit")) || (data4 === "records.delete")) || (data4 === "views.manage")) || (data4 === "definitions.manage")) || (data4 === "background.schedule")) || (data4 === "offline.replica")) || (data4 === "history.read"))) {
|
|
426
426
|
const err9 = { instancePath: instancePath + "/optional/" + i2, schemaPath: "#/$defs/applicationCapability/enum", keyword: "enum", params: { allowedValues: schema37.enum }, message: "must be equal to one of the allowed values" };
|
|
427
427
|
if (vErrors === null) {
|
|
428
428
|
vErrors = [err9];
|
|
@@ -70,3 +70,8 @@ export declare function validateTypePackProvision(value: unknown, path?: string)
|
|
|
70
70
|
/** RFC 8252 §7.3 native exception: canonical literal IPv4 only, any valid port.
|
|
71
71
|
* This classifies transport; the registered manifest, consent and pairing grant authority. */
|
|
72
72
|
export declare function isNativeLoopbackOrigin(value: unknown): value is string;
|
|
73
|
+
/** An exact loopback HTTP web origin (`localhost`, `127.0.0.1` or `[::1]`, any
|
|
74
|
+
* port): where an application runs while it is being developed. A remote page
|
|
75
|
+
* cannot give itself this origin, but any program on the computer can serve it,
|
|
76
|
+
* so it identifies no publisher. */
|
|
77
|
+
export declare function isLoopbackHttpOrigin(value: unknown): value is string;
|
|
@@ -2,6 +2,7 @@ import { sha256 as sha256Bytes } from "@noble/hashes/sha2.js";
|
|
|
2
2
|
import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils.js";
|
|
3
3
|
import { isMap, parseDocument } from "yaml";
|
|
4
4
|
import { appManifestValidator as generatedAppManifestValidator, legacyAppManifestValidator as generatedLegacyAppManifestValidator } from "./manifest-validators.generated.js";
|
|
5
|
+
import { normalizeApplicationManifest } from "./application-contract.js";
|
|
5
6
|
import { RECORD_EXTENSIONS_CONFIGURATION_PATH } from "./collection-setup.js";
|
|
6
7
|
import { isNativeRedirectUri } from "./index.js";
|
|
7
8
|
export const APPLICATION_MANIFEST_MAX_BYTES = 524_288;
|
|
@@ -66,7 +67,7 @@ export function parseAppManifest(value, options = {}) {
|
|
|
66
67
|
const result = validateAppManifest(value, options);
|
|
67
68
|
if (!result.valid)
|
|
68
69
|
throw new AppManifestValidationError(result.issues);
|
|
69
|
-
return
|
|
70
|
+
return normalizeApplicationManifest(value);
|
|
70
71
|
}
|
|
71
72
|
/** Validate and clone without changing capability IDs, file aliases, or version. */
|
|
72
73
|
export function parseVersionedAppManifest(value, options = {}) {
|
|
@@ -74,24 +75,8 @@ export function parseVersionedAppManifest(value, options = {}) {
|
|
|
74
75
|
if (!result.valid)
|
|
75
76
|
throw new AppManifestValidationError(result.issues);
|
|
76
77
|
return declaredContractVersion(value) === 1
|
|
77
|
-
? { contractVersion: 1, manifest:
|
|
78
|
-
: { contractVersion: 2, manifest:
|
|
79
|
-
}
|
|
80
|
-
function normalizeManifest(value) {
|
|
81
|
-
const manifest = structuredClone(value);
|
|
82
|
-
return {
|
|
83
|
-
...manifest,
|
|
84
|
-
requirements: {
|
|
85
|
-
configuration: [],
|
|
86
|
-
...manifest.requirements
|
|
87
|
-
},
|
|
88
|
-
provisions: {
|
|
89
|
-
type_packs: [],
|
|
90
|
-
configuration: [],
|
|
91
|
-
...manifest.provisions
|
|
92
|
-
},
|
|
93
|
-
notifications: manifest.notifications ?? { criteria: [] }
|
|
94
|
-
};
|
|
78
|
+
? { contractVersion: 1, manifest: normalizeApplicationManifest(value) }
|
|
79
|
+
: { contractVersion: 2, manifest: normalizeApplicationManifest(value) };
|
|
95
80
|
}
|
|
96
81
|
export function formatManifestValidationIssues(issues) {
|
|
97
82
|
return issues.map((issue) => `${issue.path || "/"} ${issue.message}`).join("; ");
|
|
@@ -620,6 +605,21 @@ function isNativeLoopbackUrl(value) {
|
|
|
620
605
|
const origin = /^http:\/\/[^/?#]+/.exec(value)?.[0];
|
|
621
606
|
return isNativeLoopbackOrigin(origin);
|
|
622
607
|
}
|
|
608
|
+
/** An exact loopback HTTP web origin (`localhost`, `127.0.0.1` or `[::1]`, any
|
|
609
|
+
* port): where an application runs while it is being developed. A remote page
|
|
610
|
+
* cannot give itself this origin, but any program on the computer can serve it,
|
|
611
|
+
* so it identifies no publisher. */
|
|
612
|
+
export function isLoopbackHttpOrigin(value) {
|
|
613
|
+
if (typeof value !== "string")
|
|
614
|
+
return false;
|
|
615
|
+
try {
|
|
616
|
+
const url = new URL(value);
|
|
617
|
+
return url.protocol === "http:" && isLoopback(url.hostname) && url.origin === value;
|
|
618
|
+
}
|
|
619
|
+
catch {
|
|
620
|
+
return false;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
623
|
function secureOrAllowedLocal(url, allowLocal) {
|
|
624
624
|
return url.protocol === "https:"
|
|
625
625
|
|| (allowLocal && url.protocol === "http:" && isLoopback(url.hostname));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const OPERATION_CATALOG_VERSION: 1;
|
|
2
|
-
export declare const COLLECTION_OPERATIONS: readonly ["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"];
|
|
2
|
+
export declare const COLLECTION_OPERATIONS: readonly ["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", "record_history", "record_version"];
|
|
3
3
|
export type CollectionOperation = typeof COLLECTION_OPERATIONS[number];
|
|
4
4
|
export declare const FILE_CONTROL_MESSAGE_TYPES: readonly ["list_files", "stat_file", "open_file_upload", "open_file_download", "move_file", "delete_file", "get_file_transfer_status", "commit_file_upload", "abort_file_transfer"];
|
|
5
5
|
export type FileControlMessageType = typeof FILE_CONTROL_MESSAGE_TYPES[number];
|
|
@@ -27,7 +27,9 @@ export const COLLECTION_OPERATIONS = [
|
|
|
27
27
|
"put_timer",
|
|
28
28
|
"cancel_timer",
|
|
29
29
|
"reconcile_timers",
|
|
30
|
-
"sync"
|
|
30
|
+
"sync",
|
|
31
|
+
"record_history",
|
|
32
|
+
"record_version"
|
|
31
33
|
];
|
|
32
34
|
export const FILE_CONTROL_MESSAGE_TYPES = [
|
|
33
35
|
"list_files",
|
|
@@ -67,7 +69,9 @@ const COLLECTION_MUTATION_RULES = {
|
|
|
67
69
|
"put_timer": "always",
|
|
68
70
|
"cancel_timer": "always",
|
|
69
71
|
"reconcile_timers": "always",
|
|
70
|
-
"sync": "sync_action"
|
|
72
|
+
"sync": "sync_action",
|
|
73
|
+
"record_history": "never",
|
|
74
|
+
"record_version": "never"
|
|
71
75
|
};
|
|
72
76
|
const COLLECTION_INPUT_SCHEMA_VERSIONS = {
|
|
73
77
|
"describe": 1,
|
|
@@ -96,7 +100,9 @@ const COLLECTION_INPUT_SCHEMA_VERSIONS = {
|
|
|
96
100
|
"put_timer": 1,
|
|
97
101
|
"cancel_timer": 1,
|
|
98
102
|
"reconcile_timers": 1,
|
|
99
|
-
"sync": 1
|
|
103
|
+
"sync": 1,
|
|
104
|
+
"record_history": 1,
|
|
105
|
+
"record_version": 1
|
|
100
106
|
};
|
|
101
107
|
const FILE_CONTROL_INPUT_SCHEMA_VERSIONS = {
|
|
102
108
|
"list_files": 1,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A URL a client may send credentials or collection data to: HTTPS, or HTTP
|
|
3
|
+
* on a loopback host for development, with no embedded credentials.
|
|
4
|
+
*/
|
|
5
|
+
export declare function serviceUrl(value: unknown): URL | null;
|
|
6
|
+
/**
|
|
7
|
+
* A token response's remote authority capability, bound to its collection:
|
|
8
|
+
* operation, sync and file endpoints on one service origin, each at the exact
|
|
9
|
+
* `/v1/authorities/<collection>/<endpoint>` path with no query or fragment.
|
|
10
|
+
*/
|
|
11
|
+
export declare function validAuthorityTokenResponse(value: unknown, collectionId: unknown): boolean;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const LOOPBACK_HOSTS = new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
2
|
+
const AUTHORITY_PATH = /^\/v1\/authorities\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\/(operations|sync|files)$/i;
|
|
3
|
+
/**
|
|
4
|
+
* A URL a client may send credentials or collection data to: HTTPS, or HTTP
|
|
5
|
+
* on a loopback host for development, with no embedded credentials.
|
|
6
|
+
*/
|
|
7
|
+
export function serviceUrl(value) {
|
|
8
|
+
if (typeof value !== "string")
|
|
9
|
+
return null;
|
|
10
|
+
let url;
|
|
11
|
+
try {
|
|
12
|
+
url = new URL(value);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const transport = url.protocol === "https:"
|
|
18
|
+
|| (url.protocol === "http:" && LOOPBACK_HOSTS.has(url.hostname));
|
|
19
|
+
return transport && !url.username && !url.password ? url : null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A token response's remote authority capability, bound to its collection:
|
|
23
|
+
* operation, sync and file endpoints on one service origin, each at the exact
|
|
24
|
+
* `/v1/authorities/<collection>/<endpoint>` path with no query or fragment.
|
|
25
|
+
*/
|
|
26
|
+
export function validAuthorityTokenResponse(value, collectionId) {
|
|
27
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
28
|
+
return false;
|
|
29
|
+
if (typeof collectionId !== "string")
|
|
30
|
+
return false;
|
|
31
|
+
const authority = value;
|
|
32
|
+
if (typeof authority.replica_id !== "string"
|
|
33
|
+
|| authority.replica_id.length === 0
|
|
34
|
+
|| typeof authority.access_token !== "string"
|
|
35
|
+
|| authority.access_token.length === 0
|
|
36
|
+
|| (authority.proof_public_key !== undefined
|
|
37
|
+
&& (typeof authority.proof_public_key !== "string"
|
|
38
|
+
|| authority.proof_public_key.length === 0)))
|
|
39
|
+
return false;
|
|
40
|
+
const endpoints = [
|
|
41
|
+
[authority.operations_url, "operations"],
|
|
42
|
+
[authority.sync_url, "sync"],
|
|
43
|
+
[authority.files_url, "files"]
|
|
44
|
+
];
|
|
45
|
+
const urls = endpoints.map(([value, endpoint]) => {
|
|
46
|
+
const url = serviceUrl(value);
|
|
47
|
+
const path = url && !url.search && !url.hash ? AUTHORITY_PATH.exec(url.pathname) : null;
|
|
48
|
+
return path?.[1] === collectionId && path[2] === endpoint ? url : null;
|
|
49
|
+
});
|
|
50
|
+
return urls.every((url) => url !== null && url.origin === urls[0].origin);
|
|
51
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdbase-dev/connect-protocol",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.152",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,11 +30,6 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"schemas"
|
|
32
32
|
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
35
|
-
"test": "node --test test/*.test.mjs && node ../../scripts/generate-manifest-validators.mjs --check && node ../../scripts/generate-change-events.mjs --check && node ../../scripts/generate-connect-problems.mjs --check && node ../../scripts/generate-operation-catalog.mjs --check && node ../../scripts/generate-application-capabilities.mjs --check",
|
|
36
|
-
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
37
|
-
},
|
|
38
33
|
"dependencies": {
|
|
39
34
|
"@noble/hashes": "2.4.0",
|
|
40
35
|
"yaml": "^2.9.1"
|
|
@@ -45,5 +40,10 @@
|
|
|
45
40
|
"ajv-formats": "^3.0.1",
|
|
46
41
|
"esbuild": "^0.28.1",
|
|
47
42
|
"typescript": "^7.0.2"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
46
|
+
"test": "node --test test/*.test.mjs && node ../../scripts/generate-manifest-validators.mjs --check && node ../../scripts/generate-change-events.mjs --check && node ../../scripts/generate-connect-problems.mjs --check && node ../../scripts/generate-operation-catalog.mjs --check && node ../../scripts/generate-application-capabilities.mjs --check",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
|
@@ -3448,6 +3448,63 @@
|
|
|
3448
3448
|
}
|
|
3449
3449
|
}
|
|
3450
3450
|
},
|
|
3451
|
+
{
|
|
3452
|
+
"type": "object",
|
|
3453
|
+
"additionalProperties": false,
|
|
3454
|
+
"required": [
|
|
3455
|
+
"problem_version",
|
|
3456
|
+
"code",
|
|
3457
|
+
"category",
|
|
3458
|
+
"recovery",
|
|
3459
|
+
"message",
|
|
3460
|
+
"details"
|
|
3461
|
+
],
|
|
3462
|
+
"properties": {
|
|
3463
|
+
"problem_version": {
|
|
3464
|
+
"const": 1
|
|
3465
|
+
},
|
|
3466
|
+
"code": {
|
|
3467
|
+
"const": "mutation_abandoned"
|
|
3468
|
+
},
|
|
3469
|
+
"category": {
|
|
3470
|
+
"const": "conflict"
|
|
3471
|
+
},
|
|
3472
|
+
"recovery": {
|
|
3473
|
+
"const": "none"
|
|
3474
|
+
},
|
|
3475
|
+
"message": {
|
|
3476
|
+
"type": "string",
|
|
3477
|
+
"minLength": 1
|
|
3478
|
+
},
|
|
3479
|
+
"operation_outcome": {
|
|
3480
|
+
"enum": [
|
|
3481
|
+
"not_sent",
|
|
3482
|
+
"rejected",
|
|
3483
|
+
"unknown"
|
|
3484
|
+
]
|
|
3485
|
+
},
|
|
3486
|
+
"trace_id": {
|
|
3487
|
+
"type": "string",
|
|
3488
|
+
"minLength": 1
|
|
3489
|
+
},
|
|
3490
|
+
"details": {
|
|
3491
|
+
"type": "object",
|
|
3492
|
+
"additionalProperties": false,
|
|
3493
|
+
"required": [
|
|
3494
|
+
"request_id",
|
|
3495
|
+
"application"
|
|
3496
|
+
],
|
|
3497
|
+
"properties": {
|
|
3498
|
+
"request_id": {
|
|
3499
|
+
"type": "string"
|
|
3500
|
+
},
|
|
3501
|
+
"application": {
|
|
3502
|
+
"type": "string"
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
},
|
|
3451
3508
|
{
|
|
3452
3509
|
"type": "object",
|
|
3453
3510
|
"additionalProperties": false,
|
|
@@ -271,6 +271,17 @@
|
|
|
271
271
|
"manifest_load_failed": { "category": "availability", "recovery": "retry" },
|
|
272
272
|
"manifest_required": { "category": "validation", "recovery": "fix_request" },
|
|
273
273
|
"missing_grant_key": { "category": "authorization", "recovery": "reauthorize" },
|
|
274
|
+
"mutation_abandoned": {
|
|
275
|
+
"category": "conflict",
|
|
276
|
+
"recovery": "none",
|
|
277
|
+
"details": {
|
|
278
|
+
"required": ["request_id", "application"],
|
|
279
|
+
"properties": {
|
|
280
|
+
"request_id": { "type": "string" },
|
|
281
|
+
"application": { "type": "string" }
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
274
285
|
"mutation_recovery_expired": { "category": "compatibility", "recovery": "none" },
|
|
275
286
|
"mutation_request_conflict": {
|
|
276
287
|
"category": "conflict",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"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}$"
|
|
23
23
|
},
|
|
24
24
|
"operation": {
|
|
25
|
-
"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"]
|
|
25
|
+
"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", "record_history", "record_version"]
|
|
26
26
|
},
|
|
27
27
|
"connectContractRequirements": {
|
|
28
28
|
"type": "object",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
{ "id": "put_timer", "input_schema_version": 1, "mutation": "always", "requires_timer_criterion": true },
|
|
28
28
|
{ "id": "cancel_timer", "input_schema_version": 1, "mutation": "always", "requires_timer_criterion": true },
|
|
29
29
|
{ "id": "reconcile_timers", "input_schema_version": 1, "mutation": "always", "requires_timer_criterion": true },
|
|
30
|
-
{ "id": "sync", "input_schema_version": 1, "mutation": "sync_action" }
|
|
30
|
+
{ "id": "sync", "input_schema_version": 1, "mutation": "sync_action" },
|
|
31
|
+
{ "id": "record_history", "input_schema_version": 1, "mutation": "never" },
|
|
32
|
+
{ "id": "record_version", "input_schema_version": 1, "mutation": "never" }
|
|
31
33
|
],
|
|
32
34
|
"file_control_messages": [
|
|
33
35
|
{ "id": "list_files", "input_schema_version": 1, "mutation": false },
|
package/node_modules/@mdbase-dev/connect-protocol/schemas/operation-mutation-classification.v1.json
CHANGED
|
@@ -379,6 +379,34 @@
|
|
|
379
379
|
"schema_version": 1,
|
|
380
380
|
"identifier": null
|
|
381
381
|
},
|
|
382
|
+
{
|
|
383
|
+
"operation": "record_history",
|
|
384
|
+
"input": {},
|
|
385
|
+
"schema_version": 1,
|
|
386
|
+
"identifier": null
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"operation": "record_history",
|
|
390
|
+
"input": {
|
|
391
|
+
"dry_run": true
|
|
392
|
+
},
|
|
393
|
+
"schema_version": 1,
|
|
394
|
+
"identifier": null
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"operation": "record_version",
|
|
398
|
+
"input": {},
|
|
399
|
+
"schema_version": 1,
|
|
400
|
+
"identifier": null
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"operation": "record_version",
|
|
404
|
+
"input": {
|
|
405
|
+
"dry_run": true
|
|
406
|
+
},
|
|
407
|
+
"schema_version": 1,
|
|
408
|
+
"identifier": null
|
|
409
|
+
},
|
|
382
410
|
{
|
|
383
411
|
"operation": "sync",
|
|
384
412
|
"input": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdbase-dev/sdk",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "TypeScript SDK: live queries, optimistic submits, receipts, status, holds, files and presence over the replica client API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@mdbase-dev/connect-protocol"
|
|
92
92
|
],
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@mdbase-dev/connect-protocol": "file:vendor/mdbase-dev-connect-protocol-0.1.0-beta.
|
|
94
|
+
"@mdbase-dev/connect-protocol": "file:vendor/mdbase-dev-connect-protocol-0.1.0-beta.152-3d3f95b80c9a.tgz",
|
|
95
95
|
"@noble/ciphers": "2.4.0",
|
|
96
96
|
"@noble/curves": "2.4.0",
|
|
97
97
|
"@noble/hashes": "2.4.0"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"repository": "https://github.com/mdbase-dev/mdbase-connect",
|
|
4
|
+
"revision": "3d3f95b80c9aa11634bd2fc0c099855d61d5f124",
|
|
5
|
+
"artifacts": [
|
|
6
|
+
{
|
|
7
|
+
"package": "protocol",
|
|
8
|
+
"file": "mdbase-dev-connect-protocol-0.1.0-beta.152-3d3f95b80c9a.tgz",
|
|
9
|
+
"bytes": 112974,
|
|
10
|
+
"sha512": "F0hhr8t6Z4FpbE5QpLEAt//EfTg+VuUrKpg1Iw6+l2fQFptvyaUlQc2VATTP8EGs5cgkBnAqHqOKMkYLpmPhgw=="
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema_version": 1,
|
|
3
|
-
"repository": "https://github.com/mdbase-dev/mdbase-connect",
|
|
4
|
-
"revision": "e6e66bcd172f5573f7d1e5518a52e7bf22983ea6",
|
|
5
|
-
"artifacts": [
|
|
6
|
-
{
|
|
7
|
-
"package": "protocol",
|
|
8
|
-
"file": "mdbase-dev-connect-protocol-0.1.0-beta.145-e6e66bcd172f.tgz",
|
|
9
|
-
"bytes": 106404,
|
|
10
|
-
"sha512": "uLeG6+yHiKmtpg5KY4XEa8kGx5mLg6pqLZ4H4+x0An7Q/bhfz5Hgh+P8Ngh6DWvGf6PIuJ3Smw8w6GmCK1gsvQ=="
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
Binary file
|