@tstdl/base 0.93.82 → 0.93.84

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.
@@ -1,7 +1,8 @@
1
1
  CREATE TYPE "authentication"."subject_type" AS ENUM('system', 'user', 'service-account');--> statement-breakpoint
2
2
  CREATE TYPE "authentication"."user_status" AS ENUM('active', 'suspended', 'pending-approval', 'invited');--> statement-breakpoint
3
3
  CREATE TABLE "authentication"."credentials" (
4
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
4
+ "id" uuid DEFAULT gen_random_uuid() NOT NULL,
5
+ "tenant_id" uuid NOT NULL,
5
6
  "subject" uuid NOT NULL,
6
7
  "hash_version" integer NOT NULL,
7
8
  "salt" "bytea" NOT NULL,
@@ -11,11 +12,13 @@ CREATE TABLE "authentication"."credentials" (
11
12
  "create_timestamp" timestamp with time zone NOT NULL,
12
13
  "delete_timestamp" timestamp with time zone,
13
14
  "attributes" jsonb DEFAULT '{}'::jsonb NOT NULL,
14
- CONSTRAINT "credentials_subject_unique" UNIQUE("subject")
15
+ CONSTRAINT "credentials_tenant_id_id_pk" PRIMARY KEY("tenant_id","id"),
16
+ CONSTRAINT "credentials_tenant_id_subject_unique" UNIQUE("tenant_id","subject")
15
17
  );
16
18
  --> statement-breakpoint
17
19
  CREATE TABLE "authentication"."session" (
18
- "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
20
+ "id" uuid DEFAULT gen_random_uuid() NOT NULL,
21
+ "tenant_id" uuid NOT NULL,
19
22
  "subject" uuid NOT NULL,
20
23
  "begin" timestamp with time zone NOT NULL,
21
24
  "end" timestamp with time zone NOT NULL,
@@ -26,7 +29,8 @@ CREATE TABLE "authentication"."session" (
26
29
  "revision_timestamp" timestamp with time zone NOT NULL,
27
30
  "create_timestamp" timestamp with time zone NOT NULL,
28
31
  "delete_timestamp" timestamp with time zone,
29
- "attributes" jsonb DEFAULT '{}'::jsonb NOT NULL
32
+ "attributes" jsonb DEFAULT '{}'::jsonb NOT NULL,
33
+ CONSTRAINT "session_tenant_id_id_pk" PRIMARY KEY("tenant_id","id")
30
34
  );
31
35
  --> statement-breakpoint
32
36
  CREATE TABLE "authentication"."service_account" (
@@ -56,9 +60,10 @@ CREATE TABLE "authentication"."subject" (
56
60
  "delete_timestamp" timestamp with time zone,
57
61
  "attributes" jsonb DEFAULT '{}'::jsonb NOT NULL,
58
62
  CONSTRAINT "subject_tenant_id_id_pk" PRIMARY KEY("tenant_id","id"),
59
- CONSTRAINT "subject_system_account_id_unique" UNIQUE("system_account_id"),
60
- CONSTRAINT "subject_user_id_unique" UNIQUE("user_id"),
61
- CONSTRAINT "subject_service_account_id_unique" UNIQUE("service_account_id"),
63
+ CONSTRAINT "subject_tenant_id_service_account_id_unique" UNIQUE("tenant_id","service_account_id"),
64
+ CONSTRAINT "subject_tenant_id_user_id_unique" UNIQUE("tenant_id","user_id"),
65
+ CONSTRAINT "subject_tenant_id_system_account_id_unique" UNIQUE("tenant_id","system_account_id"),
66
+ CONSTRAINT "subject_id_unique" UNIQUE("id"),
62
67
  CONSTRAINT "authentication_subject_reference_check" CHECK (num_nonnulls("authentication"."subject"."system_account_id", "authentication"."subject"."user_id", "authentication"."subject"."service_account_id") = 1)
63
68
  );
64
69
  --> statement-breakpoint
@@ -91,8 +96,8 @@ CREATE TABLE "authentication"."user" (
91
96
  CONSTRAINT "user_tenant_id_email_unique" UNIQUE("tenant_id","email")
92
97
  );
93
98
  --> statement-breakpoint
94
- ALTER TABLE "authentication"."credentials" ADD CONSTRAINT "credentials_subject_subject_id_fk" FOREIGN KEY ("subject") REFERENCES "authentication"."subject"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
95
- ALTER TABLE "authentication"."session" ADD CONSTRAINT "session_subject_subject_id_fk" FOREIGN KEY ("subject") REFERENCES "authentication"."subject"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
99
+ ALTER TABLE "authentication"."credentials" ADD CONSTRAINT "credentials_id_subject_fkey" FOREIGN KEY ("tenant_id","subject") REFERENCES "authentication"."subject"("tenant_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
100
+ ALTER TABLE "authentication"."session" ADD CONSTRAINT "session_id_subject_fkey" FOREIGN KEY ("tenant_id","subject") REFERENCES "authentication"."subject"("tenant_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
96
101
  ALTER TABLE "authentication"."service_account" ADD CONSTRAINT "service_account_id_subject_fkey" FOREIGN KEY ("tenant_id","parent") REFERENCES "authentication"."subject"("tenant_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
97
102
  ALTER TABLE "authentication"."subject" ADD CONSTRAINT "subject_id_system_account_fkey" FOREIGN KEY ("tenant_id","system_account_id") REFERENCES "authentication"."system_account"("tenant_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
98
103
  ALTER TABLE "authentication"."subject" ADD CONSTRAINT "subject_id_user_fkey" FOREIGN KEY ("tenant_id","user_id") REFERENCES "authentication"."user"("tenant_id","id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "c88f8c29-7029-4da0-b085-bd866a480533",
2
+ "id": "9385eff0-25d7-4ef6-be4b-8019af0a1424",
3
3
  "prevId": "00000000-0000-0000-0000-000000000000",
4
4
  "version": "7",
5
5
  "dialect": "postgresql",
@@ -11,10 +11,16 @@
11
11
  "id": {
12
12
  "name": "id",
13
13
  "type": "uuid",
14
- "primaryKey": true,
14
+ "primaryKey": false,
15
15
  "notNull": true,
16
16
  "default": "gen_random_uuid()"
17
17
  },
18
+ "tenant_id": {
19
+ "name": "tenant_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
18
24
  "subject": {
19
25
  "name": "subject",
20
26
  "type": "uuid",
@@ -73,27 +79,38 @@
73
79
  },
74
80
  "indexes": {},
75
81
  "foreignKeys": {
76
- "credentials_subject_subject_id_fk": {
77
- "name": "credentials_subject_subject_id_fk",
82
+ "credentials_id_subject_fkey": {
83
+ "name": "credentials_id_subject_fkey",
78
84
  "tableFrom": "credentials",
79
85
  "tableTo": "subject",
80
86
  "schemaTo": "authentication",
81
87
  "columnsFrom": [
88
+ "tenant_id",
82
89
  "subject"
83
90
  ],
84
91
  "columnsTo": [
92
+ "tenant_id",
85
93
  "id"
86
94
  ],
87
95
  "onDelete": "no action",
88
96
  "onUpdate": "no action"
89
97
  }
90
98
  },
91
- "compositePrimaryKeys": {},
99
+ "compositePrimaryKeys": {
100
+ "credentials_tenant_id_id_pk": {
101
+ "name": "credentials_tenant_id_id_pk",
102
+ "columns": [
103
+ "tenant_id",
104
+ "id"
105
+ ]
106
+ }
107
+ },
92
108
  "uniqueConstraints": {
93
- "credentials_subject_unique": {
94
- "name": "credentials_subject_unique",
109
+ "credentials_tenant_id_subject_unique": {
110
+ "name": "credentials_tenant_id_subject_unique",
95
111
  "nullsNotDistinct": false,
96
112
  "columns": [
113
+ "tenant_id",
97
114
  "subject"
98
115
  ]
99
116
  }
@@ -109,10 +126,16 @@
109
126
  "id": {
110
127
  "name": "id",
111
128
  "type": "uuid",
112
- "primaryKey": true,
129
+ "primaryKey": false,
113
130
  "notNull": true,
114
131
  "default": "gen_random_uuid()"
115
132
  },
133
+ "tenant_id": {
134
+ "name": "tenant_id",
135
+ "type": "uuid",
136
+ "primaryKey": false,
137
+ "notNull": true
138
+ },
116
139
  "subject": {
117
140
  "name": "subject",
118
141
  "type": "uuid",
@@ -183,22 +206,32 @@
183
206
  },
184
207
  "indexes": {},
185
208
  "foreignKeys": {
186
- "session_subject_subject_id_fk": {
187
- "name": "session_subject_subject_id_fk",
209
+ "session_id_subject_fkey": {
210
+ "name": "session_id_subject_fkey",
188
211
  "tableFrom": "session",
189
212
  "tableTo": "subject",
190
213
  "schemaTo": "authentication",
191
214
  "columnsFrom": [
215
+ "tenant_id",
192
216
  "subject"
193
217
  ],
194
218
  "columnsTo": [
219
+ "tenant_id",
195
220
  "id"
196
221
  ],
197
222
  "onDelete": "no action",
198
223
  "onUpdate": "no action"
199
224
  }
200
225
  },
201
- "compositePrimaryKeys": {},
226
+ "compositePrimaryKeys": {
227
+ "session_tenant_id_id_pk": {
228
+ "name": "session_tenant_id_id_pk",
229
+ "columns": [
230
+ "tenant_id",
231
+ "id"
232
+ ]
233
+ }
234
+ },
202
235
  "uniqueConstraints": {},
203
236
  "policies": {},
204
237
  "checkConstraints": {},
@@ -439,25 +472,35 @@
439
472
  }
440
473
  },
441
474
  "uniqueConstraints": {
442
- "subject_system_account_id_unique": {
443
- "name": "subject_system_account_id_unique",
475
+ "subject_tenant_id_service_account_id_unique": {
476
+ "name": "subject_tenant_id_service_account_id_unique",
444
477
  "nullsNotDistinct": false,
445
478
  "columns": [
446
- "system_account_id"
479
+ "tenant_id",
480
+ "service_account_id"
447
481
  ]
448
482
  },
449
- "subject_user_id_unique": {
450
- "name": "subject_user_id_unique",
483
+ "subject_tenant_id_user_id_unique": {
484
+ "name": "subject_tenant_id_user_id_unique",
451
485
  "nullsNotDistinct": false,
452
486
  "columns": [
487
+ "tenant_id",
453
488
  "user_id"
454
489
  ]
455
490
  },
456
- "subject_service_account_id_unique": {
457
- "name": "subject_service_account_id_unique",
491
+ "subject_tenant_id_system_account_id_unique": {
492
+ "name": "subject_tenant_id_system_account_id_unique",
458
493
  "nullsNotDistinct": false,
459
494
  "columns": [
460
- "service_account_id"
495
+ "tenant_id",
496
+ "system_account_id"
497
+ ]
498
+ },
499
+ "subject_id_unique": {
500
+ "name": "subject_id_unique",
501
+ "nullsNotDistinct": false,
502
+ "columns": [
503
+ "id"
461
504
  ]
462
505
  }
463
506
  },
@@ -5,8 +5,8 @@
5
5
  {
6
6
  "idx": 0,
7
7
  "version": "7",
8
- "when": 1767826939668,
9
- "tag": "0000_violet_callisto",
8
+ "when": 1767838186408,
9
+ "tag": "0000_majestic_proudstar",
10
10
  "breakpoints": true
11
11
  }
12
12
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.93.82",
3
+ "version": "0.93.84",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -48,6 +48,8 @@
48
48
  "./authentication/server": "./authentication/server/index.js",
49
49
  "./browser": "./browser/index.js",
50
50
  "./cancellation": "./cancellation/index.js",
51
+ "./circuit-breaker": "./circuit-breaker/index.js",
52
+ "./circuit-breaker/postgres": "./circuit-breaker/postgres/index.js",
51
53
  "./cookie": "./cookie/index.js",
52
54
  "./css": "./css/index.js",
53
55
  "./data-structures": "./data-structures/index.js",