@rotorsoft/act 2.1.15 → 2.2.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/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  store,
28
28
  unscoped_ports,
29
29
  validate
30
- } from "./chunk-CWWTVYIN.js";
30
+ } from "./chunk-OFBVOZIA.js";
31
31
  import {
32
32
  checkAppends,
33
33
  checkVersion,
@@ -1152,6 +1152,11 @@ function wrapped(schema) {
1152
1152
  return inner ? [inner] : [];
1153
1153
  }
1154
1154
  __name(wrapped, "wrapped");
1155
+ function parts_of(schema) {
1156
+ const def = def_of(schema);
1157
+ return def?.type === "intersection" ? [def.left, def.right] : wrapped(schema);
1158
+ }
1159
+ __name(parts_of, "parts_of");
1155
1160
  function some_layer(schema, test) {
1156
1161
  const seen = /* @__PURE__ */ new Set();
1157
1162
  const visit = /* @__PURE__ */ __name((s) => {
@@ -3933,6 +3938,7 @@ var Act = class {
3933
3938
  actor: void 0,
3934
3939
  asOf
3935
3940
  } : streamOrTarget;
3941
+ check("page", target.asOf ?? {});
3936
3942
  return await this._es.load(merged, target, callback);
3937
3943
  });
3938
3944
  }
@@ -4378,7 +4384,7 @@ var Act = class {
4378
4384
  * ```
4379
4385
  */
4380
4386
  async blocked_streams(options) {
4381
- check("page", options ?? {});
4387
+ check("page", { limit: options?.limit });
4382
4388
  return this._scoped(async () => {
4383
4389
  const positions = [];
4384
4390
  await store().query_streams(
@@ -4804,24 +4810,19 @@ import { z as z2 } from "zod";
4804
4810
  var SENSITIVE = /* @__PURE__ */ Symbol.for("act.sensitive");
4805
4811
  var is_pii = /* @__PURE__ */ __name((schema) => some_layer(schema, (def) => def[SENSITIVE] === true), "is_pii");
4806
4812
  function pii_schemas(schema) {
4813
+ const fields = {};
4807
4814
  const shape = schema.shape;
4808
4815
  if (shape && typeof shape === "object") {
4809
- const fields = {};
4810
4816
  for (const key of Object.keys(shape))
4811
4817
  if (is_pii(shape[key])) fields[key] = shape[key];
4812
4818
  return fields;
4813
4819
  }
4814
4820
  const options = schema.options;
4815
- if (Array.isArray(options)) {
4816
- const fields = {};
4817
- for (const option of options)
4818
- for (const [key, field] of Object.entries(
4819
- pii_schemas(option)
4820
- ))
4821
- fields[key] ??= field;
4822
- return fields;
4823
- }
4824
- return {};
4821
+ const parts = Array.isArray(options) ? options : parts_of(schema);
4822
+ for (const part of parts)
4823
+ for (const [key, field] of Object.entries(pii_schemas(part)))
4824
+ fields[key] ??= field;
4825
+ return fields;
4825
4826
  }
4826
4827
  __name(pii_schemas, "pii_schemas");
4827
4828