@logto/schemas 1.9.0 → 1.9.2
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/alterations/1.9.2-1694854226-init-sentinel.ts +79 -0
- package/alterations/1.9.2-1695198741-remove-m2m-app-admin-access-switch.ts +279 -0
- package/alterations-js/1.9.2-1694854226-init-sentinel.d.ts +3 -0
- package/alterations-js/1.9.2-1694854226-init-sentinel.js +72 -0
- package/alterations-js/1.9.2-1695198741-remove-m2m-app-admin-access-switch.d.ts +3 -0
- package/alterations-js/1.9.2-1695198741-remove-m2m-app-admin-access-switch.js +157 -0
- package/lib/db-entries/custom-types.d.ts +10 -0
- package/lib/db-entries/custom-types.js +12 -0
- package/lib/db-entries/index.d.ts +1 -0
- package/lib/db-entries/index.js +1 -0
- package/lib/db-entries/sentinel-activity.d.ts +43 -0
- package/lib/db-entries/sentinel-activity.js +58 -0
- package/lib/foundations/jsonb-types.d.ts +96 -7
- package/lib/foundations/jsonb-types.js +52 -20
- package/lib/seeds/application.js +3 -3
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/interactions.d.ts +100 -0
- package/lib/types/interactions.js +24 -1
- package/lib/types/log/interaction.d.ts +5 -2
- package/lib/types/log/interaction.js +2 -0
- package/lib/types/sentinel.d.ts +29 -0
- package/lib/types/sentinel.js +15 -0
- package/lib/types/user.d.ts +8 -8
- package/package.json +4 -4
- package/tables/logs.sql +2 -0
- package/tables/sentinel_activities.sql +32 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/schemas",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"prettier": "@silverhand/eslint-config/.prettierrc",
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@logto/connector-kit": "^1.1.1",
|
|
68
|
-
"@logto/core-kit": "^2.1.
|
|
68
|
+
"@logto/core-kit": "^2.1.2",
|
|
69
69
|
"@logto/language-kit": "^1.0.0",
|
|
70
70
|
"@logto/phrases": "^1.5.0",
|
|
71
|
-
"@logto/phrases-experience": "^1.3.
|
|
72
|
-
"@logto/shared": "^
|
|
71
|
+
"@logto/phrases-experience": "^1.3.1",
|
|
72
|
+
"@logto/shared": "^3.0.0",
|
|
73
73
|
"@withtyped/server": "^0.12.9"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
package/tables/logs.sql
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
create type sentinel_action_result as enum ('Success', 'Failed');
|
|
2
|
+
|
|
3
|
+
create type sentinel_decision as enum ('Undecided', 'Allowed', 'Blocked', 'Challenge');
|
|
4
|
+
|
|
5
|
+
create table sentinel_activities (
|
|
6
|
+
tenant_id varchar(21) not null
|
|
7
|
+
references tenants (id) on update cascade on delete cascade,
|
|
8
|
+
id varchar(21) not null,
|
|
9
|
+
/** The target that the action was performed on. */
|
|
10
|
+
target_type varchar(32) /* @use SentinelActivityTargetType */ not null,
|
|
11
|
+
/** The target hashed identifier. */
|
|
12
|
+
target_hash varchar(64) not null,
|
|
13
|
+
/** The action name that was performed. */
|
|
14
|
+
action varchar(64) /* @use SentinelActivityAction */ not null,
|
|
15
|
+
/** If the action was successful or not. */
|
|
16
|
+
action_result sentinel_action_result not null,
|
|
17
|
+
/** Additional payload data if any. */
|
|
18
|
+
payload jsonb /* @use SentinelActivityPayload */ not null,
|
|
19
|
+
/** The sentinel decision for the action. */
|
|
20
|
+
decision sentinel_decision not null,
|
|
21
|
+
/** The expiry date of the decision. For instant decisions, this is the date the activity was created. */
|
|
22
|
+
decision_expires_at timestamptz not null default(now()),
|
|
23
|
+
/** The time the activity was created. */
|
|
24
|
+
created_at timestamptz not null default(now()),
|
|
25
|
+
primary key (id)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
create index sentinel_activities__id
|
|
29
|
+
on sentinel_activities (tenant_id, id);
|
|
30
|
+
|
|
31
|
+
create index sentinel_activities__target_type_target_hash_action_action_result_decision
|
|
32
|
+
on sentinel_activities (tenant_id, target_type, target_hash, action, action_result, decision);
|