@platforma-sdk/workflow-tengo 2.10.2 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -214,13 +214,7 @@ resolve := func(ref, ...options) {
214
214
  // template for prerun
215
215
  _preRunTpl := undefined
216
216
 
217
- /**
218
- * Prepare additional resources for the workflow body. The body function of the workflow will be executed only when the references will be
219
- * returned by the prepare method will ve resolved into a ready resources. The resulting resources will be passed as an input to the body function.
220
- *
221
- * @param cb: a callback function returning a map of references to be resolved
222
- */
223
- prepare := func(cb) {
217
+ _prepare := func(cb) {
224
218
  self.prepare(func(_){
225
219
  raw := cb(args())
226
220
  prefixed := {}
@@ -232,6 +226,32 @@ prepare := func(cb) {
232
226
  })
233
227
  }
234
228
 
229
+ /**
230
+ * Prepare additional resources for the workflow body. The body function of the workflow will be executed only when the references will be
231
+ * returned by the prepare method will ve resolved into a ready resources. The resulting resources will be passed as an input to the body function.
232
+ *
233
+ * @param cb: a callback function returning a map of references to be resolved
234
+ */
235
+ prepare := func(cb) {
236
+ if !_isProduction() {
237
+ return
238
+ }
239
+ _prepare(cb)
240
+ }
241
+
242
+ /**
243
+ * Prepare additional resources for the workflow body in pre-run. The body function of the workflow will be executed only when the references will be
244
+ * returned by the prepare method will ve resolved into a ready resources. The resulting resources will be passed as an input to the body function.
245
+ *
246
+ * @param cb: a callback function returning a map of references to be resolved
247
+ */
248
+ preparePreRun := func(cb) {
249
+ if !_isStaging() {
250
+ return
251
+ }
252
+ _prepare(cb)
253
+ }
254
+
235
255
  /**
236
256
  * Defines a pre run entry point for a current workflow
237
257
  */
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/workflow-tengo",
3
- "version": "2.10.2",
3
+ "version": "2.11.0",
4
4
  "description": "Tengo SDK library",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",