@inf-monkeys-tech/monkeys 1.1.22 → 1.1.24

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.
@@ -12169,6 +12169,9 @@ var QueryBindingSchema = z13.object({
12169
12169
  draftRetention: z13.object({
12170
12170
  identityParameters: z13.array(ContractIdentifierSchema).min(1).max(32)
12171
12171
  }).strict().optional(),
12172
+ queryRetention: z13.object({
12173
+ identityParameters: z13.array(ContractIdentifierSchema).max(32)
12174
+ }).strict().optional(),
12172
12175
  resultStateBindings: z13.array(QueryResultStateBindingSchema).max(32).optional(),
12173
12176
  execution: z13.enum(["server", "local-state"]).default("server"),
12174
12177
  pagination: z13.enum(["none", "cursor", "offset"]),
@@ -12192,6 +12195,18 @@ var QueryBindingSchema = z13.object({
12192
12195
  });
12193
12196
  }
12194
12197
  }
12198
+ if (value.queryRetention) {
12199
+ const names = value.queryRetention.identityParameters;
12200
+ if (value.execution !== "server" || new Set(names).size !== names.length || names.some(
12201
+ (name) => !Object.prototype.hasOwnProperty.call(value.parameters, name)
12202
+ )) {
12203
+ context.addIssue({
12204
+ code: "custom",
12205
+ path: ["queryRetention"],
12206
+ message: "Query retention requires distinct declared Server query identity parameters."
12207
+ });
12208
+ }
12209
+ }
12195
12210
  if (value.targetProjection) {
12196
12211
  if (value.targetProjection.schemaRevisionRef.kind !== "schema")
12197
12212
  context.addIssue({
@@ -25164,6 +25179,39 @@ var schemasCannotOverlap = (left, right) => {
25164
25179
  const property = (schema2, key) => schema2.properties?.[key] ?? (schema2.patternProperties ? true : schema2.additionalProperties ?? true);
25165
25180
  return [...a.required ?? [], ...b.required ?? []].some((key) => schemasCannotOverlap(property(a, key), property(b, key)));
25166
25181
  };
25182
+ var numericBound = (schema2, direction) => {
25183
+ const inclusiveKey = direction === "lower" ? "minimum" : "maximum";
25184
+ const exclusiveKey = direction === "lower" ? "exclusiveMinimum" : "exclusiveMaximum";
25185
+ const inclusiveValue = schema2[inclusiveKey];
25186
+ const exclusiveValue = schema2[exclusiveKey];
25187
+ const candidates = [];
25188
+ if (inclusiveValue !== void 0) {
25189
+ if (typeof inclusiveValue !== "number" || !Number.isFinite(inclusiveValue)) return null;
25190
+ candidates.push({ value: inclusiveValue, inclusive: true });
25191
+ }
25192
+ if (typeof exclusiveValue === "number") {
25193
+ if (!Number.isFinite(exclusiveValue)) return null;
25194
+ candidates.push({ value: exclusiveValue, inclusive: false });
25195
+ } else if (exclusiveValue === true) {
25196
+ if (typeof inclusiveValue !== "number" || !Number.isFinite(inclusiveValue)) return null;
25197
+ candidates.push({ value: inclusiveValue, inclusive: false });
25198
+ } else if (exclusiveValue !== void 0 && exclusiveValue !== false) {
25199
+ return null;
25200
+ }
25201
+ if (!candidates.length) return void 0;
25202
+ const compare = direction === "lower" ? Math.max : Math.min;
25203
+ const value = compare(...candidates.map((candidate) => candidate.value));
25204
+ return { value, inclusive: candidates.filter((candidate) => candidate.value === value).every((candidate) => candidate.inclusive) };
25205
+ };
25206
+ var boundAcceptsPrevious = (previous, next, direction) => {
25207
+ if (previous === null || next === null) return false;
25208
+ if (!next) return true;
25209
+ if (!previous) return false;
25210
+ if (direction === "lower" && previous.value < next.value) return false;
25211
+ if (direction === "upper" && previous.value > next.value) return false;
25212
+ return previous.value !== next.value || !previous.inclusive || next.inclusive;
25213
+ };
25214
+ var numericRangesAcceptPrevious = (previous, next) => boundAcceptsPrevious(numericBound(previous, "lower"), numericBound(next, "lower"), "lower") && boundAcceptsPrevious(numericBound(previous, "upper"), numericBound(next, "upper"), "upper");
25167
25215
  var acceptsPreviousSchema = (previous, next) => {
25168
25216
  if (canonicalContentHash(previous) === canonicalContentHash(next) || next === true) return true;
25169
25217
  if (previous === false) return true;
@@ -25182,6 +25230,10 @@ var acceptsPreviousSchema = (previous, next) => {
25182
25230
  additionalProperties: oldAdditional,
25183
25231
  enum: oldEnum,
25184
25232
  items: oldItems,
25233
+ minimum: _oldMinimum,
25234
+ maximum: _oldMaximum,
25235
+ exclusiveMinimum: _oldExclusiveMinimum,
25236
+ exclusiveMaximum: _oldExclusiveMaximum,
25185
25237
  ...oldFixed
25186
25238
  } = before;
25187
25239
  const {
@@ -25190,9 +25242,14 @@ var acceptsPreviousSchema = (previous, next) => {
25190
25242
  additionalProperties: newAdditional,
25191
25243
  enum: newEnum,
25192
25244
  items: newItems,
25245
+ minimum: _newMinimum,
25246
+ maximum: _newMaximum,
25247
+ exclusiveMinimum: _newExclusiveMinimum,
25248
+ exclusiveMaximum: _newExclusiveMaximum,
25193
25249
  ...newFixed
25194
25250
  } = after;
25195
25251
  if (canonicalContentHash(oldFixed) !== canonicalContentHash(newFixed)) return false;
25252
+ if (!numericRangesAcceptPrevious(before, after)) return false;
25196
25253
  if (!acceptsPreviousSchema(oldItems ?? true, newItems ?? true)) return false;
25197
25254
  if (newEnum && (!oldEnum || oldEnum.some((value) => !newEnum.some((candidate) => canonicalContentHash(candidate) === canonicalContentHash(value))))) return false;
25198
25255
  if ((newRequired ?? []).some((key) => !(oldRequired ?? []).includes(key))) return false;