npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@simplysf/simply-permissions-core

v0.11.1

Published

Permission set generation, permission set XML, and permissions report rendering — the library layer behind @simplysf/simply-permissions, published separately for direct consumption (e.g. editor tooling, CI scripts) without the CLI framework

Readme

@simplysf/simply-permissions-core

NPM Downloads/week License: Apache-2.0

Permission set generation from source metadata, permission set XML, and permissions report rendering. This is not a Salesforce CLI plugin — it's the library layer behind @simplysf/simply-permissions's permission set build/report commands, published separately so it can be imported directly by anything that wants the same rendering (an editor extension, a CI job, a script) without pulling in the CLI framework.

Install

npm install @simplysf/simply-permissions-core

Requires Node.js >=22 and either "type": "module" or a dynamic import() — this package ships ESM only.

API

Everything below is exported from the package root. Removing or renaming an export is a breaking change; see src/index.ts.

| Export | Description | | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | buildPermissionSetXml(data) | Pure function: renders a complete PermissionSet metadata XML document from typed template data. | | buildPermissionsReportHtml(options) | Pure function: renders a self-contained HTML report of permission sets/groups, grouped by package. | | ObjectPermission, FieldPermission, TabSetting, RecordTypeVisibility, UserPermission, PermissionSetTemplateData | Types for buildPermissionSetXml's input. | | ObjectPermissionEntry, FieldPermissionEntry, PermissionSetReportEntry, PermissionSetGroupReportEntry, GroupedPermissionsData | Types for buildPermissionsReportHtml's input. |

import { buildPermissionSetXml, type PermissionSetTemplateData } from '@simplysf/simply-permissions-core';

const data: PermissionSetTemplateData = {
  label: 'My Permission Set',
  hasActivationRequired: false,
  objectPermissions: [
    {
      object: 'Account',
      allowCreate: true,
      allowDelete: false,
      allowEdit: true,
      allowRead: true,
      modifyAllRecords: false,
      viewAllRecords: true,
      viewAllFields: false,
    },
  ],
  fieldPermissions: [],
  tabSettings: [],
  recordTypeVisibilities: [],
  userPermissions: [],
};

const xml = buildPermissionSetXml(data);
// write xml to a `.permissionset-meta.xml` file
import { buildPermissionsReportHtml } from '@simplysf/simply-permissions-core';

const html = buildPermissionsReportHtml({
  username: '[email protected]',
  reportDate: new Date().toISOString(),
  groupedData: new Map([['', { permissionSets: [], permissionSetGroups: [] }]]),
});
// write html to a report file

Issues

Please report any issues at https://github.com/SimplySF/simply-plugins-core/issues

Contributing

This package is part of the @simplysf/simply monorepo. See CONTRIBUTING.md for what's specific to this package, and the repo's root CONTRIBUTING.md for repo structure, setup, commit conventions, and how to submit a pull request. Please also read our Code of Conduct.

License

Licensed under the Apache-2.0 license. | scanPermissionSetSource(directory) | Scans a source directory for custom objects, permissionable fields, tabs, and record types, recording the file each object and field came from and the fields left out as required or master-detail. Like sf project deploy start, it honors .forceignore but not .gitignore. | | compilePermissionSet(scan, options) | Pure function: applies a type baseline (read-only/view-all/modify-all) and overrides to a scan, returning PermissionSetTemplateData. | | writePermissionSet(data, name, output) | Renders and writes <output>/<name>.permissionset-meta.xml. | | loadPermissionSetBuildConfig(filePath) | Loads and validates an overrides file (PermissionSetBuildConfigSchema). | | loadPermissionSetBuildFile(filePath) | Loads and validates a permission set build file (PermissionSetBuildFileSchema), which defines one permission set, into a PermissionSetSpec: a referenced overrides file loaded, the source directory checked. A file in the pre-0.7 permissionSets list format is rejected with legacy-format. | | assertUniquePermissionSetNames(entries) | Throws duplicate-name if two { file, spec } entries declare the same permission set name, naming both files. | | findPermissionSetBuildFiles() | Every *.psbuild.json file under the current directory, as sorted /-separated relative paths. Doesn't descend into node_modules, .git, .sf, or .sfdx, or follow symbolic links. | | generatePermissionSets(specs, onPermissionSet?, onExplanation?) | Builds and writes each spec, scanning each distinct source directory once. With onExplanation, also passes each spec's PermissionSetExplanation to it, at the cost of a git lookup per source directory. | | checkPermissionSets(specs, onPermissionSet?, onExplanation?) | Builds each spec as generatePermissionSets does but writes nothing: compares it with the file at its output path and reports up-to-date, drifted, or missing. Formatting differences (indentation, line endings, comments) aren't drift. onExplanation as for generatePermissionSets. | | explainPermissionSets(specs, onPermissionSet?) | Builds each spec as generatePermissionSets does but writes nothing: returns, per spec, one ObjectAccessDecision per object saying whether its fields are granted by viewAllFields, by field permissions, or not at all; why (baseline, no-object-metadata, config-override, config-only); and which source files decided it, with each file's git status (tracked, untracked, ignored, unknown). | | findUntrackedSources(explanation) | The deciding files in an explanation that git doesn't track (untracked or ignored): usually metadata left behind by sf project retrieve start, which changes the generated permission set but isn't in anyone else's checkout. | | PermissionSetBuildError | Thrown by the above with a structural code (scan-failed, invalid-config, config-not-found, directory-not-found, legacy-format, duplicate-name) and args. | | PermissionSetBuildConfigSchema, PermissionSetBuildFileSchema | zod schemas for the overrides file and the permission set build file. | | PERMISSION_SET_BUILD_FILE_SUFFIX | '.psbuild.json', the suffix that marks a permission set build file, which findPermissionSetBuildFiles (and so sf simply cicd build check-permission-sets and a flagless sf simply permissions build) discovers files by. loadPermissionSetBuildFile accepts any name. | | PermissionSetExplanation, ObjectAccessDecision, FieldAccess, FieldAccessReason, SourceFile, GitFileStatus, OmittedField, UntrackedSource | Types for explainPermissionSets and findUntrackedSources. | | PermissionSetType, PermissionSetSourceScan, PermissionSetBuildOptions, PermissionSetSpec, PermissionSetBuildResult, PermissionSetCheckResult, PermissionSetCheckStatus, PermissionSetBuildErrorCode, PermissionSetBuildConfig, PermissionSetBuildFile | Types for the permission set build functions. |