@lssm/lib.identity-rbac 0.0.0-canary-20251217052941 → 0.0.0-canary-20251217060433

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.
@@ -0,0 +1,611 @@
1
+ import * as _lssm_lib_schema803 from "@lssm/lib.schema";
2
+ import { SchemaModel } from "@lssm/lib.schema";
3
+ import * as _lssm_lib_contracts42 from "@lssm/lib.contracts";
4
+
5
+ //#region src/contracts/rbac.d.ts
6
+ declare const RoleModel: SchemaModel<{
7
+ id: {
8
+ type: _lssm_lib_schema803.FieldType<string, string>;
9
+ isOptional: false;
10
+ };
11
+ name: {
12
+ type: _lssm_lib_schema803.FieldType<string, string>;
13
+ isOptional: false;
14
+ };
15
+ description: {
16
+ type: _lssm_lib_schema803.FieldType<string, string>;
17
+ isOptional: true;
18
+ };
19
+ permissions: {
20
+ type: _lssm_lib_schema803.FieldType<string, string>;
21
+ isOptional: false;
22
+ isArray: true;
23
+ };
24
+ createdAt: {
25
+ type: _lssm_lib_schema803.FieldType<Date, string>;
26
+ isOptional: false;
27
+ };
28
+ }>;
29
+ declare const PolicyBindingModel: SchemaModel<{
30
+ id: {
31
+ type: _lssm_lib_schema803.FieldType<string, string>;
32
+ isOptional: false;
33
+ };
34
+ roleId: {
35
+ type: _lssm_lib_schema803.FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ targetType: {
39
+ type: _lssm_lib_schema803.FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ targetId: {
43
+ type: _lssm_lib_schema803.FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ expiresAt: {
47
+ type: _lssm_lib_schema803.FieldType<Date, string>;
48
+ isOptional: true;
49
+ };
50
+ createdAt: {
51
+ type: _lssm_lib_schema803.FieldType<Date, string>;
52
+ isOptional: false;
53
+ };
54
+ role: {
55
+ type: SchemaModel<{
56
+ id: {
57
+ type: _lssm_lib_schema803.FieldType<string, string>;
58
+ isOptional: false;
59
+ };
60
+ name: {
61
+ type: _lssm_lib_schema803.FieldType<string, string>;
62
+ isOptional: false;
63
+ };
64
+ description: {
65
+ type: _lssm_lib_schema803.FieldType<string, string>;
66
+ isOptional: true;
67
+ };
68
+ permissions: {
69
+ type: _lssm_lib_schema803.FieldType<string, string>;
70
+ isOptional: false;
71
+ isArray: true;
72
+ };
73
+ createdAt: {
74
+ type: _lssm_lib_schema803.FieldType<Date, string>;
75
+ isOptional: false;
76
+ };
77
+ }>;
78
+ isOptional: false;
79
+ };
80
+ }>;
81
+ declare const PermissionCheckResultModel: SchemaModel<{
82
+ allowed: {
83
+ type: _lssm_lib_schema803.FieldType<boolean, boolean>;
84
+ isOptional: false;
85
+ };
86
+ reason: {
87
+ type: _lssm_lib_schema803.FieldType<string, string>;
88
+ isOptional: true;
89
+ };
90
+ matchedRole: {
91
+ type: _lssm_lib_schema803.FieldType<string, string>;
92
+ isOptional: true;
93
+ };
94
+ }>;
95
+ declare const CreateRoleInputModel: SchemaModel<{
96
+ name: {
97
+ type: _lssm_lib_schema803.FieldType<string, string>;
98
+ isOptional: false;
99
+ };
100
+ description: {
101
+ type: _lssm_lib_schema803.FieldType<string, string>;
102
+ isOptional: true;
103
+ };
104
+ permissions: {
105
+ type: _lssm_lib_schema803.FieldType<string, string>;
106
+ isOptional: false;
107
+ isArray: true;
108
+ };
109
+ }>;
110
+ declare const UpdateRoleInputModel: SchemaModel<{
111
+ roleId: {
112
+ type: _lssm_lib_schema803.FieldType<string, string>;
113
+ isOptional: false;
114
+ };
115
+ name: {
116
+ type: _lssm_lib_schema803.FieldType<string, string>;
117
+ isOptional: true;
118
+ };
119
+ description: {
120
+ type: _lssm_lib_schema803.FieldType<string, string>;
121
+ isOptional: true;
122
+ };
123
+ permissions: {
124
+ type: _lssm_lib_schema803.FieldType<string, string>;
125
+ isOptional: true;
126
+ isArray: true;
127
+ };
128
+ }>;
129
+ declare const DeleteRoleInputModel: SchemaModel<{
130
+ roleId: {
131
+ type: _lssm_lib_schema803.FieldType<string, string>;
132
+ isOptional: false;
133
+ };
134
+ }>;
135
+ declare const ListRolesOutputModel: SchemaModel<{
136
+ roles: {
137
+ type: SchemaModel<{
138
+ id: {
139
+ type: _lssm_lib_schema803.FieldType<string, string>;
140
+ isOptional: false;
141
+ };
142
+ name: {
143
+ type: _lssm_lib_schema803.FieldType<string, string>;
144
+ isOptional: false;
145
+ };
146
+ description: {
147
+ type: _lssm_lib_schema803.FieldType<string, string>;
148
+ isOptional: true;
149
+ };
150
+ permissions: {
151
+ type: _lssm_lib_schema803.FieldType<string, string>;
152
+ isOptional: false;
153
+ isArray: true;
154
+ };
155
+ createdAt: {
156
+ type: _lssm_lib_schema803.FieldType<Date, string>;
157
+ isOptional: false;
158
+ };
159
+ }>;
160
+ isOptional: false;
161
+ isArray: true;
162
+ };
163
+ }>;
164
+ declare const AssignRoleInputModel: SchemaModel<{
165
+ roleId: {
166
+ type: _lssm_lib_schema803.FieldType<string, string>;
167
+ isOptional: false;
168
+ };
169
+ targetType: {
170
+ type: _lssm_lib_schema803.FieldType<string, string>;
171
+ isOptional: false;
172
+ };
173
+ targetId: {
174
+ type: _lssm_lib_schema803.FieldType<string, string>;
175
+ isOptional: false;
176
+ };
177
+ expiresAt: {
178
+ type: _lssm_lib_schema803.FieldType<Date, string>;
179
+ isOptional: true;
180
+ };
181
+ }>;
182
+ declare const RevokeRoleInputModel: SchemaModel<{
183
+ bindingId: {
184
+ type: _lssm_lib_schema803.FieldType<string, string>;
185
+ isOptional: false;
186
+ };
187
+ }>;
188
+ declare const BindingIdPayloadModel: SchemaModel<{
189
+ bindingId: {
190
+ type: _lssm_lib_schema803.FieldType<string, string>;
191
+ isOptional: false;
192
+ };
193
+ }>;
194
+ declare const CheckPermissionInputModel: SchemaModel<{
195
+ userId: {
196
+ type: _lssm_lib_schema803.FieldType<string, string>;
197
+ isOptional: false;
198
+ };
199
+ orgId: {
200
+ type: _lssm_lib_schema803.FieldType<string, string>;
201
+ isOptional: true;
202
+ };
203
+ permission: {
204
+ type: _lssm_lib_schema803.FieldType<string, string>;
205
+ isOptional: false;
206
+ };
207
+ }>;
208
+ declare const ListUserPermissionsInputModel: SchemaModel<{
209
+ userId: {
210
+ type: _lssm_lib_schema803.FieldType<string, string>;
211
+ isOptional: false;
212
+ };
213
+ orgId: {
214
+ type: _lssm_lib_schema803.FieldType<string, string>;
215
+ isOptional: true;
216
+ };
217
+ }>;
218
+ declare const ListUserPermissionsOutputModel: SchemaModel<{
219
+ permissions: {
220
+ type: _lssm_lib_schema803.FieldType<string, string>;
221
+ isOptional: false;
222
+ isArray: true;
223
+ };
224
+ roles: {
225
+ type: SchemaModel<{
226
+ id: {
227
+ type: _lssm_lib_schema803.FieldType<string, string>;
228
+ isOptional: false;
229
+ };
230
+ name: {
231
+ type: _lssm_lib_schema803.FieldType<string, string>;
232
+ isOptional: false;
233
+ };
234
+ description: {
235
+ type: _lssm_lib_schema803.FieldType<string, string>;
236
+ isOptional: true;
237
+ };
238
+ permissions: {
239
+ type: _lssm_lib_schema803.FieldType<string, string>;
240
+ isOptional: false;
241
+ isArray: true;
242
+ };
243
+ createdAt: {
244
+ type: _lssm_lib_schema803.FieldType<Date, string>;
245
+ isOptional: false;
246
+ };
247
+ }>;
248
+ isOptional: false;
249
+ isArray: true;
250
+ };
251
+ }>;
252
+ /**
253
+ * Create a new role.
254
+ */
255
+ declare const CreateRoleContract: _lssm_lib_contracts42.ContractSpec<SchemaModel<{
256
+ name: {
257
+ type: _lssm_lib_schema803.FieldType<string, string>;
258
+ isOptional: false;
259
+ };
260
+ description: {
261
+ type: _lssm_lib_schema803.FieldType<string, string>;
262
+ isOptional: true;
263
+ };
264
+ permissions: {
265
+ type: _lssm_lib_schema803.FieldType<string, string>;
266
+ isOptional: false;
267
+ isArray: true;
268
+ };
269
+ }>, SchemaModel<{
270
+ id: {
271
+ type: _lssm_lib_schema803.FieldType<string, string>;
272
+ isOptional: false;
273
+ };
274
+ name: {
275
+ type: _lssm_lib_schema803.FieldType<string, string>;
276
+ isOptional: false;
277
+ };
278
+ description: {
279
+ type: _lssm_lib_schema803.FieldType<string, string>;
280
+ isOptional: true;
281
+ };
282
+ permissions: {
283
+ type: _lssm_lib_schema803.FieldType<string, string>;
284
+ isOptional: false;
285
+ isArray: true;
286
+ };
287
+ createdAt: {
288
+ type: _lssm_lib_schema803.FieldType<Date, string>;
289
+ isOptional: false;
290
+ };
291
+ }>, undefined>;
292
+ /**
293
+ * Update a role.
294
+ */
295
+ declare const UpdateRoleContract: _lssm_lib_contracts42.ContractSpec<SchemaModel<{
296
+ roleId: {
297
+ type: _lssm_lib_schema803.FieldType<string, string>;
298
+ isOptional: false;
299
+ };
300
+ name: {
301
+ type: _lssm_lib_schema803.FieldType<string, string>;
302
+ isOptional: true;
303
+ };
304
+ description: {
305
+ type: _lssm_lib_schema803.FieldType<string, string>;
306
+ isOptional: true;
307
+ };
308
+ permissions: {
309
+ type: _lssm_lib_schema803.FieldType<string, string>;
310
+ isOptional: true;
311
+ isArray: true;
312
+ };
313
+ }>, SchemaModel<{
314
+ id: {
315
+ type: _lssm_lib_schema803.FieldType<string, string>;
316
+ isOptional: false;
317
+ };
318
+ name: {
319
+ type: _lssm_lib_schema803.FieldType<string, string>;
320
+ isOptional: false;
321
+ };
322
+ description: {
323
+ type: _lssm_lib_schema803.FieldType<string, string>;
324
+ isOptional: true;
325
+ };
326
+ permissions: {
327
+ type: _lssm_lib_schema803.FieldType<string, string>;
328
+ isOptional: false;
329
+ isArray: true;
330
+ };
331
+ createdAt: {
332
+ type: _lssm_lib_schema803.FieldType<Date, string>;
333
+ isOptional: false;
334
+ };
335
+ }>, undefined>;
336
+ /**
337
+ * Delete a role.
338
+ */
339
+ declare const DeleteRoleContract: _lssm_lib_contracts42.ContractSpec<SchemaModel<{
340
+ roleId: {
341
+ type: _lssm_lib_schema803.FieldType<string, string>;
342
+ isOptional: false;
343
+ };
344
+ }>, SchemaModel<{
345
+ success: {
346
+ type: _lssm_lib_schema803.FieldType<boolean, boolean>;
347
+ isOptional: false;
348
+ };
349
+ }>, undefined>;
350
+ /**
351
+ * List all roles.
352
+ */
353
+ declare const ListRolesContract: _lssm_lib_contracts42.ContractSpec<_lssm_lib_schema803.AnySchemaModel, SchemaModel<{
354
+ roles: {
355
+ type: SchemaModel<{
356
+ id: {
357
+ type: _lssm_lib_schema803.FieldType<string, string>;
358
+ isOptional: false;
359
+ };
360
+ name: {
361
+ type: _lssm_lib_schema803.FieldType<string, string>;
362
+ isOptional: false;
363
+ };
364
+ description: {
365
+ type: _lssm_lib_schema803.FieldType<string, string>;
366
+ isOptional: true;
367
+ };
368
+ permissions: {
369
+ type: _lssm_lib_schema803.FieldType<string, string>;
370
+ isOptional: false;
371
+ isArray: true;
372
+ };
373
+ createdAt: {
374
+ type: _lssm_lib_schema803.FieldType<Date, string>;
375
+ isOptional: false;
376
+ };
377
+ }>;
378
+ isOptional: false;
379
+ isArray: true;
380
+ };
381
+ }>, undefined>;
382
+ /**
383
+ * Assign a role to a user or organization.
384
+ */
385
+ declare const AssignRoleContract: _lssm_lib_contracts42.ContractSpec<SchemaModel<{
386
+ roleId: {
387
+ type: _lssm_lib_schema803.FieldType<string, string>;
388
+ isOptional: false;
389
+ };
390
+ targetType: {
391
+ type: _lssm_lib_schema803.FieldType<string, string>;
392
+ isOptional: false;
393
+ };
394
+ targetId: {
395
+ type: _lssm_lib_schema803.FieldType<string, string>;
396
+ isOptional: false;
397
+ };
398
+ expiresAt: {
399
+ type: _lssm_lib_schema803.FieldType<Date, string>;
400
+ isOptional: true;
401
+ };
402
+ }>, SchemaModel<{
403
+ id: {
404
+ type: _lssm_lib_schema803.FieldType<string, string>;
405
+ isOptional: false;
406
+ };
407
+ roleId: {
408
+ type: _lssm_lib_schema803.FieldType<string, string>;
409
+ isOptional: false;
410
+ };
411
+ targetType: {
412
+ type: _lssm_lib_schema803.FieldType<string, string>;
413
+ isOptional: false;
414
+ };
415
+ targetId: {
416
+ type: _lssm_lib_schema803.FieldType<string, string>;
417
+ isOptional: false;
418
+ };
419
+ expiresAt: {
420
+ type: _lssm_lib_schema803.FieldType<Date, string>;
421
+ isOptional: true;
422
+ };
423
+ createdAt: {
424
+ type: _lssm_lib_schema803.FieldType<Date, string>;
425
+ isOptional: false;
426
+ };
427
+ role: {
428
+ type: SchemaModel<{
429
+ id: {
430
+ type: _lssm_lib_schema803.FieldType<string, string>;
431
+ isOptional: false;
432
+ };
433
+ name: {
434
+ type: _lssm_lib_schema803.FieldType<string, string>;
435
+ isOptional: false;
436
+ };
437
+ description: {
438
+ type: _lssm_lib_schema803.FieldType<string, string>;
439
+ isOptional: true;
440
+ };
441
+ permissions: {
442
+ type: _lssm_lib_schema803.FieldType<string, string>;
443
+ isOptional: false;
444
+ isArray: true;
445
+ };
446
+ createdAt: {
447
+ type: _lssm_lib_schema803.FieldType<Date, string>;
448
+ isOptional: false;
449
+ };
450
+ }>;
451
+ isOptional: false;
452
+ };
453
+ }>, {
454
+ name: string;
455
+ version: number;
456
+ when: string;
457
+ payload: SchemaModel<{
458
+ id: {
459
+ type: _lssm_lib_schema803.FieldType<string, string>;
460
+ isOptional: false;
461
+ };
462
+ roleId: {
463
+ type: _lssm_lib_schema803.FieldType<string, string>;
464
+ isOptional: false;
465
+ };
466
+ targetType: {
467
+ type: _lssm_lib_schema803.FieldType<string, string>;
468
+ isOptional: false;
469
+ };
470
+ targetId: {
471
+ type: _lssm_lib_schema803.FieldType<string, string>;
472
+ isOptional: false;
473
+ };
474
+ expiresAt: {
475
+ type: _lssm_lib_schema803.FieldType<Date, string>;
476
+ isOptional: true;
477
+ };
478
+ createdAt: {
479
+ type: _lssm_lib_schema803.FieldType<Date, string>;
480
+ isOptional: false;
481
+ };
482
+ role: {
483
+ type: SchemaModel<{
484
+ id: {
485
+ type: _lssm_lib_schema803.FieldType<string, string>;
486
+ isOptional: false;
487
+ };
488
+ name: {
489
+ type: _lssm_lib_schema803.FieldType<string, string>;
490
+ isOptional: false;
491
+ };
492
+ description: {
493
+ type: _lssm_lib_schema803.FieldType<string, string>;
494
+ isOptional: true;
495
+ };
496
+ permissions: {
497
+ type: _lssm_lib_schema803.FieldType<string, string>;
498
+ isOptional: false;
499
+ isArray: true;
500
+ };
501
+ createdAt: {
502
+ type: _lssm_lib_schema803.FieldType<Date, string>;
503
+ isOptional: false;
504
+ };
505
+ }>;
506
+ isOptional: false;
507
+ };
508
+ }>;
509
+ }[]>;
510
+ /**
511
+ * Revoke a role from a user or organization.
512
+ */
513
+ declare const RevokeRoleContract: _lssm_lib_contracts42.ContractSpec<SchemaModel<{
514
+ bindingId: {
515
+ type: _lssm_lib_schema803.FieldType<string, string>;
516
+ isOptional: false;
517
+ };
518
+ }>, SchemaModel<{
519
+ success: {
520
+ type: _lssm_lib_schema803.FieldType<boolean, boolean>;
521
+ isOptional: false;
522
+ };
523
+ }>, {
524
+ name: string;
525
+ version: number;
526
+ when: string;
527
+ payload: SchemaModel<{
528
+ bindingId: {
529
+ type: _lssm_lib_schema803.FieldType<string, string>;
530
+ isOptional: false;
531
+ };
532
+ }>;
533
+ }[]>;
534
+ /**
535
+ * Check if a user has a specific permission.
536
+ */
537
+ declare const CheckPermissionContract: _lssm_lib_contracts42.ContractSpec<SchemaModel<{
538
+ userId: {
539
+ type: _lssm_lib_schema803.FieldType<string, string>;
540
+ isOptional: false;
541
+ };
542
+ orgId: {
543
+ type: _lssm_lib_schema803.FieldType<string, string>;
544
+ isOptional: true;
545
+ };
546
+ permission: {
547
+ type: _lssm_lib_schema803.FieldType<string, string>;
548
+ isOptional: false;
549
+ };
550
+ }>, SchemaModel<{
551
+ allowed: {
552
+ type: _lssm_lib_schema803.FieldType<boolean, boolean>;
553
+ isOptional: false;
554
+ };
555
+ reason: {
556
+ type: _lssm_lib_schema803.FieldType<string, string>;
557
+ isOptional: true;
558
+ };
559
+ matchedRole: {
560
+ type: _lssm_lib_schema803.FieldType<string, string>;
561
+ isOptional: true;
562
+ };
563
+ }>, undefined>;
564
+ /**
565
+ * List permissions for a user.
566
+ */
567
+ declare const ListUserPermissionsContract: _lssm_lib_contracts42.ContractSpec<SchemaModel<{
568
+ userId: {
569
+ type: _lssm_lib_schema803.FieldType<string, string>;
570
+ isOptional: false;
571
+ };
572
+ orgId: {
573
+ type: _lssm_lib_schema803.FieldType<string, string>;
574
+ isOptional: true;
575
+ };
576
+ }>, SchemaModel<{
577
+ permissions: {
578
+ type: _lssm_lib_schema803.FieldType<string, string>;
579
+ isOptional: false;
580
+ isArray: true;
581
+ };
582
+ roles: {
583
+ type: SchemaModel<{
584
+ id: {
585
+ type: _lssm_lib_schema803.FieldType<string, string>;
586
+ isOptional: false;
587
+ };
588
+ name: {
589
+ type: _lssm_lib_schema803.FieldType<string, string>;
590
+ isOptional: false;
591
+ };
592
+ description: {
593
+ type: _lssm_lib_schema803.FieldType<string, string>;
594
+ isOptional: true;
595
+ };
596
+ permissions: {
597
+ type: _lssm_lib_schema803.FieldType<string, string>;
598
+ isOptional: false;
599
+ isArray: true;
600
+ };
601
+ createdAt: {
602
+ type: _lssm_lib_schema803.FieldType<Date, string>;
603
+ isOptional: false;
604
+ };
605
+ }>;
606
+ isOptional: false;
607
+ isArray: true;
608
+ };
609
+ }>, undefined>;
610
+ //#endregion
611
+ export { AssignRoleContract, AssignRoleInputModel, BindingIdPayloadModel, CheckPermissionContract, CheckPermissionInputModel, CreateRoleContract, CreateRoleInputModel, DeleteRoleContract, DeleteRoleInputModel, ListRolesContract, ListRolesOutputModel, ListUserPermissionsContract, ListUserPermissionsInputModel, ListUserPermissionsOutputModel, PermissionCheckResultModel, PolicyBindingModel, RevokeRoleContract, RevokeRoleInputModel, RoleModel, UpdateRoleContract, UpdateRoleInputModel };