@mdbase-dev/sdk 0.1.26 → 0.1.28

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.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "runtime": {
3
- "sha256": "01436d36ed9b45c4ca1904dc13d348e9b6f89c14e98ba6de8402fd8e76718452",
4
- "bytes": 3986055,
5
- "maxBytes": 3986055,
3
+ "sha256": "fd31d71c589cbd4f8fdd9ba89a648d9c127975dbd175a184289b18798b43afbb",
4
+ "bytes": 3978514,
5
+ "maxBytes": 3978514,
6
6
  "source": {
7
7
  "repository": "mdbase-dev/mdbase-connect",
8
- "commit": "c93f4b1938c8139e7f6ef4ad72fccd85c8502b25"
8
+ "commit": "b63c72d4c472d67bcad090fabad5a1316a19f66e"
9
9
  }
10
10
  },
11
11
  "sqlite": {
@@ -15693,12 +15693,12 @@ function appReleaseTrust() {
15693
15693
  // src/application/asset-pins.json
15694
15694
  var asset_pins_default = {
15695
15695
  runtime: {
15696
- sha256: "01436d36ed9b45c4ca1904dc13d348e9b6f89c14e98ba6de8402fd8e76718452",
15697
- bytes: 3986055,
15698
- maxBytes: 3986055,
15696
+ sha256: "fd31d71c589cbd4f8fdd9ba89a648d9c127975dbd175a184289b18798b43afbb",
15697
+ bytes: 3978514,
15698
+ maxBytes: 3978514,
15699
15699
  source: {
15700
15700
  repository: "mdbase-dev/mdbase-connect",
15701
- commit: "c93f4b1938c8139e7f6ef4ad72fccd85c8502b25"
15701
+ commit: "b63c72d4c472d67bcad090fabad5a1316a19f66e"
15702
15702
  }
15703
15703
  },
15704
15704
  sqlite: {
@@ -20359,7 +20359,21 @@ var fileInclusion = struct("file-inclusion", [
20359
20359
  [2, "maxSize", uint, "opt"]
20360
20360
  ]);
20361
20361
  var listsByField = dataMap(list(value));
20362
- var op = union("op", [
20362
+ var updateFields = [
20363
+ [1, "id", uuid2],
20364
+ [2, "patch", fmMap, "opt"],
20365
+ [3, "unset", list(tstr), "opt1"],
20366
+ [4, "add", listsByField, "opt"],
20367
+ [5, "remove", listsByField, "opt"],
20368
+ [6, "body", tstr, "opt"],
20369
+ [7, "bodyEdits", list(bodyEdit), "opt1"],
20370
+ [8, "bodyBase", hash, "opt"],
20371
+ [9, "bodyBaseText", tstr, "opt"],
20372
+ [10, "base", list(baseField), "opt1"],
20373
+ [11, "ifRevision", hash, "opt"],
20374
+ [12, "updateRefs", bool, "opt"]
20375
+ ];
20376
+ var taggedOp = union("op", [
20363
20377
  [
20364
20378
  1,
20365
20379
  "create",
@@ -20372,24 +20386,8 @@ var op = union("op", [
20372
20386
  [6, "document", tstr, "opt"]
20373
20387
  ]
20374
20388
  ],
20375
- [
20376
- 2,
20377
- "update",
20378
- [
20379
- [1, "id", uuid2],
20380
- [2, "patch", fmMap, "opt"],
20381
- [3, "unset", list(tstr), "opt1"],
20382
- [4, "add", listsByField, "opt"],
20383
- [5, "remove", listsByField, "opt"],
20384
- [6, "body", tstr, "opt"],
20385
- [7, "bodyEdits", list(bodyEdit), "opt1"],
20386
- [8, "bodyBase", hash, "opt"],
20387
- [9, "bodyBaseText", tstr, "opt"],
20388
- [10, "base", list(baseField), "opt1"],
20389
- [11, "ifRevision", hash, "opt"],
20390
- [12, "updateRefs", bool, "opt"]
20391
- ]
20392
- ],
20389
+ [2, "update", updateFields],
20390
+ [19, "update_live", updateFields],
20393
20391
  [
20394
20392
  3,
20395
20393
  "document",
@@ -20480,6 +20478,12 @@ var op = union("op", [
20480
20478
  ],
20481
20479
  [12, "sync_settings", [[1, "inclusion", fileInclusion]]]
20482
20480
  ]);
20481
+ var op = mapped(
20482
+ "op",
20483
+ taggedOp,
20484
+ (v) => v.kind === "update_live" ? { ...v, kind: "update", requireLive: true } : v,
20485
+ (v) => v.kind === "update" && v.requireLive ? { ...v, kind: "update_live" } : v
20486
+ );
20483
20487
  var validationLevel = enumOf("level", ["off", "warn", "error"]);
20484
20488
  var submitParams = struct("submit-params", [
20485
20489
  [0, "ops", list(op, { nonEmpty: true }), "req1"],
@@ -22662,6 +22666,7 @@ var RecordSessionImpl = class {
22662
22666
  timer;
22663
22667
  active = false;
22664
22668
  idle = false;
22669
+ requireLive = false;
22665
22670
  defaultTimeout = 3e4;
22666
22671
  async restore(signal, hint) {
22667
22672
  if (this.captured) {
@@ -22717,6 +22722,7 @@ var RecordSessionImpl = class {
22717
22722
  this.life = new AbortController();
22718
22723
  this.active = true;
22719
22724
  }
22725
+ this.requireLive = options.requireLive ?? false;
22720
22726
  this.defaultTimeout = timeout(options.timeoutMs);
22721
22727
  this.idle = options.autosave ? options.autosave.idleMs : false;
22722
22728
  this.schedule();
@@ -22986,6 +22992,7 @@ var RecordSessionImpl = class {
22986
22992
  this.why = null;
22987
22993
  this.publish();
22988
22994
  const changes = { ifRevision: this.base.revision };
22995
+ if (this.requireLive) changes.requireLive = true;
22989
22996
  if (body !== this.base.body) changes.body = body;
22990
22997
  const sets = /* @__PURE__ */ new Map(), unset = [];
22991
22998
  for (const [key3, value2] of patch) {
@@ -23243,13 +23250,14 @@ var RecordsApi = class {
23243
23250
  );
23244
23251
  const policy = JSON.stringify([
23245
23252
  options.autosave ? options.autosave.idleMs : false,
23246
- options.timeoutMs ?? 3e4
23253
+ options.timeoutMs ?? 3e4,
23254
+ options.requireLive ?? false
23247
23255
  ]);
23248
23256
  let slot = this.slots.get(current2.id);
23249
23257
  if (slot && slot.leases > 0 && slot.policy !== policy)
23250
23258
  throw mdbaseError(
23251
23259
  "invalid_request",
23252
- "active record leases must use the same autosave policy",
23260
+ "active record leases must use the same editing policy",
23253
23261
  "record_lease_policy"
23254
23262
  );
23255
23263
  if (!slot) {
@@ -26164,6 +26172,7 @@ var MdbaseClient = class _MdbaseClient {
26164
26172
  if (plan.patch.size) op2.patch = plan.patch;
26165
26173
  if (plan.unset.length) op2.unset = plan.unset;
26166
26174
  if (plan.base.length) op2.base = plan.base;
26175
+ if (c.requireLive) op2.requireLive = true;
26167
26176
  if (c.updateRefs !== void 0) op2.updateRefs = c.updateRefs;
26168
26177
  if (c.ifRevision) op2.ifRevision = c.ifRevision;
26169
26178
  return this.record(op2, o);
@@ -26173,6 +26182,7 @@ var MdbaseClient = class _MdbaseClient {
26173
26182
  if (c.contract || c.promote) throw mdbaseError("invalid_request", "contract updates are mapped by the replica; use update()");
26174
26183
  const op2 = { kind: "update", id: refId(target2) };
26175
26184
  const seen = typeof target2 === "object" && "frontmatter" in target2 ? target2 : null;
26185
+ if (c.requireLive) op2.requireLive = true;
26176
26186
  if (c.updateRefs !== void 0) op2.updateRefs = c.updateRefs;
26177
26187
  if (c.patch) op2.patch = toFmMap(c.patch);
26178
26188
  if (c.unset?.length) op2.unset = c.unset;
@@ -1076,7 +1076,7 @@ var MdbaseSDK = (() => {
1076
1076
  function bad(ty) {
1077
1077
  throw new SchemaError(ty, "wrong type");
1078
1078
  }
1079
- var version, RECOVERY, recovery, severity, issue, problem, clientFrame, helloParams, ROLES, role, grantInfo, INCIDENT_KINDS, incident, progress, resyncing, confirmedHead, appliedPrefixParams, appliedPrefix, syncStatus, helloResult, blobRef, textOrBlob, HOLD_REASONS, holdReason, holdRef, hold, HOLD_RESOLUTIONS, holdResolution, recordState, linkResolution, linkView, authorRef, fmMap, recordView, include, viewRef, queryGroup, queryMetadata, queryResult, queryUpdate, change, changesResult, MEDIA_CLASSES, mediaClass, conflictMode, baseField, bodyEdit, docVersion, fileInclusion, listsByField, op, validationLevel, submitParams, CONFLICT_FORMS, conflictValue, conflict, publishState, preflight, receipt, submitResult, conflictEntry, fileContentProfile, knownFileView, fileView, listFilesResult, openUploadParams, openUploadResult, uploadChunkParams, fileChunk, fileStreamFailure, TRANSFER_PHASES, transferProgress, materialization, peer, presencePush, fenceApply, fenceReport, fenceResult, PUSH_CODECS, opClock, mutation, confirmation, resourceView, listResourcesResult, backlinksResult, resolveLinksResult, listViewsResult, viewSourceDocument, newTypeFile, describeResult, pendingOp, listPendingResult, target, queryParams, executeViewParams, TEMPORAL_HINTS, temporalHint, typingEntry, describeTypingResult, DESCRIBE_TYPING_MAX_TYPES, DESCRIBE_TYPING_MAX_PATHS;
1079
+ var version, RECOVERY, recovery, severity, issue, problem, clientFrame, helloParams, ROLES, role, grantInfo, INCIDENT_KINDS, incident, progress, resyncing, confirmedHead, appliedPrefixParams, appliedPrefix, syncStatus, helloResult, blobRef, textOrBlob, HOLD_REASONS, holdReason, holdRef, hold, HOLD_RESOLUTIONS, holdResolution, recordState, linkResolution, linkView, authorRef, fmMap, recordView, include, viewRef, queryGroup, queryMetadata, queryResult, queryUpdate, change, changesResult, MEDIA_CLASSES, mediaClass, conflictMode, baseField, bodyEdit, docVersion, fileInclusion, listsByField, updateFields, taggedOp, op, validationLevel, submitParams, CONFLICT_FORMS, conflictValue, conflict, publishState, preflight, receipt, submitResult, conflictEntry, fileContentProfile, knownFileView, fileView, listFilesResult, openUploadParams, openUploadResult, uploadChunkParams, fileChunk, fileStreamFailure, TRANSFER_PHASES, transferProgress, materialization, peer, presencePush, fenceApply, fenceReport, fenceResult, PUSH_CODECS, opClock, mutation, confirmation, resourceView, listResourcesResult, backlinksResult, resolveLinksResult, listViewsResult, viewSourceDocument, newTypeFile, describeResult, pendingOp, listPendingResult, target, queryParams, executeViewParams, TEMPORAL_HINTS, temporalHint, typingEntry, describeTypingResult, DESCRIBE_TYPING_MAX_TYPES, DESCRIBE_TYPING_MAX_PATHS;
1080
1080
  var init_wire = __esm({
1081
1081
  "src/wire.ts"() {
1082
1082
  "use strict";
@@ -1407,7 +1407,21 @@ var MdbaseSDK = (() => {
1407
1407
  [2, "maxSize", uint, "opt"]
1408
1408
  ]);
1409
1409
  listsByField = dataMap(list(value));
1410
- op = union("op", [
1410
+ updateFields = [
1411
+ [1, "id", uuid],
1412
+ [2, "patch", fmMap, "opt"],
1413
+ [3, "unset", list(tstr), "opt1"],
1414
+ [4, "add", listsByField, "opt"],
1415
+ [5, "remove", listsByField, "opt"],
1416
+ [6, "body", tstr, "opt"],
1417
+ [7, "bodyEdits", list(bodyEdit), "opt1"],
1418
+ [8, "bodyBase", hash, "opt"],
1419
+ [9, "bodyBaseText", tstr, "opt"],
1420
+ [10, "base", list(baseField), "opt1"],
1421
+ [11, "ifRevision", hash, "opt"],
1422
+ [12, "updateRefs", bool, "opt"]
1423
+ ];
1424
+ taggedOp = union("op", [
1411
1425
  [
1412
1426
  1,
1413
1427
  "create",
@@ -1420,24 +1434,8 @@ var MdbaseSDK = (() => {
1420
1434
  [6, "document", tstr, "opt"]
1421
1435
  ]
1422
1436
  ],
1423
- [
1424
- 2,
1425
- "update",
1426
- [
1427
- [1, "id", uuid],
1428
- [2, "patch", fmMap, "opt"],
1429
- [3, "unset", list(tstr), "opt1"],
1430
- [4, "add", listsByField, "opt"],
1431
- [5, "remove", listsByField, "opt"],
1432
- [6, "body", tstr, "opt"],
1433
- [7, "bodyEdits", list(bodyEdit), "opt1"],
1434
- [8, "bodyBase", hash, "opt"],
1435
- [9, "bodyBaseText", tstr, "opt"],
1436
- [10, "base", list(baseField), "opt1"],
1437
- [11, "ifRevision", hash, "opt"],
1438
- [12, "updateRefs", bool, "opt"]
1439
- ]
1440
- ],
1437
+ [2, "update", updateFields],
1438
+ [19, "update_live", updateFields],
1441
1439
  [
1442
1440
  3,
1443
1441
  "document",
@@ -1528,6 +1526,12 @@ var MdbaseSDK = (() => {
1528
1526
  ],
1529
1527
  [12, "sync_settings", [[1, "inclusion", fileInclusion]]]
1530
1528
  ]);
1529
+ op = mapped(
1530
+ "op",
1531
+ taggedOp,
1532
+ (v) => v.kind === "update_live" ? { ...v, kind: "update", requireLive: true } : v,
1533
+ (v) => v.kind === "update" && v.requireLive ? { ...v, kind: "update_live" } : v
1534
+ );
1531
1535
  validationLevel = enumOf("level", ["off", "warn", "error"]);
1532
1536
  submitParams = struct("submit-params", [
1533
1537
  [0, "ops", list(op, { nonEmpty: true }), "req1"],
@@ -5031,6 +5035,7 @@ var MdbaseSDK = (() => {
5031
5035
  timer;
5032
5036
  active = false;
5033
5037
  idle = false;
5038
+ requireLive = false;
5034
5039
  defaultTimeout = 3e4;
5035
5040
  async restore(signal, hint) {
5036
5041
  if (this.captured) {
@@ -5086,6 +5091,7 @@ var MdbaseSDK = (() => {
5086
5091
  this.life = new AbortController();
5087
5092
  this.active = true;
5088
5093
  }
5094
+ this.requireLive = options.requireLive ?? false;
5089
5095
  this.defaultTimeout = timeout(options.timeoutMs);
5090
5096
  this.idle = options.autosave ? options.autosave.idleMs : false;
5091
5097
  this.schedule();
@@ -5355,6 +5361,7 @@ var MdbaseSDK = (() => {
5355
5361
  this.why = null;
5356
5362
  this.publish();
5357
5363
  const changes = { ifRevision: this.base.revision };
5364
+ if (this.requireLive) changes.requireLive = true;
5358
5365
  if (body !== this.base.body) changes.body = body;
5359
5366
  const sets = /* @__PURE__ */ new Map(), unset = [];
5360
5367
  for (const [key3, value2] of patch) {
@@ -5580,13 +5587,14 @@ var MdbaseSDK = (() => {
5580
5587
  );
5581
5588
  const policy = JSON.stringify([
5582
5589
  options.autosave ? options.autosave.idleMs : false,
5583
- options.timeoutMs ?? 3e4
5590
+ options.timeoutMs ?? 3e4,
5591
+ options.requireLive ?? false
5584
5592
  ]);
5585
5593
  let slot = this.slots.get(current3.id);
5586
5594
  if (slot && slot.leases > 0 && slot.policy !== policy)
5587
5595
  throw mdbaseError(
5588
5596
  "invalid_request",
5589
- "active record leases must use the same autosave policy",
5597
+ "active record leases must use the same editing policy",
5590
5598
  "record_lease_policy"
5591
5599
  );
5592
5600
  if (!slot) {
@@ -8624,6 +8632,7 @@ var MdbaseSDK = (() => {
8624
8632
  if (plan.patch.size) op2.patch = plan.patch;
8625
8633
  if (plan.unset.length) op2.unset = plan.unset;
8626
8634
  if (plan.base.length) op2.base = plan.base;
8635
+ if (c.requireLive) op2.requireLive = true;
8627
8636
  if (c.updateRefs !== void 0) op2.updateRefs = c.updateRefs;
8628
8637
  if (c.ifRevision) op2.ifRevision = c.ifRevision;
8629
8638
  return this.record(op2, o);
@@ -8633,6 +8642,7 @@ var MdbaseSDK = (() => {
8633
8642
  if (c.contract || c.promote) throw mdbaseError("invalid_request", "contract updates are mapped by the replica; use update()");
8634
8643
  const op2 = { kind: "update", id: refId(target2) };
8635
8644
  const seen2 = typeof target2 === "object" && "frontmatter" in target2 ? target2 : null;
8645
+ if (c.requireLive) op2.requireLive = true;
8636
8646
  if (c.updateRefs !== void 0) op2.updateRefs = c.updateRefs;
8637
8647
  if (c.patch) op2.patch = toFmMap(c.patch);
8638
8648
  if (c.unset?.length) op2.unset = c.unset;
@@ -50785,12 +50795,12 @@ ${end.comment}` : end.comment;
50785
50795
  // src/application/asset-pins.json
50786
50796
  var asset_pins_default = {
50787
50797
  runtime: {
50788
- sha256: "01436d36ed9b45c4ca1904dc13d348e9b6f89c14e98ba6de8402fd8e76718452",
50789
- bytes: 3986055,
50790
- maxBytes: 3986055,
50798
+ sha256: "fd31d71c589cbd4f8fdd9ba89a648d9c127975dbd175a184289b18798b43afbb",
50799
+ bytes: 3978514,
50800
+ maxBytes: 3978514,
50791
50801
  source: {
50792
50802
  repository: "mdbase-dev/mdbase-connect",
50793
- commit: "c93f4b1938c8139e7f6ef4ad72fccd85c8502b25"
50803
+ commit: "b63c72d4c472d67bcad090fabad5a1316a19f66e"
50794
50804
  }
50795
50805
  },
50796
50806
  sqlite: {