@mdbase-dev/sdk 0.2.19 → 0.2.26

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": "6e66a067bf508611cfb2a1f98f45728f4ebd2b2e8e679d2d4cb84d3a558b1c5c",
4
- "bytes": 4053495,
5
- "maxBytes": 4053495,
3
+ "sha256": "f288c009c483b0537eff2f104901005edeebfe6212b9d56f463723eb3966baf2",
4
+ "bytes": 4063471,
5
+ "maxBytes": 4063471,
6
6
  "source": {
7
7
  "repository": "mdbase-dev/mdbase-connect",
8
- "commit": "7e62ac196c10d60cb34dc47d10f0dfd765ba4ff9"
8
+ "commit": "ac0c068a9a471de88a9242ccf56393e946af488b"
9
9
  }
10
10
  },
11
11
  "sqlite": {
@@ -15698,12 +15698,12 @@ function appReleaseTrust() {
15698
15698
  // src/application/asset-pins.json
15699
15699
  var asset_pins_default = {
15700
15700
  runtime: {
15701
- sha256: "6e66a067bf508611cfb2a1f98f45728f4ebd2b2e8e679d2d4cb84d3a558b1c5c",
15702
- bytes: 4053495,
15703
- maxBytes: 4053495,
15701
+ sha256: "f288c009c483b0537eff2f104901005edeebfe6212b9d56f463723eb3966baf2",
15702
+ bytes: 4063471,
15703
+ maxBytes: 4063471,
15704
15704
  source: {
15705
15705
  repository: "mdbase-dev/mdbase-connect",
15706
- commit: "7e62ac196c10d60cb34dc47d10f0dfd765ba4ff9"
15706
+ commit: "ac0c068a9a471de88a9242ccf56393e946af488b"
15707
15707
  }
15708
15708
  },
15709
15709
  sqlite: {
@@ -24583,6 +24583,7 @@ var VALIDATE_PAGE = "validate-page-v1";
24583
24583
  var BASES_DISCOVERY_UNREADABLE = "bases-discovery-unreadable-v1";
24584
24584
  var BASES_ROW_PROPERTIES = "bases-row-properties-v1";
24585
24585
  var CONTRACT_QUERY_ORDER = "contract-query-order-v1";
24586
+ var CONTRACT_QUERY_ORDER_MTIME = "contract-query-order-mtime-v1";
24586
24587
  function params(entries) {
24587
24588
  const m2 = /* @__PURE__ */ new Map();
24588
24589
  for (const [k, v] of entries) if (v !== void 0) m2.set(k, v);
@@ -24988,7 +24989,7 @@ var MdbaseClient = class _MdbaseClient {
24988
24989
  versions: API_VERSIONS,
24989
24990
  clientName: opts.app.name,
24990
24991
  clientVersion: opts.app.version,
24991
- features: [.../* @__PURE__ */ new Set([...opts.features ?? [], "declared-collection-setup-v1", "file-stream-failure-v1", VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE, BASES_ROW_PROPERTIES, CONTRACT_QUERY_ORDER])],
24992
+ features: [.../* @__PURE__ */ new Set([...opts.features ?? [], "declared-collection-setup-v1", "file-stream-failure-v1", VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE, BASES_ROW_PROPERTIES, CONTRACT_QUERY_ORDER, CONTRACT_QUERY_ORDER_MTIME])],
24992
24993
  ...tz ? { timezone: tz } : {}
24993
24994
  };
24994
24995
  }
@@ -25551,12 +25552,14 @@ var MdbaseClient = class _MdbaseClient {
25551
25552
  * `contract-query-order-v1` is negotiated, 128 on older producers); use the
25552
25553
  * returned cursor for the remaining records. `orderBy` uses the spec 11
25553
25554
  * `order_by` grammar over contract fields and `file.*`, bound to the cursor;
25554
- * older producers refuse `orderBy` with `upgrade_required`. */
25555
+ * older producers refuse `orderBy` with `upgrade_required`. Ordering by
25556
+ * `file.mtime` additionally requires `contract-query-order-mtime-v1`. */
25555
25557
  async queryContract(contract, options = {}) {
25556
25558
  const requested = options.pageSize ?? 128;
25557
25559
  if (!Number.isInteger(requested) || requested < 1 || !contract.id || contract.id.length > 1024 || !contract.version || contract.version.length > 128 || options.where !== void 0 && (!options.where || options.where.length > 4096))
25558
25560
  throw mdbaseError("invalid_request", "invalid contract page selection");
25559
25561
  let orderWire;
25562
+ let ordersByMtime = false;
25560
25563
  if (options.orderBy !== void 0) {
25561
25564
  if (!Array.isArray(options.orderBy) || options.orderBy.length < 1 || options.orderBy.length > 8)
25562
25565
  throw mdbaseError("invalid_request", "invalid contract order_by", "invalid_query");
@@ -25567,6 +25570,7 @@ var MdbaseClient = class _MdbaseClient {
25567
25570
  const keys2 = Object.keys(term);
25568
25571
  if (keys2.some((k) => k !== "field" && k !== "direction") || typeof term.field !== "string" || !term.field || term.field.length > 256 || term.direction !== void 0 && term.direction !== "asc" && term.direction !== "desc")
25569
25572
  throw mdbaseError("invalid_request", "invalid contract order_by term", "invalid_query");
25573
+ if (term.field === "file.mtime") ordersByMtime = true;
25570
25574
  terms.push(term.direction === void 0 ? { field: term.field } : { field: term.field, direction: term.direction });
25571
25575
  }
25572
25576
  orderWire = toValue(terms);
@@ -25575,6 +25579,8 @@ var MdbaseClient = class _MdbaseClient {
25575
25579
  const extended2 = session.hello.features.includes(CONTRACT_QUERY_ORDER);
25576
25580
  if (orderWire !== void 0 && !extended2)
25577
25581
  throw mdbaseError("upgrade_required", "This replica does not support ordered contract queries.", "contract_query_order_unsupported");
25582
+ if (ordersByMtime && !session.hello.features.includes(CONTRACT_QUERY_ORDER_MTIME))
25583
+ throw mdbaseError("upgrade_required", "This replica does not support ordering contract queries by file.mtime.", "contract_query_order_mtime_unsupported");
25578
25584
  const limit = Math.min(requested, extended2 ? 1e3 : 128);
25579
25585
  const result2 = await this.call("query_contract_v1", params([
25580
25586
  [0, 1],
@@ -7026,7 +7026,7 @@ var MdbaseSDK = (() => {
7026
7026
  function connect(opts) {
7027
7027
  return MdbaseClient.connect(opts);
7028
7028
  }
7029
- var CHANGES_PAGE, DEVICE_WAITS, VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE, BASES_ROW_PROPERTIES, CONTRACT_QUERY_ORDER, Write, LiveQuery, READ_METHODS, MdbaseClient;
7029
+ var CHANGES_PAGE, DEVICE_WAITS, VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE, BASES_ROW_PROPERTIES, CONTRACT_QUERY_ORDER, CONTRACT_QUERY_ORDER_MTIME, Write, LiveQuery, READ_METHODS, MdbaseClient;
7030
7030
  var init_client = __esm({
7031
7031
  "src/client.ts"() {
7032
7032
  "use strict";
@@ -7065,6 +7065,7 @@ var MdbaseSDK = (() => {
7065
7065
  BASES_DISCOVERY_UNREADABLE = "bases-discovery-unreadable-v1";
7066
7066
  BASES_ROW_PROPERTIES = "bases-row-properties-v1";
7067
7067
  CONTRACT_QUERY_ORDER = "contract-query-order-v1";
7068
+ CONTRACT_QUERY_ORDER_MTIME = "contract-query-order-mtime-v1";
7068
7069
  Write = class {
7069
7070
  constructor(receipt4) {
7070
7071
  this.receipt = receipt4;
@@ -7434,7 +7435,7 @@ var MdbaseSDK = (() => {
7434
7435
  versions: API_VERSIONS,
7435
7436
  clientName: opts.app.name,
7436
7437
  clientVersion: opts.app.version,
7437
- features: [.../* @__PURE__ */ new Set([...opts.features ?? [], "declared-collection-setup-v1", "file-stream-failure-v1", VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE, BASES_ROW_PROPERTIES, CONTRACT_QUERY_ORDER])],
7438
+ features: [.../* @__PURE__ */ new Set([...opts.features ?? [], "declared-collection-setup-v1", "file-stream-failure-v1", VALIDATE_PAGE, BASES_DISCOVERY_UNREADABLE, BASES_ROW_PROPERTIES, CONTRACT_QUERY_ORDER, CONTRACT_QUERY_ORDER_MTIME])],
7438
7439
  ...tz ? { timezone: tz } : {}
7439
7440
  };
7440
7441
  }
@@ -7997,12 +7998,14 @@ var MdbaseSDK = (() => {
7997
7998
  * `contract-query-order-v1` is negotiated, 128 on older producers); use the
7998
7999
  * returned cursor for the remaining records. `orderBy` uses the spec 11
7999
8000
  * `order_by` grammar over contract fields and `file.*`, bound to the cursor;
8000
- * older producers refuse `orderBy` with `upgrade_required`. */
8001
+ * older producers refuse `orderBy` with `upgrade_required`. Ordering by
8002
+ * `file.mtime` additionally requires `contract-query-order-mtime-v1`. */
8001
8003
  async queryContract(contract, options = {}) {
8002
8004
  const requested = options.pageSize ?? 128;
8003
8005
  if (!Number.isInteger(requested) || requested < 1 || !contract.id || contract.id.length > 1024 || !contract.version || contract.version.length > 128 || options.where !== void 0 && (!options.where || options.where.length > 4096))
8004
8006
  throw mdbaseError("invalid_request", "invalid contract page selection");
8005
8007
  let orderWire;
8008
+ let ordersByMtime = false;
8006
8009
  if (options.orderBy !== void 0) {
8007
8010
  if (!Array.isArray(options.orderBy) || options.orderBy.length < 1 || options.orderBy.length > 8)
8008
8011
  throw mdbaseError("invalid_request", "invalid contract order_by", "invalid_query");
@@ -8013,6 +8016,7 @@ var MdbaseSDK = (() => {
8013
8016
  const keys2 = Object.keys(term);
8014
8017
  if (keys2.some((k) => k !== "field" && k !== "direction") || typeof term.field !== "string" || !term.field || term.field.length > 256 || term.direction !== void 0 && term.direction !== "asc" && term.direction !== "desc")
8015
8018
  throw mdbaseError("invalid_request", "invalid contract order_by term", "invalid_query");
8019
+ if (term.field === "file.mtime") ordersByMtime = true;
8016
8020
  terms.push(term.direction === void 0 ? { field: term.field } : { field: term.field, direction: term.direction });
8017
8021
  }
8018
8022
  orderWire = toValue(terms);
@@ -8021,6 +8025,8 @@ var MdbaseSDK = (() => {
8021
8025
  const extended2 = session.hello.features.includes(CONTRACT_QUERY_ORDER);
8022
8026
  if (orderWire !== void 0 && !extended2)
8023
8027
  throw mdbaseError("upgrade_required", "This replica does not support ordered contract queries.", "contract_query_order_unsupported");
8028
+ if (ordersByMtime && !session.hello.features.includes(CONTRACT_QUERY_ORDER_MTIME))
8029
+ throw mdbaseError("upgrade_required", "This replica does not support ordering contract queries by file.mtime.", "contract_query_order_mtime_unsupported");
8024
8030
  const limit = Math.min(requested, extended2 ? 1e3 : 128);
8025
8031
  const result2 = await this.call("query_contract_v1", params([
8026
8032
  [0, 1],
@@ -10000,6 +10006,7 @@ var MdbaseSDK = (() => {
10000
10006
  timer_operation_recovery_unavailable: "update_required",
10001
10007
  contract_query_version: "update_required",
10002
10008
  contract_query_order_unsupported: "update_required",
10009
+ contract_query_order_mtime_unsupported: "update_required",
10003
10010
  bases_row_properties_unsupported: "update_required",
10004
10011
  unsupported_push_version: "update_required",
10005
10012
  // The SDK re-checks a concurrent change or an occupied step by itself.
@@ -51026,12 +51033,12 @@ ${end.comment}` : end.comment;
51026
51033
  // src/application/asset-pins.json
51027
51034
  var asset_pins_default = {
51028
51035
  runtime: {
51029
- sha256: "6e66a067bf508611cfb2a1f98f45728f4ebd2b2e8e679d2d4cb84d3a558b1c5c",
51030
- bytes: 4053495,
51031
- maxBytes: 4053495,
51036
+ sha256: "f288c009c483b0537eff2f104901005edeebfe6212b9d56f463723eb3966baf2",
51037
+ bytes: 4063471,
51038
+ maxBytes: 4063471,
51032
51039
  source: {
51033
51040
  repository: "mdbase-dev/mdbase-connect",
51034
- commit: "7e62ac196c10d60cb34dc47d10f0dfd765ba4ff9"
51041
+ commit: "ac0c068a9a471de88a9242ccf56393e946af488b"
51035
51042
  }
51036
51043
  },
51037
51044
  sqlite: {