@~lyre/auth 0.7.0 → 0.8.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/admin.d.ts +17 -0
- package/dist/admin.js +26 -0
- package/package.json +71 -71
package/dist/admin.d.ts
CHANGED
|
@@ -223,6 +223,23 @@ declare class AccountsAdmin {
|
|
|
223
223
|
* reads membership — so without this a "deleted" user keeps reappearing in the workspace.
|
|
224
224
|
*/
|
|
225
225
|
removeGroupMember(groupId: string, userId: string): Promise<void>;
|
|
226
|
+
/**
|
|
227
|
+
* Deactivate or reactivate a user account GLOBALLY. Service-key authed (`users:write`).
|
|
228
|
+
*
|
|
229
|
+
* `disabled: true` sets `users.disabled_at`; `false` clears it. A disabled user cannot
|
|
230
|
+
* authenticate by ANY route (password, OAuth exchange, token) across EVERY app — this is an
|
|
231
|
+
* account-level gate, not a per-workspace one. Their rows are retained, so anything they own
|
|
232
|
+
* (audit history, assigned tickets, migrated connections) keeps a valid owner.
|
|
233
|
+
*
|
|
234
|
+
* Accounts also revokes their live sessions across every tenant and emits `session.revoked`, so
|
|
235
|
+
* deactivation takes effect immediately rather than whenever the last session happens to expire.
|
|
236
|
+
*
|
|
237
|
+
* This is the counterpart to `removeGroupMember`, NOT a synonym for it. Removing a membership
|
|
238
|
+
* deletes the row the members list is built from, so the person disappears and can never be
|
|
239
|
+
* reactivated from the UI; disabling keeps them listed with `disabledAt` set, which is what the
|
|
240
|
+
* Active/Deactivated badge reads.
|
|
241
|
+
*/
|
|
242
|
+
setUserDisabled(userId: string, disabled: boolean): Promise<void>;
|
|
226
243
|
/** Revoke a pending invite (withdraw one sent in error). Session-authed. */
|
|
227
244
|
revokeAppInvite(appSlug: string, inviteId: string): Promise<void>;
|
|
228
245
|
/** Everyone with access to an app. Session-authed. */
|
package/dist/admin.js
CHANGED
|
@@ -159,6 +159,32 @@ var AccountsAdmin = class {
|
|
|
159
159
|
{ auth: "key" }
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Deactivate or reactivate a user account GLOBALLY. Service-key authed (`users:write`).
|
|
164
|
+
*
|
|
165
|
+
* `disabled: true` sets `users.disabled_at`; `false` clears it. A disabled user cannot
|
|
166
|
+
* authenticate by ANY route (password, OAuth exchange, token) across EVERY app — this is an
|
|
167
|
+
* account-level gate, not a per-workspace one. Their rows are retained, so anything they own
|
|
168
|
+
* (audit history, assigned tickets, migrated connections) keeps a valid owner.
|
|
169
|
+
*
|
|
170
|
+
* Accounts also revokes their live sessions across every tenant and emits `session.revoked`, so
|
|
171
|
+
* deactivation takes effect immediately rather than whenever the last session happens to expire.
|
|
172
|
+
*
|
|
173
|
+
* This is the counterpart to `removeGroupMember`, NOT a synonym for it. Removing a membership
|
|
174
|
+
* deletes the row the members list is built from, so the person disappears and can never be
|
|
175
|
+
* reactivated from the UI; disabling keeps them listed with `disabledAt` set, which is what the
|
|
176
|
+
* Active/Deactivated badge reads.
|
|
177
|
+
*/
|
|
178
|
+
async setUserDisabled(userId, disabled) {
|
|
179
|
+
await this.request(
|
|
180
|
+
"PATCH",
|
|
181
|
+
`/api/auth/admin/users/${encodeURIComponent(userId)}`,
|
|
182
|
+
{
|
|
183
|
+
auth: "key",
|
|
184
|
+
body: { disabledAt: disabled ? (/* @__PURE__ */ new Date()).toISOString() : null }
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
162
188
|
/** Revoke a pending invite (withdraw one sent in error). Session-authed. */
|
|
163
189
|
async revokeAppInvite(appSlug, inviteId) {
|
|
164
190
|
await this.request(
|
package/package.json
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
2
|
+
"name": "@~lyre/auth",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Shared Axis Accounts auth SDK — framework-agnostic session/identity core (HMAC-signed cookies, accounts login/callback/logout) plus an optional turnkey SvelteKit adapter.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Britam Trust Services / Lyre",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/kigathi-chege/lyre-auth-sdk.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/kigathi-chege/lyre-auth-sdk#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/kigathi-chege/lyre-auth-sdk/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"auth",
|
|
19
|
+
"sso",
|
|
20
|
+
"accounts",
|
|
21
|
+
"session",
|
|
22
|
+
"sveltekit",
|
|
23
|
+
"hmac",
|
|
24
|
+
"lyre"
|
|
25
|
+
],
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./sveltekit": {
|
|
34
|
+
"types": "./dist/sveltekit.d.ts",
|
|
35
|
+
"import": "./dist/sveltekit.js"
|
|
36
|
+
},
|
|
37
|
+
"./nest": {
|
|
38
|
+
"types": "./dist/nest.d.ts",
|
|
39
|
+
"import": "./dist/nest.js"
|
|
40
|
+
},
|
|
41
|
+
"./admin": {
|
|
42
|
+
"types": "./dist/admin.d.ts",
|
|
43
|
+
"import": "./dist/admin.js"
|
|
44
|
+
},
|
|
45
|
+
"./package.json": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dist",
|
|
49
|
+
"README.md",
|
|
50
|
+
"LICENSE"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup src/index.ts src/sveltekit.ts src/nest.ts src/admin.ts --format esm --dts --clean",
|
|
54
|
+
"check": "tsc --noEmit"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@sveltejs/kit": "^2.0.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"@sveltejs/kit": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@sveltejs/kit": "^2.0.0",
|
|
66
|
+
"@types/node": "^22",
|
|
67
|
+
"tsup": "^8.3.5",
|
|
68
|
+
"typescript": "^6.0.2"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
}
|
|
73
73
|
}
|