@salesforce/b2c-tooling-sdk / safety / SafetyRule
Interface: SafetyRule ​
Defined in: packages/b2c-tooling-sdk/src/safety/types.ts:37
A safety rule that matches operations and specifies an action.
Rules support three matcher types, all using glob patterns (via minimatch):
method+path: Matches HTTP requests by method and URL pathjob: Matches job execution by job ID (extracted from OCAPI URLs)command: Matches CLI commands by oclif command ID (e.g., "sandbox:delete")
Example ​
{ "job": "sfcc-site-archive-export", "action": "allow" }
{ "command": "ecdn:cache:purge", "action": "confirm" }
{ "method": "DELETE", "path": "/code_versions/*", "action": "block" }Properties ​
action ​
action:
SafetyAction
Defined in: packages/b2c-tooling-sdk/src/safety/types.ts:47
Action to take when this rule matches.
command? ​
optionalcommand:string
Defined in: packages/b2c-tooling-sdk/src/safety/types.ts:45
CLI command ID glob pattern (e.g., "sandbox:*", "ecdn:cache:purge").
job? ​
optionaljob:string
Defined in: packages/b2c-tooling-sdk/src/safety/types.ts:43
Job ID glob pattern. Matches OCAPI job execution URLs by job ID.
method? ​
optionalmethod:string
Defined in: packages/b2c-tooling-sdk/src/safety/types.ts:39
HTTP method pattern (e.g., "POST", "DELETE"). Omit to match any method.
path? ​
optionalpath:string
Defined in: packages/b2c-tooling-sdk/src/safety/types.ts:41
URL path glob pattern (e.g., "/jobs/*/executions"). Matched with minimatch.