nucleus-core-ts 0.10.76 → 0.10.78

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.
@@ -1,6 +1,6 @@
1
- import type { AppliedPasswordPolicy } from '../passwordPolicy';
2
1
  import type { NodePgDatabase } from 'drizzle-orm/node-postgres';
3
2
  import type { Logger } from 'src/Services';
3
+ import type { AppliedPasswordPolicy } from '../passwordPolicy';
4
4
  type PgTable = ReturnType<typeof import('drizzle-orm/pg-core').pgTable>;
5
5
  export type CohortRouteConfig = {
6
6
  db: NodePgDatabase | null;
@@ -1,3 +1,4 @@
1
+ import type { Logger } from 'src/Services/Logger';
1
2
  import type { CohortRouteConfig } from './types';
2
3
  type PgTable = ReturnType<typeof import('drizzle-orm/pg-core').pgTable>;
3
4
  type Col = ReturnType<typeof import('drizzle-orm').sql>;
@@ -28,7 +29,11 @@ export declare const col: (table: PgTable, name: string) => Col;
28
29
  * non-godmin something about an account they have no claim on. The RULE is
29
30
  * shared; the sentence is this group's.
30
31
  */
31
- export declare function requireGodmin(db: NonNullable<CohortRouteConfig['db']>, usersTable: NonNullable<CohortRouteConfig['usersTable']>, userId: string): Promise<boolean>;
32
+ export declare function requireGodmin(db: NonNullable<CohortRouteConfig['db']>, usersTable: NonNullable<CohortRouteConfig['usersTable']>, userId: string, roleLookup?: {
33
+ request?: Request;
34
+ schemaTables?: Record<string, unknown>;
35
+ logger?: Logger;
36
+ }): Promise<boolean>;
32
37
  type PasswordPolicy = CohortRouteConfig['passwordPolicy'];
33
38
  type PasswordValidation = {
34
39
  valid: boolean;
@@ -1,7 +1,7 @@
1
- import type { AppliedPasswordPolicy } from './passwordPolicy';
2
1
  import type { NodePgDatabase } from 'drizzle-orm/node-postgres';
3
2
  import type { Logger, TenantRegistry } from 'src/Services';
4
3
  import type { OAuthProviderName } from 'src/Services/OAuth/types';
4
+ import type { AppliedPasswordPolicy } from './passwordPolicy';
5
5
  export type { OAuthProviderName };
6
6
  export interface OAuthProviderConfig {
7
7
  clientId: string;
@@ -25,6 +25,12 @@ export declare class VerificationService {
25
25
  * Returns null rather than throwing on a table this host does not have: a
26
26
  * missing fingerprint must never fail a decision that is otherwise valid.
27
27
  */
28
+ /**
29
+ * Three answers, not two: `true`, `false`, or "the engine cannot tell".
30
+ * `readEntityRow` folds the last into `null`, which is right for a
31
+ * fingerprint and wrong for a refusal.
32
+ */
33
+ private entityRowExists;
28
34
  private readEntityRow;
29
35
  /**
30
36
  * Put the chain's outcome on the row the chain is about.
@@ -29,6 +29,12 @@ export interface VerificationConfig {
29
29
  * not care from whom" — a single-person shop, or an internal checklist.
30
30
  */
31
31
  allowSameVerifierTwiceOnStep?: boolean;
32
+ /**
33
+ * Every step of a chain must be decided by a DIFFERENT person. Off by
34
+ * default; a regulated install turns it on so that "three signatures" cannot
35
+ * be satisfied by one account holding two roles.
36
+ */
37
+ requireDistinctVerifiersAcrossChain?: boolean;
32
38
  diffTrackingEnabled?: boolean;
33
39
  endpoints?: {
34
40
  enabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleus-core-ts",
3
- "version": "0.10.76",
3
+ "version": "0.10.78",
4
4
  "description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
5
5
  "author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",