@nocobase/plugin-workflow-javascript 2.1.0-beta.10 → 2.1.0-beta.12

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 (107) hide show
  1. package/dist/externalVersion.js +4 -4
  2. package/dist/node_modules/isolated-vm/.clang-tidy +13 -0
  3. package/dist/node_modules/isolated-vm/.dockerignore +9 -0
  4. package/dist/node_modules/isolated-vm/Dockerfile.alpine +9 -0
  5. package/dist/node_modules/isolated-vm/Dockerfile.debian +12 -0
  6. package/dist/node_modules/isolated-vm/LICENSE +13 -0
  7. package/dist/node_modules/isolated-vm/binding.gyp +120 -0
  8. package/dist/node_modules/isolated-vm/include.js +3 -0
  9. package/dist/node_modules/isolated-vm/inspector-example.js +59 -0
  10. package/dist/node_modules/isolated-vm/isolated-vm.d.ts +820 -0
  11. package/dist/node_modules/isolated-vm/isolated-vm.js +1 -0
  12. package/dist/node_modules/isolated-vm/native-example/binding.gyp +23 -0
  13. package/dist/node_modules/isolated-vm/native-example/example.cc +61 -0
  14. package/dist/node_modules/isolated-vm/native-example/package.json +13 -0
  15. package/dist/node_modules/isolated-vm/native-example/usage.js +35 -0
  16. package/dist/node_modules/isolated-vm/out/isolated_vm.node +0 -0
  17. package/dist/node_modules/isolated-vm/package.json +1 -0
  18. package/dist/node_modules/isolated-vm/src/external_copy/error.h +33 -0
  19. package/dist/node_modules/isolated-vm/src/external_copy/external_copy.cc +509 -0
  20. package/dist/node_modules/isolated-vm/src/external_copy/external_copy.h +117 -0
  21. package/dist/node_modules/isolated-vm/src/external_copy/serializer.cc +85 -0
  22. package/dist/node_modules/isolated-vm/src/external_copy/serializer.h +136 -0
  23. package/dist/node_modules/isolated-vm/src/external_copy/serializer_nortti.cc +73 -0
  24. package/dist/node_modules/isolated-vm/src/external_copy/string.cc +124 -0
  25. package/dist/node_modules/isolated-vm/src/external_copy/string.h +28 -0
  26. package/dist/node_modules/isolated-vm/src/isolate/allocator.h +32 -0
  27. package/dist/node_modules/isolated-vm/src/isolate/allocator_nortti.cc +142 -0
  28. package/dist/node_modules/isolated-vm/src/isolate/class_handle.h +334 -0
  29. package/dist/node_modules/isolated-vm/src/isolate/cpu_profile_manager.cc +220 -0
  30. package/dist/node_modules/isolated-vm/src/isolate/cpu_profile_manager.h +100 -0
  31. package/dist/node_modules/isolated-vm/src/isolate/environment.cc +626 -0
  32. package/dist/node_modules/isolated-vm/src/isolate/environment.h +381 -0
  33. package/dist/node_modules/isolated-vm/src/isolate/executor.cc +198 -0
  34. package/dist/node_modules/isolated-vm/src/isolate/executor.h +183 -0
  35. package/dist/node_modules/isolated-vm/src/isolate/external.h +64 -0
  36. package/dist/node_modules/isolated-vm/src/isolate/functor_runners.h +97 -0
  37. package/dist/node_modules/isolated-vm/src/isolate/generic/array.h +145 -0
  38. package/dist/node_modules/isolated-vm/src/isolate/generic/callbacks.h +272 -0
  39. package/dist/node_modules/isolated-vm/src/isolate/generic/error.h +140 -0
  40. package/dist/node_modules/isolated-vm/src/isolate/generic/extract_params.h +145 -0
  41. package/dist/node_modules/isolated-vm/src/isolate/generic/handle_cast.h +257 -0
  42. package/dist/node_modules/isolated-vm/src/isolate/generic/read_option.h +47 -0
  43. package/dist/node_modules/isolated-vm/src/isolate/holder.cc +88 -0
  44. package/dist/node_modules/isolated-vm/src/isolate/holder.h +63 -0
  45. package/dist/node_modules/isolated-vm/src/isolate/inspector.cc +200 -0
  46. package/dist/node_modules/isolated-vm/src/isolate/inspector.h +70 -0
  47. package/dist/node_modules/isolated-vm/src/isolate/node_wrapper.h +15 -0
  48. package/dist/node_modules/isolated-vm/src/isolate/platform_delegate.cc +22 -0
  49. package/dist/node_modules/isolated-vm/src/isolate/platform_delegate.h +46 -0
  50. package/dist/node_modules/isolated-vm/src/isolate/remote_handle.h +164 -0
  51. package/dist/node_modules/isolated-vm/src/isolate/run_with_timeout.h +171 -0
  52. package/dist/node_modules/isolated-vm/src/isolate/runnable.h +29 -0
  53. package/dist/node_modules/isolated-vm/src/isolate/scheduler.cc +191 -0
  54. package/dist/node_modules/isolated-vm/src/isolate/scheduler.h +165 -0
  55. package/dist/node_modules/isolated-vm/src/isolate/specific.h +35 -0
  56. package/dist/node_modules/isolated-vm/src/isolate/stack_trace.cc +219 -0
  57. package/dist/node_modules/isolated-vm/src/isolate/stack_trace.h +24 -0
  58. package/dist/node_modules/isolated-vm/src/isolate/strings.h +127 -0
  59. package/dist/node_modules/isolated-vm/src/isolate/three_phase_task.cc +385 -0
  60. package/dist/node_modules/isolated-vm/src/isolate/three_phase_task.h +136 -0
  61. package/dist/node_modules/isolated-vm/src/isolate/transferable.h +15 -0
  62. package/dist/node_modules/isolated-vm/src/isolate/util.h +45 -0
  63. package/dist/node_modules/isolated-vm/src/isolate/v8_inspector_wrapper.h +12 -0
  64. package/dist/node_modules/isolated-vm/src/isolate/v8_version.h +12 -0
  65. package/dist/node_modules/isolated-vm/src/isolated_vm.h +71 -0
  66. package/dist/node_modules/isolated-vm/src/lib/covariant.h +50 -0
  67. package/dist/node_modules/isolated-vm/src/lib/lockable.h +178 -0
  68. package/dist/node_modules/isolated-vm/src/lib/suspend.h +106 -0
  69. package/dist/node_modules/isolated-vm/src/lib/thread_pool.cc +98 -0
  70. package/dist/node_modules/isolated-vm/src/lib/thread_pool.h +45 -0
  71. package/dist/node_modules/isolated-vm/src/lib/timer.cc +233 -0
  72. package/dist/node_modules/isolated-vm/src/lib/timer.h +36 -0
  73. package/dist/node_modules/isolated-vm/src/module/callback.cc +151 -0
  74. package/dist/node_modules/isolated-vm/src/module/callback.h +64 -0
  75. package/dist/node_modules/isolated-vm/src/module/context_handle.cc +241 -0
  76. package/dist/node_modules/isolated-vm/src/module/context_handle.h +35 -0
  77. package/dist/node_modules/isolated-vm/src/module/evaluation.cc +109 -0
  78. package/dist/node_modules/isolated-vm/src/module/evaluation.h +99 -0
  79. package/dist/node_modules/isolated-vm/src/module/external_copy_handle.cc +119 -0
  80. package/dist/node_modules/isolated-vm/src/module/external_copy_handle.h +64 -0
  81. package/dist/node_modules/isolated-vm/src/module/isolate.cc +136 -0
  82. package/dist/node_modules/isolated-vm/src/module/isolate_handle.cc +611 -0
  83. package/dist/node_modules/isolated-vm/src/module/isolate_handle.h +47 -0
  84. package/dist/node_modules/isolated-vm/src/module/lib_handle.cc +77 -0
  85. package/dist/node_modules/isolated-vm/src/module/lib_handle.h +28 -0
  86. package/dist/node_modules/isolated-vm/src/module/module_handle.cc +475 -0
  87. package/dist/node_modules/isolated-vm/src/module/module_handle.h +68 -0
  88. package/dist/node_modules/isolated-vm/src/module/native_module_handle.cc +104 -0
  89. package/dist/node_modules/isolated-vm/src/module/native_module_handle.h +49 -0
  90. package/dist/node_modules/isolated-vm/src/module/reference_handle.cc +636 -0
  91. package/dist/node_modules/isolated-vm/src/module/reference_handle.h +106 -0
  92. package/dist/node_modules/isolated-vm/src/module/script_handle.cc +107 -0
  93. package/dist/node_modules/isolated-vm/src/module/script_handle.h +37 -0
  94. package/dist/node_modules/isolated-vm/src/module/session_handle.cc +173 -0
  95. package/dist/node_modules/isolated-vm/src/module/session_handle.h +31 -0
  96. package/dist/node_modules/isolated-vm/src/module/transferable.cc +268 -0
  97. package/dist/node_modules/isolated-vm/src/module/transferable.h +42 -0
  98. package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v18.0.0.h +360 -0
  99. package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v18.3.0.h +376 -0
  100. package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v20.0.0.h +397 -0
  101. package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v22.0.0.h +419 -0
  102. package/dist/node_modules/winston-transport/package.json +1 -1
  103. package/dist/server/IsolatedVm.js +75 -0
  104. package/dist/server/ScriptInstruction.d.ts +6 -0
  105. package/dist/server/ScriptInstruction.js +11 -1
  106. package/dist/server/Vm.js +42 -27
  107. package/package.json +3 -2
@@ -13,11 +13,11 @@ module.exports = {
13
13
  "antd-style": "3.7.1",
14
14
  "@formily/antd-v5": "1.2.3",
15
15
  "@ant-design/icons": "5.6.1",
16
- "@nocobase/client": "2.1.0-beta.10",
17
- "@nocobase/plugin-workflow": "2.1.0-beta.10",
16
+ "@nocobase/client": "2.1.0-beta.12",
17
+ "@nocobase/plugin-workflow": "2.1.0-beta.12",
18
18
  "antd": "5.24.2",
19
- "@nocobase/flow-engine": "2.1.0-beta.10",
19
+ "@nocobase/flow-engine": "2.1.0-beta.12",
20
20
  "react-i18next": "11.18.6",
21
21
  "winston": "3.13.0",
22
- "@nocobase/server": "2.1.0-beta.10"
22
+ "@nocobase/server": "2.1.0-beta.12"
23
23
  };
@@ -0,0 +1,13 @@
1
+ ---
2
+ Checks: 'bugprone-*,clang-*,hicpp-*,misc-*,modernize-*,performance-*,readability-*,-bugprone-easily-swappable-parameters,-hicpp-avoid-c-arrays,-hicpp-no-array-decay,-hicpp-no-malloc,-hicpp-signed-bitwise,-hicpp-use-override,-misc-const-correctness,-misc-no-recursion,-misc-non-private-member-variables-in-classes,-modernize-avoid-c-arrays,-modernize-use-nodiscard,-readability-else-after-return,-readability-magic-numbers,-readability-function-cognitive-complexity'
3
+ HeaderFilterRegex: 'src/*'
4
+ CheckOptions:
5
+ - key: readability-identifier-length.MinimumVariableNameLength
6
+ value: '2'
7
+ - key: readability-identifier-length.MinimumParameterNameLength
8
+ value: '2'
9
+ - key: hicpp-special-member-functions.AllowMissingMoveFunctions
10
+ value: '1'
11
+ - key: hicpp-special-member-functions.AllowSoleDefaultDtor
12
+ value: '1'
13
+ ...
@@ -0,0 +1,9 @@
1
+ .git
2
+ .gitignore
3
+ .dockerignore
4
+ Dockerfile*
5
+ examples
6
+ node_modules
7
+ out
8
+ prebuilds
9
+ spec
@@ -0,0 +1,9 @@
1
+ FROM node:22-alpine3.20 AS build
2
+ WORKDIR /isolated-vm
3
+ RUN apk add g++ make python3
4
+ COPY . .
5
+ RUN npm install --ignore-scripts
6
+ RUN MAKEFLAGS=-j$(nproc) npx -y prebuild
7
+
8
+ FROM scratch
9
+ COPY --from=build /isolated-vm/prebuilds .
@@ -0,0 +1,12 @@
1
+ FROM node:22-bullseye-slim AS build
2
+ WORKDIR /isolated-vm
3
+ RUN apt-get update && \
4
+ apt-get install -y --no-install-recommends \
5
+ g++ \
6
+ make \
7
+ python3
8
+ COPY . .
9
+ RUN npm install --ignore-scripts
10
+ RUN MAKEFLAGS=-j$(nproc) npx -y prebuild
11
+ FROM scratch
12
+ COPY --from=build /isolated-vm/prebuilds .
@@ -0,0 +1,13 @@
1
+ Copyright 2017 Marcel Laverdet
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted, provided that the above
5
+ copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,120 @@
1
+ {
2
+ 'target_defaults': {
3
+ 'default_configuration': 'Release',
4
+ 'configurations': {
5
+ 'Common': {
6
+ 'cflags_cc': [ '-std=c++17', '-g', '-Wno-unknown-pragmas' ],
7
+ 'cflags_cc!': [ '-fno-exceptions' ],
8
+ 'include_dirs': [ './src', './vendor' ],
9
+ 'xcode_settings': {
10
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
11
+ 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
12
+ 'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
13
+ 'MACOSX_DEPLOYMENT_TARGET': '10.12',
14
+ },
15
+ 'msvs_settings': {
16
+ 'VCCLCompilerTool': {
17
+ 'AdditionalOptions': [ '-std:c++17', '/GR' ],
18
+ 'ExceptionHandling': '1',
19
+ },
20
+ },
21
+ 'msvs_disabled_warnings': [
22
+ 4101, # Unreferenced local (msvc fires these for ignored exception)
23
+ 4068, # Unknown pragma
24
+ ],
25
+ 'conditions': [
26
+ [ 'OS == "win"', { 'defines': [ 'NOMSG', 'NOMINMAX', 'WIN32_LEAN_AND_MEAN' ] } ],
27
+ ],
28
+ },
29
+ 'Release': {
30
+ 'inherit_from': [ 'Common' ],
31
+ 'cflags': [ '-Wno-deprecated-declarations' ],
32
+ 'xcode_settings': {
33
+ 'GCC_OPTIMIZATION_LEVEL': '3',
34
+ 'OTHER_CFLAGS': [ '-Wno-deprecated-declarations' ],
35
+ },
36
+ 'msvs_disabled_warnings': [
37
+ 4996, # Deprecation
38
+ ],
39
+ },
40
+ 'Debug': {
41
+ 'inherit_from': [ 'Common' ],
42
+ 'defines': [ 'V8_IMMINENT_DEPRECATION_WARNINGS' ],
43
+ },
44
+ },
45
+ },
46
+ 'targets': [
47
+ {
48
+ 'target_name': 'isolated_vm',
49
+ 'cflags_cc!': [ '-fno-rtti' ],
50
+ 'xcode_settings': {
51
+ 'GCC_ENABLE_CPP_RTTI': 'YES',
52
+ },
53
+ 'msvs_settings': {
54
+ 'VCCLCompilerTool': {
55
+ 'RuntimeTypeInfo': 'true',
56
+ },
57
+ },
58
+ 'conditions': [
59
+ [ 'OS == "linux"', { 'defines': [ 'USE_CLOCK_THREAD_CPUTIME_ID' ] } ],
60
+ ],
61
+ 'sources': [
62
+ 'src/external_copy/external_copy.cc',
63
+ 'src/external_copy/serializer.cc',
64
+ 'src/external_copy/serializer_nortti.cc',
65
+ 'src/external_copy/string.cc',
66
+ 'src/isolate/allocator_nortti.cc',
67
+ 'src/isolate/environment.cc',
68
+ "src/isolate/cpu_profile_manager.cc",
69
+ 'src/isolate/executor.cc',
70
+ 'src/isolate/holder.cc',
71
+ 'src/isolate/inspector.cc',
72
+ 'src/isolate/platform_delegate.cc',
73
+ 'src/isolate/scheduler.cc',
74
+ 'src/isolate/stack_trace.cc',
75
+ 'src/isolate/three_phase_task.cc',
76
+ 'src/lib/thread_pool.cc',
77
+ 'src/lib/timer.cc',
78
+ 'src/module/callback.cc',
79
+ 'src/module/context_handle.cc',
80
+ 'src/module/evaluation.cc',
81
+ 'src/module/external_copy_handle.cc',
82
+ 'src/module/isolate.cc',
83
+ 'src/module/isolate_handle.cc',
84
+ 'src/module/lib_handle.cc',
85
+ 'src/module/module_handle.cc',
86
+ 'src/module/native_module_handle.cc',
87
+ 'src/module/reference_handle.cc',
88
+ 'src/module/script_handle.cc',
89
+ 'src/module/session_handle.cc',
90
+ 'src/module/transferable.cc'
91
+ ],
92
+ 'conditions': [
93
+ [ 'OS != "win"', {
94
+ 'dependencies': [ 'nortti' ],
95
+ 'sources/': [ [ 'exclude', '_nortti\\.cc$'] ],
96
+ } ],
97
+ ],
98
+ 'libraries': [
99
+ '<!@(node -e "process.config.target_defaults.libraries.map(flag=>console.log(flag))")'
100
+ ],
101
+ },
102
+ {
103
+ 'target_name': 'nortti',
104
+ 'type': 'static_library',
105
+ 'sources': [
106
+ 'src/external_copy/serializer_nortti.cc',
107
+ 'src/isolate/allocator_nortti.cc',
108
+ ],
109
+ },
110
+ {
111
+ 'target_name': 'action_after_build',
112
+ 'type': 'none',
113
+ 'dependencies': [ 'isolated_vm' ],
114
+ 'copies': [ {
115
+ 'files': [ '<(PRODUCT_DIR)/isolated_vm.node' ],
116
+ 'destination': 'out',
117
+ } ],
118
+ },
119
+ ],
120
+ }
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+ const path = require('path');
3
+ console.log(path.join(__dirname, 'src'));
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+ let WebSocket = require('ws');
3
+ let ivm = require('./isolated-vm');
4
+
5
+ /**
6
+ * IMPORTANT: Allowing untrusted users to access the v8 inspector will almost certainly result in a
7
+ * security vulnerability. Access to these endpoints should be restricted.
8
+ */
9
+
10
+ // Launch an infinite loop in another thread
11
+ let isolate = new ivm.Isolate({ inspector: true });
12
+ (async function() {
13
+ let context = await isolate.createContext({ inspector: true });
14
+ const inspector = isolate.createInspectorSession();
15
+ inspector.dispatchProtocolMessage('{"id":1,"method":"Debugger.enable"}');
16
+ await context.eval('/* break on script start */debugger;');
17
+ inspector.dispose();
18
+ let script = await isolate.compileScript('console.log("hello world")', { filename: 'example.js' });
19
+ await script.run(context);
20
+ }()).catch(console.error);
21
+
22
+ // Create an inspector channel on port 10000
23
+ let wss = new WebSocket.Server({ port: 10000 });
24
+
25
+ wss.on('connection', function(ws) {
26
+ // Dispose inspector session on websocket disconnect
27
+ let channel = isolate.createInspectorSession();
28
+ function dispose() {
29
+ try {
30
+ channel.dispose();
31
+ } catch (err) {}
32
+ }
33
+ ws.on('error', dispose);
34
+ ws.on('close', dispose);
35
+
36
+ // Relay messages from frontend to backend
37
+ ws.on('message', function(message) {
38
+ console.log('<', message.toString())
39
+ try {
40
+ channel.dispatchProtocolMessage(String(message));
41
+ } catch (err) {
42
+ // This happens if inspector session was closed unexpectedly
43
+ ws.close();
44
+ }
45
+ });
46
+
47
+ // Relay messages from backend to frontend
48
+ function send(message) {
49
+ console.log('>', message.toString())
50
+ try {
51
+ ws.send(message);
52
+ } catch (err) {
53
+ dispose();
54
+ }
55
+ }
56
+ channel.onResponse = (callId, message) => send(message);
57
+ channel.onNotification = send;
58
+ });
59
+ console.log('Inspector: devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:10000');