@salesforce/b2c-tooling-sdk / project-index / IndexedHook
Interface: IndexedHook
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:108
A hook registration from a cartridge's hooks.json.
Properties
calledFunctions?
optionalcalledFunctions:object[]
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:144
For custom hooks: each function the project names in HookMgr.callHook(name, fn, ...), with its line in this script when the script exports it and the call sites that use it.
callers
callers:
HookCaller[]
line?
optionalline:number
name
name:
string
cartridge
cartridge:
string
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:127
exports?
optionalexports:string[]
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:126
Functions the script exports (custom hooks can be called with any of them).
function?
optionalfunction:string
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:124
For system extension points, the function the platform calls: the extension point's last segment (afterPOST, calculate). Custom extension points have no fixed function; callers name it in HookMgr.callHook(extensionPoint, functionName, ...).
kind
kind:
"system"|"custom"
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:117
system for platform extension points (dw.*: OCAPI/SCAPI hooks and hooks such as dw.order.calculate): registrations run in cartridge path order, and the first one that returns a value skips later registrations and the system implementation. custom for your own extension points: every registration runs.
line?
optionalline:number
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:135
Line of the system hook's function in the script, when found.
name
name:
string
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:110
Extension point, for example dw.ocapi.shop.basket.afterPOST.
registeredIn?
optionalregisteredIn:object
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:139
The hooks.json that registers this hook, relative to cartridge, and the line of its entry.
line?
optionalline:number
relPath
relPath:
string
relPath?
optionalrelPath:string
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:131
Resolved script file relative to its cartridge, when it exists.
returnsValue
returnsValue:
ReturnBehavior
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:137
For system hooks: whether the function returns a value. unknown for custom hooks.
script
script:
string
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:129
Script path as written in hooks.json.
scriptCartridge?
optionalscriptCartridge:string
Defined in: packages/b2c-tooling-sdk/src/project-index/types.ts:133
The cartridge the script resolved to, when it isn't cartridge (a */cartridge/... script).