@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.
@@ -1,3 +1,332 @@
1
+ import type { Node } from '../../types/javax/jcr/Node';
2
+
3
+ /** Emitted when something (typically a page) is published. */
4
+ export type PublishingPublishOptions = {
5
+ /** The full name of the event */
6
+ event: 'sv:publishing:publish';
7
+ /** The JCR identifier of the emitting user */
8
+ emitter: string;
9
+ /** The timestamp when the event was emitted */
10
+ timestamp: number;
11
+ /** The JCR identifier of the node that was published */
12
+ node: string;
13
+ /** If the publishing comment feature is enabled and a comment has been provided */
14
+ publishingComment?: string;
15
+ };
16
+
17
+ /** Emitted when something (typically a page) is unpublished. */
18
+ export type PublishingUnpublishOptions = {
19
+ /** The full name of the event */
20
+ event: 'sv:publishing:unpublish';
21
+ /** The JCR identifier of the emitting user */
22
+ emitter: string;
23
+ /** The timestamp when the event was emitted */
24
+ timestamp: number;
25
+ /** The JCR identifier of the node that was unpublished */
26
+ node: string;
27
+ };
28
+
29
+ /** Emitted when a simple user is created. */
30
+ export type SimpleUserCreateOptions = {
31
+ /** The full name of the event */
32
+ event: 'sv:simpleuser:create';
33
+ /** The JCR identifier of the emitting user */
34
+ emitter: string;
35
+ /** The timestamp when the event was emitted */
36
+ timestamp: number;
37
+ /** The JCR identifier of the simple user that was created */
38
+ user: string;
39
+ };
40
+
41
+ /** Emitted when a simple user is updated. */
42
+ export type SimpleUserUpdateOptions = {
43
+ /** The full name of the event */
44
+ event: 'sv:simpleuser:update';
45
+ /** The JCR identifier of the emitting user */
46
+ emitter: string;
47
+ /** The timestamp when the event was emitted */
48
+ timestamp: number;
49
+ /** The JCR identifier of the simple user that was updated */
50
+ user: string;
51
+ };
52
+
53
+ /** Emitted when the http session for a simple user is destroyed (e.g. session timed out). */
54
+ export type SimpleUserSessionDestroyOptions = {
55
+ /** The full name of the event */
56
+ event: 'sv:simpleuser:session:destroy';
57
+ /** No user is emitting the event */
58
+ emitter: 'anonymous',
59
+ /** The timestamp when the event was emitted */
60
+ timestamp: number;
61
+ /** The JCR identifier of the simple user whose session was destroyed */
62
+ user: string;
63
+ };
64
+
65
+ /** Emitted when something (typically a page) is moved. */
66
+ export type StructureMoveOptions = {
67
+ /** The full name of the event */
68
+ event: 'sv:structure:move';
69
+ /** The JCR identifier of the emitting user */
70
+ emitter: string;
71
+ /** The timestamp when the event was emitted */
72
+ timestamp: number;
73
+ /** The JCR identifier of the node that was moved */
74
+ node: string;
75
+ /** The JCR identifier of the old parent node */
76
+ from: string;
77
+ /** The JCR identifier of the new parent node */
78
+ to: string;
79
+ };
80
+
81
+ /** Emitted when something (typically a page/article/file/image) is added to the trashcan. */
82
+ export type TrashcanAddOptions = {
83
+ /** The full name of the event */
84
+ event: 'sv:trashcan:add';
85
+ /** The JCR identifier of the emitting user */
86
+ emitter: string;
87
+ /** The timestamp when the event was emitted */
88
+ timestamp: number;
89
+ /** The JCR identifier of the node that was trashed */
90
+ node: string;
91
+ };
92
+
93
+ /** Emitted when something (typically a page/article/file/image) is restored from the trashcan. */
94
+ export type TrashcanRestoreOptions = {
95
+ /** The full name of the event */
96
+ event: 'sv:trashcan:restore';
97
+ /** The JCR identifier of the emitting user */
98
+ emitter: string;
99
+ /** The timestamp when the event was emitted */
100
+ timestamp: number;
101
+ /** The JCR identifier of the node that was restored */
102
+ node: string;
103
+ };
104
+
105
+ /** Emitted when a file or an image is added to a repository or folder. */
106
+ export type BinaryCreateOptions = {
107
+ /** The full name of the event */
108
+ event: 'sv:binary:create';
109
+ /** The JCR identifier of the emitting user */
110
+ emitter: string;
111
+ /** The timestamp when the event was emitted */
112
+ timestamp: number;
113
+ /** The JCR identifier of the file that has been created */
114
+ node: string;
115
+ };
116
+
117
+ /** Emitted when the content for a file or an image has been updated. */
118
+ export type BinaryUpdateContentOptions = {
119
+ /** The full name of the event */
120
+ event: 'sv:binary:update:content';
121
+ /** The JCR identifier of the emitting user */
122
+ emitter: string;
123
+ /** The timestamp when the event was emitted */
124
+ timestamp: number;
125
+ /** The JCR identifier of the file that was updated */
126
+ node: string;
127
+ };
128
+
129
+ /** Emitted when metadata for a file or an image has been updated. */
130
+ export type BinaryUpdateMetadataOptions = {
131
+ /** The full name of the event */
132
+ event: 'sv:binary:update:metadata';
133
+ /** The JCR identifier of the emitting user */
134
+ emitter: string;
135
+ /** The timestamp when the event was emitted */
136
+ timestamp: number;
137
+ /** The JCR identifier of the file that has updated metadata */
138
+ node: string;
139
+ };
140
+
141
+ /** Emitted when the name of a file or an image has been changed. */
142
+ export type BinaryUpdateNameOptions = {
143
+ /** The full name of the event */
144
+ event: 'sv:binary:update:name';
145
+ /** The JCR identifier of the emitting user */
146
+ emitter: string;
147
+ /** The timestamp when the event was emitted */
148
+ timestamp: number;
149
+ /** The JCR identifier of the file that has been renamed */
150
+ node: string;
151
+ };
152
+
153
+ /** Emitted when tags for a file or an image has been changed. */
154
+ export type BinaryUpdateTagsOptions = {
155
+ /** The full name of the event */
156
+ event: 'sv:binary:update:tags';
157
+ /** The JCR identifier of the emitting user */
158
+ emitter: string;
159
+ /** The timestamp when the event was emitted */
160
+ timestamp: number;
161
+ /** The JCR identifier of the file that was changed */
162
+ node: string;
163
+ };
164
+
165
+ /** Emitted when a new version of a file has been created. */
166
+ export type BinaryUpdateVersionCreateOptions = {
167
+ /** The full name of the event */
168
+ event: 'sv:binary:update:version:create';
169
+ /** The JCR identifier of the emitting user */
170
+ emitter: string;
171
+ /** The timestamp when the event was emitted */
172
+ timestamp: number;
173
+ /** The JCR identifier of the file that has a new version */
174
+ node: string;
175
+ };
176
+
177
+ /** Emitted when a version of a file has been deleted. */
178
+ export type BinaryUpdateVersionDeleteOptions = {
179
+ /** The full name of the event */
180
+ event: 'sv:binary:update:version:delete';
181
+ /** The JCR identifier of the emitting user */
182
+ emitter: string;
183
+ /** The timestamp when the event was emitted */
184
+ timestamp: number;
185
+ /** The JCR identifier of the file that has a deleted version */
186
+ node: string;
187
+ };
188
+
189
+ /** Emitted when a version of a file has been selected. */
190
+ export type BinaryUpdateVersionSelectOptions = {
191
+ /** The full name of the event */
192
+ event: 'sv:binary:update:version:select';
193
+ /** The JCR identifier of the emitting user */
194
+ emitter: string;
195
+ /** The timestamp when the event was emitted */
196
+ timestamp: number;
197
+ /** The JCR identifier of the file that has a new version selected */
198
+ node: string;
199
+ };
200
+
201
+ /** Emitted when a folder whose metadata is updated. */
202
+ export type FolderUpdateMetadataOptions = {
203
+ /** The full name of the event */
204
+ event: 'sv:folder:update:metadata';
205
+ /** The JCR identifier of the emitting user */
206
+ emitter: string;
207
+ /** The timestamp when the event was emitted */
208
+ timestamp: number;
209
+ /** The JCR identifier of the folder that has been updated */
210
+ node: string;
211
+ };
212
+
213
+ /** Form field answer structure */
214
+ export type FormAnswer = {
215
+ /** Unique identifier for the form field */
216
+ id: string;
217
+ /** The question or prompt shown to the user */
218
+ question: string;
219
+ /** User's answer as a string or a [sv:temporaryFile](https://developer.sitevision.se/docs/public-api/node-types/node-types/2019-02-20-svtemporaryfile) for file uploads */
220
+ value: string | Node;
221
+ };
222
+
223
+ /** Emitted when Sitevision's email/question-form module is posted. */
224
+ export type FormPostOptions = {
225
+ /** The full name of the event */
226
+ event: 'sv:form:post';
227
+ /** The JCR identifier of the emitting user */
228
+ emitter: string;
229
+ /** The timestamp when the event was emitted */
230
+ timestamp: number;
231
+ /** The JCR identifier of the page the form was posted */
232
+ node: string;
233
+ /** Array of form field answers */
234
+ answers: FormAnswer[];
235
+ };
236
+
237
+ /** Emitted every 5 minutes. */
238
+ export type Every5MinutesOptions = {
239
+ /** The full name of the event */
240
+ event: 'sv:every-5-minutes';
241
+ /** No user is emitting the event */
242
+ emitter: 'anonymous';
243
+ /** The timestamp when the event was emitted */
244
+ timestamp: number;
245
+ };
246
+
247
+ /** Emitted every 15 minutes. */
248
+ export type Every15MinutesOptions = {
249
+ /** The full name of the event */
250
+ event: 'sv:every-15-minutes';
251
+ /** No user is emitting the event */
252
+ emitter: 'anonymous';
253
+ /** The timestamp when the event was emitted */
254
+ timestamp: number;
255
+ };
256
+
257
+ /** Emitted every 30 minutes. */
258
+ export type Every30MinutesOptions = {
259
+ /** The full name of the event */
260
+ event: 'sv:every-30-minutes';
261
+ /** No user is emitting the event */
262
+ emitter: 'anonymous';
263
+ /** The timestamp when the event was emitted */
264
+ timestamp: number;
265
+ };
266
+
267
+ /** Emitted every hour. */
268
+ export type EveryHourOptions = {
269
+ /** The full name of the event */
270
+ event: 'sv:every-hour';
271
+ /** No user is emitting the event */
272
+ emitter: 'anonymous';
273
+ /** The timestamp when the event was emitted */
274
+ timestamp: number;
275
+ };
276
+
277
+ /** Emitted every day. */
278
+ export type EveryDayOptions = {
279
+ /** The full name of the event */
280
+ event: 'sv:every-day';
281
+ /** No user is emitting the event */
282
+ emitter: 'anonymous';
283
+ /** The timestamp when the event was emitted */
284
+ timestamp: number;
285
+ };
286
+
287
+ // Union types for grouped events
288
+ /** All publishing-related event options */
289
+ export type PublishingOptions = PublishingPublishOptions | PublishingUnpublishOptions;
290
+
291
+ /** All simple user-related event options */
292
+ export type SimpleUserOptions =
293
+ | SimpleUserCreateOptions
294
+ | SimpleUserUpdateOptions
295
+ | SimpleUserSessionDestroyOptions;
296
+
297
+ /** All binary-related event options */
298
+ export type BinaryOptions =
299
+ | BinaryCreateOptions
300
+ | BinaryUpdateContentOptions
301
+ | BinaryUpdateMetadataOptions
302
+ | BinaryUpdateNameOptions
303
+ | BinaryUpdateTagsOptions
304
+ | BinaryUpdateVersionCreateOptions
305
+ | BinaryUpdateVersionDeleteOptions
306
+ | BinaryUpdateVersionSelectOptions;
307
+
308
+ /** All timer-related event options */
309
+ export type TimerOptions =
310
+ | Every5MinutesOptions
311
+ | Every15MinutesOptions
312
+ | Every30MinutesOptions
313
+ | EveryHourOptions
314
+ | EveryDayOptions;
315
+
316
+ /** All trashcan-related event options */
317
+ export type TrashcanOptions = TrashcanAddOptions | TrashcanRestoreOptions;
318
+
319
+ /** All possible system event options */
320
+ export type AllSystemOptions =
321
+ | PublishingOptions
322
+ | SimpleUserOptions
323
+ | BinaryOptions
324
+ | TimerOptions
325
+ | TrashcanOptions
326
+ | StructureMoveOptions
327
+ | FolderUpdateMetadataOptions
328
+ | FormPostOptions;
329
+
1
330
  export interface Events {
2
331
  /**
3
332
  * Listen to a given event
@@ -6,6 +335,34 @@ export interface Events {
6
335
  * @param callback The callback to trigger for the given event
7
336
  */
8
337
  on(eventName: string, callback: (options: unknown) => void): void;
338
+ on(eventName: 'sv:publishing', callback: (options: PublishingOptions) => void): void;
339
+ on(eventName: 'sv:publishing:publish', callback: (options: PublishingPublishOptions) => void): void;
340
+ on(eventName: 'sv:publishing:unpublish', callback: (options: PublishingUnpublishOptions) => void): void;
341
+ on(eventName: 'sv:simpleuser', callback: (options: SimpleUserOptions) => void): void;
342
+ on(eventName: 'sv:simpleuser:create', callback: (options: SimpleUserCreateOptions) => void): void;
343
+ on(eventName: 'sv:simpleuser:update', callback: (options: SimpleUserUpdateOptions) => void): void;
344
+ on(eventName: 'sv:simpleuser:session:destroy', callback: (options: SimpleUserSessionDestroyOptions) => void): void;
345
+ on(eventName: 'sv:structure:move', callback: (options: StructureMoveOptions) => void): void;
346
+ on(eventName: 'sv:trashcan', callback: (options: TrashcanOptions) => void): void;
347
+ on(eventName: 'sv:trashcan:add', callback: (options: TrashcanAddOptions) => void): void;
348
+ on(eventName: 'sv:trashcan:restore', callback: (options: TrashcanRestoreOptions) => void): void;
349
+ on(eventName: 'sv:binary', callback: (options: BinaryOptions) => void): void;
350
+ on(eventName: 'sv:binary:create', callback: (options: BinaryCreateOptions) => void): void;
351
+ on(eventName: 'sv:binary:update:content', callback: (options: BinaryUpdateContentOptions) => void): void;
352
+ on(eventName: 'sv:binary:update:metadata', callback: (options: BinaryUpdateMetadataOptions) => void): void;
353
+ on(eventName: 'sv:binary:update:name', callback: (options: BinaryUpdateNameOptions) => void): void;
354
+ on(eventName: 'sv:binary:update:tags', callback: (options: BinaryUpdateTagsOptions) => void): void;
355
+ on(eventName: 'sv:binary:update:version:create', callback: (options: BinaryUpdateVersionCreateOptions) => void): void;
356
+ on(eventName: 'sv:binary:update:version:delete', callback: (options: BinaryUpdateVersionDeleteOptions) => void): void;
357
+ on(eventName: 'sv:binary:update:version:select', callback: (options: BinaryUpdateVersionSelectOptions) => void): void;
358
+ on(eventName: 'sv:folder:update:metadata', callback: (options: FolderUpdateMetadataOptions) => void): void;
359
+ on(eventName: 'sv:form:post', callback: (options: FormPostOptions) => void): void;
360
+ on(eventName: 'sv:every-5-minutes', callback: (options: Every5MinutesOptions) => void): void;
361
+ on(eventName: 'sv:every-15-minutes', callback: (options: Every15MinutesOptions) => void): void;
362
+ on(eventName: 'sv:every-30-minutes', callback: (options: Every30MinutesOptions) => void): void;
363
+ on(eventName: 'sv:every-hour', callback: (options: EveryHourOptions) => void): void;
364
+ on(eventName: 'sv:every-day', callback: (options: EveryDayOptions) => void): void;
365
+
9
366
  /**
10
367
  * Stop listening to a given event
11
368
  *
package/index.d.ts CHANGED
@@ -134,6 +134,7 @@ import './server/WebResourceFactory';
134
134
  import './server/XSLTUtil';
135
135
  import './server/XmlParserUtil';
136
136
  import './server/ai';
137
+ import './server/aiAssistant';
137
138
  import './server/appData';
138
139
  import './server/appInfo';
139
140
  import './server/appResource';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitevision/api",
3
- "version": "2025.4.2",
3
+ "version": "2025.7.1",
4
4
  "author": "Sitevision AB",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,5 +30,5 @@
30
30
  "access": "public",
31
31
  "directory": "dist"
32
32
  },
33
- "gitHead": "92b180a863333a8130e6b869ae0098ff2053f45d"
33
+ "gitHead": "771eb380b026a8b6df85ac5c55a83dfa55b9a179"
34
34
  }
@@ -152,6 +152,7 @@ import type { String } from "../../types/java/lang/String";
152
152
  * </ul>
153
153
  * @author Magnus Lövgren
154
154
  * @since Sitevision 2.6.1_08
155
+ * @deprecated
155
156
  */
156
157
  export interface FileIconRenderer {
157
158
  /**
@@ -9,6 +9,7 @@ import type { Node } from "../../types/javax/jcr/Node";
9
9
  * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
10
10
  * </p>
11
11
  * @author Magnus Lövgren
12
+ * @deprecated
12
13
  */
13
14
  export interface IconUtil {
14
15
  /**
@@ -734,6 +734,18 @@ export interface NodeTypeUtil extends NodeTypeUtilConstants {
734
734
  */
735
735
  SEMANTIC_INDEX_REPOSITORY_TYPE: "sv:semanticIndexRepository";
736
736
 
737
+ /**
738
+ * The primary node type name for the ai assistant type.
739
+ * @since Sitevision 2025.07.1
740
+ */
741
+ AI_ASSISTANT_TYPE: "sv:aiAssistant";
742
+
743
+ /**
744
+ * The primary node type name for the ai assistant repository type.
745
+ * @since Sitevision 2025.07.1
746
+ */
747
+ AI_ASSISTANT_REPOSITORY_TYPE: "sv:aiAssistantRepository";
748
+
737
749
  /**
738
750
  * The primary node type name for the simple user type.
739
751
  * @see #isSimpleUser(Node)
@@ -1242,6 +1254,12 @@ export interface NodeTypeUtil extends NodeTypeUtilConstants {
1242
1254
  */
1243
1255
  TARGET_AUDIENCE_TYPE: "sv:targetAudience";
1244
1256
 
1257
+ /**
1258
+ * The primary node type name for the target audience group repository type.
1259
+ * @since SiteVision 2025.07.1
1260
+ */
1261
+ TARGET_AUDIENCE_GROUP_REPOSITORY_TYPE: "sv:targetAudienceGroupRepository";
1262
+
1245
1263
  /**
1246
1264
  * The primary node type name for the target audience group type.
1247
1265
  * @since Sitevision 2024.09.2
@@ -495,6 +495,20 @@ export interface ResourceLocatorUtil {
495
495
  * @since Sitevision 2025.03.1
496
496
  */
497
497
  getSemanticIndexRepository(): Node;
498
+
499
+ /**
500
+ * Gets the target audience group repository (sv:targetAudienceGroupRepository) for the site of current node.
501
+ * @return the target audience group repository, or null if indeterminable.
502
+ * @since Sitevision 2025.07.1
503
+ */
504
+ getTargetAudienceGroupRepository(): Node;
505
+
506
+ /**
507
+ * Gets the ai assistant repository (sv:aiAssistantRepository) for the site of current node.
508
+ * @return the ai assistant repository, or null if indeterminable.
509
+ * @since Sitevision 2025.07.1
510
+ */
511
+ getAiAssistantRepository(): Node;
498
512
  }
499
513
 
500
514
  declare namespace ResourceLocatorUtil {}
@@ -52,5 +52,7 @@ var _default = exports["default"] = {
52
52
  getCssRuleRepository: function getCssRuleRepository() {},
53
53
  getLlmConfigurationRepository: function getLlmConfigurationRepository() {},
54
54
  getTargetAudienceRepository: function getTargetAudienceRepository() {},
55
- getSemanticIndexRepository: function getSemanticIndexRepository() {}
55
+ getSemanticIndexRepository: function getSemanticIndexRepository() {},
56
+ getTargetAudienceGroupRepository: function getTargetAudienceGroupRepository() {},
57
+ getAiAssistantRepository: function getAiAssistantRepository() {}
56
58
  };
@@ -405,46 +405,34 @@ export interface Utils {
405
405
  getImageScaler(aMaxWidth: number, aMaxHeight: number): ImageScaler;
406
406
 
407
407
  /**
408
- * Creates and returns an instance of an exception-suppressing proxy.
409
- *
410
- * <p>
411
- * <strong>Note! </strong>Be aware of <code>null</code>'s. They are never proxied. If you try to proxy <code>null</code>, this method
412
- * will just return <code>null</code>, not a proxy instance. In other words: even though you're trying to use a
413
- * <code>ExceptionSuppressingProxy</code> to suppress exceptions,
414
- * method invocations will of course still throw <code>NullPointerException</code>.
415
- * </p>
416
- * @param anObject an object to be proxied by an ExceptionSuppressingProxy
417
- * @return anObject proxied by an ExceptionSuppressingProxy, or <code>null</code> if <code>anObject</code> is <code>null</code>.&#xA; If <code>anObject</code> is a <code>ExceptionSuppressingProxy</code>),&#xA; <code>anObject</code> will be returned "as-is" (no new instance will be created).
408
+ * Deprecated get method for deprecated ExceptionSuppressingProxy.
409
+ * @param aObject an object to be proxied by an ExceptionSuppressingProxy
410
+ * @return a deprecated ExceptionSuppressingProxy, or null if aObject is null.
418
411
  * @since Sitevision 2.6.1_09
412
+ * @deprecated ExceptionSuppressingProxy is not supported, this method deprecated and will be removed in a future version of Sitevision
419
413
  */
420
- getExceptionSuppressingProxy(anObject: unknown): ExceptionSuppressingProxy;
414
+ getExceptionSuppressingProxy(aObject: unknown): ExceptionSuppressingProxy;
421
415
 
422
416
  /**
423
- * Creates and returns an instance of a collection decorator that exposes an exception-suppressing iterator.
424
- *
425
- * <p>
426
- * <strong>Note!</strong> The sole purpose of the <code>ExceptionSuppressingCollection</code> is to provide easy access to a decorated iterator
427
- * ({@link senselogic.sitevision.api.script.proxy.ExceptionSuppressingIterator}).
428
- * You should <em>not</em> create a collection of object proxys (i.e. <code>Collection&lt;ExceptionSuppressingProxy&gt;</code>) yourself.
429
- * You should use <code>ExceptionSuppressingCollection</code>
430
- * with your "regular" collection since the actual proxying is done by the iterator itself.
431
- * </p>
432
- * @param aCollection a collection to be decorated by a ExceptionSuppressingCollection. Note that this should be your "regular" collection,&#xA; not a already proxied one (i.e. <code>Collection&lt;ExceptionSuppressingProxy&gt;</code>).
433
- * @return the collection decorated by a ExceptionSuppressingCollection, or <code>null</code> if <code>aCollection</code> is <code>null</code>.&#xA; If <code>aCollection</code> is a <code>ExceptionSuppressingCollection</code>),&#xA; <code>aCollection</code> will be returned "as-is" (no new instance will be created).
417
+ * Deprecated get method for deprecated ExceptionSuppressingCollection.
418
+ * @param aCollection a collection to be decorated by a ExceptionSuppressingCollection
419
+ * @return a deprecated ExceptionSuppressingCollection, or null if aCollection is null.
434
420
  * @since Sitevision 2.6.1_09
421
+ * @deprecated ExceptionSuppressingCollection is not supported, this method deprecated and will be removed in a future version of Sitevision
435
422
  */
436
423
  getExceptionSuppressingCollection(
437
424
  aCollection: Collection | unknown[]
438
425
  ): ExceptionSuppressingCollection;
439
426
 
440
427
  /**
441
- * Creates and returns an instance of an exception-suppressing iterator that returns exception-suppressing dynamic proxys.
442
- * @param anIterator an iterator to be decorated by a ExceptionSuppressingIterator
443
- * @return the iterator decorated by a ExceptionSuppressingIterator, or <code>null</code> if <code>anIterator</code> is <code>null</code>.&#xA; If <code>anIterator</code> is a <code>ExceptionSuppressingIterator</code>),&#xA; <code>anIterator</code> will be returned "as-is" (no new instance will be created).
428
+ * Deprecated get method for deprecated ExceptionSuppressingIterator.
429
+ * @param aIterator an iterator to be decorated by a ExceptionSuppressingIterator
430
+ * @return a deprecated ExceptionSuppressingIterator, or null if aIterator is null.
444
431
  * @since Sitevision 2.6.1_09
432
+ * @deprecated ExceptionSuppressingIterator is not supported, this method deprecated and will be removed in a future version of Sitevision
445
433
  */
446
434
  getExceptionSuppressingIterator(
447
- anIterator: Iterator
435
+ aIterator: Iterator
448
436
  ): ExceptionSuppressingIterator;
449
437
 
450
438
  /**
@@ -18,7 +18,7 @@ import type { String } from "../../types/java/lang/String";
18
18
  * <p style="margin-top:0; margin-bottom:10px">
19
19
  * <em>The upside of this is that you get caching and such "for free" and you don't have to include or use any Velocity jar
20
20
  * when creating your portlet application (war file). You will also avoid possible Velocity.init() caveats and such.
21
- * The possible downside is that the Velocity engine (currently version 1.7) potentially can be replaced at
21
+ * The possible downside is that the Velocity engine and its features potentially can be replaced at
22
22
  * any time (i.e. whenever Sitevision is updated).</em>
23
23
  * </p>
24
24
  * <p style="margin-top:0; margin-bottom:10px">
@@ -50,13 +50,13 @@ import type { String } from "../../types/java/lang/String";
50
50
  * super.init(portletConfig);
51
51
  *
52
52
  * template =
53
- * " Current request is: $request &lt;br /&gt; " +
54
- * " Utils is: $sitevisionUtils &lt;br /&gt; " +
55
- * " Session is: $jcrSession &lt;br /&gt; " +
56
- * " VelocityEvaluator is: $velocityEvaluator &lt;br /&gt; " +
57
- * " &lt;br /&gt; " +
53
+ * " Current request is: $request &lt;br&gt; " +
54
+ * " Utils is: $sitevisionUtils &lt;br&gt; " +
55
+ * " Session is: $jcrSession &lt;br&gt; " +
56
+ * " VelocityEvaluator is: $velocityEvaluator &lt;br&gt; " +
57
+ * " &lt;br&gt; " +
58
58
  * " #set($count = 1) " +
59
- * " This is written with the VelocityEvaluator: &lt;br /&gt; " +
59
+ * " This is written with the VelocityEvaluator: &lt;br&gt; " +
60
60
  * " &lt;div style=\"margin:0 20px\"&gt; " +
61
61
  * " $velocityEvaluator.evaluate($evaluateThis) " +
62
62
  * " &lt;/div&gt; ";
@@ -105,6 +105,7 @@ import type { String } from "../../types/java/lang/String";
105
105
  * </p>
106
106
  * @author Magnus Lövgren
107
107
  * @since Sitevision 3.0
108
+ * @deprecated portlet applications are the legacy way of extending Sitevision.&#xA; WebApp/RESTApp technique should be used instead as of Sitevision 5. This class will be removed in a future version of Sitevision.
108
109
  */
109
110
  export interface VelocityRenderer {
110
111
  /**
@@ -190,7 +191,7 @@ export interface VelocityRenderer {
190
191
  /**
191
192
  * Renders a Velocity template string.
192
193
  * @param aContext a context with mappings needed by aTemplate (Note! this must be an instance created via any of the methods above,&#xA; a custom VelocityContext implementation is not allowed).
193
- * @param aTemplate the template string (i.e. if the actual template is in a file,&#xA; you must read it and put it in a string that can be passed to this method)
194
+ * @param aTemplate a String containing the Velocity code to be evaluated
194
195
  * @throws IllegalArgumentException if aTemplate is <code>null</code>, if aContext is <code>null</code> or not created via VelocityRenderer
195
196
  * @throws VelocityException if parsing/evaluation of aTemplate fails
196
197
  * @throws IOException if an I/O exception occurs during the rendering process
@@ -29,8 +29,8 @@ export interface GenerateTextOptions {
29
29
 
30
30
  /**
31
31
  * Maximum duration (in milliseconds) before timing out.
32
- * The default value and valid range are environment-dependent and can be
33
- * configured via a system property. If not explicitly set, the system
32
+ * The default value and valid range are environment-dependent and can be
33
+ * configured via a system property. If not explicitly set, the system
34
34
  * determines an appropriate timeout value.
35
35
  */
36
36
  timeout?: number;
@@ -99,8 +99,8 @@ export interface StreamTextOptions {
99
99
 
100
100
  /**
101
101
  * Maximum duration (in milliseconds) before timing out.
102
- * The default value and valid range are environment-dependent and can be
103
- * configured via a system property. If not explicitly set, the system
102
+ * The default value and valid range are environment-dependent and can be
103
+ * configured via a system property. If not explicitly set, the system
104
104
  * determines an appropriate timeout value.
105
105
  */
106
106
  timeout?: number;
@@ -139,6 +139,15 @@ export interface StreamTextOptions {
139
139
  onFinish: (result: StreamFinishResult) => void;
140
140
  }
141
141
 
142
+ /**
143
+ * Contains token usage information for the request. Note that usage may vary and may not be supported by some models.
144
+ */
145
+ export type UsageInfo = {
146
+ promptTokens: number;
147
+ completionTokens: number;
148
+ totalTokens: number;
149
+ };
150
+
142
151
  /**
143
152
  * Final result object for a streaming text operation.
144
153
  */
@@ -164,13 +173,9 @@ export interface StreamFinishResult {
164
173
  finishReason: string;
165
174
 
166
175
  /**
167
- * (Optional) Token usage statistics for this request.
176
+ * Token usage statistics for this request.
168
177
  */
169
- usage?: {
170
- promptTokens: number;
171
- completionTokens: number;
172
- totalTokens: number;
173
- };
178
+ usage: UsageInfo;
174
179
  }
175
180
 
176
181
  /**