@tstdl/base 0.93.78 → 0.93.81

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.
Files changed (39) hide show
  1. package/api/server/gateway.js +1 -1
  2. package/authentication/authentication.api.d.ts +9 -0
  3. package/authentication/authentication.api.js +3 -0
  4. package/authentication/client/authentication.service.d.ts +23 -15
  5. package/authentication/client/authentication.service.js +30 -21
  6. package/authentication/index.d.ts +1 -0
  7. package/authentication/index.js +1 -0
  8. package/authentication/models/authentication-credentials.model.d.ts +2 -2
  9. package/authentication/models/authentication-credentials.model.js +5 -5
  10. package/authentication/models/authentication-session.model.d.ts +2 -2
  11. package/authentication/models/authentication-session.model.js +3 -3
  12. package/authentication/models/subject.model.js +5 -3
  13. package/authentication/models/token-payload-base.model.d.ts +5 -1
  14. package/authentication/models/token-payload-base.model.js +10 -2
  15. package/authentication/models/token.model.d.ts +9 -1
  16. package/authentication/server/authentication-ancillary.service.d.ts +12 -15
  17. package/authentication/server/authentication-ancillary.service.js +3 -0
  18. package/authentication/server/authentication.api-controller.js +5 -5
  19. package/authentication/server/authentication.audit.d.ts +7 -5
  20. package/authentication/server/authentication.service.d.ts +32 -22
  21. package/authentication/server/authentication.service.js +116 -65
  22. package/authentication/server/drizzle/{0001_condemned_pretty_boy.sql → 0000_violet_callisto.sql} +34 -5
  23. package/authentication/server/drizzle/meta/0000_snapshot.json +500 -6
  24. package/authentication/server/drizzle/meta/_journal.json +2 -9
  25. package/authentication/types.d.ts +6 -0
  26. package/authentication/types.js +1 -0
  27. package/document-management/server/drizzle/{0000_ordinary_pretty_boy.sql → 0000_glamorous_lorna_dane.sql} +96 -76
  28. package/document-management/server/drizzle/meta/0000_snapshot.json +360 -142
  29. package/document-management/server/drizzle/meta/_journal.json +2 -16
  30. package/examples/api/authentication.js +3 -2
  31. package/examples/api/custom-authentication.js +11 -9
  32. package/orm/server/drizzle/schema-converter.js +53 -32
  33. package/package.json +1 -1
  34. package/authentication/server/drizzle/0000_calm_warlock.sql +0 -28
  35. package/authentication/server/drizzle/meta/0001_snapshot.json +0 -651
  36. package/document-management/server/drizzle/0001_lyrical_wong.sql +0 -123
  37. package/document-management/server/drizzle/0002_round_warbird.sql +0 -1
  38. package/document-management/server/drizzle/meta/0001_snapshot.json +0 -2728
  39. package/document-management/server/drizzle/meta/0002_snapshot.json +0 -2722
@@ -1,651 +0,0 @@
1
- {
2
- "id": "0afd94d3-835c-4c5c-8468-940fef2c9342",
3
- "prevId": "b41cc4f0-eadb-406c-a969-a21f01b60268",
4
- "version": "7",
5
- "dialect": "postgresql",
6
- "tables": {
7
- "authentication.credentials": {
8
- "name": "credentials",
9
- "schema": "authentication",
10
- "columns": {
11
- "id": {
12
- "name": "id",
13
- "type": "uuid",
14
- "primaryKey": true,
15
- "notNull": true,
16
- "default": "gen_random_uuid()"
17
- },
18
- "subject": {
19
- "name": "subject",
20
- "type": "uuid",
21
- "primaryKey": false,
22
- "notNull": true
23
- },
24
- "hash_version": {
25
- "name": "hash_version",
26
- "type": "integer",
27
- "primaryKey": false,
28
- "notNull": true
29
- },
30
- "salt": {
31
- "name": "salt",
32
- "type": "bytea",
33
- "primaryKey": false,
34
- "notNull": true
35
- },
36
- "hash": {
37
- "name": "hash",
38
- "type": "bytea",
39
- "primaryKey": false,
40
- "notNull": true
41
- },
42
- "revision": {
43
- "name": "revision",
44
- "type": "integer",
45
- "primaryKey": false,
46
- "notNull": true
47
- },
48
- "revision_timestamp": {
49
- "name": "revision_timestamp",
50
- "type": "timestamp with time zone",
51
- "primaryKey": false,
52
- "notNull": true
53
- },
54
- "create_timestamp": {
55
- "name": "create_timestamp",
56
- "type": "timestamp with time zone",
57
- "primaryKey": false,
58
- "notNull": true
59
- },
60
- "delete_timestamp": {
61
- "name": "delete_timestamp",
62
- "type": "timestamp with time zone",
63
- "primaryKey": false,
64
- "notNull": false
65
- },
66
- "attributes": {
67
- "name": "attributes",
68
- "type": "jsonb",
69
- "primaryKey": false,
70
- "notNull": true,
71
- "default": "'{}'::jsonb"
72
- }
73
- },
74
- "indexes": {},
75
- "foreignKeys": {
76
- "credentials_subject_subject_id_fk": {
77
- "name": "credentials_subject_subject_id_fk",
78
- "tableFrom": "credentials",
79
- "tableTo": "subject",
80
- "schemaTo": "authentication",
81
- "columnsFrom": [
82
- "subject"
83
- ],
84
- "columnsTo": [
85
- "id"
86
- ],
87
- "onDelete": "no action",
88
- "onUpdate": "no action"
89
- }
90
- },
91
- "compositePrimaryKeys": {},
92
- "uniqueConstraints": {
93
- "credentials_subject_unique": {
94
- "name": "credentials_subject_unique",
95
- "nullsNotDistinct": false,
96
- "columns": [
97
- "subject"
98
- ]
99
- }
100
- },
101
- "policies": {},
102
- "checkConstraints": {},
103
- "isRLSEnabled": false
104
- },
105
- "authentication.session": {
106
- "name": "session",
107
- "schema": "authentication",
108
- "columns": {
109
- "id": {
110
- "name": "id",
111
- "type": "uuid",
112
- "primaryKey": true,
113
- "notNull": true,
114
- "default": "gen_random_uuid()"
115
- },
116
- "subject": {
117
- "name": "subject",
118
- "type": "uuid",
119
- "primaryKey": false,
120
- "notNull": true
121
- },
122
- "begin": {
123
- "name": "begin",
124
- "type": "timestamp with time zone",
125
- "primaryKey": false,
126
- "notNull": true
127
- },
128
- "end": {
129
- "name": "end",
130
- "type": "timestamp with time zone",
131
- "primaryKey": false,
132
- "notNull": true
133
- },
134
- "refresh_token_hash_version": {
135
- "name": "refresh_token_hash_version",
136
- "type": "integer",
137
- "primaryKey": false,
138
- "notNull": true
139
- },
140
- "refresh_token_salt": {
141
- "name": "refresh_token_salt",
142
- "type": "bytea",
143
- "primaryKey": false,
144
- "notNull": true
145
- },
146
- "refresh_token_hash": {
147
- "name": "refresh_token_hash",
148
- "type": "bytea",
149
- "primaryKey": false,
150
- "notNull": true
151
- },
152
- "revision": {
153
- "name": "revision",
154
- "type": "integer",
155
- "primaryKey": false,
156
- "notNull": true
157
- },
158
- "revision_timestamp": {
159
- "name": "revision_timestamp",
160
- "type": "timestamp with time zone",
161
- "primaryKey": false,
162
- "notNull": true
163
- },
164
- "create_timestamp": {
165
- "name": "create_timestamp",
166
- "type": "timestamp with time zone",
167
- "primaryKey": false,
168
- "notNull": true
169
- },
170
- "delete_timestamp": {
171
- "name": "delete_timestamp",
172
- "type": "timestamp with time zone",
173
- "primaryKey": false,
174
- "notNull": false
175
- },
176
- "attributes": {
177
- "name": "attributes",
178
- "type": "jsonb",
179
- "primaryKey": false,
180
- "notNull": true,
181
- "default": "'{}'::jsonb"
182
- }
183
- },
184
- "indexes": {},
185
- "foreignKeys": {
186
- "session_subject_subject_id_fk": {
187
- "name": "session_subject_subject_id_fk",
188
- "tableFrom": "session",
189
- "tableTo": "subject",
190
- "schemaTo": "authentication",
191
- "columnsFrom": [
192
- "subject"
193
- ],
194
- "columnsTo": [
195
- "id"
196
- ],
197
- "onDelete": "no action",
198
- "onUpdate": "no action"
199
- }
200
- },
201
- "compositePrimaryKeys": {},
202
- "uniqueConstraints": {},
203
- "policies": {},
204
- "checkConstraints": {},
205
- "isRLSEnabled": false
206
- },
207
- "authentication.service_account": {
208
- "name": "service_account",
209
- "schema": "authentication",
210
- "columns": {
211
- "id": {
212
- "name": "id",
213
- "type": "uuid",
214
- "primaryKey": false,
215
- "notNull": true,
216
- "default": "gen_random_uuid()"
217
- },
218
- "tenant_id": {
219
- "name": "tenant_id",
220
- "type": "uuid",
221
- "primaryKey": false,
222
- "notNull": true
223
- },
224
- "description": {
225
- "name": "description",
226
- "type": "text",
227
- "primaryKey": false,
228
- "notNull": true
229
- },
230
- "parent": {
231
- "name": "parent",
232
- "type": "uuid",
233
- "primaryKey": false,
234
- "notNull": false
235
- },
236
- "revision": {
237
- "name": "revision",
238
- "type": "integer",
239
- "primaryKey": false,
240
- "notNull": true
241
- },
242
- "revision_timestamp": {
243
- "name": "revision_timestamp",
244
- "type": "timestamp with time zone",
245
- "primaryKey": false,
246
- "notNull": true
247
- },
248
- "create_timestamp": {
249
- "name": "create_timestamp",
250
- "type": "timestamp with time zone",
251
- "primaryKey": false,
252
- "notNull": true
253
- },
254
- "delete_timestamp": {
255
- "name": "delete_timestamp",
256
- "type": "timestamp with time zone",
257
- "primaryKey": false,
258
- "notNull": false
259
- },
260
- "attributes": {
261
- "name": "attributes",
262
- "type": "jsonb",
263
- "primaryKey": false,
264
- "notNull": true,
265
- "default": "'{}'::jsonb"
266
- }
267
- },
268
- "indexes": {},
269
- "foreignKeys": {
270
- "service_account_id_fkey": {
271
- "name": "service_account_id_fkey",
272
- "tableFrom": "service_account",
273
- "tableTo": "subject",
274
- "schemaTo": "authentication",
275
- "columnsFrom": [
276
- "tenant_id",
277
- "parent"
278
- ],
279
- "columnsTo": [
280
- "tenant_id",
281
- "id"
282
- ],
283
- "onDelete": "no action",
284
- "onUpdate": "no action"
285
- }
286
- },
287
- "compositePrimaryKeys": {
288
- "service_account_tenant_id_id_pk": {
289
- "name": "service_account_tenant_id_id_pk",
290
- "columns": [
291
- "tenant_id",
292
- "id"
293
- ]
294
- }
295
- },
296
- "uniqueConstraints": {},
297
- "policies": {},
298
- "checkConstraints": {},
299
- "isRLSEnabled": false
300
- },
301
- "authentication.subject": {
302
- "name": "subject",
303
- "schema": "authentication",
304
- "columns": {
305
- "id": {
306
- "name": "id",
307
- "type": "uuid",
308
- "primaryKey": false,
309
- "notNull": true,
310
- "default": "gen_random_uuid()"
311
- },
312
- "tenant_id": {
313
- "name": "tenant_id",
314
- "type": "uuid",
315
- "primaryKey": false,
316
- "notNull": true
317
- },
318
- "type": {
319
- "name": "type",
320
- "type": "subject_type",
321
- "typeSchema": "authentication",
322
- "primaryKey": false,
323
- "notNull": true
324
- },
325
- "display_name": {
326
- "name": "display_name",
327
- "type": "text",
328
- "primaryKey": false,
329
- "notNull": true
330
- },
331
- "system_account_id": {
332
- "name": "system_account_id",
333
- "type": "uuid",
334
- "primaryKey": false,
335
- "notNull": false
336
- },
337
- "user_id": {
338
- "name": "user_id",
339
- "type": "uuid",
340
- "primaryKey": false,
341
- "notNull": false
342
- },
343
- "service_account_id": {
344
- "name": "service_account_id",
345
- "type": "uuid",
346
- "primaryKey": false,
347
- "notNull": false
348
- },
349
- "revision": {
350
- "name": "revision",
351
- "type": "integer",
352
- "primaryKey": false,
353
- "notNull": true
354
- },
355
- "revision_timestamp": {
356
- "name": "revision_timestamp",
357
- "type": "timestamp with time zone",
358
- "primaryKey": false,
359
- "notNull": true
360
- },
361
- "create_timestamp": {
362
- "name": "create_timestamp",
363
- "type": "timestamp with time zone",
364
- "primaryKey": false,
365
- "notNull": true
366
- },
367
- "delete_timestamp": {
368
- "name": "delete_timestamp",
369
- "type": "timestamp with time zone",
370
- "primaryKey": false,
371
- "notNull": false
372
- },
373
- "attributes": {
374
- "name": "attributes",
375
- "type": "jsonb",
376
- "primaryKey": false,
377
- "notNull": true,
378
- "default": "'{}'::jsonb"
379
- }
380
- },
381
- "indexes": {},
382
- "foreignKeys": {
383
- "subject_id_fkey": {
384
- "name": "subject_id_fkey",
385
- "tableFrom": "subject",
386
- "tableTo": "service_account",
387
- "schemaTo": "authentication",
388
- "columnsFrom": [
389
- "tenant_id",
390
- "service_account_id"
391
- ],
392
- "columnsTo": [
393
- "tenant_id",
394
- "id"
395
- ],
396
- "onDelete": "no action",
397
- "onUpdate": "no action"
398
- }
399
- },
400
- "compositePrimaryKeys": {
401
- "subject_tenant_id_id_pk": {
402
- "name": "subject_tenant_id_id_pk",
403
- "columns": [
404
- "tenant_id",
405
- "id"
406
- ]
407
- }
408
- },
409
- "uniqueConstraints": {
410
- "subject_system_account_id_unique": {
411
- "name": "subject_system_account_id_unique",
412
- "nullsNotDistinct": false,
413
- "columns": [
414
- "system_account_id"
415
- ]
416
- },
417
- "subject_user_id_unique": {
418
- "name": "subject_user_id_unique",
419
- "nullsNotDistinct": false,
420
- "columns": [
421
- "user_id"
422
- ]
423
- },
424
- "subject_service_account_id_unique": {
425
- "name": "subject_service_account_id_unique",
426
- "nullsNotDistinct": false,
427
- "columns": [
428
- "service_account_id"
429
- ]
430
- }
431
- },
432
- "policies": {},
433
- "checkConstraints": {
434
- "authentication_subject_reference_check": {
435
- "name": "authentication_subject_reference_check",
436
- "value": "num_nonnulls(\"authentication\".\"subject\".\"system_account_id\", \"authentication\".\"subject\".\"user_id\", \"authentication\".\"subject\".\"service_account_id\") = 1"
437
- }
438
- },
439
- "isRLSEnabled": false
440
- },
441
- "authentication.system_account": {
442
- "name": "system_account",
443
- "schema": "authentication",
444
- "columns": {
445
- "id": {
446
- "name": "id",
447
- "type": "uuid",
448
- "primaryKey": false,
449
- "notNull": true,
450
- "default": "gen_random_uuid()"
451
- },
452
- "tenant_id": {
453
- "name": "tenant_id",
454
- "type": "uuid",
455
- "primaryKey": false,
456
- "notNull": true
457
- },
458
- "identifier": {
459
- "name": "identifier",
460
- "type": "text",
461
- "primaryKey": false,
462
- "notNull": true
463
- },
464
- "revision": {
465
- "name": "revision",
466
- "type": "integer",
467
- "primaryKey": false,
468
- "notNull": true
469
- },
470
- "revision_timestamp": {
471
- "name": "revision_timestamp",
472
- "type": "timestamp with time zone",
473
- "primaryKey": false,
474
- "notNull": true
475
- },
476
- "create_timestamp": {
477
- "name": "create_timestamp",
478
- "type": "timestamp with time zone",
479
- "primaryKey": false,
480
- "notNull": true
481
- },
482
- "delete_timestamp": {
483
- "name": "delete_timestamp",
484
- "type": "timestamp with time zone",
485
- "primaryKey": false,
486
- "notNull": false
487
- },
488
- "attributes": {
489
- "name": "attributes",
490
- "type": "jsonb",
491
- "primaryKey": false,
492
- "notNull": true,
493
- "default": "'{}'::jsonb"
494
- }
495
- },
496
- "indexes": {},
497
- "foreignKeys": {},
498
- "compositePrimaryKeys": {
499
- "system_account_tenant_id_id_pk": {
500
- "name": "system_account_tenant_id_id_pk",
501
- "columns": [
502
- "tenant_id",
503
- "id"
504
- ]
505
- }
506
- },
507
- "uniqueConstraints": {
508
- "system_account_identifier_unique": {
509
- "name": "system_account_identifier_unique",
510
- "nullsNotDistinct": false,
511
- "columns": [
512
- "identifier"
513
- ]
514
- }
515
- },
516
- "policies": {},
517
- "checkConstraints": {},
518
- "isRLSEnabled": false
519
- },
520
- "authentication.user": {
521
- "name": "user",
522
- "schema": "authentication",
523
- "columns": {
524
- "id": {
525
- "name": "id",
526
- "type": "uuid",
527
- "primaryKey": false,
528
- "notNull": true,
529
- "default": "gen_random_uuid()"
530
- },
531
- "tenant_id": {
532
- "name": "tenant_id",
533
- "type": "uuid",
534
- "primaryKey": false,
535
- "notNull": true
536
- },
537
- "status": {
538
- "name": "status",
539
- "type": "user_status",
540
- "typeSchema": "authentication",
541
- "primaryKey": false,
542
- "notNull": true
543
- },
544
- "email": {
545
- "name": "email",
546
- "type": "text",
547
- "primaryKey": false,
548
- "notNull": true
549
- },
550
- "first_name": {
551
- "name": "first_name",
552
- "type": "text",
553
- "primaryKey": false,
554
- "notNull": true
555
- },
556
- "last_name": {
557
- "name": "last_name",
558
- "type": "text",
559
- "primaryKey": false,
560
- "notNull": true
561
- },
562
- "revision": {
563
- "name": "revision",
564
- "type": "integer",
565
- "primaryKey": false,
566
- "notNull": true
567
- },
568
- "revision_timestamp": {
569
- "name": "revision_timestamp",
570
- "type": "timestamp with time zone",
571
- "primaryKey": false,
572
- "notNull": true
573
- },
574
- "create_timestamp": {
575
- "name": "create_timestamp",
576
- "type": "timestamp with time zone",
577
- "primaryKey": false,
578
- "notNull": true
579
- },
580
- "delete_timestamp": {
581
- "name": "delete_timestamp",
582
- "type": "timestamp with time zone",
583
- "primaryKey": false,
584
- "notNull": false
585
- },
586
- "attributes": {
587
- "name": "attributes",
588
- "type": "jsonb",
589
- "primaryKey": false,
590
- "notNull": true,
591
- "default": "'{}'::jsonb"
592
- }
593
- },
594
- "indexes": {},
595
- "foreignKeys": {},
596
- "compositePrimaryKeys": {
597
- "user_tenant_id_id_pk": {
598
- "name": "user_tenant_id_id_pk",
599
- "columns": [
600
- "tenant_id",
601
- "id"
602
- ]
603
- }
604
- },
605
- "uniqueConstraints": {
606
- "user_tenant_id_email_unique": {
607
- "name": "user_tenant_id_email_unique",
608
- "nullsNotDistinct": false,
609
- "columns": [
610
- "tenant_id",
611
- "email"
612
- ]
613
- }
614
- },
615
- "policies": {},
616
- "checkConstraints": {},
617
- "isRLSEnabled": false
618
- }
619
- },
620
- "enums": {
621
- "authentication.subject_type": {
622
- "name": "subject_type",
623
- "schema": "authentication",
624
- "values": [
625
- "system",
626
- "user",
627
- "service-account"
628
- ]
629
- },
630
- "authentication.user_status": {
631
- "name": "user_status",
632
- "schema": "authentication",
633
- "values": [
634
- "active",
635
- "suspended",
636
- "pending-approval",
637
- "invited"
638
- ]
639
- }
640
- },
641
- "schemas": {},
642
- "sequences": {},
643
- "roles": {},
644
- "policies": {},
645
- "views": {},
646
- "_meta": {
647
- "columns": {},
648
- "schemas": {},
649
- "tables": {}
650
- }
651
- }