@proteinjs/user-server 1.5.4 → 1.7.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/CHANGELOG.md +33 -0
- package/dist/generated/index.d.ts +1 -4
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +4 -5
- package/dist/generated/index.js.map +1 -1
- package/dist/src/authorization/userCache.d.ts.map +1 -1
- package/dist/src/authorization/userCache.js +18 -3
- package/dist/src/authorization/userCache.js.map +1 -1
- package/dist/src/routes/avatar.d.ts +19 -0
- package/dist/src/routes/avatar.d.ts.map +1 -0
- package/dist/src/routes/avatar.js +108 -0
- package/dist/src/routes/avatar.js.map +1 -0
- package/dist/src/routes/devLogin.d.ts +15 -5
- package/dist/src/routes/devLogin.d.ts.map +1 -1
- package/dist/src/routes/devLogin.js +61 -13
- package/dist/src/routes/devLogin.js.map +1 -1
- package/dist/src/services/Signup.d.ts +16 -1
- package/dist/src/services/Signup.d.ts.map +1 -1
- package/dist/src/services/Signup.js +49 -15
- package/dist/src/services/Signup.js.map +1 -1
- package/dist/src/services/UpdateUserInfo.d.ts +40 -2
- package/dist/src/services/UpdateUserInfo.d.ts.map +1 -1
- package/dist/src/services/UpdateUserInfo.js +183 -12
- package/dist/src/services/UpdateUserInfo.js.map +1 -1
- package/dist/test/DevLogin.test.d.ts +2 -0
- package/dist/test/DevLogin.test.d.ts.map +1 -0
- package/dist/test/DevLogin.test.js +261 -0
- package/dist/test/DevLogin.test.js.map +1 -0
- package/dist/test/UpdateUserInfoAvatar.test.d.ts +2 -0
- package/dist/test/UpdateUserInfoAvatar.test.d.ts.map +1 -0
- package/dist/test/UpdateUserInfoAvatar.test.js +337 -0
- package/dist/test/UpdateUserInfoAvatar.test.js.map +1 -0
- package/dist/test/UpdateUserInfoSessionRefresh.test.d.ts +2 -0
- package/dist/test/UpdateUserInfoSessionRefresh.test.d.ts.map +1 -0
- package/dist/test/UpdateUserInfoSessionRefresh.test.js +94 -0
- package/dist/test/UpdateUserInfoSessionRefresh.test.js.map +1 -0
- package/dist/test/UserCacheMissingAccount.test.d.ts +2 -0
- package/dist/test/UserCacheMissingAccount.test.d.ts.map +1 -0
- package/dist/test/UserCacheMissingAccount.test.js +104 -0
- package/dist/test/UserCacheMissingAccount.test.js.map +1 -0
- package/dist/test/UserServerTestEnvironment.d.ts +26 -0
- package/dist/test/UserServerTestEnvironment.d.ts.map +1 -0
- package/dist/test/UserServerTestEnvironment.js +202 -0
- package/dist/test/UserServerTestEnvironment.js.map +1 -0
- package/dist/test/avatarRoute.test.d.ts +2 -0
- package/dist/test/avatarRoute.test.d.ts.map +1 -0
- package/dist/test/avatarRoute.test.js +222 -0
- package/dist/test/avatarRoute.test.js.map +1 -0
- package/generated/index.ts +4 -5
- package/jest.config.js +4 -1
- package/package.json +8 -5
- package/src/authorization/userCache.ts +17 -2
- package/src/heic-decode.d.ts +13 -0
- package/src/routes/avatar.ts +57 -0
- package/src/routes/devLogin.ts +50 -7
- package/src/services/Signup.ts +42 -11
- package/src/services/UpdateUserInfo.ts +124 -13
- package/test/DevLogin.test.ts +159 -0
- package/test/UpdateUserInfoAvatar.test.ts +174 -0
- package/test/UpdateUserInfoSessionRefresh.test.ts +37 -0
- package/test/UserCacheMissingAccount.test.ts +42 -0
- package/test/UserServerTestEnvironment.ts +97 -0
- package/test/avatarRoute.test.ts +111 -0
- package/test/emulatorLock.globalSetup.js +11 -0
- package/test/emulatorLock.globalTeardown.js +8 -0
- package/test/emulatorLock.js +124 -0
- package/test/fixtures/fixture.heic +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var sharp_1 = __importDefault(require("sharp"));
|
|
43
|
+
var user_1 = require("@proteinjs/user");
|
|
44
|
+
var UserServerTestEnvironment_1 = require("./UserServerTestEnvironment");
|
|
45
|
+
var UpdateUserInfo_1 = require("../src/services/UpdateUserInfo");
|
|
46
|
+
var avatar_1 = require("../src/routes/avatar");
|
|
47
|
+
var testEnv = new UserServerTestEnvironment_1.UserServerTestEnvironment();
|
|
48
|
+
/** Captures exactly what the route writes — status, headers, body. */
|
|
49
|
+
var MockResponse = /** @class */ (function () {
|
|
50
|
+
function MockResponse() {
|
|
51
|
+
this.statusCode = 200;
|
|
52
|
+
this.headers = {};
|
|
53
|
+
}
|
|
54
|
+
MockResponse.prototype.status = function (code) {
|
|
55
|
+
this.statusCode = code;
|
|
56
|
+
return this;
|
|
57
|
+
};
|
|
58
|
+
MockResponse.prototype.setHeader = function (name, value) {
|
|
59
|
+
this.headers[name.toLowerCase()] = value;
|
|
60
|
+
};
|
|
61
|
+
MockResponse.prototype.send = function (body) {
|
|
62
|
+
this.body = body;
|
|
63
|
+
return this;
|
|
64
|
+
};
|
|
65
|
+
return MockResponse;
|
|
66
|
+
}());
|
|
67
|
+
var requestAvatar = function (userId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
+
var response;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
response = new MockResponse();
|
|
73
|
+
return [4 /*yield*/, avatar_1.avatar.onRequest({ params: { userId: userId } }, response)];
|
|
74
|
+
case 1:
|
|
75
|
+
_a.sent();
|
|
76
|
+
return [2 /*return*/, response];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}); };
|
|
80
|
+
/**
|
|
81
|
+
* The shared-visibility door for avatar photos: logged-in users can render ANY user's avatar
|
|
82
|
+
* (File rows are ScopedRecords, so /file/:id can't serve them cross-user); logged-out requests
|
|
83
|
+
* get 401; emoji/no-avatar users get 404 (clients render emoji/initials from the user record).
|
|
84
|
+
* Only the file id stored on the user row is ever served.
|
|
85
|
+
*/
|
|
86
|
+
describe('GET /avatar/:userId', function () {
|
|
87
|
+
beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
return __generator(this, function (_a) {
|
|
89
|
+
switch (_a.label) {
|
|
90
|
+
case 0: return [4 /*yield*/, testEnv.beforeAll()];
|
|
91
|
+
case 1:
|
|
92
|
+
_a.sent();
|
|
93
|
+
return [2 /*return*/];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}); });
|
|
97
|
+
afterAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0: return [4 /*yield*/, testEnv.afterAll()];
|
|
101
|
+
case 1:
|
|
102
|
+
_a.sent();
|
|
103
|
+
return [2 /*return*/];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}); });
|
|
107
|
+
it("serves another user's avatar photo to any logged-in (non-admin) user, cacheable by fileId", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
+
var owner, png, updated, viewer, response, bytes, metadata;
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
switch (_a.label) {
|
|
111
|
+
case 0: return [4 /*yield*/, testEnv.createUser({ name: 'Owner', email: 'owner@test.local' })];
|
|
112
|
+
case 1:
|
|
113
|
+
owner = _a.sent();
|
|
114
|
+
testEnv.actAs(owner);
|
|
115
|
+
return [4 /*yield*/, (0, sharp_1.default)({ create: { width: 100, height: 100, channels: 3, background: { r: 5, g: 150, b: 90 } } })
|
|
116
|
+
.png()
|
|
117
|
+
.toBuffer()];
|
|
118
|
+
case 2:
|
|
119
|
+
png = _a.sent();
|
|
120
|
+
return [4 /*yield*/, new UpdateUserInfo_1.UpdateUserInfo().updateAvatarPhoto(png.toString('base64'), 'image/png')];
|
|
121
|
+
case 3:
|
|
122
|
+
updated = _a.sent();
|
|
123
|
+
return [4 /*yield*/, testEnv.createUser({ name: 'Viewer', email: 'viewer@test.local', roles: [] })];
|
|
124
|
+
case 4:
|
|
125
|
+
viewer = _a.sent();
|
|
126
|
+
testEnv.actAs(viewer);
|
|
127
|
+
return [4 /*yield*/, requestAvatar(owner.id)];
|
|
128
|
+
case 5:
|
|
129
|
+
response = _a.sent();
|
|
130
|
+
expect(response.statusCode).toBe(200);
|
|
131
|
+
expect(response.headers['content-type']).toBe('image/jpeg');
|
|
132
|
+
expect(response.headers['cache-control']).toBe('public, max-age=86400, immutable');
|
|
133
|
+
bytes = response.body;
|
|
134
|
+
expect(Buffer.isBuffer(bytes)).toBe(true);
|
|
135
|
+
expect(bytes[0]).toBe(0xff); // JPEG SOI
|
|
136
|
+
expect(bytes[1]).toBe(0xd8);
|
|
137
|
+
return [4 /*yield*/, (0, sharp_1.default)(bytes).metadata()];
|
|
138
|
+
case 6:
|
|
139
|
+
metadata = _a.sent();
|
|
140
|
+
expect(metadata.width).toBe(512);
|
|
141
|
+
expect(metadata.height).toBe(512);
|
|
142
|
+
// The client-side URL contract carries the cache-buster.
|
|
143
|
+
expect(user_1.avatarRoute.path(owner.id, updated.avatarFileId)).toBe("/avatar/".concat(owner.id, "?v=").concat(updated.avatarFileId));
|
|
144
|
+
return [2 /*return*/];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}); });
|
|
148
|
+
it('404s for an emoji-avatar user and a no-avatar user (photos only)', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
+
var emojiUser, bareUser, _a, _b;
|
|
150
|
+
return __generator(this, function (_c) {
|
|
151
|
+
switch (_c.label) {
|
|
152
|
+
case 0: return [4 /*yield*/, testEnv.createUser({ name: 'Emoji', email: 'emoji-route@test.local' })];
|
|
153
|
+
case 1:
|
|
154
|
+
emojiUser = _c.sent();
|
|
155
|
+
testEnv.actAs(emojiUser);
|
|
156
|
+
return [4 /*yield*/, new UpdateUserInfo_1.UpdateUserInfo().updateAvatarEmoji('🦀')];
|
|
157
|
+
case 2:
|
|
158
|
+
_c.sent();
|
|
159
|
+
return [4 /*yield*/, testEnv.createUser({ name: 'Bare', email: 'bare-route@test.local' })];
|
|
160
|
+
case 3:
|
|
161
|
+
bareUser = _c.sent();
|
|
162
|
+
testEnv.actAs(bareUser);
|
|
163
|
+
_a = expect;
|
|
164
|
+
return [4 /*yield*/, requestAvatar(emojiUser.id)];
|
|
165
|
+
case 4:
|
|
166
|
+
_a.apply(void 0, [(_c.sent()).statusCode]).toBe(404);
|
|
167
|
+
_b = expect;
|
|
168
|
+
return [4 /*yield*/, requestAvatar(bareUser.id)];
|
|
169
|
+
case 5:
|
|
170
|
+
_b.apply(void 0, [(_c.sent()).statusCode]).toBe(404);
|
|
171
|
+
return [2 /*return*/];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}); });
|
|
175
|
+
it('404s for unknown ids — :userId is a keyed lookup, never a path', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
|
+
var viewer, _a, _b;
|
|
177
|
+
return __generator(this, function (_c) {
|
|
178
|
+
switch (_c.label) {
|
|
179
|
+
case 0: return [4 /*yield*/, testEnv.createUser({ name: 'Curious', email: 'curious@test.local' })];
|
|
180
|
+
case 1:
|
|
181
|
+
viewer = _c.sent();
|
|
182
|
+
testEnv.actAs(viewer);
|
|
183
|
+
_a = expect;
|
|
184
|
+
return [4 /*yield*/, requestAvatar('no-such-user')];
|
|
185
|
+
case 2:
|
|
186
|
+
_a.apply(void 0, [(_c.sent()).statusCode]).toBe(404);
|
|
187
|
+
_b = expect;
|
|
188
|
+
return [4 /*yield*/, requestAvatar('../../etc/passwd')];
|
|
189
|
+
case 3:
|
|
190
|
+
_b.apply(void 0, [(_c.sent()).statusCode]).toBe(404);
|
|
191
|
+
return [2 /*return*/];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}); });
|
|
195
|
+
it('401s without a logged-in session', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
196
|
+
var owner, png, response;
|
|
197
|
+
return __generator(this, function (_a) {
|
|
198
|
+
switch (_a.label) {
|
|
199
|
+
case 0: return [4 /*yield*/, testEnv.createUser({ name: 'Private', email: 'private@test.local' })];
|
|
200
|
+
case 1:
|
|
201
|
+
owner = _a.sent();
|
|
202
|
+
testEnv.actAs(owner);
|
|
203
|
+
return [4 /*yield*/, (0, sharp_1.default)({ create: { width: 32, height: 32, channels: 3, background: { r: 9, g: 9, b: 9 } } })
|
|
204
|
+
.png()
|
|
205
|
+
.toBuffer()];
|
|
206
|
+
case 2:
|
|
207
|
+
png = _a.sent();
|
|
208
|
+
return [4 /*yield*/, new UpdateUserInfo_1.UpdateUserInfo().updateAvatarPhoto(png.toString('base64'), 'image/png')];
|
|
209
|
+
case 3:
|
|
210
|
+
_a.sent();
|
|
211
|
+
testEnv.actAs(user_1.guestUser);
|
|
212
|
+
return [4 /*yield*/, requestAvatar(owner.id)];
|
|
213
|
+
case 4:
|
|
214
|
+
response = _a.sent();
|
|
215
|
+
expect(response.statusCode).toBe(401);
|
|
216
|
+
expect(response.body).not.toBeInstanceOf(Buffer);
|
|
217
|
+
return [2 /*return*/];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}); });
|
|
221
|
+
});
|
|
222
|
+
//# sourceMappingURL=avatarRoute.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatarRoute.test.js","sourceRoot":"","sources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AAK,CAAC,KAAK,CAAC,CAAC;oBACT,qBAAM,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;6BAC1G,GAAG,EAAE;6BACL,QAAQ,EAAE,EAAA;;oBAFP,GAAG,GAAG,SAEC;oBACb,qBAAM,IAAI,+BAAc,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,EAAA;;oBAAjF,SAAiF,CAAC;oBAElF,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;oBACf,qBAAM,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,EAAA;;oBAAxC,QAAQ,GAAG,SAA6B;oBAC9C,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACtC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;;;;SAClD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/generated/index.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/** Load Dependency Source Graphs */
|
|
2
2
|
|
|
3
3
|
import '@proteinjs/db';
|
|
4
|
+
import '@proteinjs/db-file';
|
|
4
5
|
import '@proteinjs/email-server';
|
|
5
6
|
import '@proteinjs/logger';
|
|
6
|
-
import '@proteinjs/reflection';
|
|
7
7
|
import '@proteinjs/server';
|
|
8
8
|
import '@proteinjs/server-api';
|
|
9
9
|
import '@proteinjs/user';
|
|
10
|
-
import 'crypto-js';
|
|
11
|
-
import 'express-session';
|
|
12
|
-
import 'moment';
|
|
13
10
|
|
|
14
11
|
/** Generate Source Graph */
|
|
15
12
|
|
|
16
13
|
const sourceGraph =
|
|
17
|
-
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/user-server/DbSessionStore","value":{"packageName":"@proteinjs/user-server","name":"DbSessionStore","filePath":"/home/runner/work/user/user/packages/server/src/authentication/DbSessionStore.ts","qualifiedName":"@proteinjs/user-server/DbSessionStore","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"TWELVE_HOURS","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"TOUCH_INTERVAL","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"logger","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"lastTouchMs","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"get","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"set","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"touch","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"destroy","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"isTransactionAbort","returnType":{"packageName":"","name":"boolean","filePath":null,"qualifiedName":"/boolean","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private","parameters":[{"name":"error","type":{"packageName":"","name":"any","filePath":null,"qualifiedName":"/any","typeParameters":null,"directParents":null}}]},{"name":"insertOrUpdate","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"sessionId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"session","type":{"packageName":"","name":"Express.SessionData","filePath":null,"qualifiedName":"/Express.SessionData","typeParameters":null,"directParents":null}},{"name":"cb","type":{"packageName":"","name":"(error?: any) => void","filePath":null,"qualifiedName":"/(error?: any) => void","typeParameters":null,"directParents":null}}]},{"name":"sweep","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"express-session","name":"Store","filePath":null,"qualifiedName":"express-session/Store","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}},{"v":"express-session/Store"},{"v":"@proteinjs/user-server/SocketIOSessionWatcher","value":{"packageName":"@proteinjs/user-server","name":"SocketIOSessionWatcher","filePath":"/home/runner/work/user/user/packages/server/src/authentication/SocketIOSessionWatcher.ts","qualifiedName":"@proteinjs/user-server/SocketIOSessionWatcher","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[{"name":"name","returnType":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"table","returnType":{"packageName":"","name":"Table<Session>","filePath":null,"qualifiedName":"/Table<Session>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"afterDelete","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"recordDeleteCount","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}},{"name":"deletedRecords","type":{"packageName":"","name":"T[]","filePath":null,"qualifiedName":"/T[]","typeParameters":null,"directParents":null}},{"name":"initialQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null}},{"name":"deleteQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/db","name":"TableWatcher","filePath":null,"qualifiedName":"@proteinjs/db/TableWatcher","properties":[],"methods":[],"typeParameters":["@proteinjs/user/Session"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/db/TableWatcher"},{"v":"@proteinjs/user-server/userCache","value":{"packageName":"@proteinjs/user-server","name":"userCache","filePath":"/home/runner/work/user/user/packages/server/src/authorization/userCache.ts","qualifiedName":"@proteinjs/user-server/userCache","type":{"packageName":"","name":"SessionDataCache<User>","filePath":null,"qualifiedName":"/SessionDataCache<User>","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"SessionDataCache","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionDataCache","typeParameters":["@proteinjs/user/User"],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/SessionDataCache"},{"v":"@proteinjs/user-server/BackfillUserRolesArray","value":{"packageName":"@proteinjs/user-server","name":"BackfillUserRolesArray","filePath":"/home/runner/work/user/user/packages/server/src/migrations/BackfillUserRolesArray.ts","qualifiedName":"@proteinjs/user-server/BackfillUserRolesArray","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"record","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/db","name":"SourceRecordLoader","filePath":null,"qualifiedName":"@proteinjs/db/SourceRecordLoader","properties":[],"methods":[],"typeParameters":["@proteinjs/db/Migration"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/db/SourceRecordLoader"},{"v":"@proteinjs/user-server/devLogin","value":{"packageName":"@proteinjs/user-server","name":"devLogin","filePath":"/home/runner/work/user/user/packages/server/src/routes/devLogin.ts","qualifiedName":"@proteinjs/user-server/devLogin","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/Route"},{"v":"@proteinjs/user-server/executePasswordReset","value":{"packageName":"@proteinjs/user-server","name":"executePasswordReset","filePath":"/home/runner/work/user/user/packages/server/src/routes/executePasswordReset.ts","qualifiedName":"@proteinjs/user-server/executePasswordReset","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/initiatePasswordReset","value":{"packageName":"@proteinjs/user-server","name":"initiatePasswordReset","filePath":"/home/runner/work/user/user/packages/server/src/routes/initiatePasswordReset.ts","qualifiedName":"@proteinjs/user-server/initiatePasswordReset","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/login","value":{"packageName":"@proteinjs/user-server","name":"login","filePath":"/home/runner/work/user/user/packages/server/src/routes/login.ts","qualifiedName":"@proteinjs/user-server/login","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/logout","value":{"packageName":"@proteinjs/user-server","name":"logout","filePath":"/home/runner/work/user/user/packages/server/src/routes/logout.ts","qualifiedName":"@proteinjs/user-server/logout","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/validateResetPasswordToken","value":{"packageName":"@proteinjs/user-server","name":"validateResetPasswordToken","filePath":"/home/runner/work/user/user/packages/server/src/routes/validateResetPasswordToken.ts","qualifiedName":"@proteinjs/user-server/validateResetPasswordToken","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/AccessInvite","value":{"packageName":"@proteinjs/user-server","name":"AccessInvite","filePath":"/home/runner/work/user/user/packages/server/src/services/AccessInvite.ts","qualifiedName":"@proteinjs/user-server/AccessInvite","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"serviceMetadata","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"createAccessInvite","returnType":{"packageName":"","name":"Promise<CreateAccessInviteResponse>","filePath":null,"qualifiedName":"/Promise<CreateAccessInviteResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"params","type":{"packageName":"@proteinjs/user","name":"CreateAccessInviteParams","filePath":null,"qualifiedName":"@proteinjs/user/CreateAccessInviteParams","typeParameters":null,"directParents":null}}]},{"name":"acceptAccessInvite","returnType":{"packageName":"","name":"Promise<T | undefined>","filePath":null,"qualifiedName":"/Promise<T | undefined>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"token","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]}],"typeParameters":["/T extends Record"],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"AccessInviteService","filePath":null,"qualifiedName":"@proteinjs/user/AccessInviteService","properties":[],"methods":[],"typeParameters":["/T"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/AccessInviteService"},{"v":"@proteinjs/user-server/Roles","value":{"packageName":"@proteinjs/user-server","name":"Roles","filePath":"/home/runner/work/user/user/packages/server/src/services/Roles.ts","qualifiedName":"@proteinjs/user-server/Roles","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"serviceMetadata","type":{"packageName":"","name":"Service[\'serviceMetadata\']","filePath":null,"qualifiedName":"/Service[\'serviceMetadata\']","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"grantRole","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"userId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"role","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"revokeRole","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"userId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"role","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"changeRole","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"userId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"role","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"action","type":{"packageName":"","name":"\'grant\' | \'revoke\'","filePath":null,"qualifiedName":"/\'grant\' | \'revoke\'","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"RolesService","filePath":null,"qualifiedName":"@proteinjs/user/RolesService","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/RolesService"},{"v":"@proteinjs/user-server/DefaultInviteConfigFactory","value":{"packageName":"@proteinjs/user-server","name":"DefaultInviteConfigFactory","filePath":"/home/runner/work/user/user/packages/server/src/services/Signup.ts","qualifiedName":"@proteinjs/user-server/DefaultInviteConfigFactory","properties":[],"methods":[{"name":"getConfig","returnType":{"packageName":"@proteinjs/user-server","name":"InviteConfig","filePath":null,"qualifiedName":"@proteinjs/user-server/InviteConfig","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":true,"isStatic":false,"visibility":"public","parameters":[]}],"typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"@proteinjs/reflection/Loadable"},{"v":"@proteinjs/user-server/Signup","value":{"packageName":"@proteinjs/user-server","name":"Signup","filePath":"/home/runner/work/user/user/packages/server/src/services/Signup.ts","qualifiedName":"@proteinjs/user-server/Signup","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"serviceMetadata","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"createUser","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"user","type":{"packageName":"@proteinjs/user","name":"UserSignup","filePath":null,"qualifiedName":"@proteinjs/user/UserSignup","typeParameters":null,"directParents":null}},{"name":"token","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"sendInvite","returnType":{"packageName":"","name":"Promise<SendInviteResponse>","filePath":null,"qualifiedName":"/Promise<SendInviteResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"email","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"revokeInvite","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"email","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"initializeSignup","returnType":{"packageName":"","name":"Promise<InitializeSignupResponse>","filePath":null,"qualifiedName":"/Promise<InitializeSignupResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"inviteToken","type":{"packageName":"","name":"string | undefined","filePath":null,"qualifiedName":"/string | undefined","typeParameters":null,"directParents":null}}]},{"name":"lookupInvite","returnType":{"packageName":"","name":"Promise<InviteLookup>","filePath":null,"qualifiedName":"/Promise<InviteLookup>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"token","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"SignupService","filePath":null,"qualifiedName":"@proteinjs/user/SignupService","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/SignupService"},{"v":"@proteinjs/user-server/UpdateUserInfo","value":{"packageName":"@proteinjs/user-server","name":"UpdateUserInfo","filePath":"/home/runner/work/user/user/packages/server/src/services/UpdateUserInfo.ts","qualifiedName":"@proteinjs/user-server/UpdateUserInfo","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"serviceMetadata","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"updateName","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"name","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"updatePassword","returnType":{"packageName":"","name":"Promise<UpdatePasswordResponse>","filePath":null,"qualifiedName":"/Promise<UpdatePasswordResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"currentPassword","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"newPassword","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"UpdateUserInfoService","filePath":null,"qualifiedName":"@proteinjs/user/UpdateUserInfoService","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/UpdateUserInfoService"}],"edges":[{"v":"@proteinjs/user-server/DbSessionStore","w":"express-session/Store","value":"extends class"},{"v":"@proteinjs/user-server/SocketIOSessionWatcher","w":"@proteinjs/db/TableWatcher","value":"implements interface"},{"v":"@proteinjs/user-server/userCache","w":"@proteinjs/server-api/SessionDataCache","value":"has type"},{"v":"@proteinjs/user-server/BackfillUserRolesArray","w":"@proteinjs/db/SourceRecordLoader","value":"implements interface"},{"v":"@proteinjs/user-server/devLogin","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/executePasswordReset","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/initiatePasswordReset","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/login","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/logout","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/validateResetPasswordToken","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/AccessInvite","w":"@proteinjs/user/AccessInviteService","value":"implements interface"},{"v":"@proteinjs/user-server/Roles","w":"@proteinjs/user/RolesService","value":"implements interface"},{"v":"@proteinjs/user-server/DefaultInviteConfigFactory","w":"@proteinjs/reflection/Loadable","value":"extends interface"},{"v":"@proteinjs/user-server/Signup","w":"@proteinjs/user/SignupService","value":"implements interface"},{"v":"@proteinjs/user-server/UpdateUserInfo","w":"@proteinjs/user/UpdateUserInfoService","value":"implements interface"}]}';
|
|
14
|
+
'{"options":{"directed":true,"multigraph":false,"compound":false},"nodes":[{"v":"@proteinjs/user-server/DbSessionStore","value":{"packageName":"@proteinjs/user-server","name":"DbSessionStore","filePath":"/home/runner/work/user/user/packages/server/src/authentication/DbSessionStore.ts","qualifiedName":"@proteinjs/user-server/DbSessionStore","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"TWELVE_HOURS","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"TOUCH_INTERVAL","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"logger","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"lastTouchMs","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private"},{"name":"get","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"set","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"touch","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"destroy","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"isTransactionAbort","returnType":{"packageName":"","name":"boolean","filePath":null,"qualifiedName":"/boolean","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private","parameters":[{"name":"error","type":{"packageName":"","name":"any","filePath":null,"qualifiedName":"/any","typeParameters":null,"directParents":null}}]},{"name":"insertOrUpdate","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"sessionId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"session","type":{"packageName":"","name":"Express.SessionData","filePath":null,"qualifiedName":"/Express.SessionData","typeParameters":null,"directParents":null}},{"name":"cb","type":{"packageName":"","name":"(error?: any) => void","filePath":null,"qualifiedName":"/(error?: any) => void","typeParameters":null,"directParents":null}}]},{"name":"sweep","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[]}],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[{"packageName":"express-session","name":"Store","filePath":null,"qualifiedName":"express-session/Store","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[],"typeParameters":[],"directParentInterfaces":[],"directParentClasses":[]}],"sourceType":2}},{"v":"express-session/Store"},{"v":"@proteinjs/user-server/SocketIOSessionWatcher","value":{"packageName":"@proteinjs/user-server","name":"SocketIOSessionWatcher","filePath":"/home/runner/work/user/user/packages/server/src/authentication/SocketIOSessionWatcher.ts","qualifiedName":"@proteinjs/user-server/SocketIOSessionWatcher","isAbstract":false,"isStatic":false,"visibility":"public","properties":[],"methods":[{"name":"name","returnType":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"table","returnType":{"packageName":"","name":"Table<Session>","filePath":null,"qualifiedName":"/Table<Session>","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"afterDelete","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"recordDeleteCount","type":{"packageName":"","name":"number","filePath":null,"qualifiedName":"/number","typeParameters":null,"directParents":null}},{"name":"deletedRecords","type":{"packageName":"","name":"T[]","filePath":null,"qualifiedName":"/T[]","typeParameters":null,"directParents":null}},{"name":"initialQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null}},{"name":"deleteQb","type":{"packageName":"","name":"QueryBuilder<T>","filePath":null,"qualifiedName":"/QueryBuilder<T>","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/db","name":"TableWatcher","filePath":null,"qualifiedName":"@proteinjs/db/TableWatcher","properties":[],"methods":[],"typeParameters":["@proteinjs/user/Session"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/db/TableWatcher"},{"v":"@proteinjs/user-server/userCache","value":{"packageName":"@proteinjs/user-server","name":"userCache","filePath":"/home/runner/work/user/user/packages/server/src/authorization/userCache.ts","qualifiedName":"@proteinjs/user-server/userCache","type":{"packageName":"","name":"SessionDataCache<User>","filePath":null,"qualifiedName":"/SessionDataCache<User>","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"SessionDataCache","filePath":null,"qualifiedName":"@proteinjs/server-api/SessionDataCache","typeParameters":["@proteinjs/user/User"],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/SessionDataCache"},{"v":"@proteinjs/user-server/BackfillUserRolesArray","value":{"packageName":"@proteinjs/user-server","name":"BackfillUserRolesArray","filePath":"/home/runner/work/user/user/packages/server/src/migrations/BackfillUserRolesArray.ts","qualifiedName":"@proteinjs/user-server/BackfillUserRolesArray","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"table","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"},{"name":"record","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/db","name":"SourceRecordLoader","filePath":null,"qualifiedName":"@proteinjs/db/SourceRecordLoader","properties":[],"methods":[],"typeParameters":["@proteinjs/db/Migration"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/db/SourceRecordLoader"},{"v":"@proteinjs/user-server/avatar","value":{"packageName":"@proteinjs/user-server","name":"avatar","filePath":"/home/runner/work/user/user/packages/server/src/routes/avatar.ts","qualifiedName":"@proteinjs/user-server/avatar","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/server-api/Route"},{"v":"@proteinjs/user-server/devLogin","value":{"packageName":"@proteinjs/user-server","name":"devLogin","filePath":"/home/runner/work/user/user/packages/server/src/routes/devLogin.ts","qualifiedName":"@proteinjs/user-server/devLogin","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/executePasswordReset","value":{"packageName":"@proteinjs/user-server","name":"executePasswordReset","filePath":"/home/runner/work/user/user/packages/server/src/routes/executePasswordReset.ts","qualifiedName":"@proteinjs/user-server/executePasswordReset","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/initiatePasswordReset","value":{"packageName":"@proteinjs/user-server","name":"initiatePasswordReset","filePath":"/home/runner/work/user/user/packages/server/src/routes/initiatePasswordReset.ts","qualifiedName":"@proteinjs/user-server/initiatePasswordReset","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/login","value":{"packageName":"@proteinjs/user-server","name":"login","filePath":"/home/runner/work/user/user/packages/server/src/routes/login.ts","qualifiedName":"@proteinjs/user-server/login","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/logout","value":{"packageName":"@proteinjs/user-server","name":"logout","filePath":"/home/runner/work/user/user/packages/server/src/routes/logout.ts","qualifiedName":"@proteinjs/user-server/logout","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/validateResetPasswordToken","value":{"packageName":"@proteinjs/user-server","name":"validateResetPasswordToken","filePath":"/home/runner/work/user/user/packages/server/src/routes/validateResetPasswordToken.ts","qualifiedName":"@proteinjs/user-server/validateResetPasswordToken","type":{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":[{"packageName":"@proteinjs/server-api","name":"Route","filePath":null,"qualifiedName":"@proteinjs/server-api/Route","typeParameters":[],"directParents":null}]},"isExported":true,"isConst":true,"sourceType":0}},{"v":"@proteinjs/user-server/AccessInvite","value":{"packageName":"@proteinjs/user-server","name":"AccessInvite","filePath":"/home/runner/work/user/user/packages/server/src/services/AccessInvite.ts","qualifiedName":"@proteinjs/user-server/AccessInvite","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"serviceMetadata","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"createAccessInvite","returnType":{"packageName":"","name":"Promise<CreateAccessInviteResponse>","filePath":null,"qualifiedName":"/Promise<CreateAccessInviteResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"params","type":{"packageName":"@proteinjs/user","name":"CreateAccessInviteParams","filePath":null,"qualifiedName":"@proteinjs/user/CreateAccessInviteParams","typeParameters":null,"directParents":null}}]},{"name":"acceptAccessInvite","returnType":{"packageName":"","name":"Promise<T | undefined>","filePath":null,"qualifiedName":"/Promise<T | undefined>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"token","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]}],"typeParameters":["/T extends Record"],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"AccessInviteService","filePath":null,"qualifiedName":"@proteinjs/user/AccessInviteService","properties":[],"methods":[],"typeParameters":["/T"],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/AccessInviteService"},{"v":"@proteinjs/user-server/Roles","value":{"packageName":"@proteinjs/user-server","name":"Roles","filePath":"/home/runner/work/user/user/packages/server/src/services/Roles.ts","qualifiedName":"@proteinjs/user-server/Roles","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"serviceMetadata","type":{"packageName":"","name":"Service[\'serviceMetadata\']","filePath":null,"qualifiedName":"/Service[\'serviceMetadata\']","typeParameters":null,"directParents":null},"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"grantRole","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"userId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"role","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"revokeRole","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"userId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"role","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"changeRole","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"userId","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"role","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"action","type":{"packageName":"","name":"\'grant\' | \'revoke\'","filePath":null,"qualifiedName":"/\'grant\' | \'revoke\'","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"RolesService","filePath":null,"qualifiedName":"@proteinjs/user/RolesService","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/RolesService"},{"v":"@proteinjs/user-server/DefaultInviteConfigFactory","value":{"packageName":"@proteinjs/user-server","name":"DefaultInviteConfigFactory","filePath":"/home/runner/work/user/user/packages/server/src/services/Signup.ts","qualifiedName":"@proteinjs/user-server/DefaultInviteConfigFactory","properties":[],"methods":[{"name":"getConfig","returnType":{"packageName":"@proteinjs/user-server","name":"InviteConfig","filePath":null,"qualifiedName":"@proteinjs/user-server/InviteConfig","typeParameters":null,"directParents":null},"isAsync":false,"isOptional":false,"isAbstract":true,"isStatic":false,"visibility":"public","parameters":[]}],"typeParameters":[],"directParents":[{"packageName":"@proteinjs/reflection","name":"Loadable","filePath":null,"qualifiedName":"@proteinjs/reflection/Loadable","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"sourceType":3}},{"v":"@proteinjs/reflection/Loadable"},{"v":"@proteinjs/user-server/Signup","value":{"packageName":"@proteinjs/user-server","name":"Signup","filePath":"/home/runner/work/user/user/packages/server/src/services/Signup.ts","qualifiedName":"@proteinjs/user-server/Signup","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"serviceMetadata","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"createUser","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"user","type":{"packageName":"@proteinjs/user","name":"UserSignup","filePath":null,"qualifiedName":"@proteinjs/user/UserSignup","typeParameters":null,"directParents":null}},{"name":"token","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"sendInvite","returnType":{"packageName":"","name":"Promise<SendInviteResponse>","filePath":null,"qualifiedName":"/Promise<SendInviteResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"email","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"revokeInvite","returnType":{"packageName":"","name":"Promise<void>","filePath":null,"qualifiedName":"/Promise<void>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"email","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"initializeSignup","returnType":{"packageName":"","name":"Promise<InitializeSignupResponse>","filePath":null,"qualifiedName":"/Promise<InitializeSignupResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"inviteToken","type":{"packageName":"","name":"string | undefined","filePath":null,"qualifiedName":"/string | undefined","typeParameters":null,"directParents":null}}]},{"name":"createAccount","returnType":{"packageName":"","name":"Promise<\'created\' | \'exists\'>","filePath":null,"qualifiedName":"/Promise<\'created\' | \'exists\'>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"account","type":{"packageName":"@proteinjs/user-server","name":"{\\n name: string;\\n email: string;\\n password: string;\\n emailVerified: boolean;\\n invitedBy: User[\'invitedBy\'];\\n }","filePath":null,"qualifiedName":"@proteinjs/user-server/{\\n name: string;\\n email: string;\\n password: string;\\n emailVerified: boolean;\\n invitedBy: User[\'invitedBy\'];\\n }","typeParameters":null,"directParents":null}}]},{"name":"lookupInvite","returnType":{"packageName":"","name":"Promise<InviteLookup>","filePath":null,"qualifiedName":"/Promise<InviteLookup>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"token","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"SignupService","filePath":null,"qualifiedName":"@proteinjs/user/SignupService","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/SignupService"},{"v":"@proteinjs/user-server/UpdateUserInfo","value":{"packageName":"@proteinjs/user-server","name":"UpdateUserInfo","filePath":"/home/runner/work/user/user/packages/server/src/services/UpdateUserInfo.ts","qualifiedName":"@proteinjs/user-server/UpdateUserInfo","isAbstract":false,"isStatic":false,"visibility":"public","properties":[{"name":"AVATAR_SIZE","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"AVATAR_JPEG_QUALITY","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"MAX_AVATAR_PHOTO_BYTES","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"ACCEPTED_AVATAR_MIME_TYPES","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"MAX_AVATAR_EMOJI_LENGTH","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"EMOJI_PATTERN","type":null,"isOptional":false,"isAbstract":false,"isStatic":true,"visibility":"private"},{"name":"serviceMetadata","type":null,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public"}],"methods":[{"name":"updateName","returnType":{"packageName":"","name":"Promise<UpdatedUser>","filePath":null,"qualifiedName":"/Promise<UpdatedUser>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"name","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"updatePassword","returnType":{"packageName":"","name":"Promise<UpdatePasswordResponse>","filePath":null,"qualifiedName":"/Promise<UpdatePasswordResponse>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"currentPassword","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"newPassword","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"updateAvatarPhoto","returnType":{"packageName":"","name":"Promise<UpdatedUser>","filePath":null,"qualifiedName":"/Promise<UpdatedUser>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"fileData","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}},{"name":"mimeType","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"updateAvatarEmoji","returnType":{"packageName":"","name":"Promise<UpdatedUser>","filePath":null,"qualifiedName":"/Promise<UpdatedUser>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[{"name":"emoji","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"clearAvatar","returnType":{"packageName":"","name":"Promise<UpdatedUser>","filePath":null,"qualifiedName":"/Promise<UpdatedUser>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"public","parameters":[]},{"name":"setAvatar","returnType":{"packageName":"","name":"Promise<UpdatedUser>","filePath":null,"qualifiedName":"/Promise<UpdatedUser>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"avatar","type":{"packageName":"@proteinjs/user-server","name":"{ avatarEmoji: string | null; avatarFileId: string | null }","filePath":null,"qualifiedName":"@proteinjs/user-server/{ avatarEmoji: string | null; avatarFileId: string | null }","typeParameters":null,"directParents":null}}]},{"name":"saveUserInfo","returnType":{"packageName":"","name":"Promise<UpdatedUser>","filePath":null,"qualifiedName":"/Promise<UpdatedUser>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"changes","type":{"packageName":"","name":"Partial<User>","filePath":null,"qualifiedName":"/Partial<User>","typeParameters":null,"directParents":null}}]},{"name":"toAvatarJpeg","returnType":{"packageName":"","name":"Promise<Buffer>","filePath":null,"qualifiedName":"/Promise<Buffer>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"imageBytes","type":{"packageName":"","name":"Buffer","filePath":null,"qualifiedName":"/Buffer","typeParameters":null,"directParents":null}},{"name":"mimeType","type":{"packageName":"","name":"string","filePath":null,"qualifiedName":"/string","typeParameters":null,"directParents":null}}]},{"name":"decodeHeic","returnType":{"packageName":"","name":"Promise<sharp.Sharp>","filePath":null,"qualifiedName":"/Promise<sharp.Sharp>","typeParameters":null,"directParents":null},"isAsync":true,"isOptional":false,"isAbstract":false,"isStatic":false,"visibility":"private","parameters":[{"name":"imageBytes","type":{"packageName":"","name":"Buffer","filePath":null,"qualifiedName":"/Buffer","typeParameters":null,"directParents":null}}]}],"typeParameters":[],"directParentInterfaces":[{"packageName":"@proteinjs/user","name":"UpdateUserInfoService","filePath":null,"qualifiedName":"@proteinjs/user/UpdateUserInfoService","properties":[],"methods":[],"typeParameters":[],"directParents":[]}],"directParentClasses":[],"sourceType":2}},{"v":"@proteinjs/user/UpdateUserInfoService"}],"edges":[{"v":"@proteinjs/user-server/DbSessionStore","w":"express-session/Store","value":"extends class"},{"v":"@proteinjs/user-server/SocketIOSessionWatcher","w":"@proteinjs/db/TableWatcher","value":"implements interface"},{"v":"@proteinjs/user-server/userCache","w":"@proteinjs/server-api/SessionDataCache","value":"has type"},{"v":"@proteinjs/user-server/BackfillUserRolesArray","w":"@proteinjs/db/SourceRecordLoader","value":"implements interface"},{"v":"@proteinjs/user-server/avatar","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/devLogin","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/executePasswordReset","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/initiatePasswordReset","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/login","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/logout","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/validateResetPasswordToken","w":"@proteinjs/server-api/Route","value":"has type"},{"v":"@proteinjs/user-server/AccessInvite","w":"@proteinjs/user/AccessInviteService","value":"implements interface"},{"v":"@proteinjs/user-server/Roles","w":"@proteinjs/user/RolesService","value":"implements interface"},{"v":"@proteinjs/user-server/DefaultInviteConfigFactory","w":"@proteinjs/reflection/Loadable","value":"extends interface"},{"v":"@proteinjs/user-server/Signup","w":"@proteinjs/user/SignupService","value":"implements interface"},{"v":"@proteinjs/user-server/UpdateUserInfo","w":"@proteinjs/user/UpdateUserInfoService","value":"implements interface"}]}';
|
|
18
15
|
|
|
19
16
|
/** Generate Source Links */
|
|
20
17
|
|
|
@@ -22,6 +19,7 @@ import { DbSessionStore } from '../src/authentication/DbSessionStore';
|
|
|
22
19
|
import { SocketIOSessionWatcher } from '../src/authentication/SocketIOSessionWatcher';
|
|
23
20
|
import { userCache } from '../src/authorization/userCache';
|
|
24
21
|
import { BackfillUserRolesArray } from '../src/migrations/BackfillUserRolesArray';
|
|
22
|
+
import { avatar } from '../src/routes/avatar';
|
|
25
23
|
import { devLogin } from '../src/routes/devLogin';
|
|
26
24
|
import { executePasswordReset } from '../src/routes/executePasswordReset';
|
|
27
25
|
import { initiatePasswordReset } from '../src/routes/initiatePasswordReset';
|
|
@@ -38,6 +36,7 @@ const sourceLinks = {
|
|
|
38
36
|
'@proteinjs/user-server/SocketIOSessionWatcher': SocketIOSessionWatcher,
|
|
39
37
|
'@proteinjs/user-server/userCache': userCache,
|
|
40
38
|
'@proteinjs/user-server/BackfillUserRolesArray': BackfillUserRolesArray,
|
|
39
|
+
'@proteinjs/user-server/avatar': avatar,
|
|
41
40
|
'@proteinjs/user-server/devLogin': devLogin,
|
|
42
41
|
'@proteinjs/user-server/executePasswordReset': executePasswordReset,
|
|
43
42
|
'@proteinjs/user-server/initiatePasswordReset': initiatePasswordReset,
|
package/jest.config.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
roots: ['<rootDir>/test'],
|
|
3
|
-
setupFiles: ['<rootDir>/test/setup.js'],
|
|
4
3
|
transform: {
|
|
5
4
|
'^.+\\.tsx?$': 'ts-jest',
|
|
6
5
|
},
|
|
7
6
|
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
|
8
7
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
9
8
|
testEnvironment: 'node',
|
|
9
|
+
testTimeout: 60000,
|
|
10
|
+
setupFiles: ['./test/setup'],
|
|
11
|
+
globalSetup: './test/emulatorLock.globalSetup.js',
|
|
12
|
+
globalTeardown: './test/emulatorLock.globalTeardown.js',
|
|
10
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteinjs/user-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "User server components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,18 +23,21 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@proteinjs/db": "^1.28.1",
|
|
26
|
+
"@proteinjs/db-file": "^1.4.5",
|
|
26
27
|
"@proteinjs/email-server": "^1.3.0",
|
|
27
28
|
"@proteinjs/logger": "^1.0.21",
|
|
28
29
|
"@proteinjs/reflection": "^1.1.12",
|
|
29
30
|
"@proteinjs/server": "^3.2.1",
|
|
30
31
|
"@proteinjs/server-api": "^3.0.11",
|
|
31
|
-
"@proteinjs/user": "^1.
|
|
32
|
+
"@proteinjs/user": "^1.8.0",
|
|
32
33
|
"crypto-js": "4.0.0",
|
|
33
34
|
"express-session": "1.17.1",
|
|
34
|
-
"
|
|
35
|
+
"heic-decode": "^2.1.0",
|
|
36
|
+
"moment": "2.29.4",
|
|
37
|
+
"sharp": "0.33.4"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
|
-
"@proteinjs/db-driver-spanner": "^1.
|
|
40
|
+
"@proteinjs/db-driver-spanner": "^1.16.0",
|
|
38
41
|
"@proteinjs/reflection-build": "^1.4.10",
|
|
39
42
|
"@types/crypto-js": "4.0.1",
|
|
40
43
|
"@types/express-session": "1.17.0",
|
|
@@ -51,5 +54,5 @@
|
|
|
51
54
|
},
|
|
52
55
|
"main": "./dist/generated/index.js",
|
|
53
56
|
"types": "./dist/generated/index.d.ts",
|
|
54
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "b79af3a0b3d0aa53bf5fbb3bf42f338daa706ae5"
|
|
55
58
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
import { SessionDataCache } from '@proteinjs/server-api';
|
|
3
3
|
import { getDbAsSystem } from '@proteinjs/db';
|
|
4
|
+
import { Logger } from '@proteinjs/logger';
|
|
4
5
|
import { User, tables, guestUser, USER_SESSION_CACHE_KEY } from '@proteinjs/user';
|
|
5
6
|
import { DefaultAdminCredentials } from '../authentication/DefaultAdminCredentials';
|
|
6
7
|
|
|
8
|
+
const logger = new Logger({ name: 'userCache' });
|
|
9
|
+
|
|
7
10
|
export const userCache: SessionDataCache<User> = {
|
|
8
11
|
key: USER_SESSION_CACHE_KEY,
|
|
9
12
|
create: async (sessionId: string, userEmail: string): Promise<User> => {
|
|
@@ -23,8 +26,20 @@ export const userCache: SessionDataCache<User> = {
|
|
|
23
26
|
};
|
|
24
27
|
user = adminUser;
|
|
25
28
|
} else {
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
const accountUser = await getDbAsSystem().get(tables.User, { email: userEmail.toLowerCase() });
|
|
30
|
+
if (accountUser) {
|
|
31
|
+
delete (accountUser as any)['password'];
|
|
32
|
+
user = accountUser;
|
|
33
|
+
} else {
|
|
34
|
+
// A session can outlive its account (row deleted, or a dev auto-login for a never-created
|
|
35
|
+
// email). Resolve it to the unauthenticated guest session — the client sees no
|
|
36
|
+
// authenticated user and re-logs. Throwing here escapes the per-request session-cache
|
|
37
|
+
// build as an unhandled rejection and downs the process.
|
|
38
|
+
logger.warn({
|
|
39
|
+
message: `Session references an account that does not exist; resolving as unauthenticated`,
|
|
40
|
+
obj: { sessionId, userEmail },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
28
43
|
}
|
|
29
44
|
}
|
|
30
45
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient types for `heic-decode` (ships no TypeScript types): WASM libheif + libde265, so it
|
|
3
|
+
* decodes HEVC-encoded HEIC — which sharp's prebuilt libvips cannot — on any platform.
|
|
4
|
+
*/
|
|
5
|
+
declare module 'heic-decode' {
|
|
6
|
+
function decode(input: { buffer: Buffer | Uint8Array }): Promise<{
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
/** RGBA pixel data, `width * height * 4` bytes. */
|
|
10
|
+
data: Uint8ClampedArray;
|
|
11
|
+
}>;
|
|
12
|
+
export = decode;
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Route } from '@proteinjs/server-api';
|
|
2
|
+
import { getDbAsSystem } from '@proteinjs/db';
|
|
3
|
+
import { tables, UserAuth, getScopedDbAsSystem } from '@proteinjs/user';
|
|
4
|
+
import { FileStorage, File, tables as fileTables } from '@proteinjs/db-file';
|
|
5
|
+
import { Logger } from '@proteinjs/logger';
|
|
6
|
+
|
|
7
|
+
const logger = new Logger({ name: 'avatarRoute' });
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Shared avatar serving: `GET /avatar/:userId?v=<avatarFileId>` — any logged-in user can render
|
|
11
|
+
* any user's avatar photo (attribution in shared spaces). File rows are ScopedRecords and
|
|
12
|
+
* `GET /file/:id` reads through the OWNER's scope, so other users cannot fetch an avatar through
|
|
13
|
+
* it; this route is the deliberate, narrow door instead.
|
|
14
|
+
*
|
|
15
|
+
* System-read surface is exactly: the user row (for `avatarFileId`), that one file row (for the
|
|
16
|
+
* Content-Type), and its bytes. The file id is never taken from the request — only the id stored
|
|
17
|
+
* on the user row is served, so this can never read arbitrary files. `:userId` is a keyed lookup
|
|
18
|
+
* (no path/filesystem interpretation).
|
|
19
|
+
*
|
|
20
|
+
* Cache contract (mirrored by `avatarRoute` in @proteinjs/user routes.ts): the path is stable per
|
|
21
|
+
* user, so responses carry `max-age=86400, immutable`; clients bust with `?v=<avatarFileId>`,
|
|
22
|
+
* which changes on every photo update. Users with an emoji avatar or no avatar answer 404 — the
|
|
23
|
+
* client renders emoji/initials from the user record; this route serves photos only.
|
|
24
|
+
*/
|
|
25
|
+
export const avatar: Route = {
|
|
26
|
+
path: '/avatar/:userId',
|
|
27
|
+
method: 'get',
|
|
28
|
+
onRequest: async (request, response): Promise<void> => {
|
|
29
|
+
if (!UserAuth.isLoggedIn()) {
|
|
30
|
+
response.status(401).send('User not logged in');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const userId = request.params.userId;
|
|
36
|
+
const user = await getDbAsSystem().get(tables.User, { id: userId });
|
|
37
|
+
if (!user || !user.avatarFileId) {
|
|
38
|
+
response.status(404).send('No avatar photo');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const file = await getScopedDbAsSystem<File>().get(fileTables.File, { id: user.avatarFileId });
|
|
43
|
+
if (!file) {
|
|
44
|
+
response.status(404).send('No avatar photo');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const fileDataBase64 = await new FileStorage().getFileData(file.id);
|
|
49
|
+
response.setHeader('Content-Type', file.type);
|
|
50
|
+
response.setHeader('Cache-Control', 'public, max-age=86400, immutable');
|
|
51
|
+
response.send(Buffer.from(fileDataBase64, 'base64'));
|
|
52
|
+
} catch (error: any) {
|
|
53
|
+
logger.error({ message: 'Failed to serve avatar', error });
|
|
54
|
+
response.status(500).send('Internal Server Error');
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
};
|