diff --git a/crates/perry-api-manifest/src/entries.rs b/crates/perry-api-manifest/src/entries.rs index d271e5b62..beed557eb 100644 --- a/crates/perry-api-manifest/src/entries.rs +++ b/crates/perry-api-manifest/src/entries.rs @@ -2012,10 +2012,12 @@ pub static API_MANIFEST: &[ApiEntry] = &[ method("crypto", "sha256", false, None), method("crypto", "md5", false, None), method("crypto", "getRandomValues", false, None), - // crypto.randomFillSync(buffer, offset?, size?) — fills the + // crypto.randomFill(buffer[, offset][, size], callback) / + // randomFillSync(buffer, offset?, size?) — fills the // typed-array / Buffer with cryptographically strong random // bytes in-place and returns the same object. Required by // axios (Uint32Array) for ID generation. + method("crypto", "randomFill", false, None), method("crypto", "randomFillSync", false, None), method("crypto", "createHash", false, None), method("crypto", "createSign", false, None), diff --git a/crates/perry-api-manifest/src/lib.rs b/crates/perry-api-manifest/src/lib.rs index 5112d3e2c..fcab3bf29 100644 --- a/crates/perry-api-manifest/src/lib.rs +++ b/crates/perry-api-manifest/src/lib.rs @@ -299,6 +299,19 @@ mod tests { assert!(matches!(entry.returns, TypeSpec::Bool)); } + #[test] + fn crypto_random_fill_is_manifest_method() { + let entry = module_has_symbol("node:crypto", "randomFill") + .expect("crypto.randomFill should be in the manifest"); + assert!(matches!( + entry.kind, + ApiKind::Method { + has_receiver: false, + class_filter: None + } + )); + } + #[test] fn deprecated_constants_alias_has_manifest_entries() { for name in [ diff --git a/docs/api/perry.d.ts b/docs/api/perry.d.ts index bfe07ec3f..d4da806d6 100644 --- a/docs/api/perry.d.ts +++ b/docs/api/perry.d.ts @@ -1,6 +1,6 @@ // Auto-generated from Perry's API manifest (#465). Do not edit by hand. // Source: perry-api-manifest::API_MANIFEST -// Coverage: 1778 entries across 88 modules +// Coverage: 1779 entries across 88 modules type PerryU32 = number & { readonly __perryU32?: never }; type PerryU64 = number & { readonly __perryU64?: never }; @@ -863,6 +863,8 @@ declare module "crypto" { /** stdlib */ export function randomBytes(...args: any[]): any; /** stdlib */ + export function randomFill(...args: any[]): any; + /** stdlib */ export function randomFillSync(...args: any[]): any; /** stdlib */ export function randomInt(...args: any[]): any; diff --git a/docs/src/api/reference.md b/docs/src/api/reference.md index 5da2f9add..4a4bae756 100644 --- a/docs/src/api/reference.md +++ b/docs/src/api/reference.md @@ -2,7 +2,7 @@ This page is auto-generated from Perry's compile-time API manifest (`perry-api-manifest::API_MANIFEST`). It is the source of truth for what `perry compile` accepts; references to symbols not listed here produce `R005 UnimplementedApi` (issue #463). Stubs (#464) are flagged ⚠ — they link cleanly but no-op at runtime on the chosen target. -Total: 1778 entries across 88 modules. +Total: 1779 entries across 88 modules. ## Modules @@ -651,6 +651,7 @@ Total: 1778 entries across 88 modules. - `publicDecrypt` — module - `publicEncrypt` — module - `randomBytes` — module +- `randomFill` — module - `randomFillSync` — module - `randomInt` — module - `randomInt` — module