Pyric
Navigate

API reference

@pyric/cli/verify

28 published symbols from @pyric/cli

Generated from the TypeScript declarations shipped at this import path.

Classes

VerifyInputError

Extends

  • Error

Constructors

Constructor
new VerifyInputError(message: string): VerifyInputError;
Parameters
ParameterType
messagestring
Returns

VerifyInputError

Overrides
Error.constructor

Interfaces

BuildVerifyFixtureInput

Properties

PropertyTypeDescription
authState?{ currentUser?: unknown; users?: unknown[]; }-
authState.currentUser?unknown-
authState.users?unknown[]-
capturedBy?stringStamped into the fixture as capturedBy (identity for boot-time event hydration). Omit for pyric verify builds — they have no instance.
createdAt?string-
description?string-
firestoreRules?string-
rtdbDatabaseUrl?string-
rtdbRules?{ rules: Record<string, unknown>; }-
rtdbRules.rulesRecord<string, unknown>-
rtdbState?unknown-
sandboxPick<Sandbox, "history" | "snapshot"> & { currentUser?: unknown; }-
storageRules?stringCurrently-deployed storage rules text. RULES ONLY — there is no storageState input; captured storage OBJECTS are a separate, larger redesign left untouched by this fixture.

DerivedRulesTestCase

Properties

PropertyType
eventIdstring
testCase{ auth?: { token?: Record<string, unknown>; uid: string; }; data?: Record<string, unknown>; description: string; expectation: "ALLOW" | "DENY"; functionMocks?: { function: "get" | "exists"; path: string; result: boolean | Record<string, unknown>; }[]; method: "delete" | "get" | "list" | "create" | "update"; path: string; query?: { limit?: number; offset?: number; orderBy?: string; }; requestTime?: string; resource?: Record<string, unknown>; writeMode?: | { kind: "create"; } | { kind: "set"; merge: boolean; } | { kind: "update"; } | { kind: "delete"; }; }
testCase.auth?{ token?: Record<string, unknown>; uid: string; }
testCase.auth.token?Record<string, unknown>
testCase.auth.uidstring
testCase.data?Record<string, unknown>
testCase.descriptionstring
testCase.expectation"ALLOW" | "DENY"
testCase.functionMocks?{ function: "get" | "exists"; path: string; result: boolean | Record<string, unknown>; }[]
testCase.method"delete" | "get" | "list" | "create" | "update"
testCase.pathstring
testCase.query?{ limit?: number; offset?: number; orderBy?: string; }
testCase.query.limit?number
testCase.query.offset?number
testCase.query.orderBy?string
testCase.requestTime?string
testCase.resource?Record<string, unknown>
testCase.writeMode?| { kind: "create"; } | { kind: "set"; merge: boolean; } | { kind: "update"; } | { kind: "delete"; }

DeriveRulesTestCasesOptions

Properties

PropertyType
includeAllowed?boolean
includeDenied?boolean
mockReads?"strict" | "omit"
service?"firestore"

DeriveRulesTestCasesResult

Properties

PropertyType
derivedDerivedRulesTestCase[]
okboolean
service"firestore"
testCases{ auth?: { token?: Record<string, unknown>; uid: string; }; data?: Record<string, unknown>; description: string; expectation: "ALLOW" | "DENY"; functionMocks?: { function: "get" | "exists"; path: string; result: boolean | Record<string, unknown>; }[]; method: "delete" | "get" | "list" | "create" | "update"; path: string; query?: { limit?: number; offset?: number; orderBy?: string; }; requestTime?: string; resource?: Record<string, unknown>; writeMode?: | { kind: "create"; } | { kind: "set"; merge: boolean; } | { kind: "update"; } | { kind: "delete"; }; }[]
unsupportedEventsVerifyUnsupportedEvent[]
warningsVerifyFixtureWarning[]

PyricVerifyFixture

Properties

PropertyTypeDescription
capturedBy?stringOpaque id of the sandbox instance that produced this capture (the served SharedWorker’s instanceId). Purely additive: pyric verify ignores it. Present only on captures written by the worker’s capture flush; used by boot-time event hydration to SKIP priming a capture that belongs to a DIFFERENT instance (e.g. another browser profile sharing one pyric dev), so someone else’s session never shows up as yours. Absent on older / standalone captures → hydration primes best-effort.
createdAt?string-
description?string-
eventsSandboxEvent[]-
schema"pyric.verify.fixture.v1"-
services{ [service: string]: unknown; auth?: { state: { currentUser?: unknown; users?: unknown[]; }; }; firestore?: { rules: VerifyFirestoreRulesBlock; state: { documents: Record<string, Record<string, unknown>>; }; }; rtdb?: { databaseUrl?: string; rules: VerifyRtdbRulesBlock; state: { tree: unknown; }; }; storage?: { rules: VerifyStorageRulesBlock; state: unknown; }; }-
services.auth?{ state: { currentUser?: unknown; users?: unknown[]; }; }-
services.auth.state{ currentUser?: unknown; users?: unknown[]; }-
services.auth.state.currentUser?unknown-
services.auth.state.users?unknown[]-
services.firestore?{ rules: VerifyFirestoreRulesBlock; state: { documents: Record<string, Record<string, unknown>>; }; }-
services.firestore.rulesVerifyFirestoreRulesBlock-
services.firestore.state{ documents: Record<string, Record<string, unknown>>; }-
services.firestore.state.documentsRecord<string, Record<string, unknown>>-
services.rtdb?{ databaseUrl?: string; rules: VerifyRtdbRulesBlock; state: { tree: unknown; }; }-
services.rtdb.databaseUrl?string-
services.rtdb.rulesVerifyRtdbRulesBlock-
services.rtdb.state{ tree: unknown; }-
services.rtdb.state.treeunknown-
services.storage?{ rules: VerifyStorageRulesBlock; state: unknown; }-
services.storage.rulesVerifyStorageRulesBlockRULES TEXT ONLY — captured object state is a separate, larger redesign (persistence.ts’s IDB blob store) and is deliberately left untouched here. state stays null until that lands.
services.storage.stateunknown-

VerifyEngineResult

Properties

PropertyType
checkedEventsnumber
derivation?DeriveRulesTestCasesResult
divergencesVerifyDivergence[]
engineVerifyEngine
failed?number
okboolean
passed?number
results?TestResult[]
testCases?number
unsupported?number

VerifyFirestoreRulesBlock

Properties

PropertyType
format"firestore.rules"
sourcestring

VerifyFixtureOptions

Properties

PropertyType
caseDerivation?Omit<DeriveRulesTestCasesOptions, "service">
engines?VerifyEngine[]
rulesVerifyRulesInput
rulesTestApi?{ expressionReportLevel?: ExpressionReportLevel; scope: ProjectScope; }
rulesTestApi.expressionReportLevel?ExpressionReportLevel
rulesTestApi.scopeProjectScope
services?VerifiableService[]

VerifyResult

Properties

PropertyType
okboolean
servicesPartial<Record<VerifiableService, VerifyServiceResult>>

VerifyRtdbRulesBlock

Properties

PropertyType
format"rtdb.rules.json"
json{ rules: Record<string, unknown>; }
json.rulesRecord<string, unknown>

VerifyServiceResult

Properties

PropertyType
checkedEventsnumber
divergencesVerifyDivergence[]
engines?Partial<Record<VerifyEngine, VerifyEngineResult>>
okboolean
serviceVerifiableService

VerifyStorageRulesBlock

Properties

PropertyType
format"storage.rules"
sourcestring

VerifyToolDeps

Properties

PropertyType
scope?ProjectScope

Type Aliases

VerifiableService

type VerifiableService = "firestore" | "rtdb";

VerifyDivergence

type VerifyDivergence =
  | {
  kind: "now-denied";
  method?: string;
  path?: string;
  reason?: string;
  service: EventService | string;
}
  | {
  kind: "now-allowed";
  method?: string;
  path?: string;
  reason?: string;
  service: EventService | string;
}
  | {
  after: unknown;
  before: unknown;
  field?: string;
  kind: "state-drift";
  path?: string;
  service: EventService | string;
}
  | {
  kind: "unsupported";
  method?: string;
  path?: string;
  reason: string;
  service: EventService | string;
}
  | {
  after?: unknown;
  before?: unknown;
  drift: string;
  field?: string;
  kind: "expected-drift";
  path?: string;
  service: EventService | string;
}
  | {
  kind: "engine-drift";
  method?: string;
  path?: string;
  reason?: string;
  rulesTestApi: string;
  sandbox: string;
  service: EventService | string;
};

VerifyEngine

type VerifyEngine = "sandbox" | "rulesTestApi";

VerifyFixtureWarning

type VerifyFixtureWarning = {
  code: string;
  eventId?: string;
  message: string;
  method?: string;
  path?: string;
  service: "firestore";
};

Properties

PropertyType
codestring
eventId?string
messagestring
method?string
path?string
service"firestore"

VerifyRulesInput

type VerifyRulesInput = {
  firestore?:   | string
     | {
     source: string;
   };
  rtdb?:   | {
     rules: Record<string, unknown>;
   }
     | RtdbRulesDocument;
  storage?:   | string
     | {
     source: string;
   };
};

Properties

PropertyType
firestore?| string | { source: string; }
rtdb?| { rules: Record<string, unknown>; } | RtdbRulesDocument
storage?| string | { source: string; }

VerifyUnsupportedEvent

type VerifyUnsupportedEvent = {
  eventId?: string;
  method?: string;
  path?: string;
  reason: string;
  service: "firestore";
};

Properties

PropertyType
eventId?string
method?string
path?string
reasonstring
service"firestore"

Variables

VERIFY_FIXTURE_SCHEMA

const VERIFY_FIXTURE_SCHEMA: "pyric.verify.fixture.v1";

Functions

buildVerifyFixture()

function buildVerifyFixture(input: BuildVerifyFixtureInput): PyricVerifyFixture;

Parameters

ParameterType
inputBuildVerifyFixtureInput

Returns

PyricVerifyFixture


createVerifyTools()

function createVerifyTools(deps?: VerifyToolDeps): ToolHandler<unknown, unknown>[];

Parameters

ParameterType
deps?VerifyToolDeps

Returns

ToolHandler<unknown, unknown>[]


deriveRulesTestCases()

function deriveRulesTestCases(fixtureInput: unknown, opts?: DeriveRulesTestCasesOptions): DeriveRulesTestCasesResult;

Parameters

ParameterType
fixtureInputunknown
opts?DeriveRulesTestCasesOptions

Returns

DeriveRulesTestCasesResult


fixtureVerifiableServices()

function fixtureVerifiableServices(fixture: PyricVerifyFixture): ("firestore" | "rtdb")[];

Parameters

ParameterType
fixturePyricVerifyFixture

Returns

("firestore" | "rtdb")[]


parseVerifyFixture()

function parseVerifyFixture(value: unknown): PyricVerifyFixture;

Parameters

ParameterType
valueunknown

Returns

PyricVerifyFixture


restoreStorageRulesFromFixture()

function restoreStorageRulesFromFixture(fixture: PyricVerifyFixture, sandbox: Sandbox): void;

Re-deploy a fixture’s captured storage rules into a sandbox’s storage evaluator. RULES TEXT ONLY, mirroring the capture-side scope note: this never touches storage OBJECTS (persistence.ts’s IDB blob store) — only fixture.services.storage.rules.source is applied.

Storage rules are honored only on the FIRST getStorageSandbox call per Sandbox (see storage/service.ts), so this must run before any other code opens the storage service on sandbox — exactly the same ordering constraint firestore/rtdb rules already have at restore time. A no-op when the fixture carries no storage block.

Parameters

ParameterType
fixturePyricVerifyFixture
sandboxSandbox

Returns

void


verifyFixture()

function verifyFixture(fixtureInput: unknown, opts: VerifyFixtureOptions): Promise<VerifyResult>;

Parameters

ParameterType
fixtureInputunknown
optsVerifyFixtureOptions

Returns

Promise<VerifyResult>