MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Definitions

Method Definitions

tools/mage/js_sdk.go:143–160  ·  view source on GitHub ↗

Definitions extracts the api-definition.json from the proto generated api.json.

()

Source from the content-addressed store, hash-verified

141
142// Definitions extracts the api-definition.json from the proto generated api.json.
143func (k JsSDK) Definitions() error {
144 mg.Deps(Proto.JsSDK, JsSDK.AllowedFieldMaskPaths)
145 ok, err := target.Path(
146 filepath.Join("sdk", "js", "generated", "api-definition.json"),
147 filepath.Join("sdk", "js", "generated", "api.json"),
148 filepath.Join("sdk", "js", "generated", "allowed-field-mask-paths.json"),
149 )
150 if err != nil {
151 return targetError(err)
152 }
153 if !ok {
154 return nil
155 }
156 if mg.Verbose() {
157 fmt.Println("Extracting api definitions from protos")
158 }
159 return k.runYarnCommandV("definitions")
160}
161
162// DefinitionsClean removes the generated api-definition.json.
163func (k JsSDK) DefinitionsClean(context.Context) error {

Callers 1

mainFunction · 0.45

Calls 4

runYarnCommandVMethod · 0.95
targetErrorFunction · 0.85
JoinMethod · 0.65
DepsMethod · 0.45

Tested by

no test coverage detected