@proteinjs/user 1.8.0 → 1.10.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/generated/index.d.ts.map +1 -1
  3. package/dist/generated/index.js +7 -1
  4. package/dist/generated/index.js.map +1 -1
  5. package/dist/index.d.ts +6 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/src/MachineAccount.d.ts +47 -0
  10. package/dist/src/MachineAccount.d.ts.map +1 -0
  11. package/dist/src/MachineAccount.js +100 -0
  12. package/dist/src/MachineAccount.js.map +1 -0
  13. package/dist/src/ScopedRecord.d.ts +8 -0
  14. package/dist/src/ScopedRecord.d.ts.map +1 -1
  15. package/dist/src/ScopedRecord.js +5 -1
  16. package/dist/src/ScopedRecord.js.map +1 -1
  17. package/dist/src/SharedRecord.d.ts +1 -6
  18. package/dist/src/SharedRecord.d.ts.map +1 -1
  19. package/dist/src/SharedRecord.js +18 -5
  20. package/dist/src/SharedRecord.js.map +1 -1
  21. package/dist/src/routes.d.ts.map +1 -1
  22. package/dist/src/routes.js +1 -0
  23. package/dist/src/routes.js.map +1 -1
  24. package/dist/src/services/AccountDeletionService.d.ts +27 -0
  25. package/dist/src/services/AccountDeletionService.d.ts.map +1 -0
  26. package/dist/src/services/AccountDeletionService.js +6 -0
  27. package/dist/src/services/AccountDeletionService.js.map +1 -0
  28. package/dist/src/services/MachineCredentialsService.d.ts +38 -0
  29. package/dist/src/services/MachineCredentialsService.d.ts.map +1 -0
  30. package/dist/src/services/MachineCredentialsService.js +6 -0
  31. package/dist/src/services/MachineCredentialsService.js.map +1 -0
  32. package/dist/src/services/SetUserStatusService.d.ts +15 -0
  33. package/dist/src/services/SetUserStatusService.d.ts.map +1 -0
  34. package/dist/src/services/SetUserStatusService.js +6 -0
  35. package/dist/src/services/SetUserStatusService.js.map +1 -0
  36. package/dist/src/services/SignupService.d.ts +8 -7
  37. package/dist/src/services/SignupService.d.ts.map +1 -1
  38. package/dist/src/tables/AccountDeletionTable.d.ts +85 -0
  39. package/dist/src/tables/AccountDeletionTable.d.ts.map +1 -0
  40. package/dist/src/tables/AccountDeletionTable.js +62 -0
  41. package/dist/src/tables/AccountDeletionTable.js.map +1 -0
  42. package/dist/src/tables/SessionTable.d.ts +1 -1
  43. package/dist/src/tables/UserStatusEventTable.d.ts +30 -0
  44. package/dist/src/tables/UserStatusEventTable.d.ts.map +1 -0
  45. package/dist/src/tables/UserStatusEventTable.js +43 -0
  46. package/dist/src/tables/UserStatusEventTable.js.map +1 -0
  47. package/dist/src/tables/UserTable.d.ts +36 -2
  48. package/dist/src/tables/UserTable.d.ts.map +1 -1
  49. package/dist/src/tables/UserTable.js +73 -4
  50. package/dist/src/tables/UserTable.js.map +1 -1
  51. package/dist/src/tables/tables.d.ts +4 -0
  52. package/dist/src/tables/tables.d.ts.map +1 -1
  53. package/dist/src/tables/tables.js +4 -0
  54. package/dist/src/tables/tables.js.map +1 -1
  55. package/dist/test/SharedRecordDuplicateModuleState.test.d.ts +18 -0
  56. package/dist/test/SharedRecordDuplicateModuleState.test.d.ts.map +1 -0
  57. package/dist/test/SharedRecordDuplicateModuleState.test.js +50 -0
  58. package/dist/test/SharedRecordDuplicateModuleState.test.js.map +1 -0
  59. package/dist/test/tablesAuth.test.js +20 -4
  60. package/dist/test/tablesAuth.test.js.map +1 -1
  61. package/generated/index.ts +7 -1
  62. package/index.ts +6 -0
  63. package/package.json +4 -4
  64. package/src/MachineAccount.ts +103 -0
  65. package/src/ScopedRecord.ts +11 -0
  66. package/src/SharedRecord.ts +18 -4
  67. package/src/routes.ts +1 -0
  68. package/src/services/AccountDeletionService.ts +28 -0
  69. package/src/services/MachineCredentialsService.ts +43 -0
  70. package/src/services/SetUserStatusService.ts +16 -0
  71. package/src/services/SignupService.ts +8 -7
  72. package/src/tables/AccountDeletionTable.ts +98 -0
  73. package/src/tables/UserStatusEventTable.ts +34 -0
  74. package/src/tables/UserTable.ts +57 -6
  75. package/src/tables/tables.ts +4 -0
  76. package/test/SharedRecordDuplicateModuleState.test.ts +59 -0
  77. package/test/tablesAuth.test.ts +22 -4
@@ -1,6 +1,16 @@
1
- import { Table, Record } from '@proteinjs/db';
1
+ import { Table, SourceRecord } from '@proteinjs/db';
2
2
  import { Moment } from 'moment';
3
- export type User = Record & {
3
+ /** Account standings. The vocabulary is owned here; every status write flows through the SetUserStatus service. */
4
+ export declare const USER_STATUSES: readonly ["active", "deactivated"];
5
+ export type UserStatus = (typeof USER_STATUSES)[number];
6
+ /**
7
+ * A mixed-ownership source-record table: rows with `isLoadedFromSource = true` are CODE-DECLARED
8
+ * MACHINE ACCOUNTS (see `MachineAccount`) whose declared fields are reverted to source on every
9
+ * boot; human rows (flag null/false) are structurally untouchable by the boot sync. A machine
10
+ * account removed from source is deactivated — never deleted — so rows it is referenced from
11
+ * stay intact, and re-declaring it reactivates it.
12
+ */
13
+ export type User = SourceRecord & {
4
14
  name: string;
5
15
  email: string;
6
16
  password: string;
@@ -20,6 +30,17 @@ export type User = Record & {
20
30
  * @proteinjs/db-file depends on @proteinjs/user, so a user→file reference would be circular.
21
31
  */
22
32
  avatarFileId?: string | null;
33
+ /**
34
+ * Account standing. Written ONLY by the SetUserStatus service (audited per change). New rows
35
+ * default to 'active'; rows predating the column read null, which every gate treats as active —
36
+ * only an explicit 'deactivated' is refused (authentication and session resolution both gate on
37
+ * it in @proteinjs/user-server).
38
+ */
39
+ status?: UserStatus | null;
40
+ /** When the user asked for their account to be deleted. Written by the account-deletion flow only. */
41
+ deleteRequestedAt?: Moment | null;
42
+ /** When the grace window ends and the purge walker may erase the account. Written by the account-deletion flow only. */
43
+ purgeAfter?: Moment | null;
23
44
  };
24
45
  export declare class UserTable extends Table<User> {
25
46
  name: string;
@@ -32,7 +53,17 @@ export declare class UserTable extends Table<User> {
32
53
  * system paths, which bypass TableAuth).
33
54
  */
34
55
  auth: Table<User>['auth'];
56
+ /**
57
+ * Machine accounts sync by EMAIL, not id: existing envs hold hand-made machine rows with
58
+ * env-random ids that other rows reference — the boot sync adopts them in place (id kept,
59
+ * declared fields reverted, runtime fields like `password` untouched). Removal from source
60
+ * deactivates (the same status the staff toggle and account deletion write — the
61
+ * UserStatusTableWatcher kills sessions on every deactivation write); re-declaring
62
+ * reactivates via normal drift reversion.
63
+ */
64
+ sourceRecordOptions: Table<User>['sourceRecordOptions'];
35
65
  columns: {
66
+ isLoadedFromSource: import("@proteinjs/db").Column<boolean | undefined, any>;
36
67
  id: import("@proteinjs/db").Column<string, any>;
37
68
  created: import("@proteinjs/db").Column<Moment, any>;
38
69
  updated: import("@proteinjs/db").Column<Moment, any>;
@@ -47,6 +78,9 @@ export declare class UserTable extends Table<User> {
47
78
  invitedBy: import("@proteinjs/db").Column<string | null | undefined, any>;
48
79
  avatarEmoji: import("@proteinjs/db").Column<string | null | undefined, any>;
49
80
  avatarFileId: import("@proteinjs/db").Column<string | null | undefined, any>;
81
+ status: import("@proteinjs/db").Column<"active" | "deactivated" | null | undefined, any>;
82
+ deleteRequestedAt: import("@proteinjs/db").Column<Moment | null | undefined, any>;
83
+ purgeAfter: import("@proteinjs/db").Column<Moment | null | undefined, any>;
50
84
  } & {};
51
85
  }
52
86
  //# sourceMappingURL=UserTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserTable.d.ts","sourceRoot":"","sources":["../../../src/tables/UserTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EACL,MAAM,EAGP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACn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AAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,sGAAsG;IACtG,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,wHAAwH;IACxH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,qBAAa,SAAU,SAAQ,KAAK,CAAC,IAAI,CAAC;IACxC,IAAI,SAAU;IACd;;;;;;;OAOG;IACH,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAsBvB;IACF;;;;;;;OAOG;IACH,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,qBAAqB,CAAC,CAGrD;IACF,OAAO;;;;;;;;;;;;;;;;;;;WAyBJ;CACJ"}
@@ -14,10 +14,48 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ 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;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
17
53
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.UserTable = void 0;
54
+ exports.UserTable = exports.USER_STATUSES = void 0;
19
55
  var db_1 = require("@proteinjs/db");
20
56
  var permissions_1 = require("../permissions");
57
+ /** Account standings. The vocabulary is owned here; every status write flows through the SetUserStatus service. */
58
+ exports.USER_STATUSES = ['active', 'deactivated'];
21
59
  var UserTable = /** @class */ (function (_super) {
22
60
  __extends(UserTable, _super);
23
61
  function UserTable() {
@@ -44,11 +82,37 @@ var UserTable = /** @class */ (function (_super) {
44
82
  update: { permission: permissions_1.USER_PERMISSIONS.users },
45
83
  delete: { permission: permissions_1.USER_PERMISSIONS.users },
46
84
  },
47
- serviceProtectedColumns: ['roles'],
85
+ /**
86
+ * `roles` is written only by the Roles service; `status` only by the SetUserStatus service
87
+ * (both audited per change — a generic RPC write would let the stored state diverge from its
88
+ * audit trail). `deleteRequestedAt`/`purgeAfter` drive the account purge machinery and are
89
+ * written only by the server-side deletion flow — never through the generic RPC path.
90
+ * `isLoadedFromSource` is machine-account ownership — written only by the boot sync; an RPC
91
+ * write could hand a human row to source ownership (or unhook a machine row from it).
92
+ */
93
+ serviceProtectedColumns: ['roles', 'status', 'deleteRequestedAt', 'purgeAfter', 'isLoadedFromSource'],
94
+ };
95
+ /**
96
+ * Machine accounts sync by EMAIL, not id: existing envs hold hand-made machine rows with
97
+ * env-random ids that other rows reference — the boot sync adopts them in place (id kept,
98
+ * declared fields reverted, runtime fields like `password` untouched). Removal from source
99
+ * deactivates (the same status the staff toggle and account deletion write — the
100
+ * UserStatusTableWatcher kills sessions on every deactivation write); re-declaring
101
+ * reactivates via normal drift reversion.
102
+ */
103
+ _this.sourceRecordOptions = {
104
+ naturalKey: 'email',
105
+ onSourceRemoved: { update: { status: 'deactivated' } },
48
106
  };
49
- _this.columns = (0, db_1.withRecordColumns)({
107
+ _this.columns = (0, db_1.withSourceRecordColumns)({
50
108
  name: new db_1.StringColumn('name'),
51
- email: new db_1.StringColumn('email', {}, 250),
109
+ /**
110
+ * Unique — codifying the invariant authenticate/Signup always assumed (lowercased +
111
+ * existence-checked). Also the machine-account natural key: adoption requires unambiguous
112
+ * matching. The schema sync's duplicate preflight names offending values if a deployed env
113
+ * somehow holds dupes when the index first lands.
114
+ */
115
+ email: new db_1.StringColumn('email', { unique: { unique: true, indexName: 'user_email_unique' } }, 250),
52
116
  password: new db_1.PasswordColumn('password'),
53
117
  passwordResetToken: new db_1.StringColumn('password_reset_token'),
54
118
  passwordResetTokenExpiration: new db_1.DateTimeColumn('password_reset_token_expiration'),
@@ -62,6 +126,11 @@ var UserTable = /** @class */ (function (_super) {
62
126
  invitedBy: new db_1.StringColumn('invited_by'),
63
127
  avatarEmoji: new db_1.StringColumn('avatar_emoji'),
64
128
  avatarFileId: new db_1.StringColumn('avatar_file_id'),
129
+ status: new db_1.StringColumn('status', { defaultValue: function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
130
+ return [2 /*return*/, 'active'];
131
+ }); }); } }, 16),
132
+ deleteRequestedAt: new db_1.DateTimeColumn('delete_requested_at'),
133
+ purgeAfter: new db_1.DateTimeColumn('purge_after'),
65
134
  });
66
135
  return _this;
67
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UserTable.js","sourceRoot":"","sources":["../../../src/tables/UserTable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCASuB;AAEvB,8CAAkD;AAwBlD;IAA+B,6BAAW;IAA1C;QAAA,qEA0CC;QAzCC,UAAI,GAAG,MAAM,CAAC;QACd;;;;;;;WAOG;QACH,UAAI,GAAwB;YAC1B,EAAE,EAAE;gBACF,KAAK,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;gBAC7C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;gBAC9C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;gBAC9C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;aAC/C;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;gBAC7C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;gBAC9C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;gBAC9C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;aAC/C;YACD,uBAAuB,EAAE,CAAC,OAAO,CAAC;S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AC;YACzC,WAAW,EAAE,IAAI,iBAAY,CAAC,cAAc,CAAC;YAC7C,YAAY,EAAE,IAAI,iBAAY,CAAC,gBAAgB,CAAC;YAChD,MAAM,EAAE,IAAI,iBAAY,CAAa,QAAQ,EAAE,EAAE,YAAY,EAAE;oBAAY,sBAAA,QAAQ,EAAA;yBAAA,EAAE,EAAE,EAAE,CAAC;YAC1F,iBAAiB,EAAE,IAAI,mBAAc,CAAC,qBAAqB,CAAC;YAC5D,UAAU,EAAE,IAAI,mBAAc,CAAC,aAAa,CAAC;SAC9C,CAAC,CAAC;;IACL,CAAC;IAAD,gBAAC;AAAD,CAAC,AAvED,CAA+B,UAAK,GAuEnC;AAvEY,8BAAS"}
@@ -2,15 +2,19 @@ import { AccessGrant } from './AccessGrantTable';
2
2
  import { User } from './UserTable';
3
3
  import { Session } from './SessionTable';
4
4
  import { Table } from '@proteinjs/db';
5
+ import { AccountDeletion } from './AccountDeletionTable';
5
6
  import { Invite } from './InviteTable';
6
7
  import { AccessInvite } from './AccessInviteTable';
7
8
  import { RoleGrantEvent } from './RoleGrantEventTable';
9
+ import { UserStatusEvent } from './UserStatusEventTable';
8
10
  export declare const tables: {
9
11
  AccessGrant: Table<AccessGrant>;
10
12
  AccessInvite: Table<AccessInvite>;
13
+ AccountDeletion: Table<AccountDeletion>;
11
14
  Invite: Table<Invite>;
12
15
  RoleGrantEvent: Table<RoleGrantEvent>;
13
16
  User: Table<User>;
17
+ UserStatusEvent: Table<UserStatusEvent>;
14
18
  Session: Table<Session>;
15
19
  };
16
20
  //# sourceMappingURL=tables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../src/tables/tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAa,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAgB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAE5E,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC"}
1
+ {"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../src/tables/tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAa,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAgB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAE/E,eAAO,MAAM,MAAM;;;;;;;;;CASlB,CAAC"}
@@ -4,15 +4,19 @@ exports.tables = void 0;
4
4
  var AccessGrantTable_1 = require("./AccessGrantTable");
5
5
  var UserTable_1 = require("./UserTable");
6
6
  var SessionTable_1 = require("./SessionTable");
7
+ var AccountDeletionTable_1 = require("./AccountDeletionTable");
7
8
  var InviteTable_1 = require("./InviteTable");
8
9
  var AccessInviteTable_1 = require("./AccessInviteTable");
9
10
  var RoleGrantEventTable_1 = require("./RoleGrantEventTable");
11
+ var UserStatusEventTable_1 = require("./UserStatusEventTable");
10
12
  exports.tables = {
11
13
  AccessGrant: new AccessGrantTable_1.AccessGrantTable(),
12
14
  AccessInvite: new AccessInviteTable_1.AccessInviteTable(),
15
+ AccountDeletion: new AccountDeletionTable_1.AccountDeletionTable(),
13
16
  Invite: new InviteTable_1.InviteTable(),
14
17
  RoleGrantEvent: new RoleGrantEventTable_1.RoleGrantEventTable(),
15
18
  User: new UserTable_1.UserTable(),
19
+ UserStatusEvent: new UserStatusEventTable_1.UserStatusEventTable(),
16
20
  Session: new SessionTable_1.SessionTable(),
17
21
  };
18
22
  //# sourceMappingURL=tables.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tables.js","sourceRoot":"","sources":["../../../src/tables/tables.ts"],"names":[],"mappings":";;;AAAA,uDAAmE;AACnE,yCAA8C;AAC9C,+CAAuD;AAEvD,6CAAoD;AACpD,yDAAsE;AACtE,6DAA4E;AAE/D,QAAA,MAAM,GAAG;IACpB,WAAW,EAAE,IAAI,mCAAgB,EAAwB;IACzD,YAAY,EAAE,IAAI,qCAAiB,EAAyB;IAC5D,MAAM,EAAE,IAAI,yBAAW,EAAmB;IAC1C,cAAc,EAAE,IAAI,yCAAmB,EAA2B;IAClE,IAAI,EAAE,IAAI,qBAAS,EAAiB;IACpC,OAAO,EAAE,IAAI,2BAAY,EAAoB;CAC9C,CAAC"}
1
+ {"version":3,"file":"tables.js","sourceRoot":"","sources":["../../../src/tables/tables.ts"],"names":[],"mappings":";;;AAAA,uDAAmE;AACnE,yCAA8C;AAC9C,+CAAuD;AAEvD,+DAA+E;AAC/E,6CAAoD;AACpD,yDAAsE;AACtE,6DAA4E;AAC5E,+DAA+E;AAElE,QAAA,MAAM,GAAG;IACpB,WAAW,EAAE,IAAI,mCAAgB,EAAwB;IACzD,YAAY,EAAE,IAAI,qCAAiB,EAAyB;IAC5D,eAAe,EAAE,IAAI,2CAAoB,EAA4B;IACrE,MAAM,EAAE,IAAI,yBAAW,EAAmB;IAC1C,cAAc,EAAE,IAAI,yCAAmB,EAA2B;IAClE,IAAI,EAAE,IAAI,qBAAS,EAAiB;IACpC,eAAe,EAAE,IAAI,2CAAoB,EAA4B;IACrE,OAAO,EAAE,IAAI,2BAAY,EAAoB;CAC9C,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Duplicate-module-instance guard for the skip-access-grants toggle (task #36).
3
+ *
4
+ * Per-package installs can put two live copies of @proteinjs/user in one process (each sibling
5
+ * package's nested node_modules hosts its own registry copy; Node resolves through symlinked
6
+ * workspace packages to distinct real paths). A module-scoped toggle then splits per copy:
7
+ * the 2026-08-14 incident had a test toggling one copy's skipAccessGrants while the AccessGrant
8
+ * closures enforced from the other copy — the toggle was a silent no-op and a stranger's
9
+ * lock-room join was acked ok.
10
+ *
11
+ * `jest.isolateModules` reproduces the split semantics exactly: each isolated registry gets its
12
+ * own module instance with its own module scope, the same way two nested install paths do. The
13
+ * guard asserts the toggle set through one live copy is observed by another live copy — which
14
+ * only holds when the state is anchored on the process global, not in module scope.
15
+ */
16
+ type SharedRecordModule = typeof import('../src/SharedRecord');
17
+ declare const loadIsolatedCopy: () => SharedRecordModule;
18
+ //# sourceMappingURL=SharedRecordDuplicateModuleState.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharedRecordDuplicateModuleState.test.d.ts","sourceRoot":"","sources":["../../test/SharedRecordDuplicateModuleState.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,KAAK,kBAAkB,GAAG,cAAc,qBAAqB,CAAC,CAAC;AAE/D,QAAA,MAAM,gBAAgB,QAAO,kBAY5B,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /**
3
+ * Duplicate-module-instance guard for the skip-access-grants toggle (task #36).
4
+ *
5
+ * Per-package installs can put two live copies of @proteinjs/user in one process (each sibling
6
+ * package's nested node_modules hosts its own registry copy; Node resolves through symlinked
7
+ * workspace packages to distinct real paths). A module-scoped toggle then splits per copy:
8
+ * the 2026-08-14 incident had a test toggling one copy's skipAccessGrants while the AccessGrant
9
+ * closures enforced from the other copy — the toggle was a silent no-op and a stranger's
10
+ * lock-room join was acked ok.
11
+ *
12
+ * `jest.isolateModules` reproduces the split semantics exactly: each isolated registry gets its
13
+ * own module instance with its own module scope, the same way two nested install paths do. The
14
+ * guard asserts the toggle set through one live copy is observed by another live copy — which
15
+ * only holds when the state is anchored on the process global, not in module scope.
16
+ */
17
+ var loadIsolatedCopy = function () {
18
+ var copy;
19
+ jest.isolateModules(function () {
20
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
21
+ copy = require('../src/SharedRecord');
22
+ });
23
+ if (!copy) {
24
+ throw new Error('Failed to load an isolated copy of SharedRecord');
25
+ }
26
+ return copy;
27
+ };
28
+ describe('SharedRecord skip-access-grants state under duplicate module instances', function () {
29
+ afterEach(function () {
30
+ delete globalThis.__proteinjs_user_skipAccessGrants;
31
+ });
32
+ test('a toggle set through one live copy is enforced by every other live copy', function () {
33
+ var copyA = loadIsolatedCopy();
34
+ var copyB = loadIsolatedCopy();
35
+ expect(copyA).not.toBe(copyB); // two distinct module instances, as under per-package installs
36
+ // The incident shape: the test toggles copy A, the enforcing closures live in copy B.
37
+ copyA.setSkipAccessGrants(true);
38
+ expect(copyB.skipAccessGrantsEnabled()).toBe(true);
39
+ // And the reverse direction: resetting through B must reach A.
40
+ copyB.setSkipAccessGrants(false);
41
+ expect(copyA.skipAccessGrantsEnabled()).toBe(false);
42
+ });
43
+ test('a copy loaded after the toggle was set still observes it', function () {
44
+ var copyA = loadIsolatedCopy();
45
+ copyA.setSkipAccessGrants(true);
46
+ var lateCopy = loadIsolatedCopy();
47
+ expect(lateCopy.skipAccessGrantsEnabled()).toBe(true);
48
+ });
49
+ });
50
+ //# sourceMappingURL=SharedRecordDuplicateModuleState.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharedRecordDuplicateModuleState.test.js","sourceRoot":"","sources":["../../test/SharedRecordDuplicateModuleState.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAIH,IAAM,gBAAgB,GAAG;IACvB,IAAI,IAAoC,CAAC;IACzC,IAAI,CAAC,cAAc,CAAC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
5
5
  /**
6
6
  * The users/roles split lives in these table schemas — invariants worth pinning so a drive-by
7
7
  * edit cannot silently reopen a door:
8
- * - user: 'users' permission covers viewing/managing records, EXCEPT roles — the roles column is
9
- * service-protected (single write path: the Roles service).
8
+ * - user: 'users' permission covers viewing/managing records, EXCEPT roles and status — those
9
+ * columns are service-protected (single write paths: the Roles and SetUserStatus services),
10
+ * and the deletion-machinery datetimes are written only by the server-side deletion flow.
10
11
  * - role_grant_event: the audit trail is readable by 'roles' holders and has NO generic write
11
12
  * door — an explicit auth block with no write grants is a lock, not an admin default.
13
+ * - user_status_event: the standing audit trail is admin-read (the same scope as the
14
+ * SetUserStatus service that writes it) with NO generic write door.
12
15
  * - session: 'sessions' holders read (a different trust than 'users' — rows carry auth
13
16
  * material); writes are system-written, so there is NO generic write door.
14
17
  * - invite: 'users' holders read and delete; creating rides SignupService only.
@@ -32,9 +35,15 @@ describe('user table auth shape', function () {
32
35
  delete: { permission: permissions_1.USER_PERMISSIONS.users },
33
36
  });
34
37
  });
35
- it('service-protects the roles column (single write path: the Roles service)', function () {
38
+ it("service-protects roles and status (single write paths: the Roles and SetUserStatus\n services), the deletion-machinery datetimes (written only by the server-side\n deletion flow), and machine-account ownership (written only by the boot sync)", function () {
36
39
  var _a;
37
- expect((_a = tables_1.tables.User.auth) === null || _a === void 0 ? void 0 : _a.serviceProtectedColumns).toEqual(['roles']);
40
+ expect((_a = tables_1.tables.User.auth) === null || _a === void 0 ? void 0 : _a.serviceProtectedColumns).toEqual([
41
+ 'roles',
42
+ 'status',
43
+ 'deleteRequestedAt',
44
+ 'purgeAfter',
45
+ 'isLoadedFromSource',
46
+ ]);
38
47
  });
39
48
  });
40
49
  describe('role_grant_event table auth shape', function () {
@@ -44,6 +53,13 @@ describe('role_grant_event table auth shape', function () {
44
53
  expect((_b = tables_1.tables.RoleGrantEvent.auth) === null || _b === void 0 ? void 0 : _b.service).toEqual({ query: { permission: permissions_1.USER_PERMISSIONS.roles } });
45
54
  });
46
55
  });
56
+ describe('user_status_event table auth shape', function () {
57
+ it('is admin-read only and has no generic write door', function () {
58
+ var _a, _b;
59
+ expect((_a = tables_1.tables.UserStatusEvent.auth) === null || _a === void 0 ? void 0 : _a.db).toEqual({ query: ['admin'] });
60
+ expect((_b = tables_1.tables.UserStatusEvent.auth) === null || _b === void 0 ? void 0 : _b.service).toEqual({ query: ['admin'] });
61
+ });
62
+ });
47
63
  describe('session table auth shape', function () {
48
64
  it('is readable by sessions holders and has no generic write door (writes are system-written)', function () {
49
65
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"tablesAuth.test.js","sourceRoot":"","sources":["../../test/tablesAuth.test.ts"],"names":[],"mappings":";;AAAA,+CAA8C;AAC9C,kDAAsD;AAEtD;;;;;;;;;;GAUG;AAEH,QAAQ,CAAC,uBAAuB,EAAE;IAChC,EAAE,CAAC,kDAAkD,EAAE;;QACrD,MAAM,CAAC,MAAA,eAAM,CAAC,IAAI,CAAC,IAAI,0CAAE,OAAO,CAAC,CAAC,OAAO,CAAC;YACxC,KAAK,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;YAC7C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;YAC9C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;YAC9C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0PAEsD,EAAE;;QACzD,MAAM,CAAC,MAAA,eAAM,CAAC,IAAI,CAAC,IAAI,0CAAE,EAAE,CAAC,CAAC,OAAO,CAAC;YACnC,KAAK,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;YAC7C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB,CAAC,KAAK,EAAE;YAC9C,MAAM,EAAE,EAAE,UAAU,EAAE,8BAAgB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