@platforma-sdk/workflow-tengo 4.6.2 → 4.6.4

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 (33) hide show
  1. package/dist/tengo/lib/pframes.data.lib.tengo +11 -6
  2. package/dist/tengo/lib/smart.lib.tengo +6 -2
  3. package/dist/tengo/lib/tpl.state-await.lib.tengo +3 -1
  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/exec.R.create-renv.plj.gz +0 -0
  11. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  12. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  13. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  14. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  17. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  18. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  19. package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
  20. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  21. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  22. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  23. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  24. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  25. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  26. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  27. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  28. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  29. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  30. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  31. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  32. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  33. package/package.json +2 -2
@@ -51,17 +51,14 @@ parseData := func(inputParam, ...optsRaw) {
51
51
  initialSpec := undefined
52
52
 
53
53
 
54
- isResourceDirectly := smart.isResource(inputParam)
54
+ isReferenceDirectly := smart.isReference(inputParam)
55
55
 
56
- if !isResourceDirectly && is_map(inputParam) && !is_undefined(inputParam.data) {
56
+ if !isReferenceDirectly && is_map(inputParam) && !is_undefined(inputParam.data) {
57
57
  actualResource = inputParam.data
58
- if parse && !smart.isResource(actualResource) {
59
- ll.panic("The 'data' field in inputParam must be a valid resource. Got: %v", actualResource)
60
- }
61
58
  if !is_undefined(inputParam.spec) {
62
59
  initialSpec = inputParam.spec
63
60
  }
64
- } else if isResourceDirectly {
61
+ } else if isReferenceDirectly {
65
62
  actualResource = inputParam
66
63
  } else {
67
64
  ll.panic(
@@ -70,6 +67,10 @@ parseData := func(inputParam, ...optsRaw) {
70
67
  )
71
68
  }
72
69
 
70
+ if parse && !smart.isResource(actualResource) {
71
+ ll.panic("Data must be a valid resource. Got: %v", actualResource)
72
+ }
73
+
73
74
  state := {
74
75
  resource: actualResource,
75
76
  resourceType: actualResource.info().Type,
@@ -112,6 +113,10 @@ parseData := func(inputParam, ...optsRaw) {
112
113
 
113
114
  _decodeKeyString := _createDecodeKeyString(state.relevantTopLayerKeyLength)
114
115
 
116
+ if !actualResource.info().InputsLocked {
117
+ ll.panic("Can't parse data resource which inputs are not locked.")
118
+ }
119
+
115
120
 
116
121
  if state.resourceType == pConstants.RTYPE_P_COLUMN_DATA_JSON {
117
122
  state.data = resourceData.data
@@ -135,6 +135,7 @@ isReference := func(f) {
135
135
 
136
136
  _getFutureField := func(from, name, fieldType, isEph) {
137
137
  ll.assert(isReference(from), "'from' must be either a resource or a field, got: %#v", from)
138
+ ll.assert(is_string(name) && name != "", "field name must be a non-empty string")
138
139
 
139
140
  futureField := tx.createFutureFieldID(fieldType, name, !isEph)
140
141
  f := field(futureField.ResourceFID)
@@ -385,8 +386,8 @@ resource = func(r) {
385
386
 
386
387
 
387
388
 
388
- isReady: func() {
389
- return self.info().ResourceReady
389
+ isFinal: func() {
390
+ return self.info().ResourceReady || self.info().IsDuplicate || self.info().HasErrors
390
391
  },
391
392
 
392
393
  isEphemeral: func() {
@@ -589,6 +590,7 @@ resource = func(r) {
589
590
  isEph = eph[0]
590
591
  }
591
592
 
593
+ ll.assert(is_string(name) && name != "", "field name must be a non-empty string")
592
594
  fieldId := ffDefault.getFutureFieldWithDefault(self.id, name, fieldType, isEph)
593
595
  return field(fieldId)
594
596
  },
@@ -1024,6 +1026,7 @@ field = func(f) {
1024
1026
  isEph = eph[0]
1025
1027
  }
1026
1028
 
1029
+ ll.assert(is_string(name) && name != "", "field name must be a non-empty string")
1027
1030
  fieldId := ffDefault.getFutureFieldWithDefault(self.id, name, fieldType, isEph)
1028
1031
  return field(fieldId)
1029
1032
  },
@@ -1114,6 +1117,7 @@ resourceBuilder = func(r) {
1114
1117
 
1115
1118
  createField: func(name, fieldType) {
1116
1119
  assertNotBuilt()
1120
+ ll.assert(is_string(name) && name != "", "field name must be a non-empty string")
1117
1121
  fid := ll.fieldId(super.id, name)
1118
1122
  tx.createField(fid, fieldType)
1119
1123
  return field(fid)
@@ -158,7 +158,9 @@ awaitOneState := func(field, path, state) {
158
158
  }
159
159
  }
160
160
  } else if state == "ResourceReady" {
161
- if resource.info().ResourceReady {
161
+
162
+
163
+ if resource.isFinal() {
162
164
  return { type: "Ready" }
163
165
  } else {
164
166
  return {
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.6.2",
3
+ "version": "4.6.4",
4
4
  "description": "Tengo SDK library",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "@platforma-open/milaboratories.software-ptabler": "1.6.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@platforma-sdk/tengo-builder": "^2.1.5"
24
+ "@platforma-sdk/tengo-builder": "^2.1.6"
25
25
  },
26
26
  "scripts": {
27
27
  "type-check": "pl-tengo check",