@proteinjs/user-server 1.12.0 → 1.14.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 +22 -0
- package/dist/src/authorization/UserActivityStamp.d.ts +32 -0
- package/dist/src/authorization/UserActivityStamp.d.ts.map +1 -0
- package/dist/src/authorization/UserActivityStamp.js +126 -0
- package/dist/src/authorization/UserActivityStamp.js.map +1 -0
- package/dist/src/authorization/userCache.d.ts.map +1 -1
- package/dist/src/authorization/userCache.js +9 -0
- package/dist/src/authorization/userCache.js.map +1 -1
- package/dist/test/SharedScopeEncryption.integration.test.d.ts +2 -0
- package/dist/test/SharedScopeEncryption.integration.test.d.ts.map +1 -0
- package/dist/test/SharedScopeEncryption.integration.test.js +571 -0
- package/dist/test/SharedScopeEncryption.integration.test.js.map +1 -0
- package/dist/test/UserActivityStamp.integration.test.d.ts +2 -0
- package/dist/test/UserActivityStamp.integration.test.d.ts.map +1 -0
- package/dist/test/UserActivityStamp.integration.test.js +255 -0
- package/dist/test/UserActivityStamp.integration.test.js.map +1 -0
- package/package.json +4 -4
- package/src/authorization/UserActivityStamp.ts +66 -0
- package/src/authorization/userCache.ts +9 -0
- package/test/SharedScopeEncryption.integration.test.ts +363 -0
- package/test/UserActivityStamp.integration.test.ts +122 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.14.0](https://github.com/proteinjs/user/compare/@proteinjs/user-server@1.13.0...@proteinjs/user-server@1.14.0) (2026-08-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* shared-scope encryption key owners — the encryption-sharing MVP (TRUST_AND_COMPLIANCE §4/§4.4): SharedRecord rows key by the SCOPE-ROOT OWNER, and a share grant extends decrypt + blind-index search to the recipient ([6f5d0db](https://github.com/proteinjs/user/commit/6f5d0dbd1e56d2b0bf0236b138af50164b244b3c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [1.13.0](https://github.com/proteinjs/user/compare/@proteinjs/user-server@1.12.0...@proteinjs/user-server@1.13.0) (2026-08-31)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* last activity = HUMAN PRESENCE, with one owner — the user_activity stamp (founder finding 2026-08-31: a user's routine runs read as their activity on the admin usage surface; 'last activity' must mean a person was HERE, and machinery acting on their behalf must be structurally unable to move it). New scoped table user_activity (one row per user, scope-unique index user_activity_scope_unique; reads ride the 'users' people-management door, writes are system-only so record surfaces cannot fabricate presence; no retain policy — presence purges with the account) + UserActivityStamp in user-server, invoked from userCache.create: the once-per-session-cookie-request session-cache build IS the interactive-transport seam, so background/seeded contexts (runInUserScope seeds session data directly and never passes through) can never stamp, categorically — no per-feature carve-outs. Machine accounts (isLoadedFromSource, e.g. the error bridge's per-poll login) are refused by the stamp even though their requests ride real sessions. Write behavior mirrors DbSessionStore.touch: throttled per user (5 min), fail-open (the promise never rejects; a request never waits on its own stamp), first-stamp races resolved by the unique index. Consumed by thought-server's usage report (lastActiveDay cutover rides that landing). Bite checks ran: the userCache call removed reddens the human-stamp outcome test; the machine refusal dropped reddens the machine test — both restored green. New suite UserActivityStamp.integration.test.ts (5): stamp lands through the real seam, one-row-per-user advance, machine refusal, throttle, missing-account guest no-op. Estate green on a dedicated emulator: user 45, user-server 122 (117 pre-existing + 5 new), auth 20, ui 50. ([bc39960](https://github.com/proteinjs/user/commit/bc39960204df9ae535a3c44646a16da05e622247))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
# [1.12.0](https://github.com/proteinjs/user/compare/@proteinjs/user-server@1.11.1...@proteinjs/user-server@1.12.0) (2026-08-29)
|
|
7
29
|
|
|
8
30
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type User } from '@proteinjs/user';
|
|
2
|
+
/**
|
|
3
|
+
* Writes the LAST-ACTIVITY presence stamp (`user_activity`, one row per user — see
|
|
4
|
+
* UserActivityTable's contract): "this human made an interactive request just now".
|
|
5
|
+
*
|
|
6
|
+
* The TRANSPORT keying lives at the call site — userCache.create runs once per session-cookie
|
|
7
|
+
* request (wrapRoute's session-cache build) and only there, so seeded/background contexts
|
|
8
|
+
* (runInUserScope sets session data directly) structurally never reach this class. What this
|
|
9
|
+
* class owns is the ACCOUNT predicate: machine accounts (`isLoadedFromSource`) are refused —
|
|
10
|
+
* their requests do arrive over real sessions (e.g. the error bridge's polling), but a machine
|
|
11
|
+
* logging in is not a person being present.
|
|
12
|
+
*
|
|
13
|
+
* Write behavior mirrors DbSessionStore's touch: throttled per user (a presence fact consumed at
|
|
14
|
+
* day grain needs no finer cadence, and an unthrottled stamp would put a write on EVERY request),
|
|
15
|
+
* fail-open (a lost stamp is a few minutes of staleness, never a failed request — the returned
|
|
16
|
+
* promise NEVER rejects), and race-tolerant (concurrent first stamps contend on the scope-unique
|
|
17
|
+
* index; the loser's error is swallowed as debug).
|
|
18
|
+
*/
|
|
19
|
+
export declare class UserActivityStamp {
|
|
20
|
+
/** Stamp at most this often per user — same cadence class as DbSessionStore.TOUCH_INTERVAL. */
|
|
21
|
+
private static readonly STAMP_INTERVAL_MS;
|
|
22
|
+
/** Process-wide: userCache is a plain object, so throttle state can't live per-instance. */
|
|
23
|
+
private static lastStampMs;
|
|
24
|
+
private logger;
|
|
25
|
+
/**
|
|
26
|
+
* Record that `user` is present on an interactive request. Fire-and-forget safe: errors are
|
|
27
|
+
* handled (and logged) here, so callers may `void` the returned promise.
|
|
28
|
+
*/
|
|
29
|
+
recordInteractiveRequest(user: User): Promise<void>;
|
|
30
|
+
private upsert;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=UserActivityStamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserActivityStamp.d.ts","sourceRoot":"","sources":["../../../src/authorization/UserActivityStamp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,IAAI,EAAqB,MAAM,iBAAiB,CAAC;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,iBAAiB;IAC5B,+FAA+F;IAC/F,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;IAC1D,4FAA4F;IAC5F,OAAO,CAAC,MAAM,CAAC,WAAW,CAA6B;IAEvD,OAAO,CAAC,MAAM,CAA+C;IAE7D;;;OAGG;IACH,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAsBrC,MAAM;CASrB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
exports.UserActivityStamp = void 0;
|
|
43
|
+
var moment_1 = __importDefault(require("moment"));
|
|
44
|
+
var db_1 = require("@proteinjs/db");
|
|
45
|
+
var logger_1 = require("@proteinjs/logger");
|
|
46
|
+
var user_1 = require("@proteinjs/user");
|
|
47
|
+
/**
|
|
48
|
+
* Writes the LAST-ACTIVITY presence stamp (`user_activity`, one row per user — see
|
|
49
|
+
* UserActivityTable's contract): "this human made an interactive request just now".
|
|
50
|
+
*
|
|
51
|
+
* The TRANSPORT keying lives at the call site — userCache.create runs once per session-cookie
|
|
52
|
+
* request (wrapRoute's session-cache build) and only there, so seeded/background contexts
|
|
53
|
+
* (runInUserScope sets session data directly) structurally never reach this class. What this
|
|
54
|
+
* class owns is the ACCOUNT predicate: machine accounts (`isLoadedFromSource`) are refused —
|
|
55
|
+
* their requests do arrive over real sessions (e.g. the error bridge's polling), but a machine
|
|
56
|
+
* logging in is not a person being present.
|
|
57
|
+
*
|
|
58
|
+
* Write behavior mirrors DbSessionStore's touch: throttled per user (a presence fact consumed at
|
|
59
|
+
* day grain needs no finer cadence, and an unthrottled stamp would put a write on EVERY request),
|
|
60
|
+
* fail-open (a lost stamp is a few minutes of staleness, never a failed request — the returned
|
|
61
|
+
* promise NEVER rejects), and race-tolerant (concurrent first stamps contend on the scope-unique
|
|
62
|
+
* index; the loser's error is swallowed as debug).
|
|
63
|
+
*/
|
|
64
|
+
var UserActivityStamp = /** @class */ (function () {
|
|
65
|
+
function UserActivityStamp() {
|
|
66
|
+
this.logger = new logger_1.Logger({ name: this.constructor.name });
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Record that `user` is present on an interactive request. Fire-and-forget safe: errors are
|
|
70
|
+
* handled (and logged) here, so callers may `void` the returned promise.
|
|
71
|
+
*/
|
|
72
|
+
UserActivityStamp.prototype.recordInteractiveRequest = function (user) {
|
|
73
|
+
var _this = this;
|
|
74
|
+
var _a;
|
|
75
|
+
if (!user.id || user.isLoadedFromSource === true) {
|
|
76
|
+
return Promise.resolve();
|
|
77
|
+
}
|
|
78
|
+
var last = (_a = UserActivityStamp.lastStampMs.get(user.id)) !== null && _a !== void 0 ? _a : 0;
|
|
79
|
+
var now = Date.now();
|
|
80
|
+
if (now - last < UserActivityStamp.STAMP_INTERVAL_MS) {
|
|
81
|
+
return Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
UserActivityStamp.lastStampMs.set(user.id, now);
|
|
84
|
+
if (UserActivityStamp.lastStampMs.size > 10000) {
|
|
85
|
+
UserActivityStamp.lastStampMs.clear(); // bounded memory; worst case is one extra stamp per user
|
|
86
|
+
}
|
|
87
|
+
return this.upsert(user.id).catch(function (error) {
|
|
88
|
+
// Contention (a concurrent request stamped first, racing the scope-unique index) and real
|
|
89
|
+
// failures land here alike; both are harmless to the request. Un-throttle so the next
|
|
90
|
+
// request retries instead of waiting out a full interval on a stamp that never landed.
|
|
91
|
+
UserActivityStamp.lastStampMs.delete(user.id);
|
|
92
|
+
_this.logger.error({ message: 'Failed to write user activity stamp', error: error });
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
UserActivityStamp.prototype.upsert = function (userId) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
var db, existing;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
db = (0, db_1.getDbAsSystem)();
|
|
102
|
+
return [4 /*yield*/, db.get(user_1.tables.UserActivity, { scope: userId })];
|
|
103
|
+
case 1:
|
|
104
|
+
existing = _a.sent();
|
|
105
|
+
if (!existing) return [3 /*break*/, 3];
|
|
106
|
+
return [4 /*yield*/, db.update(user_1.tables.UserActivity, { id: existing.id, lastActiveAt: (0, moment_1.default)() })];
|
|
107
|
+
case 2:
|
|
108
|
+
_a.sent();
|
|
109
|
+
return [3 /*break*/, 5];
|
|
110
|
+
case 3: return [4 /*yield*/, db.insert(user_1.tables.UserActivity, { scope: userId, lastActiveAt: (0, moment_1.default)() })];
|
|
111
|
+
case 4:
|
|
112
|
+
_a.sent();
|
|
113
|
+
_a.label = 5;
|
|
114
|
+
case 5: return [2 /*return*/];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
/** Stamp at most this often per user — same cadence class as DbSessionStore.TOUCH_INTERVAL. */
|
|
120
|
+
UserActivityStamp.STAMP_INTERVAL_MS = 1000 * 60 * 5;
|
|
121
|
+
/** Process-wide: userCache is a plain object, so throttle state can't live per-instance. */
|
|
122
|
+
UserActivityStamp.lastStampMs = new Map();
|
|
123
|
+
return UserActivityStamp;
|
|
124
|
+
}());
|
|
125
|
+
exports.UserActivityStamp = UserActivityStamp;
|
|
126
|
+
//# sourceMappingURL=UserActivityStamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserActivityStamp.js","sourceRoot":"","sources":["../../../src/authorization/UserActivityStamp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,oCAA8C;AAC9C,4CAA2C;AAC3C,wCAAuE;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH;IAAA;QAMU,WAAM,GAAG,IAAI,eAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAqC/D,CAAC;IAnCC;;;OAGG;IACH,oDAAwB,GAAxB,UAAyB,IAAU;QAAnC,iBAoBC;;QAnBC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,EAAE;YAChD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SAC1B;QACD,IAAM,IAAI,GAAG,MAAA,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,mCAAI,CAAC,CAAC;QAC7D,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,GAAG,GAAG,IAAI,GAAG,iBAAiB,CAAC,iBAAiB,EAAE;YACpD,OAAO,OAAO,CAAC,OAAO,EAAE,CA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G,EAAE,GAAG,CAAC,AAAhB,CAAiB;IAC1D,4FAA4F;IAC7E,6BAAW,GAAG,IAAI,GAAG,EAAkB,AAA5B,CAA6B;IAuCzD,wBAAC;CAAA,AA3CD,IA2CC;AA3CY,8CAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userCache.d.ts","sourceRoot":"","sources":["../../../src/authorization/userCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,IAAI,EAA6C,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"userCache.d.ts","sourceRoot":"","sources":["../../../src/authorization/userCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,IAAI,EAA6C,MAAM,iBAAiB,CAAC;AAOlF,eAAO,MAAM,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAqD5C,CAAC"}
|
|
@@ -45,7 +45,9 @@ var db_1 = require("@proteinjs/db");
|
|
|
45
45
|
var logger_1 = require("@proteinjs/logger");
|
|
46
46
|
var user_1 = require("@proteinjs/user");
|
|
47
47
|
var DefaultAdminCredentials_1 = require("../authentication/DefaultAdminCredentials");
|
|
48
|
+
var UserActivityStamp_1 = require("./UserActivityStamp");
|
|
48
49
|
var logger = new logger_1.Logger({ name: 'userCache' });
|
|
50
|
+
var userActivityStamp = new UserActivityStamp_1.UserActivityStamp();
|
|
49
51
|
exports.userCache = {
|
|
50
52
|
key: user_1.USER_SESSION_CACHE_KEY,
|
|
51
53
|
create: function (sessionId, userEmail) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -84,6 +86,13 @@ exports.userCache = {
|
|
|
84
86
|
else if (accountUser) {
|
|
85
87
|
delete accountUser['password'];
|
|
86
88
|
user = accountUser;
|
|
89
|
+
// LAST ACTIVITY (human presence — UserActivityTable's contract): stamped HERE because
|
|
90
|
+
// this cache build runs exactly once per session-cookie request (wrapRoute), i.e. only
|
|
91
|
+
// for interactive transport. Background/seeded contexts (runInUserScope) set session
|
|
92
|
+
// data directly and never pass through, so machinery acting as the user structurally
|
|
93
|
+
// cannot stamp; the stamp itself refuses machine accounts. Fire-and-forget: the
|
|
94
|
+
// returned promise never rejects, and a request never waits on its own stamp.
|
|
95
|
+
void userActivityStamp.recordInteractiveRequest(user);
|
|
87
96
|
}
|
|
88
97
|
else {
|
|
89
98
|
// A session can outlive its account (row deleted, or a dev auto-login for a never-created
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userCache.js","sourceRoot":"","sources":["../../../src/authorization/userCache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA4B;AAE5B,oCAA8C;AAC9C,4CAA2C;AAC3C,wCAAkF;AAClF,qFAAoF;
|
|
1
|
+
{"version":3,"file":"userCache.js","sourceRoot":"","sources":["../../../src/authorization/userCache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA4B;AAE5B,oCAA8C;AAC9C,4CAA2C;AAC3C,wCAAkF;AAClF,qFAAoF;AACpF,yDAAwD;AAExD,IAAM,MAAM,GAAG,IAAI,eAAM,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;AACjD,IAAM,iBAAiB,GAAG,IAAI,qCAAiB,EAAE,CAAC;AAErC,QAAA,SAAS,GAA2B;IAC/C,GAAG,EAAE,6BAAsB;IAC3B,MAAM,EAAE,UAAO,SAAiB,EAAE,SAAiB;;;;;oBAC7C,IAAI,GAAG,gBAAS,CAAC;yBACjB,SAAS,EAAT,wBAAS;oBACL,gBAAgB,GAAG,iDAAuB,CAAC,cAAc,EAAE,CAAC;yBAC9D,CAAA,gBAAgB,IAAI,SAAS,IAAI,gBAAgB,CAAC,QAAQ,CAAA,EAA1D,wBAA0D;oBACtD,SAA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wBAIL,sBAAO,IAAI,EAAC;;;SACb;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharedScopeEncryption.integration.test.d.ts","sourceRoot":"","sources":["../../test/SharedScopeEncryption.integration.test.ts"],"names":[],"mappings":""}
|