@happyvertical/smrt-users 0.37.1 → 0.37.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.
Files changed (35) hide show
  1. package/AGENTS.md +2 -1
  2. package/README.md +63 -0
  3. package/dist/chunks/TerminalAuthService-BXAAuaXf.js +4531 -0
  4. package/dist/chunks/TerminalAuthService-BXAAuaXf.js.map +1 -0
  5. package/dist/collections/AccessRequestCollection.d.ts +28 -0
  6. package/dist/collections/AccessRequestCollection.d.ts.map +1 -0
  7. package/dist/collections/index.d.ts +1 -0
  8. package/dist/collections/index.d.ts.map +1 -1
  9. package/dist/index.d.ts +4 -4
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1571 -1322
  12. package/dist/index.js.map +1 -1
  13. package/dist/manifest.json +421 -2
  14. package/dist/models/AccessRequest.d.ts +131 -0
  15. package/dist/models/AccessRequest.d.ts.map +1 -0
  16. package/dist/models/index.d.ts +1 -0
  17. package/dist/models/index.d.ts.map +1 -1
  18. package/dist/playground.js +114 -136
  19. package/dist/playground.js.map +1 -1
  20. package/dist/services/AccessRequestService.d.ts +326 -0
  21. package/dist/services/AccessRequestService.d.ts.map +1 -0
  22. package/dist/services/index.d.ts +1 -0
  23. package/dist/services/index.d.ts.map +1 -1
  24. package/dist/smrt-knowledge.json +129 -15
  25. package/dist/sveltekit.js +685 -881
  26. package/dist/sveltekit.js.map +1 -1
  27. package/dist/types/index.d.ts +1 -1
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/dist/ui.js +79 -73
  30. package/dist/ui.js.map +1 -1
  31. package/package.json +19 -19
  32. package/dist/chunks/TerminalAuthService-bY1oWeAh.js +0 -5261
  33. package/dist/chunks/TerminalAuthService-bY1oWeAh.js.map +0 -1
  34. package/dist/chunks/index-DBpq-WMK.js +0 -169
  35. package/dist/chunks/index-DBpq-WMK.js.map +0 -1
@@ -1,139 +1,117 @@
1
1
  import { USERS_MODULE_META } from "./ui.js";
2
- const noop = () => {
2
+ //#region src/svelte/playground.ts
3
+ var noop = () => {};
4
+ var sampleTenant = {
5
+ id: "tenant-riverstone",
6
+ name: "Riverstone Newsroom",
7
+ slug: "riverstone-newsroom",
8
+ status: "active"
3
9
  };
4
- const sampleTenant = {
5
- id: "tenant-riverstone",
6
- name: "Riverstone Newsroom",
7
- slug: "riverstone-newsroom",
8
- status: "active"
10
+ var sampleRoles = [{
11
+ id: "role-member",
12
+ slug: "member",
13
+ name: "Member",
14
+ description: "Can collaborate on editorial work."
15
+ }, {
16
+ id: "role-editor",
17
+ slug: "editor",
18
+ name: "Editor",
19
+ description: "Can approve and publish content."
20
+ }];
21
+ var sampleUsers = [{
22
+ user: {
23
+ id: "user-taylor",
24
+ email: "taylor@example.com",
25
+ status: "active"
26
+ },
27
+ profile: {
28
+ id: "profile-taylor",
29
+ name: "Taylor Rowan",
30
+ email: "taylor@example.com"
31
+ },
32
+ role: "Editor"
33
+ }, {
34
+ user: {
35
+ id: "user-jordan",
36
+ email: "jordan@example.com",
37
+ status: "pending"
38
+ },
39
+ profile: {
40
+ id: "profile-jordan",
41
+ name: "Jordan Lee",
42
+ email: "jordan@example.com"
43
+ },
44
+ role: "Contributor"
45
+ }];
46
+ var loadInviteUserModal = () => import("./svelte/components/InviteUserModal.svelte");
47
+ var loadUserForm = () => import("./svelte/components/UserForm.svelte");
48
+ var loadUserList = () => import("./svelte/components/UserList.svelte");
49
+ var loadUserMenu = () => import("./svelte/components/UserMenu.svelte");
50
+ var playground_default = {
51
+ packageName: "@happyvertical/smrt-users",
52
+ displayName: USERS_MODULE_META.displayName,
53
+ description: USERS_MODULE_META.description,
54
+ moduleMeta: USERS_MODULE_META,
55
+ entries: [
56
+ {
57
+ id: "user-list",
58
+ title: "User List",
59
+ description: "Role-aware list of users with selection and profile display.",
60
+ loadComponent: loadUserList,
61
+ order: 1,
62
+ props: {
63
+ users: sampleUsers,
64
+ selectedId: "user-taylor",
65
+ onselect: noop
66
+ },
67
+ modes: { mock: { label: "Mock" } }
68
+ },
69
+ {
70
+ id: "user-form",
71
+ title: "User Form",
72
+ description: "Create and edit form for user records and account status.",
73
+ loadComponent: loadUserForm,
74
+ order: 2,
75
+ props: {
76
+ user: sampleUsers[0].user,
77
+ profile: sampleUsers[0].profile,
78
+ onsubmit: noop,
79
+ oncancel: noop
80
+ },
81
+ modes: { mock: { label: "Mock" } }
82
+ },
83
+ {
84
+ id: "invite-user-modal",
85
+ title: "Invite User Modal",
86
+ description: "Invitation flow for adding a tenant member with a role assignment.",
87
+ loadComponent: loadInviteUserModal,
88
+ order: 3,
89
+ props: {
90
+ open: false,
91
+ tenant: sampleTenant,
92
+ roles: sampleRoles,
93
+ onsubmit: noop,
94
+ onclose: noop
95
+ },
96
+ modes: { mock: { label: "Mock" } }
97
+ },
98
+ {
99
+ id: "user-menu",
100
+ title: "User Menu",
101
+ description: "Authenticated account menu for profile, settings, and sign-out actions.",
102
+ loadComponent: loadUserMenu,
103
+ order: 4,
104
+ props: {
105
+ profile: sampleUsers[0].profile,
106
+ profileUrl: "/settings/profile",
107
+ settingsUrl: "/settings",
108
+ signoutUrl: "/auth/signout"
109
+ },
110
+ modes: { mock: { label: "Mock" } }
111
+ }
112
+ ]
9
113
  };
10
- const sampleRoles = [
11
- {
12
- id: "role-member",
13
- slug: "member",
14
- name: "Member",
15
- description: "Can collaborate on editorial work."
16
- },
17
- {
18
- id: "role-editor",
19
- slug: "editor",
20
- name: "Editor",
21
- description: "Can approve and publish content."
22
- }
23
- ];
24
- const sampleUsers = [
25
- {
26
- user: {
27
- id: "user-taylor",
28
- email: "taylor@example.com",
29
- status: "active"
30
- },
31
- profile: {
32
- id: "profile-taylor",
33
- name: "Taylor Rowan",
34
- email: "taylor@example.com"
35
- },
36
- role: "Editor"
37
- },
38
- {
39
- user: {
40
- id: "user-jordan",
41
- email: "jordan@example.com",
42
- status: "pending"
43
- },
44
- profile: {
45
- id: "profile-jordan",
46
- name: "Jordan Lee",
47
- email: "jordan@example.com"
48
- },
49
- role: "Contributor"
50
- }
51
- ];
52
- const loadInviteUserModal = () => import("./svelte/components/InviteUserModal.svelte");
53
- const loadUserForm = () => import("./svelte/components/UserForm.svelte");
54
- const loadUserList = () => import("./svelte/components/UserList.svelte");
55
- const loadUserMenu = () => import("./svelte/components/UserMenu.svelte");
56
- const playground = {
57
- packageName: "@happyvertical/smrt-users",
58
- displayName: USERS_MODULE_META.displayName,
59
- description: USERS_MODULE_META.description,
60
- moduleMeta: USERS_MODULE_META,
61
- entries: [
62
- {
63
- id: "user-list",
64
- title: "User List",
65
- description: "Role-aware list of users with selection and profile display.",
66
- loadComponent: loadUserList,
67
- order: 1,
68
- props: {
69
- users: sampleUsers,
70
- selectedId: "user-taylor",
71
- onselect: noop
72
- },
73
- modes: {
74
- mock: {
75
- label: "Mock"
76
- }
77
- }
78
- },
79
- {
80
- id: "user-form",
81
- title: "User Form",
82
- description: "Create and edit form for user records and account status.",
83
- loadComponent: loadUserForm,
84
- order: 2,
85
- props: {
86
- user: sampleUsers[0].user,
87
- profile: sampleUsers[0].profile,
88
- onsubmit: noop,
89
- oncancel: noop
90
- },
91
- modes: {
92
- mock: {
93
- label: "Mock"
94
- }
95
- }
96
- },
97
- {
98
- id: "invite-user-modal",
99
- title: "Invite User Modal",
100
- description: "Invitation flow for adding a tenant member with a role assignment.",
101
- loadComponent: loadInviteUserModal,
102
- order: 3,
103
- props: {
104
- open: false,
105
- tenant: sampleTenant,
106
- roles: sampleRoles,
107
- onsubmit: noop,
108
- onclose: noop
109
- },
110
- modes: {
111
- mock: {
112
- label: "Mock"
113
- }
114
- }
115
- },
116
- {
117
- id: "user-menu",
118
- title: "User Menu",
119
- description: "Authenticated account menu for profile, settings, and sign-out actions.",
120
- loadComponent: loadUserMenu,
121
- order: 4,
122
- props: {
123
- profile: sampleUsers[0].profile,
124
- profileUrl: "/settings/profile",
125
- settingsUrl: "/settings",
126
- signoutUrl: "/auth/signout"
127
- },
128
- modes: {
129
- mock: {
130
- label: "Mock"
131
- }
132
- }
133
- }
134
- ]
135
- };
136
- export {
137
- playground as default
138
- };
139
- //# sourceMappingURL=playground.js.map
114
+ //#endregion
115
+ export { playground_default as default };
116
+
117
+ //# sourceMappingURL=playground.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"playground.js","sources":["../src/svelte/playground.ts"],"sourcesContent":["import { USERS_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\nconst sampleTenant = {\n id: 'tenant-riverstone',\n name: 'Riverstone Newsroom',\n slug: 'riverstone-newsroom',\n status: 'active',\n};\n\nconst sampleRoles = [\n {\n id: 'role-member',\n slug: 'member',\n name: 'Member',\n description: 'Can collaborate on editorial work.',\n },\n {\n id: 'role-editor',\n slug: 'editor',\n name: 'Editor',\n description: 'Can approve and publish content.',\n },\n];\n\nconst sampleUsers = [\n {\n user: {\n id: 'user-taylor',\n email: 'taylor@example.com',\n status: 'active',\n },\n profile: {\n id: 'profile-taylor',\n name: 'Taylor Rowan',\n email: 'taylor@example.com',\n },\n role: 'Editor',\n },\n {\n user: {\n id: 'user-jordan',\n email: 'jordan@example.com',\n status: 'pending',\n },\n profile: {\n id: 'profile-jordan',\n name: 'Jordan Lee',\n email: 'jordan@example.com',\n },\n role: 'Contributor',\n },\n];\n\nconst loadInviteUserModal = () => import('./components/InviteUserModal.svelte');\nconst loadUserForm = () => import('./components/UserForm.svelte');\nconst loadUserList = () => import('./components/UserList.svelte');\nconst loadUserMenu = () => import('./components/UserMenu.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-users',\n displayName: USERS_MODULE_META.displayName,\n description: USERS_MODULE_META.description,\n moduleMeta: USERS_MODULE_META,\n entries: [\n {\n id: 'user-list',\n title: 'User List',\n description:\n 'Role-aware list of users with selection and profile display.',\n loadComponent: loadUserList,\n order: 1,\n props: {\n users: sampleUsers,\n selectedId: 'user-taylor',\n onselect: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'user-form',\n title: 'User Form',\n description: 'Create and edit form for user records and account status.',\n loadComponent: loadUserForm,\n order: 2,\n props: {\n user: sampleUsers[0].user,\n profile: sampleUsers[0].profile,\n onsubmit: noop,\n oncancel: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'invite-user-modal',\n title: 'Invite User Modal',\n description:\n 'Invitation flow for adding a tenant member with a role assignment.',\n loadComponent: loadInviteUserModal,\n order: 3,\n props: {\n open: false,\n tenant: sampleTenant,\n roles: sampleRoles,\n onsubmit: noop,\n onclose: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'user-menu',\n title: 'User Menu',\n description:\n 'Authenticated account menu for profile, settings, and sign-out actions.',\n loadComponent: loadUserMenu,\n order: 4,\n props: {\n profile: sampleUsers[0].profile,\n profileUrl: '/settings/profile',\n settingsUrl: '/settings',\n signoutUrl: '/auth/signout',\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n ],\n};\n"],"names":[],"mappings":";AAEA,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,eAAe;AAAA,EACnB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;AAEA,MAAM,cAAc;AAAA,EAClB;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,EAAA;AAEjB;AAEA,MAAM,cAAc;AAAA,EAClB;AAAA,IACE,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,IAEV,SAAS;AAAA,MACP,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAET,MAAM;AAAA,EAAA;AAAA,EAER;AAAA,IACE,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,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AAO;AAAA,QACL,MAAM;AAAA,UACJ,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,IAEF;AAAA,MACE,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,aACE;AAAA,MACF,eAAe;AAAA,MACf,OAAO;AAAA,MACP,OAAO;AAAA,QACL,SAAS,YAAY,CAAC,EAAE;AAAA,QACxB,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,YAAY;AAAA,MAAA;AAAA,MAEd,OAAO;AAAA,QACL,MAAM;AAAA,UACJ,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import { USERS_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\nconst sampleTenant = {\n id: 'tenant-riverstone',\n name: 'Riverstone Newsroom',\n slug: 'riverstone-newsroom',\n status: 'active',\n};\n\nconst sampleRoles = [\n {\n id: 'role-member',\n slug: 'member',\n name: 'Member',\n description: 'Can collaborate on editorial work.',\n },\n {\n id: 'role-editor',\n slug: 'editor',\n name: 'Editor',\n description: 'Can approve and publish content.',\n },\n];\n\nconst sampleUsers = [\n {\n user: {\n id: 'user-taylor',\n email: 'taylor@example.com',\n status: 'active',\n },\n profile: {\n id: 'profile-taylor',\n name: 'Taylor Rowan',\n email: 'taylor@example.com',\n },\n role: 'Editor',\n },\n {\n user: {\n id: 'user-jordan',\n email: 'jordan@example.com',\n status: 'pending',\n },\n profile: {\n id: 'profile-jordan',\n name: 'Jordan Lee',\n email: 'jordan@example.com',\n },\n role: 'Contributor',\n },\n];\n\nconst loadInviteUserModal = () => import('./components/InviteUserModal.svelte');\nconst loadUserForm = () => import('./components/UserForm.svelte');\nconst loadUserList = () => import('./components/UserList.svelte');\nconst loadUserMenu = () => import('./components/UserMenu.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-users',\n displayName: USERS_MODULE_META.displayName,\n description: USERS_MODULE_META.description,\n moduleMeta: USERS_MODULE_META,\n entries: [\n {\n id: 'user-list',\n title: 'User List',\n description:\n 'Role-aware list of users with selection and profile display.',\n loadComponent: loadUserList,\n order: 1,\n props: {\n users: sampleUsers,\n selectedId: 'user-taylor',\n onselect: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'user-form',\n title: 'User Form',\n description: 'Create and edit form for user records and account status.',\n loadComponent: loadUserForm,\n order: 2,\n props: {\n user: sampleUsers[0].user,\n profile: sampleUsers[0].profile,\n onsubmit: noop,\n oncancel: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'invite-user-modal',\n title: 'Invite User Modal',\n description:\n 'Invitation flow for adding a tenant member with a role assignment.',\n loadComponent: loadInviteUserModal,\n order: 3,\n props: {\n open: false,\n tenant: sampleTenant,\n roles: sampleRoles,\n onsubmit: noop,\n onclose: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'user-menu',\n title: 'User Menu',\n description:\n 'Authenticated account menu for profile, settings, and sign-out actions.',\n loadComponent: loadUserMenu,\n order: 4,\n props: {\n profile: sampleUsers[0].profile,\n profileUrl: '/settings/profile',\n settingsUrl: '/settings',\n signoutUrl: '/auth/signout',\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n ],\n};\n"],"mappings":";;AAEA,IAAM,aAAa,CAAC;AAEpB,IAAM,eAAe;CACnB,IAAI;CACJ,MAAM;CACN,MAAM;CACN,QAAQ;AACV;AAEA,IAAM,cAAc,CAClB;CACE,IAAI;CACJ,MAAM;CACN,MAAM;CACN,aAAa;AACf,GACA;CACE,IAAI;CACJ,MAAM;CACN,MAAM;CACN,aAAa;AACf,CACF;AAEA,IAAM,cAAc,CAClB;CACE,MAAM;EACJ,IAAI;EACJ,OAAO;EACP,QAAQ;CACV;CACA,SAAS;EACP,IAAI;EACJ,MAAM;EACN,OAAO;CACT;CACA,MAAM;AACR,GACA;CACE,MAAM;EACJ,IAAI;EACJ,OAAO;EACP,QAAQ;CACV;CACA,SAAS;EACP,IAAI;EACJ,MAAM;EACN,OAAO;CACT;CACA,MAAM;AACR,CACF;AAEA,IAAM,4BAA4B,OAAO;AACzC,IAAM,qBAAqB,OAAO;AAClC,IAAM,qBAAqB,OAAO;AAClC,IAAM,qBAAqB,OAAO;AAElC,IAAA,qBAAe;CACb,aAAa;CACb,aAAa,kBAAkB;CAC/B,aAAa,kBAAkB;CAC/B,YAAY;CACZ,SAAS;EACP;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,OAAO;IACP,YAAY;IACZ,UAAU;GACZ;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,eAAe;GACf,OAAO;GACP,OAAO;IACL,MAAM,YAAY,EAAC,CAAE;IACrB,SAAS,YAAY,EAAC,CAAE;IACxB,UAAU;IACV,UAAU;GACZ;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,MAAM;IACN,QAAQ;IACR,OAAO;IACP,UAAU;IACV,SAAS;GACX;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,SAAS,YAAY,EAAC,CAAE;IACxB,YAAY;IACZ,aAAa;IACb,YAAY;GACd;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;CACF;AACF"}
@@ -0,0 +1,326 @@
1
+ import { SmrtClassOptions } from '@happyvertical/smrt-core';
2
+ import { AccessRequestCollection } from '../collections/AccessRequestCollection.js';
3
+ import { AccessRequest } from '../models/AccessRequest.js';
4
+ import { Membership } from '../models/Membership.js';
5
+ import { Tenant } from '../models/Tenant.js';
6
+ import { User } from '../models/User.js';
7
+ import { AccessRequestStatus, TenantStatus, UserStatus } from '../types/index.js';
8
+ /**
9
+ * Capabilities that gate the operator-facing methods of
10
+ * {@link AccessRequestService}.
11
+ */
12
+ export declare const ACCESS_REQUEST_CAPABILITIES: {
13
+ /** Read the access-request queue (`list` / `get`). */
14
+ readonly READ: "access-requests:read";
15
+ /** Decide requests (`approve` / `decline` / `cancel` / `graduate`). */
16
+ readonly MANAGE: "access-requests:manage";
17
+ };
18
+ /**
19
+ * One of the capability slugs in {@link ACCESS_REQUEST_CAPABILITIES}.
20
+ */
21
+ export type AccessRequestCapability = (typeof ACCESS_REQUEST_CAPABILITIES)[keyof typeof ACCESS_REQUEST_CAPABILITIES];
22
+ /**
23
+ * Context passed to an {@link AccessRequestAuthorizer} before an operator method
24
+ * runs.
25
+ */
26
+ export interface AccessRequestAuthorizationContext {
27
+ /** The capability the operation requires. */
28
+ capability: AccessRequestCapability;
29
+ /** The operator user id supplied to the method (`by`), if any. */
30
+ by?: string | null;
31
+ /** The target access-request id, when the operation targets a specific row. */
32
+ accessRequestId?: string;
33
+ }
34
+ /**
35
+ * Hook that authorizes an operator action. Throw (or reject) to deny — the
36
+ * thrown error propagates to the caller unchanged. Resolve/return to allow.
37
+ *
38
+ * Wire this to your permission system, e.g. resolve the operator's permissions
39
+ * and assert the required capability:
40
+ *
41
+ * ```typescript
42
+ * const service = await AccessRequestService.create({
43
+ * db,
44
+ * authorize: async ({ capability, by }) => {
45
+ * if (!by || !(await isPlatformOperator(by, capability))) {
46
+ * throw new Error(`Missing capability: ${capability}`);
47
+ * }
48
+ * },
49
+ * });
50
+ * ```
51
+ */
52
+ export type AccessRequestAuthorizer = (context: AccessRequestAuthorizationContext) => void | Promise<void>;
53
+ /**
54
+ * Lifecycle event types emitted by {@link AccessRequestService}.
55
+ */
56
+ export type AccessRequestEventType = 'access-request.created' | 'access-request.approved' | 'access-request.declined' | 'access-request.canceled' | 'access-request.graduated';
57
+ /**
58
+ * Payload delivered to an {@link AccessRequestEventHandler}.
59
+ */
60
+ export interface AccessRequestEvent {
61
+ /** Which lifecycle transition fired. */
62
+ type: AccessRequestEventType;
63
+ /** The access request after the transition. */
64
+ accessRequest: AccessRequest;
65
+ /** When the event was emitted. */
66
+ at: Date;
67
+ /** Operator user id responsible, for operator-driven transitions. */
68
+ by?: string | null;
69
+ /** Graduated user (only on `access-request.graduated`). */
70
+ user?: User;
71
+ /** Membership created/linked on graduation, when a tenant was attached. */
72
+ membership?: Membership;
73
+ /** Tenant created/linked on graduation, when a tenant was attached. */
74
+ tenant?: Tenant;
75
+ }
76
+ /**
77
+ * Event hook apps provide to react to access-request lifecycle changes.
78
+ * Delivery is best-effort: a throwing handler is logged and swallowed so it
79
+ * never rolls back an already-persisted transition. Do not rely on it for
80
+ * critical-path work that must share the request's transaction.
81
+ */
82
+ export type AccessRequestEventHandler = (event: AccessRequestEvent) => void | Promise<void>;
83
+ /**
84
+ * Options for {@link AccessRequestService}.
85
+ */
86
+ export interface AccessRequestServiceOptions extends SmrtClassOptions {
87
+ /** Optional capability gate for operator methods (see {@link AccessRequestAuthorizer}). */
88
+ authorize?: AccessRequestAuthorizer;
89
+ /** Optional lifecycle event hook (see {@link AccessRequestEventHandler}). */
90
+ onEvent?: AccessRequestEventHandler;
91
+ }
92
+ /**
93
+ * Input for {@link AccessRequestService.createAccessRequest}. Only `email` is
94
+ * required.
95
+ */
96
+ export interface CreateAccessRequestInput {
97
+ /** Requester email (validated + normalized to lowercase). */
98
+ email: string;
99
+ /** Requester display name. */
100
+ name?: string | null;
101
+ /** Where the request came from, e.g. `www`, `sdk`. */
102
+ source?: string;
103
+ /** Free-form metadata (intended use, company, message, referrer, …). */
104
+ context?: Record<string, unknown>;
105
+ /** Optional requested org/tenant hint (advisory). */
106
+ tenantHint?: Record<string, unknown> | null;
107
+ /** Optional initial note. */
108
+ note?: string | null;
109
+ }
110
+ /**
111
+ * Filter for {@link AccessRequestService.listAccessRequests}.
112
+ */
113
+ export interface ListAccessRequestsFilter {
114
+ /** Restrict to one status or any of several. */
115
+ status?: AccessRequestStatus | AccessRequestStatus[];
116
+ /** Restrict to a single (normalized) email. */
117
+ email?: string;
118
+ /** Restrict to a single source. */
119
+ source?: string;
120
+ /** Operator user id, forwarded to the authorizer as `by`. */
121
+ by?: string | null;
122
+ /** Max rows to return. */
123
+ limit?: number;
124
+ /** Rows to skip. */
125
+ offset?: number;
126
+ /** Order-by clause (defaults to `created_at DESC`). */
127
+ orderBy?: string;
128
+ }
129
+ /**
130
+ * Options shared by the operator decision methods.
131
+ */
132
+ export interface DecideAccessRequestOptions {
133
+ /** Operator user id recorded as `decidedBy` and forwarded to the authorizer. */
134
+ by?: string | null;
135
+ }
136
+ /**
137
+ * Options for {@link AccessRequestService.approveAccessRequest}.
138
+ */
139
+ export interface ApproveAccessRequestOptions extends DecideAccessRequestOptions {
140
+ /** Operator note stored on the request. */
141
+ note?: string | null;
142
+ }
143
+ /**
144
+ * Options for {@link AccessRequestService.declineAccessRequest}.
145
+ */
146
+ export interface DeclineAccessRequestOptions extends DecideAccessRequestOptions {
147
+ /** Decision reason stored as the request's note. */
148
+ reason?: string | null;
149
+ }
150
+ /**
151
+ * Options for {@link AccessRequestService.cancelAccessRequest}.
152
+ */
153
+ export interface CancelAccessRequestOptions extends DecideAccessRequestOptions {
154
+ /** Cancellation reason stored as the request's note. */
155
+ reason?: string | null;
156
+ }
157
+ /**
158
+ * Graduate into a **new** tenant, enrolling the requester (owner by default).
159
+ */
160
+ export interface GraduateNewTenantOption {
161
+ /** New tenant attributes — `name` is required. */
162
+ create: {
163
+ name: string;
164
+ slug?: string;
165
+ description?: string;
166
+ status?: TenantStatus;
167
+ };
168
+ /** Role slug for the requester's membership (default `owner`). */
169
+ role?: string;
170
+ }
171
+ /**
172
+ * Graduate into an **existing** tenant, enrolling the requester.
173
+ */
174
+ export interface GraduateExistingTenantOption {
175
+ /** Target tenant id. */
176
+ tenantId: string;
177
+ /** Role slug for the requester's membership (default `member`). */
178
+ role?: string;
179
+ }
180
+ /**
181
+ * Tenant handling at graduation: create a new tenant, attach to an existing
182
+ * one, or `'none'` (user only, no membership).
183
+ */
184
+ export type GraduateTenantOption = GraduateNewTenantOption | GraduateExistingTenantOption | 'none';
185
+ /**
186
+ * Options for {@link AccessRequestService.graduateAccessRequest}.
187
+ */
188
+ export interface GraduateAccessRequestOptions extends DecideAccessRequestOptions {
189
+ /** Tenant handling (default `'none'`). */
190
+ tenant?: GraduateTenantOption;
191
+ /** Status applied to the user produced/linked by graduation (default `ACTIVE`). */
192
+ activate?: UserStatus;
193
+ /**
194
+ * Convenience: allow graduating directly from `REQUESTED` (skipping the
195
+ * `APPROVED` step). Defaults to `false`.
196
+ */
197
+ allowFromRequested?: boolean;
198
+ /** Operator note stored on the request. */
199
+ note?: string | null;
200
+ }
201
+ /**
202
+ * Result of {@link AccessRequestService.graduateAccessRequest}.
203
+ */
204
+ export interface GraduateAccessRequestResult {
205
+ /** The graduated (created or linked) user. */
206
+ user: User;
207
+ /** The membership, when a tenant was attached. */
208
+ membership?: Membership;
209
+ /** The tenant, when one was created or attached. */
210
+ tenant?: Tenant;
211
+ /** The access request, now `GRADUATED`. */
212
+ accessRequest: AccessRequest;
213
+ /** Whether a brand-new user was created (`false` when an existing one was linked). */
214
+ created: boolean;
215
+ }
216
+ /**
217
+ * Error codes raised by {@link AccessRequestError}.
218
+ */
219
+ export type AccessRequestErrorCode = 'INVALID_EMAIL' | 'NOT_FOUND' | 'INVALID_TRANSITION' | 'TENANT_NOT_FOUND' | 'ROLE_NOT_FOUND';
220
+ /**
221
+ * Error thrown for access-request domain failures the caller is expected to
222
+ * surface (invalid email, unknown id, illegal state transition, …). Authorizer
223
+ * denials are not wrapped — those propagate from the supplied authorizer
224
+ * unchanged.
225
+ */
226
+ export declare class AccessRequestError extends Error {
227
+ readonly code: AccessRequestErrorCode;
228
+ constructor(message: string, code: AccessRequestErrorCode);
229
+ }
230
+ /**
231
+ * High-level orchestration for the access-request lifecycle and graduation.
232
+ */
233
+ export declare class AccessRequestService {
234
+ #private;
235
+ constructor(options: AccessRequestServiceOptions);
236
+ /**
237
+ * Initialize the backing collections (creates/verifies their tables).
238
+ */
239
+ initialize(): Promise<void>;
240
+ /**
241
+ * Static factory — construct and initialize in one call.
242
+ */
243
+ static create(options: AccessRequestServiceOptions): Promise<AccessRequestService>;
244
+ /**
245
+ * The underlying collection, for advanced read scenarios. Prefer the service
246
+ * methods, which apply normalization, the state machine, capability gating,
247
+ * and events.
248
+ */
249
+ get collection(): AccessRequestCollection;
250
+ /**
251
+ * Create an access request. **Public-safe**: no capability check — meant to be
252
+ * callable unauthenticated by apps (which add their own rate-limiting).
253
+ *
254
+ * Validates and normalizes the email, then de-duplicates: if an open
255
+ * (`REQUESTED`) request already exists for the email, this merges any newly
256
+ * supplied context/name/source/hint into it and returns it instead of
257
+ * creating a duplicate (no second `created` event).
258
+ *
259
+ * @remarks
260
+ * De-duplication is **best-effort, not atomic**: it is a read-then-write
261
+ * (`findOpenByEmail` → `create`) with no DB-level partial-unique constraint
262
+ * (the table is append-style, keyed on `id`, because the same email may
263
+ * accumulate many requests over its lifetime). Two requests for the same
264
+ * email racing concurrently can therefore both create an open row. This is by
265
+ * design — the spec makes dedup configurable and pushes abuse control to the
266
+ * app (rate-limiting on the public endpoint). Operators triaging two open rows
267
+ * for one email is benign; apps needing a hard single-open-request guarantee
268
+ * should add a partial unique index (`UNIQUE(email) WHERE status='requested'`)
269
+ * in their migration.
270
+ *
271
+ * @throws {@link AccessRequestError} (`INVALID_EMAIL`) when the email is invalid.
272
+ */
273
+ createAccessRequest(input: CreateAccessRequestInput): Promise<AccessRequest>;
274
+ /**
275
+ * List access requests (operator-facing). Requires the `access-requests:read`
276
+ * capability when an authorizer is configured.
277
+ */
278
+ listAccessRequests(filter?: ListAccessRequestsFilter): Promise<AccessRequest[]>;
279
+ /**
280
+ * Get a single access request by id (operator-facing). Requires the
281
+ * `access-requests:read` capability when an authorizer is configured.
282
+ */
283
+ getAccessRequest(id: string, options?: {
284
+ by?: string | null;
285
+ }): Promise<AccessRequest | null>;
286
+ /**
287
+ * Approve a request: `REQUESTED → APPROVED`. Idempotent (re-approving an
288
+ * already-`APPROVED` request is a no-op returning it). Requires
289
+ * `access-requests:manage`.
290
+ *
291
+ * @throws {@link AccessRequestError} (`INVALID_TRANSITION`) from a terminal state.
292
+ */
293
+ approveAccessRequest(id: string, options?: ApproveAccessRequestOptions): Promise<AccessRequest>;
294
+ /**
295
+ * Decline a request: `REQUESTED | APPROVED → DECLINED`. Idempotent. Requires
296
+ * `access-requests:manage`.
297
+ *
298
+ * @throws {@link AccessRequestError} (`INVALID_TRANSITION`) from a terminal state.
299
+ */
300
+ declineAccessRequest(id: string, options?: DeclineAccessRequestOptions): Promise<AccessRequest>;
301
+ /**
302
+ * Cancel a request: `REQUESTED | APPROVED → CANCELED`. Idempotent. Requires
303
+ * `access-requests:manage`.
304
+ *
305
+ * @throws {@link AccessRequestError} (`INVALID_TRANSITION`) from a terminal state.
306
+ */
307
+ cancelAccessRequest(id: string, options?: CancelAccessRequestOptions): Promise<AccessRequest>;
308
+ /**
309
+ * Graduate an approved request into a `User`, optionally attaching a tenant.
310
+ *
311
+ * Valid from `APPROVED` (or from `REQUESTED` when
312
+ * {@link GraduateAccessRequestOptions.allowFromRequested} is set). Creates a
313
+ * user when none exists for the email, or **links** the existing one
314
+ * otherwise (reusing {@link UserCollection}). Idempotent: a second call on an
315
+ * already-`GRADUATED` request returns the same user (and an existing
316
+ * membership for the requested tenant, if any) without re-creating anything.
317
+ *
318
+ * Requires `access-requests:manage`.
319
+ *
320
+ * @throws {@link AccessRequestError} — `NOT_FOUND` (unknown id),
321
+ * `INVALID_TRANSITION` (terminal/declined/canceled or `REQUESTED` without
322
+ * `allowFromRequested`), `TENANT_NOT_FOUND`, or `ROLE_NOT_FOUND`.
323
+ */
324
+ graduateAccessRequest(id: string, options?: GraduateAccessRequestOptions): Promise<GraduateAccessRequestResult>;
325
+ }
326
+ //# sourceMappingURL=AccessRequestService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessRequestService.d.ts","sourceRoot":"","sources":["../../src/services/AccessRequestService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAKpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EACL,mBAAmB,EAGnB,KAAK,YAAY,EACjB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B;;;GAGG;AACH,eAAO,MAAM,2BAA2B;IACtC,sDAAsD;;IAEtD,uEAAuE;;CAE/D,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,iCAAiC;IAChD,6CAA6C;IAC7C,UAAU,EAAE,uBAAuB,CAAC;IACpC,kEAAkE;IAClE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,OAAO,EAAE,iCAAiC,KACvC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B,wBAAwB,GACxB,yBA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;;;;;;;;OAsBG;IACG,mBAAmB,CACvB,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,aAAa,CAAC;IA6DzB;;;OAGG;IACG,kBAAkB,CACtB,MAAM,GAAE,wBAA6B,GACpC,OAAO,CAAC,aAAa,EAAE,CAAC;IAkB3B;;;OAGG;IACG,gBAAgB,CACpB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAO,GACnC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAUhC;;;;;;OAMG;IACG,oBAAoB,CACxB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,aAAa,CAAC;IAyBzB;;;;;OAKG;IACG,oBAAoB,CACxB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,aAAa,CAAC;IAyBzB;;;;;OAKG;IACG,mBAAmB,CACvB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,aAAa,CAAC;IA2BzB;;;;;;;;;;;;;;;OAeG;IACG,qBAAqB,CACzB,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,2BAA2B,CAAC;CAuTxC"}
@@ -2,6 +2,7 @@
2
2
  * Service exports for smrt-users
3
3
  * @packageDocumentation
4
4
  */
5
+ export { ACCESS_REQUEST_CAPABILITIES, type AccessRequestAuthorizationContext, type AccessRequestAuthorizer, type AccessRequestCapability, AccessRequestError, type AccessRequestErrorCode, type AccessRequestEvent, type AccessRequestEventHandler, type AccessRequestEventType, AccessRequestService, type AccessRequestServiceOptions, type ApproveAccessRequestOptions, type CancelAccessRequestOptions, type CreateAccessRequestInput, type DeclineAccessRequestOptions, type GraduateAccessRequestOptions, type GraduateAccessRequestResult, type GraduateExistingTenantOption, type GraduateNewTenantOption, type GraduateTenantOption, type ListAccessRequestsFilter, } from './AccessRequestService.js';
5
6
  export { MagicLinkError, type MagicLinkResult, MagicLinkService, type MagicLinkServiceOptions, type MagicLinkVerifyResult, } from './MagicLinkService.js';
6
7
  export { type CreateAuthorizationUrlOptions, decodeOidcTransaction, encodeOidcTransaction, getUsersOidcConfig, type OidcCallbackResult, OidcLoginError, type OidcLoginResult, OidcLoginService, type OidcLoginServiceOptions, type OidcProviderConfig, type OidcProviderKind, type OidcProviderMetadata, type OidcProviderResolution, type OidcProviderResolutionOptions, type OidcTokenEndpointAuthMethod, type OidcTokenSet, type OidcTransaction, type ResolvedOidcProviderConfig, resolveOidcProviderConfig, type UsersOidcConfig, } from './OidcLoginService.js';
7
8
  export { type PermissionCatalog, PermissionCatalogService, type PermissionCatalogSource, type PermissionCatalogSyncResult, type PermissionDefinition, type PostgresPermissionAction, type PostgresPermissionBinding, registerPermissionDefinitions, syncPermissionCatalog, type UsersConfig, } from './PermissionCatalogService.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,6BAA6B,EAClC,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,cAAc,EACd,KAAK,eAAe,EACpB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,yBAAyB,EACzB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,iBAAiB,EACtB,wBAAwB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,6BAA6B,EAC7B,qBAAqB,EACrB,KAAK,WAAW,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,kBAAkB,EAClB,KAAK,iCAAiC,GACvC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,+BAA+B,EAC/B,KAAK,mCAAmC,EACxC,6BAA6B,EAC7B,KAAK,kCAAkC,EACvC,KAAK,8BAA8B,GACpC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,kCAAkC,EAClC,wBAAwB,EACxB,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,yBAAyB,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,+CAA+C,EAC/C,qCAAqC,EACrC,sCAAsC,EACtC,oCAAoC,EACpC,+BAA+B,EAC/B,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,kBAAk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