@platforma-sdk/workflow-tengo 4.16.0 → 4.17.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.
Files changed (38) hide show
  1. package/dist/tengo/lib/pt.expression.lib.tengo +48 -12
  2. package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
  3. package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
  4. package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
  5. package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
  6. package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
  7. package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
  8. package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
  9. package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
  10. package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
  11. package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
  12. package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
  13. package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
  14. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  17. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  18. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  19. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  20. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  21. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  22. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  23. package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
  24. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  25. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  26. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  27. package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
  28. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  29. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  30. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  31. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  32. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  33. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  34. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  35. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  36. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  37. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  38. package/package.json +2 -2
@@ -338,23 +338,59 @@ _newExpression = func(expression, currentAlias) {
338
338
 
339
339
 
340
340
 
341
- structField: func(...fieldNames) {
342
- ll.assert(len(fieldNames) > 0, "structField expects at least one field name")
343
- for fieldName in fieldNames {
344
- ll.assert(is_string(fieldName), "All field names must be strings, got: %T", fieldName)
345
- }
346
341
 
347
342
 
348
- currentExpr := expression
349
- for fieldName in fieldNames {
350
- currentExpr = {
351
- type: "struct_field",
352
- struct: currentExpr,
353
- fields: fieldName
343
+
344
+
345
+
346
+
347
+
348
+
349
+
350
+ structField: func(fieldPath, ...options) {
351
+
352
+ ll.assert(!is_undefined(fieldPath), "structField expects a field path (string or array of strings)")
353
+
354
+ fields := undefined
355
+ if is_string(fieldPath) {
356
+ fields = fieldPath
357
+ } else if is_array(fieldPath) {
358
+ ll.assert(len(fieldPath) > 0, "structField field path array cannot be empty")
359
+ for fieldName in fieldPath {
360
+ ll.assert(is_string(fieldName), "All field names in path must be strings, got: %T", fieldName)
361
+ }
362
+ if len(fieldPath) == 1 {
363
+ fields = fieldPath[0]
364
+ } else {
365
+ fields = fieldPath
354
366
  }
367
+ } else {
368
+ ll.panic("structField fieldPath must be a string or array of strings, got: %T", fieldPath)
369
+ }
370
+
371
+
372
+ ops := _validateOptions(options, {
373
+ "__options__,closed": "",
374
+ "default,?": "any",
375
+ "dtype,?": "string"
376
+ }, "structField")
377
+
378
+
379
+ structExpr := {
380
+ type: "struct_field",
381
+ struct: expression,
382
+ fields: fields
383
+ }
384
+
385
+
386
+ if !is_undefined(ops.default) {
387
+ structExpr.default = ops.default
388
+ }
389
+ if !is_undefined(ops.dtype) {
390
+ structExpr.dtype = ops.dtype
355
391
  }
356
392
 
357
- return _newExpression(currentExpr, undefined)
393
+ return _newExpression(structExpr, undefined)
358
394
  },
359
395
 
360
396
 
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/workflow-tengo",
3
- "version": "4.16.0",
3
+ "version": "4.17.0",
4
4
  "description": "Tengo SDK library",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@milaboratories/software-pframes-conv": "2.2.2",
20
20
  "@platforma-open/milaboratories.software-small-binaries": "^1.15.21",
21
- "@platforma-open/milaboratories.software-ptabler": "1.11.0"
21
+ "@platforma-open/milaboratories.software-ptabler": "1.12.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@platforma-sdk/tengo-builder": "^2.1.14"