@zap-studio/permit 0.3.2 → 0.3.3

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.d.mts CHANGED
@@ -1,256 +1,261 @@
1
1
  import { Actions, ConditionFn, Context, PermitConfig, Policy, PolicyFn, Resources, Role, RoleHierarchy } from "./types.mjs";
2
-
3
2
  //#region src/index.d.ts
4
3
  /**
5
- * Returns a policy function that always allows the action.
6
- *
7
- * @example
8
- * ```ts
9
- * const policy = createPolicy({
10
- * resources,
11
- * actions,
12
- * rules: {
13
- * post: {
14
- * read: allow(), // Always allow reading posts
15
- * },
16
- * },
17
- * });
18
- * ```
19
- */
20
- declare function allow<TContext extends Context, TAction extends string = string, TResource = unknown>(): PolicyFn<TContext, TAction, TResource>;
4
+ * Returns a policy function that always allows the action.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const policy = createPolicy({
9
+ * resources,
10
+ * actions,
11
+ * rules: {
12
+ * post: {
13
+ * read: allow(), // Always allow reading posts
14
+ * },
15
+ * },
16
+ * });
17
+ * ```
18
+ */
19
+ declare const allow: <TContext extends Context, TAction extends string = string, TResource = unknown>() => PolicyFn<TContext, TAction, TResource>;
21
20
  /**
22
- * Returns a policy function that always denies the action.
23
- *
24
- * @example
25
- * ```ts
26
- * const policy = createPolicy({
27
- * resources,
28
- * actions,
29
- * rules: {
30
- * post: {
31
- * delete: deny(), // Never allow deleting posts
32
- * },
33
- * },
34
- * });
35
- * ```
36
- */
37
- declare function deny<TContext extends Context, TAction extends string = string, TResource = unknown>(): PolicyFn<TContext, TAction, TResource>;
21
+ * Returns a policy function that always denies the action.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const policy = createPolicy({
26
+ * resources,
27
+ * actions,
28
+ * rules: {
29
+ * post: {
30
+ * delete: deny(), // Never allow deleting posts
31
+ * },
32
+ * },
33
+ * });
34
+ * ```
35
+ */
36
+ declare const deny: <TContext extends Context, TAction extends string = string, TResource = unknown>() => PolicyFn<TContext, TAction, TResource>;
38
37
  /**
39
- * Returns a policy function that allows or denies based on a condition.
40
- *
41
- * @example
42
- * ```ts
43
- * const policy = createPolicy({
44
- * resources,
45
- * actions,
46
- * rules: {
47
- * post: {
48
- * write: when((ctx, action, resource) => ctx.user.id === resource.authorId),
49
- * },
50
- * },
51
- * });
52
- * ```
53
- */
54
- declare function when<TContext extends Context, TAction extends string = string, TResource = unknown>(condition: ConditionFn<TContext, TAction, TResource>): PolicyFn<TContext, TAction, TResource>;
38
+ * Returns a policy function that allows or denies based on a condition.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const policy = createPolicy({
43
+ * resources,
44
+ * actions,
45
+ * rules: {
46
+ * post: {
47
+ * write: when((ctx, action, resource) => ctx.user.id === resource.authorId),
48
+ * },
49
+ * },
50
+ * });
51
+ * ```
52
+ */
53
+ declare const when: <TContext extends Context, TAction extends string = string, TResource = unknown>(condition: ConditionFn<TContext, TAction, TResource>) => PolicyFn<TContext, TAction, TResource>;
55
54
  /**
56
- * Returns a condition function that returns `true` if all conditions are met.
57
- *
58
- * @example
59
- * ```ts
60
- * const isOwnerAndPublished = and(
61
- * (ctx, action, resource) => ctx.user.id === resource.authorId,
62
- * (ctx, action, resource) => resource.status === "published"
63
- * );
64
- *
65
- * rules: {
66
- * post: {
67
- * delete: when(isOwnerAndPublished),
68
- * },
69
- * }
70
- * ```
71
- */
72
- declare function and<TContext extends Context, TAction extends string = string, TResource = unknown>(...conditions: ConditionFn<TContext, TAction, TResource>[]): ConditionFn<TContext, TAction, TResource>;
55
+ * Returns a condition function that returns `true` if all conditions are met.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const isOwnerAndPublished = and(
60
+ * (ctx, action, resource) => ctx.user.id === resource.authorId,
61
+ * (ctx, action, resource) => resource.status === "published"
62
+ * );
63
+ *
64
+ * rules: {
65
+ * post: {
66
+ * delete: when(isOwnerAndPublished),
67
+ * },
68
+ * }
69
+ * ```
70
+ */
71
+ declare const and: <TContext extends Context, TAction extends string = string, TResource = unknown>(...conditions: ConditionFn<TContext, TAction, TResource>[]) => ConditionFn<TContext, TAction, TResource>;
73
72
  /**
74
- * Returns a condition function that returns `true` if any condition is met.
75
- *
76
- * @example
77
- * ```ts
78
- * const isOwnerOrAdmin = or(
79
- * (ctx, action, resource) => ctx.user.id === resource.authorId,
80
- * (ctx, action, resource) => ctx.user.role === "admin"
81
- * );
82
- *
83
- * rules: {
84
- * post: {
85
- * write: when(isOwnerOrAdmin),
86
- * },
87
- * }
88
- * ```
89
- */
90
- declare function or<TContext extends Context, TAction extends string = string, TResource = unknown>(...conditions: ConditionFn<TContext, TAction, TResource>[]): ConditionFn<TContext, TAction, TResource>;
73
+ * Returns a condition function that returns `true` if any condition is met.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const isOwnerOrAdmin = or(
78
+ * (ctx, action, resource) => ctx.user.id === resource.authorId,
79
+ * (ctx, action, resource) => ctx.user.role === "admin"
80
+ * );
81
+ *
82
+ * rules: {
83
+ * post: {
84
+ * write: when(isOwnerOrAdmin),
85
+ * },
86
+ * }
87
+ * ```
88
+ */
89
+ declare const or: <TContext extends Context, TAction extends string = string, TResource = unknown>(...conditions: ConditionFn<TContext, TAction, TResource>[]) => ConditionFn<TContext, TAction, TResource>;
91
90
  /**
92
- * Returns a condition function that negates another condition.
93
- *
94
- * @example
95
- * ```ts
96
- * const isNotOwner = not((ctx, action, resource) => ctx.user.id === resource.authorId);
97
- *
98
- * rules: {
99
- * post: {
100
- * like: when(isNotOwner), // Can only like posts you don't own
101
- * },
102
- * }
103
- * ```
104
- */
105
- declare function not<TContext extends Context, TAction extends string = string, TResource = unknown>(condition: ConditionFn<TContext, TAction, TResource>): ConditionFn<TContext, TAction, TResource>;
91
+ * Returns a condition function that negates another condition.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * const isNotOwner = not((ctx, action, resource) => ctx.user.id === resource.authorId);
96
+ *
97
+ * rules: {
98
+ * post: {
99
+ * like: when(isNotOwner), // Can only like posts you don't own
100
+ * },
101
+ * }
102
+ * ```
103
+ */
104
+ declare const not: <TContext extends Context, TAction extends string = string, TResource = unknown>(condition: ConditionFn<TContext, TAction, TResource>) => ConditionFn<TContext, TAction, TResource>;
106
105
  /**
107
- * Returns a condition function that checks if a context property equals a value.
108
- *
109
- * @example
110
- * ```ts
111
- * rules: {
112
- * post: {
113
- * write: when(has("role", "admin")), // Only admins can write
114
- * },
115
- * }
116
- * ```
117
- */
118
- declare function has<TContext extends Context, K extends keyof TContext>(key: K, value: TContext[K]): ConditionFn<TContext>;
106
+ * Returns a condition function that checks if a context property equals a value.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * rules: {
111
+ * post: {
112
+ * write: when(has("role", "admin")), // Only admins can write
113
+ * },
114
+ * }
115
+ * ```
116
+ */
117
+ declare const has: <TContext extends Context, K extends keyof TContext>(key: K, value: TContext[K]) => ConditionFn<TContext>;
119
118
  /**
120
- * Collects all roles including inherited ones from a role hierarchy.
121
- *
122
- * @example
123
- * ```ts
124
- * type Role = "guest" | "user" | "admin";
125
- *
126
- * const hierarchy: RoleHierarchy<Role> = {
127
- * guest: [],
128
- * user: ["guest"],
129
- * admin: ["user"],
130
- * };
131
- *
132
- * collectInheritedRoles(["admin"], hierarchy);
133
- * // Returns: Set { "admin", "user", "guest" }
134
- * ```
135
- */
136
- declare function collectInheritedRoles<TRole extends Role = Role>(roles: TRole[], hierarchy: RoleHierarchy<TRole>): Set<TRole>;
119
+ * Collects all roles including inherited ones from a role hierarchy.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * type Role = "guest" | "user" | "admin";
124
+ *
125
+ * const hierarchy: RoleHierarchy<Role> = {
126
+ * guest: [],
127
+ * user: ["guest"],
128
+ * admin: ["user"],
129
+ * };
130
+ *
131
+ * collectInheritedRoles(["admin"], hierarchy);
132
+ * // Returns: Set { "admin", "user", "guest" }
133
+ * ```
134
+ */
135
+ declare const collectInheritedRoles: <TRole extends Role = Role>(roles: TRole[], hierarchy: RoleHierarchy<TRole>) => Set<TRole>;
137
136
  /**
138
- * Returns a condition function that checks if the user has a specific role.
139
- * Supports role hierarchy for inherited permissions.
140
- *
141
- * @example
142
- * ```ts
143
- * // Without hierarchy
144
- * rules: {
145
- * post: {
146
- * delete: when(hasRole("admin")),
147
- * },
148
- * }
149
- *
150
- * // With hierarchy
151
- * const hierarchy = {
152
- * guest: [],
153
- * user: ["guest"],
154
- * admin: ["user"],
155
- * };
156
- *
157
- * rules: {
158
- * post: {
159
- * read: when(hasRole("guest", hierarchy)), // Admins and users can also read
160
- * },
161
- * }
162
- * ```
163
- */
164
- declare function hasRole<TContext extends {
165
- role: Role | Role[];
166
- }, TAction extends string = string, TResource = unknown>(role: Role): ConditionFn<TContext, TAction, TResource>;
167
- declare function hasRole<TContext extends {
168
- role: TRole | TRole[];
169
- }, TAction extends string = string, TResource = unknown, TRole extends Role = Role>(role: TRole, hierarchy: RoleHierarchy<TRole>): ConditionFn<TContext, TAction, TResource>;
137
+ * Call signatures for {@link hasRole}, preserving the with/without hierarchy overloads.
138
+ */
139
+ interface HasRoleFn {
140
+ <TContext extends {
141
+ role: Role | Role[];
142
+ }, TAction extends string = string, TResource = unknown>(role: Role): ConditionFn<TContext, TAction, TResource>;
143
+ <TContext extends {
144
+ role: TRole | TRole[];
145
+ }, TAction extends string = string, TResource = unknown, TRole extends Role = Role>(role: TRole, hierarchy: RoleHierarchy<TRole>): ConditionFn<TContext, TAction, TResource>;
146
+ }
170
147
  /**
171
- * Creates a type-safe policy from resource schemas, actions, and rules.
172
- *
173
- * @example
174
- * ```ts
175
- * import { z } from "zod";
176
- * import { createPolicy, allow, deny, when } from "@zap-studio/permit";
177
- * import type { Resources, Actions } from "@zap-studio/permit/types";
178
- *
179
- * // Define resource schemas
180
- * const resources = {
181
- * post: z.object({
182
- * id: z.string(),
183
- * authorId: z.string(),
184
- * visibility: z.enum(["public", "private"]),
185
- * }),
186
- * comment: z.object({
187
- * id: z.string(),
188
- * postId: z.string(),
189
- * authorId: z.string(),
190
- * }),
191
- * } satisfies Resources;
192
- *
193
- * // Define actions per resource
194
- * const actions = {
195
- * post: ["read", "write", "delete"],
196
- * comment: ["read", "write"],
197
- * } as const satisfies Actions<typeof resources>;
198
- *
199
- * // Define context type
200
- * type AppContext = { user: { id: string; role: string } };
201
- *
202
- * // Create the policy
203
- * const policy = createPolicy<AppContext>({
204
- * resources,
205
- * actions,
206
- * rules: {
207
- * post: {
208
- * read: when((ctx, action, resource) => resource.visibility === "public"),
209
- * write: when((ctx, action, resource) => ctx.user.id === resource.authorId),
210
- * delete: deny(),
211
- * },
212
- * comment: {
213
- * read: allow(),
214
- * write: when((ctx, action, resource) => ctx.user.id === resource.authorId),
215
- * },
216
- * },
217
- * });
218
- *
219
- * // Check permissions
220
- * const post = { id: "1", authorId: "user-1", visibility: "public" as const };
221
- * await policy.can(ctx, "post:read", post); // true
222
- * await policy.can(ctx, "post:write", post); // depends on ctx.user.id
223
- * ```
224
- */
225
- declare function createPolicy<TContext extends Context, TResources extends Resources = Resources, TActions extends Actions<TResources> = Actions<TResources>>(config: PermitConfig<TContext, TResources, TActions>): Policy<TContext, TResources, TActions>;
148
+ * Returns a condition function that checks if the user has a specific role.
149
+ * Supports role hierarchy for inherited permissions.
150
+ *
151
+ * @example
152
+ * ```ts
153
+ * // Without hierarchy
154
+ * rules: {
155
+ * post: {
156
+ * delete: when(hasRole("admin")),
157
+ * },
158
+ * }
159
+ *
160
+ * // With hierarchy
161
+ * const hierarchy = {
162
+ * guest: [],
163
+ * user: ["guest"],
164
+ * admin: ["user"],
165
+ * };
166
+ *
167
+ * rules: {
168
+ * post: {
169
+ * read: when(hasRole("guest", hierarchy)), // Admins and users can also read
170
+ * },
171
+ * }
172
+ * ```
173
+ */
174
+ declare const hasRole: HasRoleFn;
226
175
  /**
227
- * Merges multiple policies into one using "deny-overrides" strategy.
228
- * If any policy denies, the merged policy denies. All must allow for the result to allow.
229
- *
230
- * @example
231
- * ```ts
232
- * const basePolicy = createPolicy({ ... });
233
- * const adminPolicy = createPolicy({ ... });
234
- *
235
- * const merged = mergePolicies(basePolicy, adminPolicy);
236
- * // Both policies must allow for the action to be permitted
237
- * ```
238
- */
239
- declare function mergePolicies<TContext extends Context, TResources extends Resources = Resources, TActions extends Actions<TResources> = Actions<TResources>>(...policies: Policy<TContext, TResources, TActions>[]): Policy<TContext, TResources, TActions>;
176
+ * Creates a type-safe policy from resource schemas, actions, and rules.
177
+ *
178
+ * @example
179
+ * ```ts
180
+ * import { z } from "zod";
181
+ * import { createPolicy, allow, deny, when } from "@zap-studio/permit";
182
+ * import type { Resources, Actions } from "@zap-studio/permit/types";
183
+ *
184
+ * // Define resource schemas
185
+ * const resources = {
186
+ * post: z.object({
187
+ * id: z.string(),
188
+ * authorId: z.string(),
189
+ * visibility: z.enum(["public", "private"]),
190
+ * }),
191
+ * comment: z.object({
192
+ * id: z.string(),
193
+ * postId: z.string(),
194
+ * authorId: z.string(),
195
+ * }),
196
+ * } satisfies Resources;
197
+ *
198
+ * // Define actions per resource
199
+ * const actions = {
200
+ * post: ["read", "write", "delete"],
201
+ * comment: ["read", "write"],
202
+ * } as const satisfies Actions<typeof resources>;
203
+ *
204
+ * // Define context type
205
+ * type AppContext = { user: { id: string; role: string } };
206
+ *
207
+ * // Create the policy
208
+ * const policy = createPolicy<AppContext>({
209
+ * resources,
210
+ * actions,
211
+ * rules: {
212
+ * post: {
213
+ * read: when((ctx, action, resource) => resource.visibility === "public"),
214
+ * write: when((ctx, action, resource) => ctx.user.id === resource.authorId),
215
+ * delete: deny(),
216
+ * },
217
+ * comment: {
218
+ * read: allow(),
219
+ * write: when((ctx, action, resource) => ctx.user.id === resource.authorId),
220
+ * },
221
+ * },
222
+ * });
223
+ *
224
+ * // Check permissions
225
+ * const post = { id: "1", authorId: "user-1", visibility: "public" as const };
226
+ * await policy.can(ctx, "post:read", post); // true
227
+ * await policy.can(ctx, "post:write", post); // depends on ctx.user.id
228
+ * ```
229
+ */
230
+ declare const createPolicy: <TContext extends Context, TResources extends Resources = Resources, TActions extends Actions<TResources> = Actions<TResources>>(config: PermitConfig<TContext, TResources, TActions>) => Policy<TContext, TResources, TActions>;
240
231
  /**
241
- * Merges multiple policies into one using "allow-overrides" strategy.
242
- * If any policy allows, the merged policy allows. All must deny for the result to deny.
243
- *
244
- * @example
245
- * ```ts
246
- * const guestPolicy = createPolicy({ ... });
247
- * const memberPolicy = createPolicy({ ... });
248
- *
249
- * const merged = mergePoliciesAny(guestPolicy, memberPolicy);
250
- * // If either policy allows, the action is permitted
251
- * ```
252
- */
253
- declare function mergePoliciesAny<TContext extends Context, TResources extends Resources = Resources, TActions extends Actions<TResources> = Actions<TResources>>(...policies: Policy<TContext, TResources, TActions>[]): Policy<TContext, TResources, TActions>;
232
+ * Merges multiple policies into one using "deny-overrides" strategy.
233
+ * If any policy denies, the merged policy denies. All must allow for the result to allow.
234
+ *
235
+ * @example
236
+ * ```ts
237
+ * const basePolicy = createPolicy({ ... });
238
+ * const adminPolicy = createPolicy({ ... });
239
+ *
240
+ * const merged = mergePolicies(basePolicy, adminPolicy);
241
+ * // Both policies must allow for the action to be permitted
242
+ * ```
243
+ */
244
+ declare const mergePolicies: <TContext extends Context, TResources extends Resources = Resources, TActions extends Actions<TResources> = Actions<TResources>>(...policies: Policy<TContext, TResources, TActions>[]) => Policy<TContext, TResources, TActions>;
245
+ /**
246
+ * Merges multiple policies into one using "allow-overrides" strategy.
247
+ * If any policy allows, the merged policy allows. All must deny for the result to deny.
248
+ *
249
+ * @example
250
+ * ```ts
251
+ * const guestPolicy = createPolicy({ ... });
252
+ * const memberPolicy = createPolicy({ ... });
253
+ *
254
+ * const merged = mergePoliciesAny(guestPolicy, memberPolicy);
255
+ * // If either policy allows, the action is permitted
256
+ * ```
257
+ */
258
+ declare const mergePoliciesAny: <TContext extends Context, TResources extends Resources = Resources, TActions extends Actions<TResources> = Actions<TResources>>(...policies: Policy<TContext, TResources, TActions>[]) => Policy<TContext, TResources, TActions>;
254
259
  //#endregion
255
260
  export { allow, and, collectInheritedRoles, createPolicy, deny, has, hasRole, mergePolicies, mergePoliciesAny, not, or, when };
256
261
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;AAkCA;;;;;;;;;;;;;;iBAAgB,KAAA,kBACG,OAAA,uDAAA,CAAA,GAGd,QAAA,CAAS,QAAA,EAAU,OAAA,EAAS,SAAA;;AAoBjC;;;;;;;;;;;;;;;iBAAgB,IAAA,kBACG,OAAA,uDAAA,CAAA,GAGd,QAAA,CAAS,QAAA,EAAU,OAAA,EAAS,SAAA;AAoBjC;;;;;;;;;;;;;;;;AAAA,iBAAgB,IAAA,kBACG,OAAA,uDAAA,CAGjB,SAAA,EAAW,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,SAAA,IAAa,QAAA,CAAS,QAAA,EAAU,OAAA,EAAS,SAAA;;;;;;;;;AAqBrF;;;;;;;;;iBAAgB,GAAA,kBAAqB,OAAA,uDAAA,CAAA,GAChC,UAAA,EAAY,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,SAAA,MAC7C,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,SAAA;;;;;;;;;;;;;;;;AAsBlC;;iBAAgB,EAAA,kBAAoB,OAAA,uDAAA,CAAA,GAC/B,UAAA,EAAY,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,SAAA,MAC7C,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,SAAA;;;;;;;;;;;;;;;iBAmBlB,GAAA,kBAAqB,OAAA,uDAAA,CACnC,SAAA,EAAW,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,SAAA,IACzC,WAAA,CAAY,QAAA,EAAU,OAAA,EAAS,SAAA;;;;AAFlC;;;;;;;;;iBAkBgB,GAAA,kBAAqB,OAAA,kBAAyB,QAAA,CAAA,CAC5D,GAAA,EAAK,CAAA,EACL,KAAA,EAAO,QAAA,CAAS,C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