@aiquants/auth-directory-drizzle 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1113,8 +1113,12 @@ type LedgerIdentityTables = {
1113
1113
  * Finds every ledger row that belongs to the identity, within one tenant.
1114
1114
  * 1 テナント内で、その identity に属する台帳行をすべて探す処理。
1115
1115
  *
1116
- * 突合順は上流 ID が第一キー、アドレスが第二キー。両方を `OR` で混ぜると優先順位が消え、
1117
- * 退職者のアドレスを再利用した新入社員が前任者の所属をそのまま継承する。
1116
+ * 上流 ID の一致は無条件に本人。アドレスの一致は、その行が **別の** 上流 ID に紐付いていない
1117
+ * ときだけ本人である。単純な `OR` にすると後者の条件が消え、退職者のアドレスを再利用した
1118
+ * 新入社員が前任者の所属をそのまま継承する。
1119
+ *
1120
+ * ⚠️ この優先順位は **行ごと** に適用する。「ID で当たったらアドレスは見ない」という打ち切りは
1121
+ * 誤りで、同じ人物の行が ID 付きと ID 無しに混在すると ID 無しの行が丸ごと落ちる。
1118
1122
  *
1119
1123
  * @param db - Connected database surface. 接続済みの DB 面。
1120
1124
  * @param tables - The ledger and its parent group table. 台帳と親グループ表。
@@ -1437,6 +1441,16 @@ type PromotionRepositoryOptions = {
1437
1441
  /** Injected clock — tests must not depend on wall time. 注入時計 (実時刻に依存させない)。 */
1438
1442
  now?: () => Date;
1439
1443
  };
1444
+ /**
1445
+ * Builds the promotion repository over the directory ledger and the authz membership table.
1446
+ * ディレクトリ台帳と認可の所属表に対して、昇格リポジトリを構築する処理。
1447
+ *
1448
+ * @param dbUnknown - Drizzle database instance. drizzle のデータベースインスタンス。
1449
+ * @param tables - Directory tables (owns the ledger). ディレクトリ表 (台帳の所有者)。
1450
+ * @param authzTables - Authorization tables (owns groups and membership). 認可表 (グループと所属の所有者)。
1451
+ * @param opts - Connection, actor and clock. 接続・実行者・時計。
1452
+ * @returns A repository consumable by `promoteLedgerForUser`. `promoteLedgerForUser` が使うリポジトリ。
1453
+ */
1440
1454
  declare function createPromotionRepository(dbUnknown: unknown, tables: AuthDirectoryTables, authzTables: AuthzTables, opts: PromotionRepositoryOptions): PromotionRepository;
1441
1455
 
1442
1456
  /**
package/dist/index.d.ts CHANGED
@@ -1113,8 +1113,12 @@ type LedgerIdentityTables = {
1113
1113
  * Finds every ledger row that belongs to the identity, within one tenant.
1114
1114
  * 1 テナント内で、その identity に属する台帳行をすべて探す処理。
1115
1115
  *
1116
- * 突合順は上流 ID が第一キー、アドレスが第二キー。両方を `OR` で混ぜると優先順位が消え、
1117
- * 退職者のアドレスを再利用した新入社員が前任者の所属をそのまま継承する。
1116
+ * 上流 ID の一致は無条件に本人。アドレスの一致は、その行が **別の** 上流 ID に紐付いていない
1117
+ * ときだけ本人である。単純な `OR` にすると後者の条件が消え、退職者のアドレスを再利用した
1118
+ * 新入社員が前任者の所属をそのまま継承する。
1119
+ *
1120
+ * ⚠️ この優先順位は **行ごと** に適用する。「ID で当たったらアドレスは見ない」という打ち切りは
1121
+ * 誤りで、同じ人物の行が ID 付きと ID 無しに混在すると ID 無しの行が丸ごと落ちる。
1118
1122
  *
1119
1123
  * @param db - Connected database surface. 接続済みの DB 面。
1120
1124
  * @param tables - The ledger and its parent group table. 台帳と親グループ表。
@@ -1437,6 +1441,16 @@ type PromotionRepositoryOptions = {
1437
1441
  /** Injected clock — tests must not depend on wall time. 注入時計 (実時刻に依存させない)。 */
1438
1442
  now?: () => Date;
1439
1443
  };
1444
+ /**
1445
+ * Builds the promotion repository over the directory ledger and the authz membership table.
1446
+ * ディレクトリ台帳と認可の所属表に対して、昇格リポジトリを構築する処理。
1447
+ *
1448
+ * @param dbUnknown - Drizzle database instance. drizzle のデータベースインスタンス。
1449
+ * @param tables - Directory tables (owns the ledger). ディレクトリ表 (台帳の所有者)。
1450
+ * @param authzTables - Authorization tables (owns groups and membership). 認可表 (グループと所属の所有者)。
1451
+ * @param opts - Connection, actor and clock. 接続・実行者・時計。
1452
+ * @returns A repository consumable by `promoteLedgerForUser`. `promoteLedgerForUser` が使うリポジトリ。
1453
+ */
1440
1454
  declare function createPromotionRepository(dbUnknown: unknown, tables: AuthDirectoryTables, authzTables: AuthzTables, opts: PromotionRepositoryOptions): PromotionRepository;
1441
1455
 
1442
1456
  /**