@mdbase-dev/sdk 0.1.0-beta.231 → 0.1.1

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.
Files changed (59) hide show
  1. package/dist/app-host/bases-wire.d.ts +18 -2
  2. package/dist/app-host/bases-wire.js +13 -4
  3. package/dist/app-host/bases-wire.js.map +1 -1
  4. package/dist/app-host/index.d.ts +1 -1
  5. package/dist/application/asset-pins.json +4 -4
  6. package/dist/application/manifest.d.ts +2 -2
  7. package/dist/application/worker-session.d.ts +2 -2
  8. package/dist/application/worker.js +200 -109
  9. package/dist/browser/mdbase-sdk.js +238 -135
  10. package/dist/browser/mdbase-sdk.min.js +58 -58
  11. package/dist/client.d.ts +20 -0
  12. package/dist/client.js +41 -4
  13. package/dist/client.js.map +1 -1
  14. package/dist/collection-api.d.ts +1 -0
  15. package/dist/collection-api.js.map +1 -1
  16. package/dist/describe-error.d.ts +1 -1
  17. package/dist/describe-error.js +2 -1
  18. package/dist/describe-error.js.map +1 -1
  19. package/dist/history.d.ts +66 -0
  20. package/dist/history.js +55 -0
  21. package/dist/history.js.map +1 -0
  22. package/dist/native/provenance.json +5 -5
  23. package/dist/native/runtime.wasm +0 -0
  24. package/dist/private.js +3 -2
  25. package/dist/private.js.map +1 -1
  26. package/dist/session.js +1 -1
  27. package/dist/session.js.map +1 -1
  28. package/dist/testing/memory-replica.js +6 -2
  29. package/dist/testing/memory-replica.js.map +1 -1
  30. package/node_modules/@mdbase-dev/connect-protocol/LICENSE +21 -0
  31. package/node_modules/@mdbase-dev/connect-protocol/dist/application-contract.d.ts +28 -0
  32. package/node_modules/@mdbase-dev/connect-protocol/dist/application-contract.js +21 -0
  33. package/node_modules/@mdbase-dev/connect-protocol/dist/application-declaration.d.ts +1 -1
  34. package/node_modules/@mdbase-dev/connect-protocol/dist/capabilities.d.ts +1 -0
  35. package/node_modules/@mdbase-dev/connect-protocol/dist/capabilities.js +2 -1
  36. package/node_modules/@mdbase-dev/connect-protocol/dist/connect-problems.generated.d.ts +14 -0
  37. package/node_modules/@mdbase-dev/connect-protocol/dist/connect-problems.generated.js +16 -0
  38. package/node_modules/@mdbase-dev/connect-protocol/dist/index.d.ts +2 -1
  39. package/node_modules/@mdbase-dev/connect-protocol/dist/index.js +2 -1
  40. package/node_modules/@mdbase-dev/connect-protocol/dist/manifest-validators.generated.js +4 -4
  41. package/node_modules/@mdbase-dev/connect-protocol/dist/manifest.d.ts +5 -0
  42. package/node_modules/@mdbase-dev/connect-protocol/dist/manifest.js +19 -19
  43. package/node_modules/@mdbase-dev/connect-protocol/dist/operations.d.ts +1 -1
  44. package/node_modules/@mdbase-dev/connect-protocol/dist/operations.js +9 -3
  45. package/node_modules/@mdbase-dev/connect-protocol/dist/service-urls.d.ts +11 -0
  46. package/node_modules/@mdbase-dev/connect-protocol/dist/service-urls.js +51 -0
  47. package/node_modules/@mdbase-dev/connect-protocol/package.json +7 -7
  48. package/node_modules/@mdbase-dev/connect-protocol/schemas/application-capability-catalog.v2.json +4 -0
  49. package/node_modules/@mdbase-dev/connect-protocol/schemas/connect-problem.v1.schema.json +57 -0
  50. package/node_modules/@mdbase-dev/connect-protocol/schemas/connect-problems.v1.catalog.json +11 -0
  51. package/node_modules/@mdbase-dev/connect-protocol/schemas/connect-protocol.v1.schema.json +1 -1
  52. package/node_modules/@mdbase-dev/connect-protocol/schemas/mdbase-app.schema.json +2 -1
  53. package/node_modules/@mdbase-dev/connect-protocol/schemas/operation-catalog.v1.json +3 -1
  54. package/node_modules/@mdbase-dev/connect-protocol/schemas/operation-mutation-classification.v1.json +28 -0
  55. package/package.json +2 -2
  56. package/vendor/mdbase-connect-sdk-3d3f95b80c9a.json +13 -0
  57. package/vendor/mdbase-dev-connect-protocol-0.1.0-beta.152-3d3f95b80c9a.tgz +0 -0
  58. package/vendor/mdbase-connect-sdk-e6e66bcd172f.json +0 -13
  59. package/vendor/mdbase-dev-connect-protocol-0.1.0-beta.145-e6e66bcd172f.tgz +0 -0
@@ -3155,7 +3155,7 @@ var MdbaseSDK = (() => {
3155
3155
  function encodeAppBasesDiscoveryRequest(request3) {
3156
3156
  const limit = unsigned(request3.limit, 128);
3157
3157
  if (!limit) throw bad2("discovery limit must be positive");
3158
- return encode(/* @__PURE__ */ new Map([[0, 1], [1, text(request3.captureTimezone, 128)], [2, limit], [3, discoveryHandle(request3.continuation)]]));
3158
+ return encode(/* @__PURE__ */ new Map([[0, request3.reportUnreadable ? 2 : 1], [1, text(request3.captureTimezone, 128)], [2, limit], [3, discoveryHandle(request3.continuation)]]));
3159
3159
  }
3160
3160
  function encodeAppBasesSourceRequest(request3) {
3161
3161
  return encode(/* @__PURE__ */ new Map([[0, 1], [1, uuid.enc(request3.record)], [2, hash.enc(request3.sourceRevision)], [3, unsigned(request3.ordinal, 4294967295)], [4, text(request3.captureTimezone, 128)]]));
@@ -3180,7 +3180,11 @@ var MdbaseSDK = (() => {
3180
3180
  text(clock2.localDate, 128);
3181
3181
  return clock2;
3182
3182
  }
3183
- function decodeAppBasesDiscoveryResult(bytes10, expectedLimit = 128) {
3183
+ function unreadableSource(value2) {
3184
+ const m2 = fields(value2, [0, 1, 2, 3, 4]);
3185
+ return { record: uuid.dec(m2.get(0)), path: text(m2.get(1)), sourceRevision: hash.dec(m2.get(2)), reason: text(m2.get(3), 128), detail: text(m2.get(4), 128) };
3186
+ }
3187
+ function decodeAppBasesDiscoveryResult(bytes10, expectedLimit = 128, reportUnreadable = false) {
3184
3188
  const limit = unsigned(expectedLimit, 128);
3185
3189
  if (!limit) throw bad2("discovery limit must be positive");
3186
3190
  const value2 = discoveryEnvelope(bytes10);
@@ -3188,7 +3192,9 @@ var MdbaseSDK = (() => {
3188
3192
  const m3 = fields(value2, [0, 7]);
3189
3193
  return { kind: "refusal", problem: problem.dec(m3.get(7)) };
3190
3194
  }
3191
- const m2 = fields(value2, [0, 1, 2, 3, 4]);
3195
+ const m2 = fields(value2, reportUnreadable ? [0, 1, 2, 3, 4, 5] : [0, 1, 2, 3, 4]);
3196
+ const unreadable = reportUnreadable ? list2(m2.get(5), 128).map(unreadableSource) : [];
3197
+ for (let i = 1; i < unreadable.length; i++) if (unreadable[i - 1].record >= unreadable[i].record) throw bad2("unreadable sources must ascend by record");
3192
3198
  const views = list2(m2.get(1), limit).map(discoveryDescriptor);
3193
3199
  for (let i = 1; i < views.length; i++) {
3194
3200
  const previous = views[i - 1], next = views[i];
@@ -3197,7 +3203,7 @@ var MdbaseSDK = (() => {
3197
3203
  }
3198
3204
  const token = m2.get(4);
3199
3205
  if (token !== null && !(token instanceof Uint8Array)) throw bad2("native discovery handle required");
3200
- return { kind: "success", views, clock: discoveryClock(m2.get(2)), collectionRevision: hash.dec(m2.get(3)), continuation: discoveryHandle(token) };
3206
+ return { kind: "success", views, unreadable, clock: discoveryClock(m2.get(2)), collectionRevision: hash.dec(m2.get(3)), continuation: discoveryHandle(token) };
3201
3207
  }
3202
3208
  function decodeAppBasesSourceResult(bytes10, expected) {
3203
3209
  const value2 = discoveryEnvelope(bytes10);
@@ -3667,7 +3673,7 @@ var MdbaseSDK = (() => {
3667
3673
  init_bases_rpc();
3668
3674
  init_original_session();
3669
3675
  init_wire();
3670
- API_VERSIONS = [{ major: 1, minor: 3 }, { major: 1, minor: 2 }, { major: 1, minor: 1 }, { major: 1, minor: 0 }];
3676
+ API_VERSIONS = [{ major: 1, minor: 4 }, { major: 1, minor: 3 }, { major: 1, minor: 2 }, { major: 1, minor: 1 }, { major: 1, minor: 0 }];
3671
3677
  WriteRefusal = class extends MdbaseError {
3672
3678
  constructor(error5, context = {}) {
3673
3679
  super(schemaToError(error5, "submit").toProblem(), { ...context, cause: error5 });
@@ -4428,6 +4434,114 @@ var MdbaseSDK = (() => {
4428
4434
  }
4429
4435
  });
4430
4436
 
4437
+ // src/private.ts
4438
+ function formatSas(sas) {
4439
+ return /^\d{6}$/.test(sas) ? `${sas.slice(0, 3)} ${sas.slice(3)}` : sas;
4440
+ }
4441
+ var DEVICE_KINDS, kinds, deviceKind, pendingDeviceShape, pendingDevice, approvalReadinessShape, approvalReadiness, recoveryKeyStatus, recoveryKeyCreated, ACCOUNT_KEY_STATES, accountKeyState, accountKeyStatus;
4442
+ var init_private = __esm({
4443
+ "src/private.ts"() {
4444
+ "use strict";
4445
+ init_codec();
4446
+ init_wire();
4447
+ DEVICE_KINDS = ["desktop", "mobile", "app_runtime", "cli", "hosted", "escrow", "recovery"];
4448
+ kinds = enumOf("device-kind", DEVICE_KINDS);
4449
+ deviceKind = {
4450
+ name: "device-kind",
4451
+ enc: (v) => kinds.enc(v),
4452
+ dec: (c) => {
4453
+ try {
4454
+ return kinds.dec(c);
4455
+ } catch {
4456
+ return "unknown";
4457
+ }
4458
+ }
4459
+ };
4460
+ pendingDeviceShape = struct("pending-device", [
4461
+ [0, "device", uuid],
4462
+ [1, "account", uuid],
4463
+ [2, "kind", deviceKind],
4464
+ [3, "sas", tstr, "opt"],
4465
+ // Host response only; omitted from client encodings.
4466
+ [4, "exchangeReady", bool]
4467
+ ]);
4468
+ pendingDevice = {
4469
+ ...pendingDeviceShape,
4470
+ enc: (v) => pendingDeviceShape.enc({ ...v, sas: void 0 })
4471
+ };
4472
+ approvalReadinessShape = struct("approval-readiness", [
4473
+ [0, "device", uuid],
4474
+ [1, "sas", tstr, "opt"],
4475
+ // Reserved: decode-only.
4476
+ [2, "exchangeReady", bool]
4477
+ ]);
4478
+ approvalReadiness = {
4479
+ ...approvalReadinessShape,
4480
+ enc: (v) => approvalReadinessShape.enc({ ...v, sas: void 0 })
4481
+ };
4482
+ recoveryKeyStatus = struct("recovery-key-status", [
4483
+ [0, "configured", bool],
4484
+ [1, "device", uuid, "opt"]
4485
+ ]);
4486
+ recoveryKeyCreated = struct("recovery-key-created", [
4487
+ [0, "phrase", tstr],
4488
+ [1, "device", uuid]
4489
+ ]);
4490
+ ACCOUNT_KEY_STATES = ["idle", "reading_ahead", "pending_grant", "keyed", "refused"];
4491
+ accountKeyState = enumOf("account-key-state", ACCOUNT_KEY_STATES);
4492
+ accountKeyStatus = struct("account-key-status", [
4493
+ [0, "state", accountKeyState],
4494
+ [1, "problem", problem, "opt"]
4495
+ ]);
4496
+ }
4497
+ });
4498
+
4499
+ // src/history.ts
4500
+ var recordHistoryParams, recordVersionParams, authorRef2, historyVersion, recordHistory, recordVersion;
4501
+ var init_history = __esm({
4502
+ "src/history.ts"() {
4503
+ "use strict";
4504
+ init_codec();
4505
+ init_private();
4506
+ recordHistoryParams = struct("record-history-params", [
4507
+ [0, "record", uuid],
4508
+ [1, "before", uint, "opt"],
4509
+ [2, "limit", uint, "opt"]
4510
+ ]);
4511
+ recordVersionParams = struct("record-version-params", [
4512
+ [0, "record", uuid],
4513
+ [1, "seq", uint]
4514
+ ]);
4515
+ authorRef2 = struct("author-ref", [
4516
+ [0, "account", uuid],
4517
+ [1, "device", uuid],
4518
+ [2, "grant", uuid, "opt"],
4519
+ [3, "grantAccount", uuid, "opt"]
4520
+ ]);
4521
+ historyVersion = struct("history-version", [
4522
+ [0, "seq", uint],
4523
+ [1, "time", int],
4524
+ [2, "author", authorRef2],
4525
+ [3, "kind", enumOf("version-kind", ["created", "edited", "moved", "deleted"])],
4526
+ [4, "path", tstr],
4527
+ [5, "revision", hash, "opt"],
4528
+ [6, "source", enumOf("source", ["api", "external"])],
4529
+ [7, "deviceKind", deviceKind],
4530
+ [8, "app", tstr, "opt"]
4531
+ ]);
4532
+ recordHistory = struct("record-history", [
4533
+ [0, "versions", list(historyVersion)],
4534
+ [1, "from", uint],
4535
+ [2, "fromTime", int, "opt"],
4536
+ [3, "next", uint, "opt"]
4537
+ ]);
4538
+ recordVersion = struct("record-version", [
4539
+ [0, "path", tstr],
4540
+ [1, "document", tstr]
4541
+ ]);
4542
+ }
4543
+ });
4544
+
4431
4545
  // src/settle.ts
4432
4546
  function unknown(mutationId, reason, text9, receipt4) {
4433
4547
  const problem7 = { code: "outcome_unknown", recovery: "resolve_outcome", reason, message: text9 };
@@ -6627,68 +6741,6 @@ var MdbaseSDK = (() => {
6627
6741
  }
6628
6742
  });
6629
6743
 
6630
- // src/private.ts
6631
- function formatSas(sas) {
6632
- return /^\d{6}$/.test(sas) ? `${sas.slice(0, 3)} ${sas.slice(3)}` : sas;
6633
- }
6634
- var DEVICE_KINDS, kinds, deviceKind, pendingDeviceShape, pendingDevice, approvalReadinessShape, approvalReadiness, recoveryKeyStatus, recoveryKeyCreated, ACCOUNT_KEY_STATES, accountKeyState, accountKeyStatus;
6635
- var init_private = __esm({
6636
- "src/private.ts"() {
6637
- "use strict";
6638
- init_codec();
6639
- init_wire();
6640
- DEVICE_KINDS = ["desktop", "mobile", "app_runtime", "cli", "hosted", "escrow", "recovery"];
6641
- kinds = enumOf("device-kind", DEVICE_KINDS);
6642
- deviceKind = {
6643
- name: "device-kind",
6644
- enc: (v) => kinds.enc(v),
6645
- dec: (c) => {
6646
- try {
6647
- return kinds.dec(c);
6648
- } catch {
6649
- return "unknown";
6650
- }
6651
- }
6652
- };
6653
- pendingDeviceShape = struct("pending-device", [
6654
- [0, "device", uuid],
6655
- [1, "account", uuid],
6656
- [2, "kind", deviceKind],
6657
- [3, "sas", tstr, "opt"],
6658
- // Host response only; omitted from client encodings.
6659
- [4, "exchangeReady", bool]
6660
- ]);
6661
- pendingDevice = {
6662
- ...pendingDeviceShape,
6663
- enc: (v) => pendingDeviceShape.enc({ ...v, sas: void 0 })
6664
- };
6665
- approvalReadinessShape = struct("approval-readiness", [
6666
- [0, "device", uuid],
6667
- [1, "sas", tstr, "opt"],
6668
- // Reserved: decode-only.
6669
- [2, "exchangeReady", bool]
6670
- ]);
6671
- approvalReadiness = {
6672
- ...approvalReadinessShape,
6673
- enc: (v) => approvalReadinessShape.enc({ ...v, sas: void 0 })
6674
- };
6675
- recoveryKeyStatus = struct("recovery-key-status", [
6676
- [0, "configured", bool],
6677
- [1, "device", uuid, "opt"]
6678
- ]);
6679
- recoveryKeyCreated = struct("recovery-key-created", [
6680
- [0, "phrase", tstr],
6681
- [1, "device", uuid]
6682
- ]);
6683
- ACCOUNT_KEY_STATES = ["idle", "reading_ahead", "pending_grant", "keyed", "refused"];
6684
- accountKeyState = enumOf("account-key-state", ACCOUNT_KEY_STATES);
6685
- accountKeyStatus = struct("account-key-status", [
6686
- [0, "state", accountKeyState],
6687
- [1, "problem", problem, "opt"]
6688
- ]);
6689
- }
6690
- });
6691
-
6692
6744
  // src/write-ledger.ts
6693
6745
  function memoryWriteLedgerStore() {
6694
6746
  const rows2 = /* @__PURE__ */ new Map();
@@ -6884,6 +6936,14 @@ var MdbaseSDK = (() => {
6884
6936
  for (const [k, v] of entries) if (v !== void 0) m2.set(k, v);
6885
6937
  return m2;
6886
6938
  }
6939
+ function historyRead(read2) {
6940
+ return read2.catch((e) => {
6941
+ if (isMdbaseError(e, "invalid_request") && e.reason === "unknown_method") {
6942
+ throw mdbaseError("upgrade_required", "This collection's replica has no record history.", "history_unsupported");
6943
+ }
6944
+ throw e;
6945
+ });
6946
+ }
6887
6947
  function withCurrentGrant(hello, grant) {
6888
6948
  const prior = hello.grant;
6889
6949
  if (!grant || prior.grant === grant.grant && prior.role === grant.role && valueEquals(prior.capabilities, grant.capabilities) && valueEquals(prior.fileFolders ?? null, grant.fileFolders ?? null)) return hello;
@@ -6910,7 +6970,7 @@ var MdbaseSDK = (() => {
6910
6970
  function connect(opts) {
6911
6971
  return MdbaseClient.connect(opts);
6912
6972
  }
6913
- var CHANGES_PAGE, VALIDATE_PAGE, Write, LiveQuery, READ_METHODS, MdbaseClient;
6973
+ var CHANGES_PAGE, VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE, Write, LiveQuery, READ_METHODS, MdbaseClient;
6914
6974
  var init_client = __esm({
6915
6975
  "src/client.ts"() {
6916
6976
  "use strict";
@@ -6922,6 +6982,7 @@ var MdbaseSDK = (() => {
6922
6982
  init_validation();
6923
6983
  init_errors();
6924
6984
  init_files();
6985
+ init_history();
6925
6986
  init_settle();
6926
6987
  init_read_helpers();
6927
6988
  init_records();
@@ -6944,6 +7005,7 @@ var MdbaseSDK = (() => {
6944
7005
  init_wire();
6945
7006
  CHANGES_PAGE = 1e3;
6946
7007
  VALIDATE_PAGE = "validate-page-v1";
7008
+ BASES_DISCOVERY_UNREADABLE = "bases-discovery-unreadable-v1";
6947
7009
  Write = class {
6948
7010
  constructor(receipt4) {
6949
7011
  this.receipt = receipt4;
@@ -7133,7 +7195,9 @@ var MdbaseSDK = (() => {
7133
7195
  "new_type_file",
7134
7196
  "get_contract_v1",
7135
7197
  "map_contract_write_v1",
7136
- "plan_type_pack_v1"
7198
+ "plan_type_pack_v1",
7199
+ "record_history",
7200
+ "record_version"
7137
7201
  ]);
7138
7202
  MdbaseClient = class _MdbaseClient {
7139
7203
  constructor(opts, session) {
@@ -7310,7 +7374,7 @@ var MdbaseSDK = (() => {
7310
7374
  versions: API_VERSIONS,
7311
7375
  clientName: opts.app.name,
7312
7376
  clientVersion: opts.app.version,
7313
- features: [.../* @__PURE__ */ new Set([...opts.features ?? [], "declared-collection-setup-v1", "file-stream-failure-v1", VALIDATE_PAGE])],
7377
+ features: [.../* @__PURE__ */ new Set([...opts.features ?? [], "declared-collection-setup-v1", "file-stream-failure-v1", VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE])],
7314
7378
  ...tz ? { timezone: tz } : {}
7315
7379
  };
7316
7380
  }
@@ -7945,6 +8009,29 @@ var MdbaseSDK = (() => {
7945
8009
  throw e;
7946
8010
  });
7947
8011
  }
8012
+ /**
8013
+ * Record history (§4.4, API 1.4): the versions of a record that the log still
8014
+ * retains. Needs `collection.read` and `history.read` through a grant without
8015
+ * a folder scope. A replica without history,
8016
+ * the hosted replica and a local-only collection refuse with
8017
+ * `upgrade_required` / `history_unsupported`.
8018
+ */
8019
+ history = {
8020
+ /** One page of a record's versions, newest first. Pass `next` as `before`
8021
+ * for older ones. `o.signal` cancels the read. */
8022
+ list: (record5, o = {}) => historyRead(this.call("record_history", recordHistoryParams.enc({ record: record5, before: o.before, limit: o.limit }), {
8023
+ codec: recordHistory,
8024
+ retry: true,
8025
+ ...o.signal ? { signal: o.signal } : {}
8026
+ })),
8027
+ /** The exact document of the version at log position `seq`, checked
8028
+ * against its revision. `o.signal` cancels the read. */
8029
+ version: (record5, seq2, o = {}) => historyRead(this.call("record_version", recordVersionParams.enc({ record: record5, seq: seq2 }), {
8030
+ codec: recordVersion,
8031
+ retry: true,
8032
+ ...o.signal ? { signal: o.signal } : {}
8033
+ }))
8034
+ };
7948
8035
  /** Definitions: `mdbase.yaml`, type files, contract files (§4.1). */
7949
8036
  resources = {
7950
8037
  /** One definition by path. `o.signal` cancels the read. */
@@ -8393,15 +8480,22 @@ var MdbaseSDK = (() => {
8393
8480
  }
8394
8481
  /** One bounded native discovery page. Empty views do not mean EOF when a
8395
8482
  * continuation is present. Supplied handles never silently restart/retry.
8483
+ * With `reportUnreadable`, a replica that grants
8484
+ * `bases-discovery-unreadable-v1` skips records it cannot classify and names
8485
+ * them in `unreadable`; an older replica refuses the discovery as before, so
8486
+ * an empty `unreadable` on success always means none were skipped.
8396
8487
  * `o.signal` cancels the read. */
8397
8488
  async listAppBasesViews(request3, o = {}) {
8398
8489
  const signal = o.signal;
8399
- const limit = request3.limit, bytes10 = encodeAppBasesDiscoveryRequest(request3);
8490
+ const limit = request3.limit;
8491
+ encodeAppBasesDiscoveryRequest(request3);
8400
8492
  const session = await this.readyForRead(signal);
8493
+ const reportUnreadable = request3.reportUnreadable === true && session.hello.features.includes(BASES_DISCOVERY_UNREADABLE);
8494
+ const bytes10 = encodeAppBasesDiscoveryRequest({ ...request3, reportUnreadable });
8401
8495
  const reply = await session.readAppBasesDiscovery("list-views", bytes10, signal);
8402
8496
  try {
8403
8497
  if (session !== this.session || session.closed || this.readFencedAt !== null) throw mdbaseError("unavailable", "original Bases session is no longer current");
8404
- return decodeAppBasesDiscoveryResult(reply, limit);
8498
+ return decodeAppBasesDiscoveryResult(reply, limit, reportUnreadable);
8405
8499
  } catch (error5) {
8406
8500
  throw schemaToError(error5, "app Bases discovery");
8407
8501
  } finally {
@@ -9606,6 +9700,7 @@ var MdbaseSDK = (() => {
9606
9700
  "people_unsupported",
9607
9701
  "people_permission_declined",
9608
9702
  "people_access",
9703
+ "history_unsupported",
9609
9704
  "configuration_conflict",
9610
9705
  "configuration_unavailable",
9611
9706
  "configuration_unsupported",
@@ -9743,6 +9838,7 @@ var MdbaseSDK = (() => {
9743
9838
  people_unsupported: ["Sharing isn't available here", "People and sharing aren't supported for this collection yet.", "none", "info"],
9744
9839
  people_permission_declined: ["People aren't shown", "This app wasn't allowed to see who else is in this collection. Approve it again and allow people to show them here.", "approve", "info", false, "Approve again"],
9745
9840
  people_access: ["People can't be shown", "This app can't see the people in this collection right now. Everything else still works.", "none", "info"],
9841
+ history_unsupported: ["History isn't available here", "Earlier versions of records in this collection can't be read here. Everything else still works.", "none", "info"],
9746
9842
  configuration_conflict: ["Settings changed elsewhere", "These settings were changed on another device. Review them and try again.", "retry", "warning"],
9747
9843
  // The collection's setup couldn't be assessed: not a network problem.
9748
9844
  configuration_unavailable: ["Couldn't check this collection's setup", "The app couldn't read how this collection is set up, so it didn't open it. Nothing in the collection was changed. Try again, and contact support if it keeps happening.", "retry", "warning"],
@@ -17090,7 +17186,7 @@ ${end.comment}` : end.comment;
17090
17186
  const len0 = data1.length;
17091
17187
  for (let i0 = 0; i0 < len0; i0++) {
17092
17188
  let data2 = data1[i0];
17093
- 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")) {
17189
+ 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")) {
17094
17190
  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" };
17095
17191
  if (vErrors === null) {
17096
17192
  vErrors = [err5];
@@ -17143,7 +17239,7 @@ ${end.comment}` : end.comment;
17143
17239
  const len1 = data3.length;
17144
17240
  for (let i2 = 0; i2 < len1; i2++) {
17145
17241
  let data4 = data3[i2];
17146
- 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")) {
17242
+ 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")) {
17147
17243
  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" };
17148
17244
  if (vErrors === null) {
17149
17245
  vErrors = [err9];
@@ -24063,7 +24159,7 @@ ${end.comment}` : end.comment;
24063
24159
  "node_modules/@mdbase-dev/connect-protocol/dist/manifest-validators.generated.js"() {
24064
24160
  "use strict";
24065
24161
  appManifestValidator = validate20;
24066
- 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://" } } }] } } };
24162
+ 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://" } } }] } } };
24067
24163
  func1 = Object.prototype.hasOwnProperty;
24068
24164
  func2 = (function ucs2length(str3) {
24069
24165
  const len = str3.length;
@@ -24093,7 +24189,7 @@ ${end.comment}` : end.comment;
24093
24189
  })();
24094
24190
  validate21.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
24095
24191
  schema39 = { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["identity", "members"] } };
24096
- schema37 = { "enum": ["collection.read", "records.create", "records.edit", "records.delete", "views.manage", "definitions.manage", "background.schedule", "offline.replica"] };
24192
+ schema37 = { "enum": ["collection.read", "records.create", "records.edit", "records.delete", "views.manage", "definitions.manage", "background.schedule", "offline.replica", "history.read"] };
24097
24193
  func0 = (function equal2(a, b) {
24098
24194
  if (a === b)
24099
24195
  return true;
@@ -24171,15 +24267,6 @@ ${end.comment}` : end.comment;
24171
24267
  }
24172
24268
  });
24173
24269
 
24174
- // node_modules/@mdbase-dev/connect-protocol/dist/collection-setup.js
24175
- var RECORD_EXTENSIONS_CONFIGURATION_PATH, YAML_DOCUMENT_RECORDS_CAPABILITY;
24176
- var init_collection_setup = __esm({
24177
- "node_modules/@mdbase-dev/connect-protocol/dist/collection-setup.js"() {
24178
- RECORD_EXTENSIONS_CONFIGURATION_PATH = "/settings/record_extensions";
24179
- YAML_DOCUMENT_RECORDS_CAPABILITY = "yaml-document-records-v1";
24180
- }
24181
- });
24182
-
24183
24270
  // node_modules/@mdbase-dev/connect-protocol/dist/capabilities.js
24184
24271
  function capabilityOperationsForContractVersion(contractVersion, capability) {
24185
24272
  const definitions = contractVersion === 1 ? APPLICATION_CAPABILITY_V1_DEFINITIONS : contractVersion === 2 ? APPLICATION_CAPABILITY_DEFINITIONS : void 0;
@@ -24199,7 +24286,8 @@ ${end.comment}` : end.comment;
24199
24286
  "views.manage": ["create_view_source", "update_view_source", "delete_view_source"],
24200
24287
  "definitions.manage": ["create_type", "update_type", "assess_type_pack", "apply_type_pack"],
24201
24288
  "background.schedule": ["list_timers", "put_timer", "cancel_timer", "reconcile_timers"],
24202
- "offline.replica": ["sync"]
24289
+ "offline.replica": ["sync"],
24290
+ "history.read": ["record_history", "record_version"]
24203
24291
  };
24204
24292
  APPLICATION_SETUP_OPERATIONS = [
24205
24293
  "assess_collection_setup",
@@ -24246,11 +24334,26 @@ ${end.comment}` : end.comment;
24246
24334
  }
24247
24335
  });
24248
24336
 
24249
- // node_modules/@mdbase-dev/connect-protocol/dist/records.js
24250
- var MAX_READ_MANY_RESPONSE_BYTES;
24251
- var init_records2 = __esm({
24252
- "node_modules/@mdbase-dev/connect-protocol/dist/records.js"() {
24253
- MAX_READ_MANY_RESPONSE_BYTES = 8 * 1024 * 1024;
24337
+ // node_modules/@mdbase-dev/connect-protocol/dist/files.js
24338
+ function applicationFileRequest(requirement, options = {}) {
24339
+ return {
24340
+ actions: [.../* @__PURE__ */ new Set([
24341
+ ...requirement.required,
24342
+ ...options.includeOptional === false ? [] : requirement.optional ?? []
24343
+ ])],
24344
+ scope: structuredClone(requirement.scope)
24345
+ };
24346
+ }
24347
+ var DEFAULT_FILE_CHUNK_BYTES, MAX_FILE_CHUNK_BYTES, MAX_FILE_FRAME_HEADER_BYTES, FILE_FRAME_PREFIX_BYTES, MAX_FILE_FRAME_BYTES, FILE_FRAME_MAGIC_BYTES, RELAY_FILE_MAGIC_BYTES;
24348
+ var init_files2 = __esm({
24349
+ "node_modules/@mdbase-dev/connect-protocol/dist/files.js"() {
24350
+ DEFAULT_FILE_CHUNK_BYTES = 1024 * 1024;
24351
+ MAX_FILE_CHUNK_BYTES = 4 * 1024 * 1024;
24352
+ MAX_FILE_FRAME_HEADER_BYTES = 16 * 1024;
24353
+ FILE_FRAME_PREFIX_BYTES = 16;
24354
+ MAX_FILE_FRAME_BYTES = FILE_FRAME_PREFIX_BYTES + MAX_FILE_FRAME_HEADER_BYTES + MAX_FILE_CHUNK_BYTES + 16;
24355
+ FILE_FRAME_MAGIC_BYTES = new Uint8Array([77, 68, 66, 70]);
24356
+ RELAY_FILE_MAGIC_BYTES = new Uint8Array([77, 68, 66, 82]);
24254
24357
  }
24255
24358
  });
24256
24359
 
@@ -24338,6 +24441,7 @@ ${end.comment}` : end.comment;
24338
24441
  "manifest_load_failed": { category: "availability", recovery: "retry" },
24339
24442
  "manifest_required": { category: "validation", recovery: "fix_request" },
24340
24443
  "missing_grant_key": { category: "authorization", recovery: "reauthorize" },
24444
+ "mutation_abandoned": { category: "conflict", recovery: "none" },
24341
24445
  "mutation_recovery_expired": { category: "compatibility", recovery: "none" },
24342
24446
  "mutation_request_conflict": { category: "conflict", recovery: "resolve_conflict" },
24343
24447
  "no_pending_mutation": { category: "conflict", recovery: "refresh" },
@@ -24449,30 +24553,23 @@ ${end.comment}` : end.comment;
24449
24553
  }
24450
24554
  });
24451
24555
 
24452
- // node_modules/@mdbase-dev/connect-protocol/dist/files.js
24453
- function applicationFileRequest(requirement, options = {}) {
24556
+ // node_modules/@mdbase-dev/connect-protocol/dist/application-contract.js
24557
+ function normalizeApplicationManifest(value2) {
24558
+ const manifest = structuredClone(value2);
24454
24559
  return {
24455
- actions: [.../* @__PURE__ */ new Set([
24456
- ...requirement.required,
24457
- ...options.includeOptional === false ? [] : requirement.optional ?? []
24458
- ])],
24459
- scope: structuredClone(requirement.scope)
24560
+ ...manifest,
24561
+ requirements: {
24562
+ configuration: [],
24563
+ ...manifest.requirements
24564
+ },
24565
+ provisions: {
24566
+ type_packs: [],
24567
+ configuration: [],
24568
+ ...manifest.provisions
24569
+ },
24570
+ notifications: manifest.notifications ?? { criteria: [] }
24460
24571
  };
24461
24572
  }
24462
- var DEFAULT_FILE_CHUNK_BYTES, MAX_FILE_CHUNK_BYTES, MAX_FILE_FRAME_HEADER_BYTES, FILE_FRAME_PREFIX_BYTES, MAX_FILE_FRAME_BYTES, FILE_FRAME_MAGIC_BYTES, RELAY_FILE_MAGIC_BYTES;
24463
- var init_files2 = __esm({
24464
- "node_modules/@mdbase-dev/connect-protocol/dist/files.js"() {
24465
- DEFAULT_FILE_CHUNK_BYTES = 1024 * 1024;
24466
- MAX_FILE_CHUNK_BYTES = 4 * 1024 * 1024;
24467
- MAX_FILE_FRAME_HEADER_BYTES = 16 * 1024;
24468
- FILE_FRAME_PREFIX_BYTES = 16;
24469
- MAX_FILE_FRAME_BYTES = FILE_FRAME_PREFIX_BYTES + MAX_FILE_FRAME_HEADER_BYTES + MAX_FILE_CHUNK_BYTES + 16;
24470
- FILE_FRAME_MAGIC_BYTES = new Uint8Array([77, 68, 66, 70]);
24471
- RELAY_FILE_MAGIC_BYTES = new Uint8Array([77, 68, 66, 82]);
24472
- }
24473
- });
24474
-
24475
- // node_modules/@mdbase-dev/connect-protocol/dist/application-contract.js
24476
24573
  function semanticContractVersion(requirements2) {
24477
24574
  const version3 = requirements2.capabilities === void 0 ? 1 : requirements2.capabilities?.contract_version;
24478
24575
  if (version3 !== 1 && version3 !== 2)
@@ -24543,6 +24640,23 @@ ${end.comment}` : end.comment;
24543
24640
  }
24544
24641
  });
24545
24642
 
24643
+ // node_modules/@mdbase-dev/connect-protocol/dist/collection-setup.js
24644
+ var RECORD_EXTENSIONS_CONFIGURATION_PATH, YAML_DOCUMENT_RECORDS_CAPABILITY;
24645
+ var init_collection_setup = __esm({
24646
+ "node_modules/@mdbase-dev/connect-protocol/dist/collection-setup.js"() {
24647
+ RECORD_EXTENSIONS_CONFIGURATION_PATH = "/settings/record_extensions";
24648
+ YAML_DOCUMENT_RECORDS_CAPABILITY = "yaml-document-records-v1";
24649
+ }
24650
+ });
24651
+
24652
+ // node_modules/@mdbase-dev/connect-protocol/dist/records.js
24653
+ var MAX_READ_MANY_RESPONSE_BYTES;
24654
+ var init_records2 = __esm({
24655
+ "node_modules/@mdbase-dev/connect-protocol/dist/records.js"() {
24656
+ MAX_READ_MANY_RESPONSE_BYTES = 8 * 1024 * 1024;
24657
+ }
24658
+ });
24659
+
24546
24660
  // node_modules/@mdbase-dev/connect-protocol/dist/operations.js
24547
24661
  function mutationOperationIdentifier(operation, input) {
24548
24662
  const object13 = isObject(input) ? input : {};
@@ -24595,7 +24709,9 @@ ${end.comment}` : end.comment;
24595
24709
  "put_timer",
24596
24710
  "cancel_timer",
24597
24711
  "reconcile_timers",
24598
- "sync"
24712
+ "sync",
24713
+ "record_history",
24714
+ "record_version"
24599
24715
  ];
24600
24716
  FILE_CONTROL_MESSAGE_TYPES = [
24601
24717
  "list_files",
@@ -24635,7 +24751,9 @@ ${end.comment}` : end.comment;
24635
24751
  "put_timer": "always",
24636
24752
  "cancel_timer": "always",
24637
24753
  "reconcile_timers": "always",
24638
- "sync": "sync_action"
24754
+ "sync": "sync_action",
24755
+ "record_history": "never",
24756
+ "record_version": "never"
24639
24757
  };
24640
24758
  MUTATING_FILE_CONTROL_MESSAGE_TYPES = /* @__PURE__ */ new Set([
24641
24759
  "open_file_upload",
@@ -24994,23 +25112,7 @@ ${end.comment}` : end.comment;
24994
25112
  const result2 = validateVersionedAppManifest(value2, options);
24995
25113
  if (!result2.valid)
24996
25114
  throw new AppManifestValidationError(result2.issues);
24997
- return declaredContractVersion(value2) === 1 ? { contractVersion: 1, manifest: normalizeManifest(value2) } : { contractVersion: 2, manifest: normalizeManifest(value2) };
24998
- }
24999
- function normalizeManifest(value2) {
25000
- const manifest = structuredClone(value2);
25001
- return {
25002
- ...manifest,
25003
- requirements: {
25004
- configuration: [],
25005
- ...manifest.requirements
25006
- },
25007
- provisions: {
25008
- type_packs: [],
25009
- configuration: [],
25010
- ...manifest.provisions
25011
- },
25012
- notifications: manifest.notifications ?? { criteria: [] }
25013
- };
25115
+ return declaredContractVersion(value2) === 1 ? { contractVersion: 1, manifest: normalizeApplicationManifest(value2) } : { contractVersion: 2, manifest: normalizeApplicationManifest(value2) };
25014
25116
  }
25015
25117
  function formatManifestValidationIssues(issues) {
25016
25118
  return issues.map((issue3) => `${issue3.path || "/"} ${issue3.message}`).join("; ");
@@ -25476,6 +25578,7 @@ ${end.comment}` : end.comment;
25476
25578
  init_utils();
25477
25579
  init_browser();
25478
25580
  init_manifest_validators_generated();
25581
+ init_application_contract();
25479
25582
  init_collection_setup();
25480
25583
  init_dist2();
25481
25584
  APPLICATION_MANIFEST_MAX_BYTES = 524288;
@@ -50447,12 +50550,12 @@ ${end.comment}` : end.comment;
50447
50550
  // src/application/asset-pins.json
50448
50551
  var asset_pins_default = {
50449
50552
  runtime: {
50450
- sha256: "8d01624313252ae512f35ab9ee2f865a9d53699826c1f731280b2dd7f39a93ca",
50451
- bytes: 3926059,
50452
- maxBytes: 3926059,
50553
+ sha256: "31d8cda0e72a21107b5ad0b8bf48d68e9829f8842b0055e7a6fa7c7f2eff3988",
50554
+ bytes: 3981261,
50555
+ maxBytes: 3981261,
50453
50556
  source: {
50454
50557
  repository: "mdbase-dev/mdbase-connect",
50455
- commit: "7439dbd48279f5f64d89fbde9c4326a814c1259a"
50558
+ commit: "eada920017111ad18c44498d56f715c074a7a9e9"
50456
50559
  }
50457
50560
  },
50458
50561
  sqlite: {