@tailor-platform/sdk 1.15.2 → 1.16.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 1.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#602](https://github.com/tailor-platform/sdk/pull/602) [`4174110`](https://github.com/tailor-platform/sdk/commit/4174110ae1d1410801de98f9df2020c1ee0a4ef8) Thanks [@remiposo](https://github.com/remiposo)! - Add `hasAny` / `not hasAny` permission operators for array-to-array comparison
8
+
9
+ New permission operators that check whether two arrays share any common elements.
10
+
11
+ Usage examples:
12
+
13
+ - `[{ user: "roles" }, "hasAny", { record: "allowedRoles" }]` — allow access when the user's roles overlap with the record's allowed roles
14
+ - `[{ user: "tags" }, "not hasAny", ["blocked", "suspended"]]` — deny access when the user's tags share any element with the blocked list
15
+ - `[["admin", "editor"], "hasAny", { user: "roles" }]` — both operands can be string arrays
16
+
17
+ Unlike `in` / `not in` (scalar vs array), `hasAny` / `not hasAny` compares two arrays and checks for intersection.
18
+
3
19
  ## 1.15.2
4
20
 
5
21
  ### Patch Changes
@@ -0,0 +1,4 @@
1
+ import "./chunk-GMkBE123.mjs";
2
+ import { t as defineApplication } from "./application-DQ2F9UmJ.mjs";
3
+
4
+ export { defineApplication };
@@ -336,7 +336,9 @@ const operatorMap = {
336
336
  "=": "eq",
337
337
  "!=": "ne",
338
338
  in: "in",
339
- "not in": "nin"
339
+ "not in": "nin",
340
+ hasAny: "hasAny",
341
+ "not hasAny": "nhasAny"
340
342
  };
341
343
  function normalizeOperand(operand) {
342
344
  if (typeof operand === "object" && "user" in operand) return { user: operand.user === "id" ? "_id" : operand.user };
@@ -97659,7 +97661,9 @@ const PermissionOperatorSchema = z.enum([
97659
97661
  "=",
97660
97662
  "!=",
97661
97663
  "in",
97662
- "not in"
97664
+ "not in",
97665
+ "hasAny",
97666
+ "not hasAny"
97663
97667
  ]);
97664
97668
  const RecordPermissionConditionSchema = z.tuple([
97665
97669
  RecordPermissionOperandSchema,
@@ -98591,4 +98595,4 @@ function defineApplication(params) {
98591
98595
 
98592
98596
  //#endregion
98593
98597
  export { ExecutorSchema as a, functionSchema as c, loadFilesWithIgnores as d, logger as f, createExecutorService as i, stringifyFunction as l, symbols as m, WorkflowJobSchema as n, OAuth2ClientSchema as o, styles as p, WorkflowSchema as r, ResolverSchema as s, defineApplication as t, tailorUserMap as u };
98594
- //# sourceMappingURL=application-DLUgR1gv.mjs.map
98598
+ //# sourceMappingURL=application-DQ2F9UmJ.mjs.map