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

sfpt

v1.0.2

Published

用于在Excel中填写权限,通过修改本地PermissionSet的文件,达到批量调整

Downloads

1

Readme

sf-pt 使用说明

描述:

本工具目地简单明了,就是通过在Excel中配置权限,通过工具读取本地的PermissionSet 元数据, 将Excel中的权限附加到指定的元数据中,达到批量修改

准备工作

  • 请确保电脑上已经具有node环境

  • 请确保电脑上已经安装好SFDX CLI

  • 请确保通过SFDX 授权了对应SF Org

  • 通过npm install sfpt 安装sfpt

使用方法

1. 初始化

创建一个目录,进入目录后,sfpt init 会自动生成初始化的目录 init

  • config.json 程序的配置文件

  • input 存放PermissionSet的XML目录

  • output 生成新的PermissionSet的XML目录

  • PermissionSetConfig.xlsx 用于权限配置

  • sfdx-project.json SFDX验证所需要

  • retrieve SFDX获取PermissionSet 元数据存放的目录

    以上目录位置均可以在config.json中配置,但是一般保持默认,所有命令在当前目录下执行

2. 配置username

打开config.json中,将本地授权过的SF用户名填写在SFUserName,要看本地授权的SF Org,通过sfdx force:org:list 查看

3. 获取Org所有的权限集

  • 执行sfpt retrieve,将获取的权限集元数据存放在retrieve目录下

4. config.json中的permissionSetFiles选

  • 在retrieve目录中选择需要添加权限的权限集,将元数据复制到input目录

新版本中此处可以不需要,只要将要处理的PermissionSet的XML放在input目录下就可以了

  • 执行 sfpt load 程序将input目录下的权限集名称,自动填充到config.json中的permissionSetFiles节点中(避免手动填写)。

5. 在Excel中配置好权限

  • 每个sheet的名称与权限集中的节点对应,比如fieldPermissions

  • 表头与fieldPermissions节点下的子节点对应,不同类型的权限,子节点不相同

  • 程序默认创建4种常见类型的权限

6. 生成新的权限集元数据

  • 当excel中权限配置完成后,执行sfpt run 后,会在output 目录下生成新的元数据,同时会执行验证程序,来验证permission是否正确
  • 如果输出:Successfully validated the deployment,则表明生成的PemissionSet是没有问题

7. 验证元数据

  • 执行 sfpt verify config.json 执行验证元数据,看元数据合并是否有错误,此处调用SFDX命令

新版本中此处可以不需要,在执行 sfpt run时会最后会自动验证

8. 将新的元数据部署到Org中

  • 执行 sfpt deploy 执行元数据部署,此处调用SFDX命令

9. 生成Excel文件

  • 执行sfpt x2e 会将retrieve目录下的permission.xml生成对应的Excel文件

补充:

  • tabSettings中的visibility有三个值:Invisible,Visible,Available,当为Invisible时,程序会移除这行,生成新的xml中不含,deploy后就不会有这个权限