@portaidentity/sdk 1.5.1 → 1.6.0
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/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +17 -2
- package/dist/agent.js.map +1 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -1
- package/dist/client.js.map +1 -1
- package/dist/domains/branding.d.ts +14 -2
- package/dist/domains/branding.d.ts.map +1 -1
- package/dist/domains/branding.js.map +1 -1
- package/dist/domains/index.d.ts +2 -2
- package/dist/domains/index.d.ts.map +1 -1
- package/dist/domains/index.js +1 -1
- package/dist/domains/index.js.map +1 -1
- package/dist/domains/stats.d.ts +4 -1
- package/dist/domains/stats.d.ts.map +1 -1
- package/dist/domains/stats.js +9 -2
- package/dist/domains/stats.js.map +1 -1
- package/dist/domains/two-factor.d.ts +16 -1
- package/dist/domains/two-factor.d.ts.map +1 -1
- package/dist/domains/two-factor.js +31 -4
- package/dist/domains/two-factor.js.map +1 -1
- package/dist/domains/users.d.ts +58 -2
- package/dist/domains/users.d.ts.map +1 -1
- package/dist/domains/users.js +120 -9
- package/dist/domains/users.js.map +1 -1
- package/dist/types/common.d.ts +12 -14
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/organizations.d.ts +23 -6
- package/dist/types/organizations.d.ts.map +1 -1
- package/dist/types/permissions.d.ts +4 -1
- package/dist/types/permissions.d.ts.map +1 -1
- package/dist/types/stats.d.ts +61 -10
- package/dist/types/stats.d.ts.map +1 -1
- package/dist/types/stats.js +4 -0
- package/dist/types/stats.js.map +1 -1
- package/dist/types/two-factor.d.ts +46 -4
- package/dist/types/two-factor.d.ts.map +1 -1
- package/dist/types/users.d.ts +74 -11
- package/dist/types/users.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/domains/users.js
CHANGED
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
* @module domains/users
|
|
5
5
|
*/
|
|
6
6
|
import { listAll } from '../pagination/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { etagHeaders, toQueryParams, unwrapData, unwrapWithEtag } from './helpers.js';
|
|
8
8
|
export function createUsersDomain(transport) {
|
|
9
9
|
function userBase(orgId) {
|
|
10
10
|
return `/organizations/${orgId}/users`;
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
13
|
async list(orgId, params) {
|
|
14
|
-
const res = await transport.request({
|
|
14
|
+
const res = await transport.request({
|
|
15
|
+
method: 'GET',
|
|
16
|
+
path: userBase(orgId),
|
|
17
|
+
params: toQueryParams(params),
|
|
18
|
+
});
|
|
15
19
|
return res.body;
|
|
16
20
|
},
|
|
17
21
|
listAll(orgId, params) {
|
|
@@ -22,27 +26,76 @@ export function createUsersDomain(transport) {
|
|
|
22
26
|
return unwrapWithEtag(res);
|
|
23
27
|
},
|
|
24
28
|
async create(input) {
|
|
25
|
-
const res = await transport.request({
|
|
29
|
+
const res = await transport.request({
|
|
30
|
+
method: 'POST',
|
|
31
|
+
path: userBase(input.organizationId),
|
|
32
|
+
body: input,
|
|
33
|
+
});
|
|
26
34
|
return unwrapData(res.body);
|
|
27
35
|
},
|
|
28
36
|
async update(orgId, userId, input, etag) {
|
|
29
37
|
const res = await transport.request({
|
|
30
|
-
method: 'PUT',
|
|
38
|
+
method: 'PUT',
|
|
39
|
+
path: `${userBase(orgId)}/${userId}`,
|
|
40
|
+
body: input,
|
|
41
|
+
headers: etagHeaders(etag),
|
|
31
42
|
});
|
|
32
43
|
return unwrapData(res.body);
|
|
33
44
|
},
|
|
34
45
|
async invite(input) {
|
|
35
|
-
const res = await transport.request({
|
|
46
|
+
const res = await transport.request({
|
|
47
|
+
method: 'POST',
|
|
48
|
+
path: `${userBase(input.organizationId)}/invite`,
|
|
49
|
+
body: input,
|
|
50
|
+
});
|
|
51
|
+
return unwrapData(res.body);
|
|
52
|
+
},
|
|
53
|
+
async invitePreview(input) {
|
|
54
|
+
const res = await transport.request({
|
|
55
|
+
method: 'POST',
|
|
56
|
+
path: `${userBase(input.organizationId)}/invite/preview`,
|
|
57
|
+
body: input,
|
|
58
|
+
});
|
|
36
59
|
return unwrapData(res.body);
|
|
37
60
|
},
|
|
38
61
|
async setPassword(orgId, userId, input) {
|
|
39
|
-
await transport.request({
|
|
62
|
+
await transport.request({
|
|
63
|
+
method: 'POST',
|
|
64
|
+
path: `${userBase(orgId)}/${userId}/password`,
|
|
65
|
+
body: input,
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
async clearPassword(orgId, userId) {
|
|
69
|
+
await transport.request({ method: 'DELETE', path: `${userBase(orgId)}/${userId}/password` });
|
|
70
|
+
},
|
|
71
|
+
async verifyEmail(orgId, userId) {
|
|
72
|
+
await transport.request({
|
|
73
|
+
method: 'POST',
|
|
74
|
+
path: `${userBase(orgId)}/${userId}/verify-email`,
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
async exportData(orgId, userId) {
|
|
78
|
+
const res = await transport.request({
|
|
79
|
+
method: 'GET',
|
|
80
|
+
path: `${userBase(orgId)}/${userId}/export`,
|
|
81
|
+
});
|
|
82
|
+
return unwrapData(res.body);
|
|
83
|
+
},
|
|
84
|
+
async purge(orgId, userId) {
|
|
85
|
+
// The server requires an explicit confirmation header to perform the
|
|
86
|
+
// irreversible GDPR purge (X-Confirm-Purge: true).
|
|
87
|
+
const res = await transport.request({
|
|
88
|
+
method: 'POST',
|
|
89
|
+
path: `${userBase(orgId)}/${userId}/purge`,
|
|
90
|
+
headers: { 'X-Confirm-Purge': 'true' },
|
|
91
|
+
});
|
|
92
|
+
return unwrapData(res.body);
|
|
40
93
|
},
|
|
41
94
|
async suspend(orgId, userId) {
|
|
42
95
|
await transport.request({ method: 'POST', path: `${userBase(orgId)}/${userId}/suspend` });
|
|
43
96
|
},
|
|
44
|
-
async
|
|
45
|
-
await transport.request({ method: 'POST', path: `${userBase(orgId)}/${userId}/
|
|
97
|
+
async unsuspend(orgId, userId) {
|
|
98
|
+
await transport.request({ method: 'POST', path: `${userBase(orgId)}/${userId}/unsuspend` });
|
|
46
99
|
},
|
|
47
100
|
async lock(orgId, userId) {
|
|
48
101
|
await transport.request({ method: 'POST', path: `${userBase(orgId)}/${userId}/lock` });
|
|
@@ -58,7 +111,65 @@ export function createUsersDomain(transport) {
|
|
|
58
111
|
},
|
|
59
112
|
async getHistory(orgId, userId, params) {
|
|
60
113
|
const res = await transport.request({
|
|
61
|
-
method: 'GET',
|
|
114
|
+
method: 'GET',
|
|
115
|
+
path: `${userBase(orgId)}/${userId}/history`,
|
|
116
|
+
params: toQueryParams(params),
|
|
117
|
+
});
|
|
118
|
+
return unwrapData(res.body);
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export function createStandaloneUsersDomain(transport) {
|
|
123
|
+
const base = '/users';
|
|
124
|
+
return {
|
|
125
|
+
async get(userId) {
|
|
126
|
+
const res = await transport.request({ method: 'GET', path: `${base}/${userId}` });
|
|
127
|
+
return unwrapWithEtag(res);
|
|
128
|
+
},
|
|
129
|
+
async update(userId, input, etag) {
|
|
130
|
+
const res = await transport.request({
|
|
131
|
+
method: 'PUT',
|
|
132
|
+
path: `${base}/${userId}`,
|
|
133
|
+
body: input,
|
|
134
|
+
headers: etagHeaders(etag),
|
|
135
|
+
});
|
|
136
|
+
return unwrapData(res.body);
|
|
137
|
+
},
|
|
138
|
+
async setPassword(userId, input) {
|
|
139
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/password`, body: input });
|
|
140
|
+
},
|
|
141
|
+
async clearPassword(userId) {
|
|
142
|
+
await transport.request({ method: 'DELETE', path: `${base}/${userId}/password` });
|
|
143
|
+
},
|
|
144
|
+
async verifyEmail(userId) {
|
|
145
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/verify-email` });
|
|
146
|
+
},
|
|
147
|
+
async deactivate(userId) {
|
|
148
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/deactivate` });
|
|
149
|
+
},
|
|
150
|
+
async reactivate(userId) {
|
|
151
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/reactivate` });
|
|
152
|
+
},
|
|
153
|
+
async activate(userId) {
|
|
154
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/activate` });
|
|
155
|
+
},
|
|
156
|
+
async suspend(userId) {
|
|
157
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/suspend` });
|
|
158
|
+
},
|
|
159
|
+
async unsuspend(userId) {
|
|
160
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/unsuspend` });
|
|
161
|
+
},
|
|
162
|
+
async lock(userId) {
|
|
163
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/lock` });
|
|
164
|
+
},
|
|
165
|
+
async unlock(userId) {
|
|
166
|
+
await transport.request({ method: 'POST', path: `${base}/${userId}/unlock` });
|
|
167
|
+
},
|
|
168
|
+
async getHistory(userId, params) {
|
|
169
|
+
const res = await transport.request({
|
|
170
|
+
method: 'GET',
|
|
171
|
+
path: `${base}/${userId}/history`,
|
|
172
|
+
params: toQueryParams(params),
|
|
62
173
|
});
|
|
63
174
|
return unwrapData(res.body);
|
|
64
175
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAcjD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA2CtF,MAAM,UAAU,iBAAiB,CAAC,SAAwB;IACxD,SAAS,QAAQ,CAAC,KAAa;QAC7B,OAAO,kBAAkB,KA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AM,EAAE,MAAO;YAC9B,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC;gBAClC,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,GAAG,IAAI,IAAI,MAAM,UAAU;gBACjC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC;aAC9B,CAAC,CAAC;YACH,OAAO,UAAU,CAAiB,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -52,23 +52,21 @@ export interface ETagResponse<T> {
|
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Entity change history entry returned by `getHistory()` methods.
|
|
55
|
+
*
|
|
56
|
+
* Mirrors the server `HistoryEntry` (src/lib/entity-history.ts) — entries are
|
|
57
|
+
* audit-log rows projected to `{ id, eventType, actorId, metadata, createdAt }`.
|
|
58
|
+
* The server has no `entityType`/`entityId`/`action`/`changes`/`performedBy`
|
|
59
|
+
* fields; those were SDK drift (AR-18).
|
|
55
60
|
*/
|
|
56
61
|
export interface HistoryEntry {
|
|
57
|
-
/** History entry ID */
|
|
62
|
+
/** History entry (audit-log) ID */
|
|
58
63
|
id: string;
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
/** Changes made (field → { old, new }) */
|
|
66
|
-
changes: Record<string, {
|
|
67
|
-
old: unknown;
|
|
68
|
-
new: unknown;
|
|
69
|
-
}>;
|
|
70
|
-
/** User who made the change */
|
|
71
|
-
performedBy: string | null;
|
|
64
|
+
/** Event type (e.g., 'user.login', 'org.updated') */
|
|
65
|
+
eventType: string;
|
|
66
|
+
/** ID of the actor who triggered the event, or null for system events */
|
|
67
|
+
actorId: string | null;
|
|
68
|
+
/** Arbitrary event metadata recorded with the audit entry */
|
|
69
|
+
metadata: Record<string, unknown> | null;
|
|
72
70
|
/** ISO 8601 timestamp */
|
|
73
71
|
createdAt: string;
|
|
74
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,mCAAmC;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;CAC7D;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,4BAA4B;IAC5B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAMD;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,sBAAsB;IACtB,IAAI,EAAE,CAAC,CAAC;IACR,8DAA8D;IAC9D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAMD
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["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,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzC,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -14,12 +14,12 @@ export type { ClaimDefinition, ClaimValueType, CreateClaimDefinitionInput, Updat
|
|
|
14
14
|
export type { ConfigEntry, SetConfigInput, } from './config.js';
|
|
15
15
|
export type { SigningKey } from './keys.js';
|
|
16
16
|
export type { AuditEntry, AuditListParams, } from './audit.js';
|
|
17
|
-
export type { DashboardStats,
|
|
17
|
+
export type { DashboardStats, StatsOverview, OrgStats, StatusCounts, UserStatsCounts, LoginActivity, LoginActivityWindows, SystemHealth, } from './stats.js';
|
|
18
18
|
export type { AdminSession, SessionListParams, RevokeUserSessionsResult, } from './sessions.js';
|
|
19
19
|
export type { BulkOrgAction, BulkUserAction, BulkOrgStatusInput, BulkUserStatusInput, BulkItemResult, BulkOperationResult, } from './bulk.js';
|
|
20
20
|
export type { BrandingAssets } from './branding.js';
|
|
21
21
|
export type { ExportEntityType, ExportFormat, ExportParams, } from './exports.js';
|
|
22
|
-
export type { TwoFactorMethod, TwoFactorStatus, } from './two-factor.js';
|
|
22
|
+
export type { TwoFactorMethod, TwoFactorStatus, TwoFactorPolicyResult, TwoFactorSummary, RegenerateRecoveryCodesResult, } from './two-factor.js';
|
|
23
23
|
export type { ImportMode, ImportManifest, ImportEntityResult, ImportSkippedResult, ImportErrorResult, ImportClientCredentials, ImportResult, } from './imports.js';
|
|
24
24
|
export type { UserRoleAssignment, AssignRoleInput, } from './user-roles.js';
|
|
25
25
|
export type { UserClaimEntry, SetUserClaimValueInput, } from './user-claims.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,MAAM,EACN,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,eAAe,GAChB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,IAAI,EACJ,UAAU,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,IAAI,EACJ,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,UAAU,EACV,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,eAAe,EACf,cAAc,EACd,0BAA0B,EAC1B,0BAA0B,EAC1B,cAAc,EACd,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG5C,YAAY,EACV,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,GACb,MA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BAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAGnB,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,MAAM,cAAc,CAAC;AAKtB,YAAY,EACV,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAKzB,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,kBAAkB,EAClB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,cAAc,EACd,sBAAsB,GACvB,MAAM,kBAAkB,CAAC"}
|
|
@@ -23,22 +23,39 @@ export interface Organization {
|
|
|
23
23
|
createdAt: string;
|
|
24
24
|
updatedAt: string;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Nested branding object accepted by the org create/update schemas
|
|
28
|
+
* (src/routes/organizations.ts — `branding{}`). `null` clears a field.
|
|
29
|
+
*/
|
|
30
|
+
export interface OrganizationBrandingInput {
|
|
31
|
+
logoUrl?: string | null;
|
|
32
|
+
faviconUrl?: string | null;
|
|
33
|
+
primaryColor?: string | null;
|
|
34
|
+
companyName?: string | null;
|
|
35
|
+
customCss?: string | null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Input for creating an organization — mirrors the server
|
|
39
|
+
* `createOrganizationSchema`. The server does NOT accept `twoFactorPolicy`
|
|
40
|
+
* on create (AR-17/PF-005); branding is a nested object, not flat fields.
|
|
41
|
+
*/
|
|
26
42
|
export interface CreateOrganizationInput {
|
|
27
43
|
name: string;
|
|
28
44
|
slug?: string;
|
|
29
45
|
defaultLocale?: string;
|
|
30
|
-
twoFactorPolicy?: TwoFactorPolicy;
|
|
31
46
|
defaultLoginMethods?: LoginMethod[];
|
|
47
|
+
branding?: OrganizationBrandingInput;
|
|
32
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Input for updating an organization — mirrors the server
|
|
51
|
+
* `updateOrganizationSchema`. The server does NOT accept `slug` or
|
|
52
|
+
* `twoFactorPolicy` on update (PF-005); branding is a nested object.
|
|
53
|
+
*/
|
|
33
54
|
export interface UpdateOrganizationInput {
|
|
34
55
|
name?: string;
|
|
35
|
-
slug?: string;
|
|
36
56
|
defaultLocale?: string;
|
|
37
|
-
twoFactorPolicy?: TwoFactorPolicy;
|
|
38
57
|
defaultLoginMethods?: LoginMethod[];
|
|
39
|
-
|
|
40
|
-
brandingCompanyName?: string | null;
|
|
41
|
-
brandingCustomCss?: string | null;
|
|
58
|
+
branding?: OrganizationBrandingInput;
|
|
42
59
|
}
|
|
43
60
|
export interface BrandingInput {
|
|
44
61
|
logo?: Blob | Buffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/types/organizations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AACrE,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,gBAAgB,GAAG,eAAe,GAAG,cAAc,CAAC;AAC/F,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC;AAMpD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,mBA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C,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,WAAW,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,WAAW,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;CACtC;AAMD,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;CACzB"}
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module types/permissions
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* A permission — mirrors the server `mapRowToPermission` (src/rbac/types.ts).
|
|
8
|
+
* The server projection has no `updatedAt` field; it was SDK drift (AR-18).
|
|
9
|
+
*/
|
|
6
10
|
export interface Permission {
|
|
7
11
|
id: string;
|
|
8
12
|
applicationId: string;
|
|
@@ -11,7 +15,6 @@ export interface Permission {
|
|
|
11
15
|
slug: string;
|
|
12
16
|
description: string | null;
|
|
13
17
|
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
18
|
}
|
|
16
19
|
export interface CreatePermissionInput {
|
|
17
20
|
applicationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/types/permissions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/types/stats.d.ts
CHANGED
|
@@ -1,18 +1,69 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dashboard statistics types for the Porta SDK.
|
|
3
3
|
*
|
|
4
|
+
* Mirrors the server `src/lib/stats.ts` — `StatsOverview` (system-wide) and
|
|
5
|
+
* `OrgStats` (per-organization). The old flat `DashboardStats`/`EntityCount`
|
|
6
|
+
* shapes were SDK drift (AR-18) and have been replaced.
|
|
7
|
+
*
|
|
4
8
|
* @module types/stats
|
|
5
9
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
activeSessionCount: number;
|
|
12
|
-
auditEventCount: number;
|
|
13
|
-
}
|
|
14
|
-
export interface EntityCount {
|
|
10
|
+
/**
|
|
11
|
+
* Count breakdown by entity status. Always includes `total`; additional keys
|
|
12
|
+
* are per-status counts (e.g. `active`, `suspended`) discovered at runtime.
|
|
13
|
+
*/
|
|
14
|
+
export interface StatusCounts {
|
|
15
15
|
total: number;
|
|
16
|
-
|
|
16
|
+
[status: string]: number;
|
|
17
17
|
}
|
|
18
|
+
/** Login activity for a time window. */
|
|
19
|
+
export interface LoginActivity {
|
|
20
|
+
successful: number;
|
|
21
|
+
failed: number;
|
|
22
|
+
}
|
|
23
|
+
/** System health check results. */
|
|
24
|
+
export interface SystemHealth {
|
|
25
|
+
database: boolean;
|
|
26
|
+
redis: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Login activity broken down by rolling time window. */
|
|
29
|
+
export interface LoginActivityWindows {
|
|
30
|
+
last24h: LoginActivity;
|
|
31
|
+
last7d: LoginActivity;
|
|
32
|
+
last30d: LoginActivity;
|
|
33
|
+
}
|
|
34
|
+
/** User counts plus growth/activity metrics. */
|
|
35
|
+
export type UserStatsCounts = StatusCounts & {
|
|
36
|
+
newLast7d: number;
|
|
37
|
+
newLast30d: number;
|
|
38
|
+
activeLast30d: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* System-wide dashboard statistics — mirrors the server `StatsOverview`,
|
|
42
|
+
* returned by `GET /stats/overview` (unwrapped from `{ data }`).
|
|
43
|
+
*/
|
|
44
|
+
export interface StatsOverview {
|
|
45
|
+
organizations: StatusCounts;
|
|
46
|
+
users: UserStatsCounts;
|
|
47
|
+
applications: StatusCounts;
|
|
48
|
+
clients: StatusCounts;
|
|
49
|
+
loginActivity: LoginActivityWindows;
|
|
50
|
+
systemHealth: SystemHealth;
|
|
51
|
+
generatedAt: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Per-organization dashboard statistics — mirrors the server `OrgStats`,
|
|
55
|
+
* returned by `GET /stats/organization/:orgId` (unwrapped from `{ data }`).
|
|
56
|
+
*/
|
|
57
|
+
export interface OrgStats {
|
|
58
|
+
organizationId: string;
|
|
59
|
+
users: UserStatsCounts;
|
|
60
|
+
clients: StatusCounts;
|
|
61
|
+
loginActivity: LoginActivityWindows;
|
|
62
|
+
generatedAt: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Backwards-compatible alias — the SDK `stats.get()` return type is
|
|
66
|
+
* `DashboardStats`, which is the system-wide `StatsOverview`.
|
|
67
|
+
*/
|
|
68
|
+
export type DashboardStats = StatsOverview;
|
|
18
69
|
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/types/stats.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/types/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,mCAAmC;AACnC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,gDAAgD;AAChD,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,YAAY,CAAC;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,aAAa,EAAE,oBAAoB,CAAC;IACpC,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,YAAY,CAAC;IACtB,aAAa,EAAE,oBAAoB,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC"}
|
package/dist/types/stats.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dashboard statistics types for the Porta SDK.
|
|
3
3
|
*
|
|
4
|
+
* Mirrors the server `src/lib/stats.ts` — `StatsOverview` (system-wide) and
|
|
5
|
+
* `OrgStats` (per-organization). The old flat `DashboardStats`/`EntityCount`
|
|
6
|
+
* shapes were SDK drift (AR-18) and have been replaced.
|
|
7
|
+
*
|
|
4
8
|
* @module types/stats
|
|
5
9
|
*/
|
|
6
10
|
export {};
|
package/dist/types/stats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/types/stats.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/types/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -4,11 +4,53 @@
|
|
|
4
4
|
* @module types/two-factor
|
|
5
5
|
*/
|
|
6
6
|
export type TwoFactorMethod = 'email' | 'totp';
|
|
7
|
+
/**
|
|
8
|
+
* A user's current 2FA status — mirrors the server `TwoFactorStatus`
|
|
9
|
+
* (src/two-factor/types.ts). The old `userId`/`emailEnabled`/`totpEnabled`/
|
|
10
|
+
* `enforcedBy` fields were SDK drift (AR-18) and have been removed.
|
|
11
|
+
*/
|
|
7
12
|
export interface TwoFactorStatus {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
/** Whether 2FA is enabled for the user */
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
/** The configured 2FA method, or null if not enabled */
|
|
16
|
+
method: TwoFactorMethod | null;
|
|
17
|
+
/** Whether a TOTP authenticator is configured */
|
|
18
|
+
totpConfigured: boolean;
|
|
19
|
+
/** Number of unused recovery codes remaining */
|
|
11
20
|
recoveryCodesRemaining: number;
|
|
12
|
-
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Organization 2FA policy values — mirrors the server `TwoFactorPolicy`
|
|
24
|
+
* (src/two-factor/types.ts).
|
|
25
|
+
*/
|
|
26
|
+
export type TwoFactorPolicy = 'optional' | 'required_email' | 'required_totp' | 'required_any';
|
|
27
|
+
/**
|
|
28
|
+
* Response from the org 2FA policy endpoints (GET/PUT `.../two-factor/policy`).
|
|
29
|
+
* Mirrors the server `{ twoFactorPolicy, validPolicies }` shape.
|
|
30
|
+
*/
|
|
31
|
+
export interface TwoFactorPolicyResult {
|
|
32
|
+
twoFactorPolicy: TwoFactorPolicy;
|
|
33
|
+
validPolicies: TwoFactorPolicy[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Org 2FA enrollment summary — mirrors the server `TwoFactorSummary`
|
|
37
|
+
* (src/two-factor/service.ts), returned by GET `.../two-factor/summary`.
|
|
38
|
+
*/
|
|
39
|
+
export interface TwoFactorSummary {
|
|
40
|
+
totalUsers: number;
|
|
41
|
+
enabledCount: number;
|
|
42
|
+
disabledCount: number;
|
|
43
|
+
totpCount: number;
|
|
44
|
+
emailCount: number;
|
|
45
|
+
complianceRate: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Result of regenerating a user's recovery codes — mirrors the server
|
|
49
|
+
* response from POST `.../two-factor/recovery-codes/regenerate`.
|
|
50
|
+
*/
|
|
51
|
+
export interface RegenerateRecoveryCodesResult {
|
|
52
|
+
recoveryCodes: string[];
|
|
53
|
+
count: number;
|
|
54
|
+
warning: string;
|
|
13
55
|
}
|
|
14
56
|
//# sourceMappingURL=two-factor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"two-factor.d.ts","sourceRoot":"","sources":["../../src/types/two-factor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,
|
|
1
|
+
{"version":3,"file":"two-factor.d.ts","sourceRoot":"","sources":["../../src/types/two-factor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,wDAAwD;IACxD,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,iDAAiD;IACjD,cAAc,EAAE,OAAO,CAAC;IACxB,gDAAgD;IAChD,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,gBAAgB,GAAG,eAAe,GAAG,cAAc,CAAC;AAE/F;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,eAAe,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types/users.d.ts
CHANGED
|
@@ -3,38 +3,101 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module types/users
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
import type { TwoFactorMethod } from './two-factor.js';
|
|
7
|
+
/**
|
|
8
|
+
* User status values — mirrors the server `UserStatus` (src/users/types.ts).
|
|
9
|
+
*
|
|
10
|
+
* Lifecycle: active → inactive (deactivate) / suspended / locked, and back
|
|
11
|
+
* to active via reactivate / unsuspend / unlock. There is no `invited` or
|
|
12
|
+
* `deactivated` status on the server — those were SDK drift (AR-4).
|
|
13
|
+
*/
|
|
14
|
+
export type UserStatus = 'active' | 'inactive' | 'suspended' | 'locked';
|
|
15
|
+
/**
|
|
16
|
+
* A Porta user — full parity with the server `User` (src/users/types.ts,
|
|
17
|
+
* `mapRowToUser`, 36 fields). All server timestamp `Date`s are serialized
|
|
18
|
+
* to ISO-8601 strings over the wire. Profile fields follow the OIDC
|
|
19
|
+
* Standard Claims (§5.1). The password hash is never exposed — only the
|
|
20
|
+
* derived `hasPassword` boolean.
|
|
21
|
+
*/
|
|
7
22
|
export interface User {
|
|
8
23
|
id: string;
|
|
9
24
|
organizationId: string;
|
|
10
25
|
email: string;
|
|
11
|
-
name: string | null;
|
|
12
|
-
status: UserStatus;
|
|
13
26
|
emailVerified: boolean;
|
|
14
27
|
hasPassword: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
passwordChangedAt: string | null;
|
|
29
|
+
givenName: string | null;
|
|
30
|
+
familyName: string | null;
|
|
31
|
+
middleName: string | null;
|
|
32
|
+
nickname: string | null;
|
|
33
|
+
preferredUsername: string | null;
|
|
34
|
+
profileUrl: string | null;
|
|
35
|
+
pictureUrl: string | null;
|
|
36
|
+
websiteUrl: string | null;
|
|
37
|
+
gender: string | null;
|
|
38
|
+
birthdate: string | null;
|
|
39
|
+
zoneinfo: string | null;
|
|
40
|
+
locale: string | null;
|
|
41
|
+
phoneNumber: string | null;
|
|
42
|
+
phoneNumberVerified: boolean;
|
|
43
|
+
addressStreet: string | null;
|
|
44
|
+
addressLocality: string | null;
|
|
45
|
+
addressRegion: string | null;
|
|
46
|
+
addressPostalCode: string | null;
|
|
47
|
+
addressCountry: string | null;
|
|
48
|
+
twoFactorEnabled: boolean;
|
|
49
|
+
twoFactorMethod: TwoFactorMethod | null;
|
|
50
|
+
status: UserStatus;
|
|
17
51
|
lockedAt: string | null;
|
|
52
|
+
lockedReason: string | null;
|
|
53
|
+
lastLoginAt: string | null;
|
|
54
|
+
loginCount: number;
|
|
55
|
+
failedLoginCount: number;
|
|
56
|
+
lastFailedLoginAt: string | null;
|
|
18
57
|
createdAt: string;
|
|
19
58
|
updatedAt: string;
|
|
20
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Input for creating a user — mirrors the server `createUserSchema`
|
|
62
|
+
* (src/routes/users.ts). Only `email` is required by the server; the SDK
|
|
63
|
+
* also threads `organizationId` to build the org-scoped route.
|
|
64
|
+
*/
|
|
21
65
|
export interface CreateUserInput {
|
|
22
66
|
organizationId: string;
|
|
23
67
|
email: string;
|
|
24
|
-
|
|
68
|
+
givenName?: string;
|
|
69
|
+
familyName?: string;
|
|
25
70
|
password?: string;
|
|
26
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Input for updating a user profile — mirrors the server `updateUserSchema`.
|
|
74
|
+
* `null` clears a field; `undefined` leaves it unchanged.
|
|
75
|
+
*/
|
|
27
76
|
export interface UpdateUserInput {
|
|
28
77
|
email?: string;
|
|
29
|
-
|
|
78
|
+
givenName?: string | null;
|
|
79
|
+
familyName?: string | null;
|
|
30
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Input for inviting a user — mirrors the server `inviteUserSchema`
|
|
83
|
+
* (src/routes/users.ts). The server accepts `displayName` (not `name`),
|
|
84
|
+
* plus an optional personal message, role/claim pre-assignments, and locale.
|
|
85
|
+
*/
|
|
31
86
|
export interface InviteUserInput {
|
|
32
87
|
organizationId: string;
|
|
33
88
|
email: string;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
89
|
+
displayName?: string;
|
|
90
|
+
personalMessage?: string;
|
|
91
|
+
roles?: Array<{
|
|
92
|
+
applicationId: string;
|
|
93
|
+
roleId: string;
|
|
94
|
+
}>;
|
|
95
|
+
claims?: Array<{
|
|
96
|
+
applicationId: string;
|
|
97
|
+
claimDefinitionId: string;
|
|
98
|
+
value: unknown;
|
|
99
|
+
}>;
|
|
100
|
+
locale?: string;
|
|
38
101
|
}
|
|
39
102
|
export interface SetPasswordInput {
|
|
40
103
|
password: string;
|