@sitevision/api 2025.4.2 → 2025.7.1
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.
- package/common/events/index.d.ts +357 -0
- package/index.d.ts +1 -0
- package/package.json +2 -2
- package/server/FileIconRenderer/index.d.ts +1 -0
- package/server/IconUtil/index.d.ts +1 -0
- package/server/NodeTypeUtil/index.d.ts +18 -0
- package/server/ResourceLocatorUtil/index.d.ts +14 -0
- package/server/ResourceLocatorUtil/index.js +3 -1
- package/server/Utils/index.d.ts +14 -26
- package/server/VelocityRenderer/index.d.ts +9 -8
- package/server/ai/index.d.ts +15 -10
- package/server/aiAssistant/index.d.ts +197 -0
- package/server/aiAssistant/index.js +14 -0
- package/types/senselogic/sitevision/api/render/TextModuleRenderer/index.d.ts +28 -2
- package/types/senselogic/sitevision/api/render/TextModuleRenderer/index.js +2 -1
- package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.ExceptionSuppressingProxyConstants/index.d.ts +2 -1
- package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.NodeTypeUtilConstants/index.d.ts +21 -0
- package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.NodeTypeUtilConstants/index.js +4 -1
- package/types/senselogic/sitevision/api/render/velocity/VelocityEvaluator/index.d.ts +3 -34
- package/types/senselogic/sitevision/api/script/proxy/ExceptionSuppressingCollection/index.d.ts +4 -83
- package/types/senselogic/sitevision/api/script/proxy/ExceptionSuppressingIterator/index.d.ts +7 -54
- package/types/senselogic/sitevision/api/script/proxy/ExceptionSuppressingProxy/index.d.ts +8 -71
|
@@ -3,90 +3,27 @@ import type { Object } from "../../../../../../java/lang/Object";
|
|
|
3
3
|
import type { ExceptionSuppressingProxyConstants } from "../../../render/velocity/VelocityAccess.ExceptionSuppressingProxyConstants";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* will throw an exception.
|
|
8
|
-
*
|
|
9
|
-
* <p>
|
|
10
|
-
* This interface is an exception suppressing implementation of a so called
|
|
11
|
-
* <em><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/reflection/proxy.html">Dynamic proxy</a></em>.
|
|
12
|
-
* This means it will proxy all methods of an object that are declared in an interface implemented by the object.
|
|
13
|
-
* If a method invocation through this proxy throws an <code>Exception</code>, it will be catched and the default value will be returned
|
|
14
|
-
* (e.g. <code>null</code>, <code>0</code>, <code>false</code> etc).
|
|
15
|
-
* </p>
|
|
16
|
-
*
|
|
17
|
-
* <p>
|
|
18
|
-
* <strong>Important note! </strong>This interface is intended to be used <em>only</em> in contexts where exceptions will cause <em>serious</em>
|
|
19
|
-
* trouble if they arise and the context doesn't provide proper exception handling (e.g. when executing a Velocity template).
|
|
20
|
-
* Suppressing exceptions is generally a <em>really</em> bad idea and using this proxy will affect performance.
|
|
21
|
-
* Hence, this interface should only be used where the upsides with suppressing exceptions far outweighs the downsides.
|
|
22
|
-
* This interface should be used only as a temporary patch/solution until the "real" problem causing the exception has been solved.
|
|
23
|
-
* </p>
|
|
24
|
-
*
|
|
25
|
-
* <p>
|
|
26
|
-
* The state of an ExceptionSuppressingProxy is available at all times and updated for each method invocation
|
|
27
|
-
* (except for invocations of methods declared in this interface).
|
|
28
|
-
* If last method invocation resulted in a thrown exception the proxy status will be {@link #EXCEPTION_THROWN_STATUS}
|
|
29
|
-
* and the exception will be available via {@link #getCurrentException()}.
|
|
30
|
-
* </p>
|
|
31
|
-
*
|
|
32
|
-
* <p>
|
|
33
|
-
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
34
|
-
* {@link senselogic.sitevision.api.Utils#getExceptionSuppressingProxy(Object)}.
|
|
35
|
-
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
|
|
36
|
-
* </p>
|
|
37
|
-
*
|
|
38
|
-
* <p>
|
|
39
|
-
* ----------------------------------------------------------------------------------------------------
|
|
40
|
-
* </p>
|
|
41
|
-
*
|
|
42
|
-
* <p>
|
|
43
|
-
* <strong>Example of how <code>ExceptionSuppressingProxy</code> could be used in Velocity:</strong>
|
|
44
|
-
* </p>
|
|
45
|
-
*
|
|
46
|
-
* <p>Case description:</p>
|
|
47
|
-
* <p>
|
|
48
|
-
* <em>You have a Velocity template where a certain method invocation sometimes throws an exception.
|
|
49
|
-
* The rendered output of the template gets corrupt whenever an exception is thrown and you have not yet tracked down the root cause
|
|
50
|
-
* of the exception. Until the root cause is found and the problem is fixed, you need a temporary solution that ignores exceptions
|
|
51
|
-
* to keep template output acceptable. Since the method is declared in an interface and implemented in the instance you're invoking,
|
|
52
|
-
* you're in sheer luck. You can use an <code>ExceptionSuppressingProxy</code> to suppress exceptions in order to diminish output
|
|
53
|
-
* problems.</em><p>This is what the code looks like before your temporary fix:
|
|
54
|
-
* </p>
|
|
55
|
-
* <pre><code>
|
|
56
|
-
* <p>
|
|
57
|
-
* $myObject.thisNeverThrowsExceptions()
|
|
58
|
-
* $myObject.thisMethodSometimesThrowsExceptions() <em>## This method is declared in an interface, hence can be proxied</em>
|
|
59
|
-
* </p>
|
|
60
|
-
* </code></pre>
|
|
61
|
-
* This is how you could use an <code>ExceptionSuppressingProxy</code> to apply a temporary fix:<pre><code>
|
|
62
|
-
* <p>
|
|
63
|
-
* $myObject.thisNeverThrowsExceptions()
|
|
64
|
-
*
|
|
65
|
-
* <em>## Get an ExceptionSuppressingProxy instance for myObject</em>
|
|
66
|
-
* #set ($proxy = $sitevisionUtils.getExceptionSuppressingProxy($myObject))
|
|
67
|
-
*
|
|
68
|
-
* $!proxy.thisMethodSometimesThrowsExceptions() <em>## Method invoked through a proxy, might return null</em>
|
|
69
|
-
* </p>
|
|
70
|
-
* </code></pre>
|
|
6
|
+
* Deprecated interface that will be removed in a future version of Sitevision.
|
|
71
7
|
* @author Magnus Lövgren
|
|
72
8
|
* @since Sitevision 2.6.1_09
|
|
9
|
+
* @deprecated this interface is deprecated and will be removed in a future version of Sitevision
|
|
73
10
|
*/
|
|
74
11
|
export type ExceptionSuppressingProxy = ExceptionSuppressingProxyConstants & {
|
|
75
12
|
/**
|
|
76
|
-
*
|
|
77
|
-
* @return {@link #
|
|
13
|
+
* Always returns {@link #NO_EXCEPTION_THROWN_STATUS}.
|
|
14
|
+
* @return {@link #NO_EXCEPTION_THROWN_STATUS}
|
|
78
15
|
*/
|
|
79
16
|
getCurrentStatus(): number;
|
|
80
17
|
|
|
81
18
|
/**
|
|
82
|
-
*
|
|
83
|
-
* @return
|
|
19
|
+
* Always returns null.
|
|
20
|
+
* @return null
|
|
84
21
|
*/
|
|
85
22
|
getCurrentException(): Exception;
|
|
86
23
|
|
|
87
24
|
/**
|
|
88
|
-
* Returns the
|
|
89
|
-
* @return the
|
|
25
|
+
* Returns the object this ExceptionSuppressingProxy was created for.
|
|
26
|
+
* @return the decorated object
|
|
90
27
|
*/
|
|
91
28
|
getProxiedObject(): unknown;
|
|
92
29
|
|