@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
|
@@ -7035,7 +7035,7 @@ function parseDocument(source, options = {}) {
|
|
|
7035
7035
|
|
|
7036
7036
|
// node_modules/@mdbase-dev/connect-protocol/dist/manifest-validators.generated.js
|
|
7037
7037
|
var appManifestValidator = validate20;
|
|
7038
|
-
var 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://" } } }] } } };
|
|
7038
|
+
var 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://" } } }] } } };
|
|
7039
7039
|
var func1 = Object.prototype.hasOwnProperty;
|
|
7040
7040
|
var func2 = (function ucs2length(str2) {
|
|
7041
7041
|
const len = str2.length;
|
|
@@ -7271,7 +7271,7 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7271
7271
|
}
|
|
7272
7272
|
validate21.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
7273
7273
|
var schema39 = { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["identity", "members"] } };
|
|
7274
|
-
var schema37 = { "enum": ["collection.read", "records.create", "records.edit", "records.delete", "views.manage", "definitions.manage", "background.schedule", "offline.replica"] };
|
|
7274
|
+
var schema37 = { "enum": ["collection.read", "records.create", "records.edit", "records.delete", "views.manage", "definitions.manage", "background.schedule", "offline.replica", "history.read"] };
|
|
7275
7275
|
var func0 = (function equal(a, b) {
|
|
7276
7276
|
if (a === b)
|
|
7277
7277
|
return true;
|
|
@@ -7376,7 +7376,7 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7376
7376
|
const len0 = data1.length;
|
|
7377
7377
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
7378
7378
|
let data2 = data1[i0];
|
|
7379
|
-
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")) {
|
|
7379
|
+
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")) {
|
|
7380
7380
|
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" };
|
|
7381
7381
|
if (vErrors === null) {
|
|
7382
7382
|
vErrors = [err5];
|
|
@@ -7429,7 +7429,7 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7429
7429
|
const len1 = data3.length;
|
|
7430
7430
|
for (let i2 = 0; i2 < len1; i2++) {
|
|
7431
7431
|
let data4 = data3[i2];
|
|
7432
|
-
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")) {
|
|
7432
|
+
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")) {
|
|
7433
7433
|
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" };
|
|
7434
7434
|
if (vErrors === null) {
|
|
7435
7435
|
vErrors = [err9];
|
|
@@ -14381,10 +14381,6 @@ function validate47(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
14381
14381
|
}
|
|
14382
14382
|
validate47.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
14383
14383
|
|
|
14384
|
-
// node_modules/@mdbase-dev/connect-protocol/dist/collection-setup.js
|
|
14385
|
-
var RECORD_EXTENSIONS_CONFIGURATION_PATH = "/settings/record_extensions";
|
|
14386
|
-
var YAML_DOCUMENT_RECORDS_CAPABILITY = "yaml-document-records-v1";
|
|
14387
|
-
|
|
14388
14384
|
// node_modules/@mdbase-dev/connect-protocol/dist/capabilities.js
|
|
14389
14385
|
var APPLICATION_CAPABILITY_CONTRACT_VERSION = 2;
|
|
14390
14386
|
var APPLICATION_CAPABILITY_DEFINITIONS = {
|
|
@@ -14395,7 +14391,8 @@ var APPLICATION_CAPABILITY_DEFINITIONS = {
|
|
|
14395
14391
|
"views.manage": ["create_view_source", "update_view_source", "delete_view_source"],
|
|
14396
14392
|
"definitions.manage": ["create_type", "update_type", "assess_type_pack", "apply_type_pack"],
|
|
14397
14393
|
"background.schedule": ["list_timers", "put_timer", "cancel_timer", "reconcile_timers"],
|
|
14398
|
-
"offline.replica": ["sync"]
|
|
14394
|
+
"offline.replica": ["sync"],
|
|
14395
|
+
"history.read": ["record_history", "record_version"]
|
|
14399
14396
|
};
|
|
14400
14397
|
var APPLICATION_SETUP_OPERATIONS = [
|
|
14401
14398
|
"assess_collection_setup",
|
|
@@ -14446,6 +14443,24 @@ function capabilityOperationsForContractVersion(contractVersion, capability) {
|
|
|
14446
14443
|
var FRESH_APPLICATION_AUTHORIZATION_VERSIONS = Object.freeze([1, 2]);
|
|
14447
14444
|
var FRESH_APPLICATION_AUTHORIZATION_CAPABILITIES = Object.freeze(["application-authorization-v2-issuance"]);
|
|
14448
14445
|
|
|
14446
|
+
// node_modules/@mdbase-dev/connect-protocol/dist/files.js
|
|
14447
|
+
var DEFAULT_FILE_CHUNK_BYTES = 1024 * 1024;
|
|
14448
|
+
var MAX_FILE_CHUNK_BYTES = 4 * 1024 * 1024;
|
|
14449
|
+
var MAX_FILE_FRAME_HEADER_BYTES = 16 * 1024;
|
|
14450
|
+
var FILE_FRAME_PREFIX_BYTES = 16;
|
|
14451
|
+
var MAX_FILE_FRAME_BYTES = FILE_FRAME_PREFIX_BYTES + MAX_FILE_FRAME_HEADER_BYTES + MAX_FILE_CHUNK_BYTES + 16;
|
|
14452
|
+
var FILE_FRAME_MAGIC_BYTES = new Uint8Array([77, 68, 66, 70]);
|
|
14453
|
+
var RELAY_FILE_MAGIC_BYTES = new Uint8Array([77, 68, 66, 82]);
|
|
14454
|
+
function applicationFileRequest(requirement, options = {}) {
|
|
14455
|
+
return {
|
|
14456
|
+
actions: [.../* @__PURE__ */ new Set([
|
|
14457
|
+
...requirement.required,
|
|
14458
|
+
...options.includeOptional === false ? [] : requirement.optional ?? []
|
|
14459
|
+
])],
|
|
14460
|
+
scope: structuredClone(requirement.scope)
|
|
14461
|
+
};
|
|
14462
|
+
}
|
|
14463
|
+
|
|
14449
14464
|
// node_modules/@mdbase-dev/connect-protocol/dist/connect-problems.generated.js
|
|
14450
14465
|
var CONNECT_PROBLEM_VERSION = 1;
|
|
14451
14466
|
var CONNECT_PROBLEM_CATALOG = {
|
|
@@ -14527,6 +14542,7 @@ var CONNECT_PROBLEM_CATALOG = {
|
|
|
14527
14542
|
"manifest_load_failed": { category: "availability", recovery: "retry" },
|
|
14528
14543
|
"manifest_required": { category: "validation", recovery: "fix_request" },
|
|
14529
14544
|
"missing_grant_key": { category: "authorization", recovery: "reauthorize" },
|
|
14545
|
+
"mutation_abandoned": { category: "conflict", recovery: "none" },
|
|
14530
14546
|
"mutation_recovery_expired": { category: "compatibility", recovery: "none" },
|
|
14531
14547
|
"mutation_request_conflict": { category: "conflict", recovery: "resolve_conflict" },
|
|
14532
14548
|
"no_pending_mutation": { category: "conflict", recovery: "refresh" },
|
|
@@ -14630,26 +14646,24 @@ function connectError(code, message2, ...args) {
|
|
|
14630
14646
|
});
|
|
14631
14647
|
}
|
|
14632
14648
|
|
|
14633
|
-
// node_modules/@mdbase-dev/connect-protocol/dist/
|
|
14634
|
-
var
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
var FILE_FRAME_PREFIX_BYTES = 16;
|
|
14638
|
-
var MAX_FILE_FRAME_BYTES = FILE_FRAME_PREFIX_BYTES + MAX_FILE_FRAME_HEADER_BYTES + MAX_FILE_CHUNK_BYTES + 16;
|
|
14639
|
-
var FILE_FRAME_MAGIC_BYTES = new Uint8Array([77, 68, 66, 70]);
|
|
14640
|
-
var RELAY_FILE_MAGIC_BYTES = new Uint8Array([77, 68, 66, 82]);
|
|
14641
|
-
function applicationFileRequest(requirement, options = {}) {
|
|
14649
|
+
// node_modules/@mdbase-dev/connect-protocol/dist/application-contract.js
|
|
14650
|
+
var DEFAULT_OPERATIONS = ["describe", "changes", "read", "query"];
|
|
14651
|
+
function normalizeApplicationManifest(value2) {
|
|
14652
|
+
const manifest = structuredClone(value2);
|
|
14642
14653
|
return {
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
|
|
14647
|
-
|
|
14654
|
+
...manifest,
|
|
14655
|
+
requirements: {
|
|
14656
|
+
configuration: [],
|
|
14657
|
+
...manifest.requirements
|
|
14658
|
+
},
|
|
14659
|
+
provisions: {
|
|
14660
|
+
type_packs: [],
|
|
14661
|
+
configuration: [],
|
|
14662
|
+
...manifest.provisions
|
|
14663
|
+
},
|
|
14664
|
+
notifications: manifest.notifications ?? { criteria: [] }
|
|
14648
14665
|
};
|
|
14649
14666
|
}
|
|
14650
|
-
|
|
14651
|
-
// node_modules/@mdbase-dev/connect-protocol/dist/application-contract.js
|
|
14652
|
-
var DEFAULT_OPERATIONS = ["describe", "changes", "read", "query"];
|
|
14653
14667
|
function semanticContractVersion(requirements) {
|
|
14654
14668
|
const version3 = requirements.capabilities === void 0 ? 1 : requirements.capabilities?.contract_version;
|
|
14655
14669
|
if (version3 !== 1 && version3 !== 2)
|
|
@@ -14711,6 +14725,10 @@ function authorizationFiles(requirements) {
|
|
|
14711
14725
|
return applicationFileRequest(files);
|
|
14712
14726
|
}
|
|
14713
14727
|
|
|
14728
|
+
// node_modules/@mdbase-dev/connect-protocol/dist/collection-setup.js
|
|
14729
|
+
var RECORD_EXTENSIONS_CONFIGURATION_PATH = "/settings/record_extensions";
|
|
14730
|
+
var YAML_DOCUMENT_RECORDS_CAPABILITY = "yaml-document-records-v1";
|
|
14731
|
+
|
|
14714
14732
|
// node_modules/@mdbase-dev/connect-protocol/dist/operations.js
|
|
14715
14733
|
var COLLECTION_OPERATIONS = [
|
|
14716
14734
|
"describe",
|
|
@@ -14739,7 +14757,9 @@ var COLLECTION_OPERATIONS = [
|
|
|
14739
14757
|
"put_timer",
|
|
14740
14758
|
"cancel_timer",
|
|
14741
14759
|
"reconcile_timers",
|
|
14742
|
-
"sync"
|
|
14760
|
+
"sync",
|
|
14761
|
+
"record_history",
|
|
14762
|
+
"record_version"
|
|
14743
14763
|
];
|
|
14744
14764
|
var FILE_CONTROL_MESSAGE_TYPES = [
|
|
14745
14765
|
"list_files",
|
|
@@ -14779,7 +14799,9 @@ var COLLECTION_MUTATION_RULES = {
|
|
|
14779
14799
|
"put_timer": "always",
|
|
14780
14800
|
"cancel_timer": "always",
|
|
14781
14801
|
"reconcile_timers": "always",
|
|
14782
|
-
"sync": "sync_action"
|
|
14802
|
+
"sync": "sync_action",
|
|
14803
|
+
"record_history": "never",
|
|
14804
|
+
"record_version": "never"
|
|
14783
14805
|
};
|
|
14784
14806
|
var MUTATING_FILE_CONTROL_MESSAGE_TYPES = /* @__PURE__ */ new Set([
|
|
14785
14807
|
"open_file_upload",
|
|
@@ -14937,23 +14959,7 @@ function parseVersionedAppManifest(value2, options = {}) {
|
|
|
14937
14959
|
const result2 = validateVersionedAppManifest(value2, options);
|
|
14938
14960
|
if (!result2.valid)
|
|
14939
14961
|
throw new AppManifestValidationError(result2.issues);
|
|
14940
|
-
return declaredContractVersion(value2) === 1 ? { contractVersion: 1, manifest:
|
|
14941
|
-
}
|
|
14942
|
-
function normalizeManifest(value2) {
|
|
14943
|
-
const manifest = structuredClone(value2);
|
|
14944
|
-
return {
|
|
14945
|
-
...manifest,
|
|
14946
|
-
requirements: {
|
|
14947
|
-
configuration: [],
|
|
14948
|
-
...manifest.requirements
|
|
14949
|
-
},
|
|
14950
|
-
provisions: {
|
|
14951
|
-
type_packs: [],
|
|
14952
|
-
configuration: [],
|
|
14953
|
-
...manifest.provisions
|
|
14954
|
-
},
|
|
14955
|
-
notifications: manifest.notifications ?? { criteria: [] }
|
|
14956
|
-
};
|
|
14962
|
+
return declaredContractVersion(value2) === 1 ? { contractVersion: 1, manifest: normalizeApplicationManifest(value2) } : { contractVersion: 2, manifest: normalizeApplicationManifest(value2) };
|
|
14957
14963
|
}
|
|
14958
14964
|
function formatManifestValidationIssues(issues) {
|
|
14959
14965
|
return issues.map((issue3) => `${issue3.path || "/"} ${issue3.message}`).join("; ");
|
|
@@ -15687,12 +15693,12 @@ function appReleaseTrust() {
|
|
|
15687
15693
|
// src/application/asset-pins.json
|
|
15688
15694
|
var asset_pins_default = {
|
|
15689
15695
|
runtime: {
|
|
15690
|
-
sha256: "
|
|
15691
|
-
bytes:
|
|
15692
|
-
maxBytes:
|
|
15696
|
+
sha256: "fa2c6c114536fd2ed822c6513a7ab7d3aa64e46aef7e37076fdbd230560d74ce",
|
|
15697
|
+
bytes: 3979440,
|
|
15698
|
+
maxBytes: 3979440,
|
|
15693
15699
|
source: {
|
|
15694
15700
|
repository: "mdbase-dev/mdbase-connect",
|
|
15695
|
-
commit: "
|
|
15701
|
+
commit: "e6fcee0b73ad6bd3f6188e07875dc5aef15f6955"
|
|
15696
15702
|
}
|
|
15697
15703
|
},
|
|
15698
15704
|
sqlite: {
|
|
@@ -19855,6 +19861,11 @@ function waitForOpenRetry(milliseconds, signal) {
|
|
|
19855
19861
|
});
|
|
19856
19862
|
}
|
|
19857
19863
|
|
|
19864
|
+
// src/performance-mark.ts
|
|
19865
|
+
function performanceMark(name2) {
|
|
19866
|
+
if (typeof performance !== "undefined") performance.mark(name2);
|
|
19867
|
+
}
|
|
19868
|
+
|
|
19858
19869
|
// src/values.ts
|
|
19859
19870
|
function toFmMap(v) {
|
|
19860
19871
|
return toValue(v);
|
|
@@ -21496,7 +21507,7 @@ function inheritOriginalAppGrant(port, session) {
|
|
|
21496
21507
|
}
|
|
21497
21508
|
|
|
21498
21509
|
// src/session.ts
|
|
21499
|
-
var API_VERSIONS = [{ major: 1, minor: 3 }, { major: 1, minor: 2 }, { major: 1, minor: 1 }, { major: 1, minor: 0 }];
|
|
21510
|
+
var API_VERSIONS = [{ major: 1, minor: 4 }, { major: 1, minor: 3 }, { major: 1, minor: 2 }, { major: 1, minor: 1 }, { major: 1, minor: 0 }];
|
|
21500
21511
|
function schemaToError(e, what) {
|
|
21501
21512
|
if (isMdbaseError(e)) return e;
|
|
21502
21513
|
if (e instanceof SchemaError && e.unknown) {
|
|
@@ -22250,6 +22261,95 @@ var FilesApi = class {
|
|
|
22250
22261
|
}
|
|
22251
22262
|
};
|
|
22252
22263
|
|
|
22264
|
+
// src/private.ts
|
|
22265
|
+
var DEVICE_KINDS = ["desktop", "mobile", "app_runtime", "cli", "hosted", "escrow", "recovery"];
|
|
22266
|
+
var kinds = enumOf("device-kind", DEVICE_KINDS);
|
|
22267
|
+
var deviceKind = {
|
|
22268
|
+
name: "device-kind",
|
|
22269
|
+
enc: (v) => kinds.enc(v),
|
|
22270
|
+
dec: (c) => {
|
|
22271
|
+
try {
|
|
22272
|
+
return kinds.dec(c);
|
|
22273
|
+
} catch {
|
|
22274
|
+
return "unknown";
|
|
22275
|
+
}
|
|
22276
|
+
}
|
|
22277
|
+
};
|
|
22278
|
+
var pendingDeviceShape = struct("pending-device", [
|
|
22279
|
+
[0, "device", uuid2],
|
|
22280
|
+
[1, "account", uuid2],
|
|
22281
|
+
[2, "kind", deviceKind],
|
|
22282
|
+
[3, "sas", tstr, "opt"],
|
|
22283
|
+
// Host response only; omitted from client encodings.
|
|
22284
|
+
[4, "exchangeReady", bool]
|
|
22285
|
+
]);
|
|
22286
|
+
var pendingDevice = {
|
|
22287
|
+
...pendingDeviceShape,
|
|
22288
|
+
enc: (v) => pendingDeviceShape.enc({ ...v, sas: void 0 })
|
|
22289
|
+
};
|
|
22290
|
+
var approvalReadinessShape = struct("approval-readiness", [
|
|
22291
|
+
[0, "device", uuid2],
|
|
22292
|
+
[1, "sas", tstr, "opt"],
|
|
22293
|
+
// Reserved: decode-only.
|
|
22294
|
+
[2, "exchangeReady", bool]
|
|
22295
|
+
]);
|
|
22296
|
+
var approvalReadiness = {
|
|
22297
|
+
...approvalReadinessShape,
|
|
22298
|
+
enc: (v) => approvalReadinessShape.enc({ ...v, sas: void 0 })
|
|
22299
|
+
};
|
|
22300
|
+
var recoveryKeyStatus = struct("recovery-key-status", [
|
|
22301
|
+
[0, "configured", bool],
|
|
22302
|
+
[1, "device", uuid2, "opt"]
|
|
22303
|
+
]);
|
|
22304
|
+
var recoveryKeyCreated = struct("recovery-key-created", [
|
|
22305
|
+
[0, "phrase", tstr],
|
|
22306
|
+
[1, "device", uuid2]
|
|
22307
|
+
]);
|
|
22308
|
+
var ACCOUNT_KEY_STATES = ["idle", "reading_ahead", "pending_grant", "keyed", "refused"];
|
|
22309
|
+
var accountKeyState = enumOf("account-key-state", ACCOUNT_KEY_STATES);
|
|
22310
|
+
var accountKeyStatus = struct("account-key-status", [
|
|
22311
|
+
[0, "state", accountKeyState],
|
|
22312
|
+
[1, "problem", problem, "opt"]
|
|
22313
|
+
]);
|
|
22314
|
+
|
|
22315
|
+
// src/history.ts
|
|
22316
|
+
var recordHistoryParams = struct("record-history-params", [
|
|
22317
|
+
[0, "record", uuid2],
|
|
22318
|
+
[1, "before", uint, "opt"],
|
|
22319
|
+
[2, "limit", uint, "opt"]
|
|
22320
|
+
]);
|
|
22321
|
+
var recordVersionParams = struct("record-version-params", [
|
|
22322
|
+
[0, "record", uuid2],
|
|
22323
|
+
[1, "seq", uint]
|
|
22324
|
+
]);
|
|
22325
|
+
var authorRef2 = struct("author-ref", [
|
|
22326
|
+
[0, "account", uuid2],
|
|
22327
|
+
[1, "device", uuid2],
|
|
22328
|
+
[2, "grant", uuid2, "opt"],
|
|
22329
|
+
[3, "grantAccount", uuid2, "opt"]
|
|
22330
|
+
]);
|
|
22331
|
+
var historyVersion = struct("history-version", [
|
|
22332
|
+
[0, "seq", uint],
|
|
22333
|
+
[1, "time", int3],
|
|
22334
|
+
[2, "author", authorRef2],
|
|
22335
|
+
[3, "kind", enumOf("version-kind", ["created", "edited", "moved", "deleted"])],
|
|
22336
|
+
[4, "path", tstr],
|
|
22337
|
+
[5, "revision", hash, "opt"],
|
|
22338
|
+
[6, "source", enumOf("source", ["api", "external"])],
|
|
22339
|
+
[7, "deviceKind", deviceKind],
|
|
22340
|
+
[8, "app", tstr, "opt"]
|
|
22341
|
+
]);
|
|
22342
|
+
var recordHistory = struct("record-history", [
|
|
22343
|
+
[0, "versions", list(historyVersion)],
|
|
22344
|
+
[1, "from", uint],
|
|
22345
|
+
[2, "fromTime", int3, "opt"],
|
|
22346
|
+
[3, "next", uint, "opt"]
|
|
22347
|
+
]);
|
|
22348
|
+
var recordVersion = struct("record-version", [
|
|
22349
|
+
[0, "path", tstr],
|
|
22350
|
+
[1, "document", tstr]
|
|
22351
|
+
]);
|
|
22352
|
+
|
|
22253
22353
|
// src/settle.ts
|
|
22254
22354
|
var DEFAULT_WAIT_MS = 3e3;
|
|
22255
22355
|
var cancelled = (e) => isMdbaseError(e, "cancelled");
|
|
@@ -24216,57 +24316,6 @@ async function applyTypePack(client, plan, o = {}) {
|
|
|
24216
24316
|
return { outcome: receipt3.state === "confirmed" ? "applied" : "pending", receipt: applied.desired, write };
|
|
24217
24317
|
}
|
|
24218
24318
|
|
|
24219
|
-
// src/private.ts
|
|
24220
|
-
var DEVICE_KINDS = ["desktop", "mobile", "app_runtime", "cli", "hosted", "escrow", "recovery"];
|
|
24221
|
-
var kinds = enumOf("device-kind", DEVICE_KINDS);
|
|
24222
|
-
var deviceKind = {
|
|
24223
|
-
name: "device-kind",
|
|
24224
|
-
enc: (v) => kinds.enc(v),
|
|
24225
|
-
dec: (c) => {
|
|
24226
|
-
try {
|
|
24227
|
-
return kinds.dec(c);
|
|
24228
|
-
} catch {
|
|
24229
|
-
return "unknown";
|
|
24230
|
-
}
|
|
24231
|
-
}
|
|
24232
|
-
};
|
|
24233
|
-
var pendingDeviceShape = struct("pending-device", [
|
|
24234
|
-
[0, "device", uuid2],
|
|
24235
|
-
[1, "account", uuid2],
|
|
24236
|
-
[2, "kind", deviceKind],
|
|
24237
|
-
[3, "sas", tstr, "opt"],
|
|
24238
|
-
// Host response only; omitted from client encodings.
|
|
24239
|
-
[4, "exchangeReady", bool]
|
|
24240
|
-
]);
|
|
24241
|
-
var pendingDevice = {
|
|
24242
|
-
...pendingDeviceShape,
|
|
24243
|
-
enc: (v) => pendingDeviceShape.enc({ ...v, sas: void 0 })
|
|
24244
|
-
};
|
|
24245
|
-
var approvalReadinessShape = struct("approval-readiness", [
|
|
24246
|
-
[0, "device", uuid2],
|
|
24247
|
-
[1, "sas", tstr, "opt"],
|
|
24248
|
-
// Reserved: decode-only.
|
|
24249
|
-
[2, "exchangeReady", bool]
|
|
24250
|
-
]);
|
|
24251
|
-
var approvalReadiness = {
|
|
24252
|
-
...approvalReadinessShape,
|
|
24253
|
-
enc: (v) => approvalReadinessShape.enc({ ...v, sas: void 0 })
|
|
24254
|
-
};
|
|
24255
|
-
var recoveryKeyStatus = struct("recovery-key-status", [
|
|
24256
|
-
[0, "configured", bool],
|
|
24257
|
-
[1, "device", uuid2, "opt"]
|
|
24258
|
-
]);
|
|
24259
|
-
var recoveryKeyCreated = struct("recovery-key-created", [
|
|
24260
|
-
[0, "phrase", tstr],
|
|
24261
|
-
[1, "device", uuid2]
|
|
24262
|
-
]);
|
|
24263
|
-
var ACCOUNT_KEY_STATES = ["idle", "reading_ahead", "pending_grant", "keyed", "refused"];
|
|
24264
|
-
var accountKeyState = enumOf("account-key-state", ACCOUNT_KEY_STATES);
|
|
24265
|
-
var accountKeyStatus = struct("account-key-status", [
|
|
24266
|
-
[0, "state", accountKeyState],
|
|
24267
|
-
[1, "problem", problem, "opt"]
|
|
24268
|
-
]);
|
|
24269
|
-
|
|
24270
24319
|
// src/write-ledger.ts
|
|
24271
24320
|
function memoryWriteLedgerStore() {
|
|
24272
24321
|
const rows2 = /* @__PURE__ */ new Map();
|
|
@@ -24450,6 +24499,14 @@ function params(entries) {
|
|
|
24450
24499
|
for (const [k, v] of entries) if (v !== void 0) m2.set(k, v);
|
|
24451
24500
|
return m2;
|
|
24452
24501
|
}
|
|
24502
|
+
function historyRead(read) {
|
|
24503
|
+
return read.catch((e) => {
|
|
24504
|
+
if (isMdbaseError(e, "invalid_request") && e.reason === "unknown_method") {
|
|
24505
|
+
throw mdbaseError("upgrade_required", "This collection's replica has no record history.", "history_unsupported");
|
|
24506
|
+
}
|
|
24507
|
+
throw e;
|
|
24508
|
+
});
|
|
24509
|
+
}
|
|
24453
24510
|
function withCurrentGrant(hello, grant) {
|
|
24454
24511
|
const prior = hello.grant;
|
|
24455
24512
|
if (!grant || prior.grant === grant.grant && prior.role === grant.role && valueEquals(prior.capabilities, grant.capabilities) && valueEquals(prior.fileFolders ?? null, grant.fileFolders ?? null)) return hello;
|
|
@@ -24662,7 +24719,9 @@ var READ_METHODS = /* @__PURE__ */ new Set([
|
|
|
24662
24719
|
"new_type_file",
|
|
24663
24720
|
"get_contract_v1",
|
|
24664
24721
|
"map_contract_write_v1",
|
|
24665
|
-
"plan_type_pack_v1"
|
|
24722
|
+
"plan_type_pack_v1",
|
|
24723
|
+
"record_history",
|
|
24724
|
+
"record_version"
|
|
24666
24725
|
]);
|
|
24667
24726
|
var MdbaseClient = class _MdbaseClient {
|
|
24668
24727
|
constructor(opts, session) {
|
|
@@ -24721,6 +24780,7 @@ var MdbaseClient = class _MdbaseClient {
|
|
|
24721
24780
|
presence;
|
|
24722
24781
|
writeLedger;
|
|
24723
24782
|
ledgerStarted = false;
|
|
24783
|
+
queryAnswered = false;
|
|
24724
24784
|
transportDeferred = false;
|
|
24725
24785
|
/**
|
|
24726
24786
|
* Unconfirmed and refused writes, and the overall save state. Survives a
|
|
@@ -25387,7 +25447,14 @@ var MdbaseClient = class _MdbaseClient {
|
|
|
25387
25447
|
[2, o.contract]
|
|
25388
25448
|
]),
|
|
25389
25449
|
{ codec: queryResult, retry: true, ...o.signal ? { signal: o.signal } : {} }
|
|
25390
|
-
);
|
|
25450
|
+
).then((result2) => this.firstQueryResult(result2));
|
|
25451
|
+
}
|
|
25452
|
+
firstQueryResult(result2) {
|
|
25453
|
+
if (!this.queryAnswered) {
|
|
25454
|
+
this.queryAnswered = true;
|
|
25455
|
+
performanceMark("mdbase:query:first-result");
|
|
25456
|
+
}
|
|
25457
|
+
return result2;
|
|
25391
25458
|
}
|
|
25392
25459
|
/** Canonical contract projections with validation issues and ordinary cursor
|
|
25393
25460
|
* metadata. Positive page sizes above the producer's 128-record maximum clamp
|
|
@@ -25409,7 +25476,7 @@ var MdbaseClient = class _MdbaseClient {
|
|
|
25409
25476
|
if (result2.version !== 1) throw mdbaseError("upgrade_required", "unsupported contract query result", "contract_query_version");
|
|
25410
25477
|
if (result2.records.length !== result2.page.records.length || result2.records.some((record3, i) => record3.id !== result2.page.records[i]?.id))
|
|
25411
25478
|
throw mdbaseError("unavailable", "invalid contract query record binding", "contract_query_response");
|
|
25412
|
-
return result2;
|
|
25479
|
+
return this.firstQueryResult(result2);
|
|
25413
25480
|
}
|
|
25414
25481
|
/**
|
|
25415
25482
|
* One page of the records whose links resolve to `target`, from the
|
|
@@ -25466,6 +25533,29 @@ var MdbaseClient = class _MdbaseClient {
|
|
|
25466
25533
|
throw e;
|
|
25467
25534
|
});
|
|
25468
25535
|
}
|
|
25536
|
+
/**
|
|
25537
|
+
* Record history (§4.4, API 1.4): the versions of a record that the log still
|
|
25538
|
+
* retains. Needs `collection.read` and `history.read` through a grant without
|
|
25539
|
+
* a folder scope. A replica without history,
|
|
25540
|
+
* the hosted replica and a local-only collection refuse with
|
|
25541
|
+
* `upgrade_required` / `history_unsupported`.
|
|
25542
|
+
*/
|
|
25543
|
+
history = {
|
|
25544
|
+
/** One page of a record's versions, newest first. Pass `next` as `before`
|
|
25545
|
+
* for older ones. `o.signal` cancels the read. */
|
|
25546
|
+
list: (record3, o = {}) => historyRead(this.call("record_history", recordHistoryParams.enc({ record: record3, before: o.before, limit: o.limit }), {
|
|
25547
|
+
codec: recordHistory,
|
|
25548
|
+
retry: true,
|
|
25549
|
+
...o.signal ? { signal: o.signal } : {}
|
|
25550
|
+
})),
|
|
25551
|
+
/** The exact document of the version at log position `seq`, checked
|
|
25552
|
+
* against its revision. `o.signal` cancels the read. */
|
|
25553
|
+
version: (record3, seq2, o = {}) => historyRead(this.call("record_version", recordVersionParams.enc({ record: record3, seq: seq2 }), {
|
|
25554
|
+
codec: recordVersion,
|
|
25555
|
+
retry: true,
|
|
25556
|
+
...o.signal ? { signal: o.signal } : {}
|
|
25557
|
+
}))
|
|
25558
|
+
};
|
|
25469
25559
|
/** Definitions: `mdbase.yaml`, type files, contract files (§4.1). */
|
|
25470
25560
|
resources = {
|
|
25471
25561
|
/** One definition by path. `o.signal` cancels the read. */
|
|
@@ -25628,6 +25718,10 @@ var MdbaseClient = class _MdbaseClient {
|
|
|
25628
25718
|
live(query, o = {}) {
|
|
25629
25719
|
const l = new LiveQuery(this, query, o.include);
|
|
25630
25720
|
this.lives.add(l);
|
|
25721
|
+
void l.ready.then(() => {
|
|
25722
|
+
this.firstQueryResult(void 0);
|
|
25723
|
+
}, () => {
|
|
25724
|
+
});
|
|
25631
25725
|
void this._resubscribeLive(l, true);
|
|
25632
25726
|
return l;
|
|
25633
25727
|
}
|