@sitevision/api 2024.4.1 → 2024.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/index.d.ts +2 -0
- package/package.json +2 -2
- package/server/ChannelUtil/index.d.ts +73 -0
- package/server/ChannelUtil/index.js +11 -0
- package/server/ImageUtil/index.d.ts +36 -0
- package/server/ImageUtil/index.js +3 -1
- package/server/MessagesFactory/index.d.ts +8 -0
- package/server/MessagesFactory/index.js +1 -0
- package/server/NodeTypeUtil/index.d.ts +12 -0
- package/server/ResourceLocatorUtil/index.d.ts +7 -0
- package/server/ResourceLocatorUtil/index.js +2 -1
- package/server/RestApi/index.d.ts +8 -3
- package/server/RestApiFactory/index.d.ts +70 -0
- package/server/RestApiFactory/index.js +12 -0
- package/server/appData/index.d.ts +1 -0
- package/server/appData/index.js +2 -1
- package/types/senselogic/sitevision/api/message/ChannelWrapper/index.d.ts +42 -2
- package/types/senselogic/sitevision/api/message/ChannelWrapper/index.js +4 -1
- package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.NodeTypeUtilConstants/index.d.ts +14 -0
- package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.NodeTypeUtilConstants/index.js +3 -1
- package/types/senselogic/sitevision/api/script/VersionedRestApi/index.d.ts +225 -0
- package/types/senselogic/sitevision/api/script/VersionedRestApi/index.js +14 -0
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import './server/AuthenticationUtil';
|
|
|
6
6
|
import './server/BookmarkUtil';
|
|
7
7
|
import './server/BuddyIconRenderer';
|
|
8
8
|
import './server/BuddyIconRenderer.BuddyIconSize';
|
|
9
|
+
import './server/ChannelUtil';
|
|
9
10
|
import './server/ClientUtil';
|
|
10
11
|
import './server/CollaborationFactory';
|
|
11
12
|
import './server/CollaborationGroupFolderUtil';
|
|
@@ -90,6 +91,7 @@ import './server/RelatedValueBuilder';
|
|
|
90
91
|
import './server/Requester';
|
|
91
92
|
import './server/ResourceLocatorUtil';
|
|
92
93
|
import './server/RestApi';
|
|
94
|
+
import './server/RestApiFactory';
|
|
93
95
|
import './server/RestAppInvokerFactory';
|
|
94
96
|
import './server/RoleAssignmentBuilder';
|
|
95
97
|
import './server/RoleMatcherBuilder';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitevision/api",
|
|
3
|
-
"version": "2024.
|
|
3
|
+
"version": "2024.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": "
|
|
33
|
+
"gitHead": "fcd74122108f19e03a0a9db51efc16286fc7a802"
|
|
34
34
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { String } from "../../types/java/lang/String";
|
|
2
|
+
|
|
3
|
+
import type { Node } from "../../types/javax/jcr/Node";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Channel utility interface.
|
|
7
|
+
*
|
|
8
|
+
* <p>
|
|
9
|
+
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
10
|
+
* {@link MessagesFactory#getChannelUtil()}.
|
|
11
|
+
* See {@link MessagesFactory} for how to obtain an instance of the <code>MessagesFactory</code> interface.
|
|
12
|
+
* </p>
|
|
13
|
+
* @author Elias Abrache
|
|
14
|
+
* @since Sitevision 2024.05.01
|
|
15
|
+
*/
|
|
16
|
+
export interface ChannelUtil {
|
|
17
|
+
/**
|
|
18
|
+
* Creates a channel.
|
|
19
|
+
* <p>
|
|
20
|
+
* A <code>ConstraintViolationException</code> will be thrown if social collaboration is not enabled
|
|
21
|
+
* Or if current user is attempting to create a private channel without
|
|
22
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#CREATE_PRIVATE_CHANNELS} permission.
|
|
23
|
+
* </p>
|
|
24
|
+
*
|
|
25
|
+
* <p>
|
|
26
|
+
* A <code>IllegalArgumentException</code> will be thrown if aName is null, blank or exceeds 80 characters.
|
|
27
|
+
* </p>
|
|
28
|
+
*
|
|
29
|
+
* <p>
|
|
30
|
+
* A <code>ItemExistsException</code> will be thrown if a channel with the same name already exists.
|
|
31
|
+
* </p>
|
|
32
|
+
*
|
|
33
|
+
* <p>
|
|
34
|
+
* A <code>RepositoryException</code> will be thrown If an error occurs while fetching channels
|
|
35
|
+
* </p>
|
|
36
|
+
* @param aName the name of the channel (Must be unique and must not exceed 80 characters)
|
|
37
|
+
* @param aDescription the description of the channel
|
|
38
|
+
* @param aPrivate whether the channel should be private or not
|
|
39
|
+
* @throws RepositoryException if an error occurs.
|
|
40
|
+
* @return a channel wrapper for the newly created <code>channel</code>, or <code>null</code>.
|
|
41
|
+
*/
|
|
42
|
+
createChannel(
|
|
43
|
+
aName: String | string,
|
|
44
|
+
aDescription: String | string,
|
|
45
|
+
aPrivate: boolean
|
|
46
|
+
): Node;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Searches for a channel by name.
|
|
50
|
+
*
|
|
51
|
+
* <p>
|
|
52
|
+
* <em>Permission note</em> Private channels can only be found by members.
|
|
53
|
+
* </p>
|
|
54
|
+
*
|
|
55
|
+
* <p>
|
|
56
|
+
* A <code>ConstraintViolationException</code> will be thrown if social collaboration is not enabled.
|
|
57
|
+
* </p>
|
|
58
|
+
*
|
|
59
|
+
* <p>
|
|
60
|
+
* A <code>RepositoryException</code> will be thrown if an error occurs while fetching channels.
|
|
61
|
+
* </p>
|
|
62
|
+
* @return the channel node, or null.
|
|
63
|
+
* @param aChannelName the name of the channel to search for.
|
|
64
|
+
* @throws RepositoryException if an error occurs.
|
|
65
|
+
*/
|
|
66
|
+
findChannelByName(aChannelName: String | string): Node;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare namespace ChannelUtil {}
|
|
70
|
+
|
|
71
|
+
declare var channelUtil: ChannelUtil;
|
|
72
|
+
|
|
73
|
+
export default channelUtil;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
createChannel: function createChannel() {},
|
|
9
|
+
findChannelByName: function findChannelByName() {}
|
|
10
|
+
};
|
|
11
|
+
exports["default"] = _default;
|
|
@@ -266,6 +266,42 @@ export interface ImageUtil {
|
|
|
266
266
|
* @since Sitevision 4.5.5.2
|
|
267
267
|
*/
|
|
268
268
|
toBase64(aImage: Node): string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Sets the alt property for an image Node.
|
|
272
|
+
*
|
|
273
|
+
* <p>
|
|
274
|
+
* <strong>Permission note!</strong> Current user (the invoker of this method) must have
|
|
275
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE} permission
|
|
276
|
+
* on the image node that should be updated. <em>Updating an image for a <code>sv:userIdentity</code> requires
|
|
277
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES MANAGE_USER_IDENTITIES} permission
|
|
278
|
+
* on current page.</em>
|
|
279
|
+
* </p>
|
|
280
|
+
* @param aImage the sv:image Node, may not be null
|
|
281
|
+
* @param aAltText the alt text to set
|
|
282
|
+
* @throws ConstraintViolationException if aImage is not a sv:image or if current user is not authorized to alter the image node
|
|
283
|
+
* @throws RepositoryException if something else goes wrong
|
|
284
|
+
* @since Sitevision 2024.06.1
|
|
285
|
+
*/
|
|
286
|
+
setAltText(aImage: Node, aAltText: String | string): void;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Sets the caption property for an image Node.
|
|
290
|
+
*
|
|
291
|
+
* <p>
|
|
292
|
+
* <strong>Permission note!</strong> Current user (the invoker of this method) must have
|
|
293
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE WRITE} permission
|
|
294
|
+
* on the image node that should be updated. <em>Updating an image for a <code>sv:userIdentity</code> requires
|
|
295
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES MANAGE_USER_IDENTITIES} permission
|
|
296
|
+
* on current page.</em>
|
|
297
|
+
* </p>
|
|
298
|
+
* @param aImage the sv:image Node, may not be null
|
|
299
|
+
* @param aCaptionText the caption text to set
|
|
300
|
+
* @throws ConstraintViolationException if aImage is not a sv:image or if current user is not authorized to alter the image node
|
|
301
|
+
* @throws RepositoryException if something else goes wrong
|
|
302
|
+
* @since Sitevision 2024.06.1
|
|
303
|
+
*/
|
|
304
|
+
setCaptionText(aImage: Node, aCaptionText: String | string): void;
|
|
269
305
|
}
|
|
270
306
|
|
|
271
307
|
declare namespace ImageUtil {}
|
|
@@ -13,6 +13,8 @@ var _default = {
|
|
|
13
13
|
updateBinaryContentFromBase64: function updateBinaryContentFromBase64() {},
|
|
14
14
|
updateBinaryContentFromTemporary: function updateBinaryContentFromTemporary() {},
|
|
15
15
|
renameImage: function renameImage() {},
|
|
16
|
-
toBase64: function toBase64() {}
|
|
16
|
+
toBase64: function toBase64() {},
|
|
17
|
+
setAltText: function setAltText() {},
|
|
18
|
+
setCaptionText: function setCaptionText() {}
|
|
17
19
|
};
|
|
18
20
|
exports["default"] = _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChannelUtil } from "../ChannelUtil";
|
|
1
2
|
import type { Node } from "../../types/javax/jcr/Node";
|
|
2
3
|
import type { ChannelWrapper } from "../../types/senselogic/sitevision/api/message/ChannelWrapper";
|
|
3
4
|
|
|
@@ -13,6 +14,13 @@ import type { ChannelWrapper } from "../../types/senselogic/sitevision/api/messa
|
|
|
13
14
|
* @since Sitevision 2024.03.01
|
|
14
15
|
*/
|
|
15
16
|
export interface MessagesFactory {
|
|
17
|
+
/**
|
|
18
|
+
* Gets an instance of a channel utility class.
|
|
19
|
+
* @return a channel utility class
|
|
20
|
+
* @since Sitevision 2024.05.01
|
|
21
|
+
*/
|
|
22
|
+
getChannelUtil(): ChannelUtil;
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
* Gets a wrapper for the specified channel.
|
|
18
26
|
* @param aChannel the channel node (node of type sv:topic).
|
|
@@ -1194,6 +1194,18 @@ export interface NodeTypeUtil extends NodeTypeUtilConstants {
|
|
|
1194
1194
|
*/
|
|
1195
1195
|
WIDGET_CUSTOM_MODULE_TYPE: "sv:widgetCustomModule";
|
|
1196
1196
|
|
|
1197
|
+
/**
|
|
1198
|
+
* The primary node type name for the css rule repository type.
|
|
1199
|
+
* @since Sitevision 2024.04.2
|
|
1200
|
+
*/
|
|
1201
|
+
CSS_RULE_REPOSITORY_TYPE: "sv:cssRuleRepository";
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* The primary node type name for the css rule type.
|
|
1205
|
+
* @since Sitevision 2024.04.2
|
|
1206
|
+
*/
|
|
1207
|
+
CSS_RULE_TYPE: "sv:cssRule";
|
|
1208
|
+
|
|
1197
1209
|
/**
|
|
1198
1210
|
* Checks if a node is a layout.
|
|
1199
1211
|
* @param aNode the node to be checked
|
|
@@ -467,6 +467,13 @@ export interface ResourceLocatorUtil {
|
|
|
467
467
|
* @since Sitevision 2023.09.2
|
|
468
468
|
*/
|
|
469
469
|
getWorkStatusTemplateRepository(): Node;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Gets the css rule repository (sv:cssRuleRepository) for the site of current node.
|
|
473
|
+
* @return the css rule repository, or null if indeterminable.
|
|
474
|
+
* @since Sitevision 2024.04.2
|
|
475
|
+
*/
|
|
476
|
+
getCssRuleRepository(): Node;
|
|
470
477
|
}
|
|
471
478
|
|
|
472
479
|
declare namespace ResourceLocatorUtil {}
|
|
@@ -48,6 +48,7 @@ var _default = {
|
|
|
48
48
|
getAliasRepository: function getAliasRepository() {},
|
|
49
49
|
getSiteCookieRepository: function getSiteCookieRepository() {},
|
|
50
50
|
getImageFilterRepository: function getImageFilterRepository() {},
|
|
51
|
-
getWorkStatusTemplateRepository: function getWorkStatusTemplateRepository() {}
|
|
51
|
+
getWorkStatusTemplateRepository: function getWorkStatusTemplateRepository() {},
|
|
52
|
+
getCssRuleRepository: function getCssRuleRepository() {}
|
|
52
53
|
};
|
|
53
54
|
exports["default"] = _default;
|
|
@@ -2,11 +2,11 @@ import type { Node } from "../../types/javax/jcr/Node";
|
|
|
2
2
|
import type { String } from "../../types/java/lang/String";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Script utility for server-side invoke of the local
|
|
5
|
+
* Script utility for server-side invoke of the local
|
|
6
|
+
* <a href="https://developer.sitevision.se/docs/rest-api/model-rest-api" target="_blank">Sitevision REST API</a>.
|
|
6
7
|
*
|
|
7
8
|
* <p>
|
|
8
|
-
* This is a local, server-side, inbound utility to invoke the
|
|
9
|
-
* <a href="https://developer.sitevision.se/docs/rest-api/model-rest-api" target="_blank">Sitevision REST API</a>
|
|
9
|
+
* This is a local, server-side, inbound utility to invoke the Sitevision REST API
|
|
10
10
|
* of the local site without any outgoing http connections.
|
|
11
11
|
* This utility can be used regardless of the REST API of the local site is enabled or not!
|
|
12
12
|
* </p>
|
|
@@ -46,6 +46,10 @@ import type { String } from "../../types/java/lang/String";
|
|
|
46
46
|
* </p>
|
|
47
47
|
* <ul>
|
|
48
48
|
* <li>
|
|
49
|
+
* To execute endpoints in the REST API with a <em>fixed version</em> (ONLINE / OFFLINE) should typically be handled via
|
|
50
|
+
* {@link VersionedRestApi}.
|
|
51
|
+
* </li>
|
|
52
|
+
* <li>
|
|
49
53
|
* Server-side invoke of a <em>local RESTApp</em> should typically be handled via
|
|
50
54
|
* {@link senselogic.sitevision.api.script.app.RestAppInvoker}.
|
|
51
55
|
* </li>
|
|
@@ -57,6 +61,7 @@ import type { String } from "../../types/java/lang/String";
|
|
|
57
61
|
* @param <O> script object
|
|
58
62
|
* @author Magnus Lövgren
|
|
59
63
|
* @since Sitevision 4.5
|
|
64
|
+
* @see VersionedRestApi
|
|
60
65
|
* @see Requester
|
|
61
66
|
* @see senselogic.sitevision.api.script.app.RestAppInvoker
|
|
62
67
|
*/
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { RestApi } from "../RestApi";
|
|
2
|
+
import type { VersionedRestApi } from "../../types/senselogic/sitevision/api/script/VersionedRestApi";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Factory for creating server-side invokers of the local
|
|
6
|
+
* <a href="https://developer.sitevision.se/docs/rest-api/model-rest-api" target="_blank">Sitevision REST API</a>.
|
|
7
|
+
*
|
|
8
|
+
* <p>
|
|
9
|
+
* <strong>REST siblings note!</strong>
|
|
10
|
+
* </p>
|
|
11
|
+
* <ul>
|
|
12
|
+
* <li>
|
|
13
|
+
* Server-side invoke of a <em>local RESTApp</em> should typically be handled via
|
|
14
|
+
* {@link senselogic.sitevision.api.script.app.RestAppInvoker}.
|
|
15
|
+
* </li>
|
|
16
|
+
* <li>
|
|
17
|
+
* Invoking <em>external REST API:s</em> should typically be handled via
|
|
18
|
+
* {@link senselogic.sitevision.api.script.Requester}.
|
|
19
|
+
* </li>
|
|
20
|
+
* </ul>
|
|
21
|
+
* @param <O> script object
|
|
22
|
+
* @author Magnus Lövgren
|
|
23
|
+
* @since Sitevision 2024.04.2
|
|
24
|
+
*/
|
|
25
|
+
export interface RestApiFactory {
|
|
26
|
+
/**
|
|
27
|
+
* Gets the RestApi utility.
|
|
28
|
+
*
|
|
29
|
+
* <p>
|
|
30
|
+
* The returned utility invokes the local REST API in
|
|
31
|
+
* <strong>{@link senselogic.sitevision.api.versioning.VersionUtil#getCurrentVersion() current version}</strong>.
|
|
32
|
+
* </p>
|
|
33
|
+
* @return the RestApi utility
|
|
34
|
+
*/
|
|
35
|
+
getRestApi(): RestApi;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Gets the Versioned RestApi utility for the <strong>ONLINE</strong> version.
|
|
39
|
+
*
|
|
40
|
+
* <p>
|
|
41
|
+
* The returned utility always invokes the local REST API in the
|
|
42
|
+
* <strong>{@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION ONLINE version}</strong>.
|
|
43
|
+
* </p>
|
|
44
|
+
* <p>
|
|
45
|
+
* <em>Related info: URI prefix for the REST API in the ONLINE version is: <code>/rest-api/1/<strong>1</strong>/</code></em>
|
|
46
|
+
* </p>
|
|
47
|
+
* @return the VersionedRestApi for the {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION ONLINE version}
|
|
48
|
+
*/
|
|
49
|
+
getOnlineRestApi(): VersionedRestApi;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Gets the Versioned RestApi utility for the <strong>OFFLINE</strong> version.
|
|
53
|
+
*
|
|
54
|
+
* <p>
|
|
55
|
+
* The returned utility always invokes the local REST API in the
|
|
56
|
+
* <strong>{@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION OFFLINE version}</strong>.
|
|
57
|
+
* </p>
|
|
58
|
+
* <p>
|
|
59
|
+
* <em>Related info: URI prefix for the REST API in the OFFLINE version is: <code>/rest-api/1/<strong>0</strong>/</code></em>
|
|
60
|
+
* </p>
|
|
61
|
+
* @return the VersionedRestApi for the {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION OFFLINE version}
|
|
62
|
+
*/
|
|
63
|
+
getOfflineRestApi(): VersionedRestApi;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare namespace RestApiFactory {}
|
|
67
|
+
|
|
68
|
+
declare var restApiFactory: RestApiFactory;
|
|
69
|
+
|
|
70
|
+
export default restApiFactory;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
getRestApi: function getRestApi() {},
|
|
9
|
+
getOnlineRestApi: function getOnlineRestApi() {},
|
|
10
|
+
getOfflineRestApi: function getOfflineRestApi() {}
|
|
11
|
+
};
|
|
12
|
+
exports["default"] = _default;
|
package/server/appData/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node } from "../../../../../javax/jcr/Node";
|
|
2
2
|
|
|
3
|
+
import type { String } from "../../../../../java/lang/String";
|
|
3
4
|
import type { Wrapper } from "../../base/Wrapper";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -34,8 +35,9 @@ export type ChannelWrapper = Wrapper & {
|
|
|
34
35
|
* <strong>Permission notes!</strong>
|
|
35
36
|
* </p>
|
|
36
37
|
* <p>
|
|
37
|
-
* <em>Open channels</em> require the operating user to either
|
|
38
|
-
*
|
|
38
|
+
* <em>Open channels</em> require the operating user to have either membership or the
|
|
39
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_CHANNELS} permission
|
|
40
|
+
* when adding members other than self.
|
|
39
41
|
* </p>
|
|
40
42
|
* <p>
|
|
41
43
|
* <em>Private channels</em> require the operating user to have membership.
|
|
@@ -88,4 +90,42 @@ export type ChannelWrapper = Wrapper & {
|
|
|
88
90
|
* @return true if aUserIdentity was removed as member from the wrapped channel, false otherwise.
 false is always returned if aUserIdentity is null or not a member of the wrapped channel.
|
|
89
91
|
*/
|
|
90
92
|
removeMember(aUserIdentity: Node): boolean;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Checks if a user identity is a member of the wrapped channel.
|
|
96
|
+
* @param aUserIdentity a user identity (or user)
|
|
97
|
+
* @return true if aUserIdentity is a member of the wrapped channel, false otherwise.
 false is always returned if aUserIdentity is null.
|
|
98
|
+
* @since Sitevision 2024.05.01
|
|
99
|
+
*/
|
|
100
|
+
isMember(aUserIdentity: Node): boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Alters the name of the wrapped channel.
|
|
104
|
+
*
|
|
105
|
+
* <p>
|
|
106
|
+
* <em>Permission note</em> Only the author or members with the
|
|
107
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_CHANNELS} permission can alter the channel name.
|
|
108
|
+
* </p>
|
|
109
|
+
*
|
|
110
|
+
* <p>
|
|
111
|
+
* The new channel name most not exceed 80 characters in length and must be unique otherwise false will be returned.
|
|
112
|
+
* </p>
|
|
113
|
+
* @param aChannelName the new name of the channel
|
|
114
|
+
* @return true if channel could be renamed to aChannelName, false otherwise.
|
|
115
|
+
* @since Sitevision 2024.05.01
|
|
116
|
+
*/
|
|
117
|
+
renameChannel(aChannelName: String | string): boolean;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Alters the description of the wrapped channel.
|
|
121
|
+
*
|
|
122
|
+
* <p>
|
|
123
|
+
* <em>Permission note</em> Only the author or members with the
|
|
124
|
+
* {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_CHANNELS} permission can alter the channel description.
|
|
125
|
+
* </p>
|
|
126
|
+
* @param aChannelDescription the new description of the channel
|
|
127
|
+
* @return true if channel description was set to aChannelDescription, false otherwise.
|
|
128
|
+
* @since Sitevision 2024.05.01
|
|
129
|
+
*/
|
|
130
|
+
setChannelDescription(aChannelDescription: String | string): boolean;
|
|
91
131
|
};
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _default = {
|
|
8
8
|
addMember: function addMember() {},
|
|
9
|
-
removeMember: function removeMember() {}
|
|
9
|
+
removeMember: function removeMember() {},
|
|
10
|
+
isMember: function isMember() {},
|
|
11
|
+
renameChannel: function renameChannel() {},
|
|
12
|
+
setChannelDescription: function setChannelDescription() {}
|
|
10
13
|
};
|
|
11
14
|
exports["default"] = _default;
|
|
@@ -1324,4 +1324,18 @@ export type NodeTypeUtilConstants = {
|
|
|
1324
1324
|
* @since Sitevision 2024.02.1
|
|
1325
1325
|
*/
|
|
1326
1326
|
getWIDGET_CUSTOM_MODULE_TYPE(): string;
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* Get accessor for {@link senselogic.sitevision.api.node.NodeTypeUtil#CSS_RULE_REPOSITORY_TYPE}.
|
|
1330
|
+
* @return {@link senselogic.sitevision.api.node.NodeTypeUtil#CSS_RULE_REPOSITORY_TYPE}
|
|
1331
|
+
* @since Sitevision 2024.04.2
|
|
1332
|
+
*/
|
|
1333
|
+
getCSS_RULE_REPOSITORY_TYPE(): string;
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Get accessor for {@link senselogic.sitevision.api.node.NodeTypeUtil#CSS_RULE_TYPE}.
|
|
1337
|
+
* @return {@link senselogic.sitevision.api.node.NodeTypeUtil#CSS_RULE_TYPE}
|
|
1338
|
+
* @since Sitevision 2024.04.2
|
|
1339
|
+
*/
|
|
1340
|
+
getCSS_RULE_TYPE(): string;
|
|
1327
1341
|
};
|
|
@@ -196,6 +196,8 @@ var _default = {
|
|
|
196
196
|
getWORK_STATUS_TEMPLATE_TYPE: function getWORK_STATUS_TEMPLATE_TYPE() {},
|
|
197
197
|
getWORK_STATUS_TEMPLATE_REPOSITORY_TYPE: function getWORK_STATUS_TEMPLATE_REPOSITORY_TYPE() {},
|
|
198
198
|
getDASHBOARD_TYPE: function getDASHBOARD_TYPE() {},
|
|
199
|
-
getWIDGET_CUSTOM_MODULE_TYPE: function getWIDGET_CUSTOM_MODULE_TYPE() {}
|
|
199
|
+
getWIDGET_CUSTOM_MODULE_TYPE: function getWIDGET_CUSTOM_MODULE_TYPE() {},
|
|
200
|
+
getCSS_RULE_REPOSITORY_TYPE: function getCSS_RULE_REPOSITORY_TYPE() {},
|
|
201
|
+
getCSS_RULE_TYPE: function getCSS_RULE_TYPE() {}
|
|
200
202
|
};
|
|
201
203
|
exports["default"] = _default;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import type { String } from "../../../../../java/lang/String";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Script utility for server-side invoke of the local
|
|
5
|
+
* <a href="https://developer.sitevision.se/docs/rest-api/model-rest-api" target="_blank">Sitevision REST API</a> in a specific version.
|
|
6
|
+
*
|
|
7
|
+
* <p>
|
|
8
|
+
* <strong>Version note!</strong>
|
|
9
|
+
* This is an exotic sibling interface to {@link RestApi RestApi} that can be used to invoke the local Sitevision REST API
|
|
10
|
+
* in a specific version - regardless of what version your code are currently executing in.
|
|
11
|
+
* If you don't know what a version is or haven't thought much about it, you would typically use {@link RestApi RestApi}
|
|
12
|
+
* that invokes the local REST API in {@link senselogic.sitevision.api.versioning.VersionUtil#getCurrentVersion() current version}.
|
|
13
|
+
* </p>
|
|
14
|
+
*
|
|
15
|
+
* <p>
|
|
16
|
+
* This utility can be used regardless of the REST API of the local site is enabled or not!
|
|
17
|
+
* </p>
|
|
18
|
+
*
|
|
19
|
+
* <p>
|
|
20
|
+
* <strong>Performance note!</strong> {@link RestApi} will always outperform <code>VersionedRestApi</code> when executing
|
|
21
|
+
* in the same version! Note that the method contracts of the interfaces differs. RestApi operates on Node objects and VersionedRestApi
|
|
22
|
+
* operates on Strings (i.e. Node identifiers).
|
|
23
|
+
* </p>
|
|
24
|
+
*
|
|
25
|
+
* <p>
|
|
26
|
+
* An instance of the Sitevision class implementing this interface can be obtained via
|
|
27
|
+
* {@link RestApiFactory#getOfflineRestApi() RestApiFactory.getOfflineRestApi()} or
|
|
28
|
+
* {@link RestApiFactory#getOnlineRestApi() RestApiFactory.getOnlineRestApi()}.
|
|
29
|
+
* See {@link RestApiFactory} for how to obtain an instance of the <code>RestApiFactory</code> interface.
|
|
30
|
+
* </p>
|
|
31
|
+
* @param <O> script object
|
|
32
|
+
* @author Magnus Lövgren
|
|
33
|
+
* @see RestApi
|
|
34
|
+
* @see RestApiFactory
|
|
35
|
+
* @since Sitevision 2024.04.2
|
|
36
|
+
*/
|
|
37
|
+
export type VersionedRestApi = {
|
|
38
|
+
/**
|
|
39
|
+
* Get the version that is used by this instance.
|
|
40
|
+
* @return {@link senselogic.sitevision.api.versioning.VersionUtil#OFFLINE_VERSION}
 or {@link senselogic.sitevision.api.versioning.VersionUtil#ONLINE_VERSION}
|
|
41
|
+
*/
|
|
42
|
+
getVersion(): number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Executes a GET endpoint of the REST API.
|
|
46
|
+
*
|
|
47
|
+
* <p>
|
|
48
|
+
* Delegates execution to {@link RestApi#get(javax.jcr.Node, String) RestApi.get(Node,String)}
|
|
49
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
50
|
+
* </p>
|
|
51
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
52
|
+
* @param aOperationName the endpoint operation name/method
|
|
53
|
+
* @return the result of the {@link RestApi#get(javax.jcr.Node, String) RestApi.get(Node,String)} invocation
|
|
54
|
+
* @throws NullPointerException if aContextNodeIdentifier or aOperationName is null
|
|
55
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier or aOperationName is empty or blank
|
|
56
|
+
*/
|
|
57
|
+
get(
|
|
58
|
+
aContextNodeIdentifier: String | string,
|
|
59
|
+
aOperationName: String | string
|
|
60
|
+
): unknown;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Executes a GET endpoint of the REST API.
|
|
64
|
+
*
|
|
65
|
+
* <p>
|
|
66
|
+
* Delegates execution to {@link RestApi#get(javax.jcr.Node, String, Object) RestApi.get(Node,String,Options)}
|
|
67
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
68
|
+
* </p>
|
|
69
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
70
|
+
* @param aOperationName the endpoint operation name/method
|
|
71
|
+
* @param aOperationOptions the operation data/parameters
|
|
72
|
+
* @return the result of the {@link RestApi#get(javax.jcr.Node, String, Object) RestApi.get(Node,String,Options)} invocation
|
|
73
|
+
* @throws NullPointerException if aContextNodeIdentifier or aOperationName is null
|
|
74
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier or aOperationName is empty or blank
|
|
75
|
+
*/
|
|
76
|
+
get(
|
|
77
|
+
aContextNodeIdentifier: String | string,
|
|
78
|
+
aOperationName: String | string,
|
|
79
|
+
aOperationOptions: unknown
|
|
80
|
+
): unknown;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Executes a GET endpoint of the REST API, targeting an instance of the context.
|
|
84
|
+
*
|
|
85
|
+
* <p>
|
|
86
|
+
* Delegates execution to {@link RestApi#get(javax.jcr.Node, String, javax.jcr.Node, Object) RestApi.get(Node,String,Node,Options)}
|
|
87
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
88
|
+
* </p>
|
|
89
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
90
|
+
* @param aOperationName the endpoint operation name/method
|
|
91
|
+
* @param aOperationNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint operation Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
92
|
+
* @param aOperationOptions the operation data/parameters
|
|
93
|
+
* @return the result of the {@link RestApi#get(javax.jcr.Node, String, javax.jcr.Node, Object) RestApi.get(Node,String,Node,Options)} invocation
|
|
94
|
+
* @throws NullPointerException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is null
|
|
95
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is empty or blank
|
|
96
|
+
*/
|
|
97
|
+
get(
|
|
98
|
+
aContextNodeIdentifier: String | string,
|
|
99
|
+
aOperationName: String | string,
|
|
100
|
+
aOperationNodeIdentifier: String | string,
|
|
101
|
+
aOperationOptions: unknown
|
|
102
|
+
): unknown;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Executes a POST endpoint of the REST API.
|
|
106
|
+
*
|
|
107
|
+
* <p>
|
|
108
|
+
* Delegates execution to {@link RestApi#post(javax.jcr.Node, String, Object) RestApi.post(Node,String,Options)}
|
|
109
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
110
|
+
* </p>
|
|
111
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
112
|
+
* @param aOperationName the endpoint operation name/method
|
|
113
|
+
* @param aOperationOptions the operation data/parameters
|
|
114
|
+
* @return the result of the {@link RestApi#post(javax.jcr.Node, String, Object) RestApi.post(Node,String,Options)} invocation
|
|
115
|
+
* @throws NullPointerException if aContextNodeIdentifier or aOperationName is null
|
|
116
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier or aOperationName is empty or blank
|
|
117
|
+
*/
|
|
118
|
+
post(
|
|
119
|
+
aContextNodeIdentifier: String | string,
|
|
120
|
+
aOperationName: String | string,
|
|
121
|
+
aOperationOptions: unknown
|
|
122
|
+
): unknown;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Executes a PUT endpoint of the REST API.
|
|
126
|
+
*
|
|
127
|
+
* <p>
|
|
128
|
+
* Delegates execution to {@link RestApi#put(javax.jcr.Node, String, Object) RestApi.put(Node,String,Options)}
|
|
129
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
130
|
+
* </p>
|
|
131
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
132
|
+
* @param aOperationName the endpoint operation name/method
|
|
133
|
+
* @param aOperationOptions the operation data/parameters
|
|
134
|
+
* @return the result of the {@link RestApi#put(javax.jcr.Node, String, Object) RestApi.put(Node,String,Options)} invocation
|
|
135
|
+
* @throws NullPointerException if aContextNodeIdentifier or aOperationName is null
|
|
136
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier or aOperationName is empty or blank
|
|
137
|
+
*/
|
|
138
|
+
put(
|
|
139
|
+
aContextNodeIdentifier: String | string,
|
|
140
|
+
aOperationName: String | string,
|
|
141
|
+
aOperationOptions: unknown
|
|
142
|
+
): unknown;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Executes a PUT endpoint of the REST API
|
|
146
|
+
*
|
|
147
|
+
* <p>
|
|
148
|
+
* Delegates execution to {@link RestApi#put(javax.jcr.Node, String, javax.jcr.Node, Object) RestApi.put(Node,String,Node,Options)}
|
|
149
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
150
|
+
* </p>
|
|
151
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
152
|
+
* @param aOperationName the endpoint operation name/method
|
|
153
|
+
* @param aOperationNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint operation Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
154
|
+
* @param aOperationOptions the operation data/parameters
|
|
155
|
+
* @return the result of the {@link RestApi#put(javax.jcr.Node, String, javax.jcr.Node, Object) RestApi.put(Node,String,Node,Options)} invocation
|
|
156
|
+
* @throws NullPointerException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is null
|
|
157
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is empty or blank
|
|
158
|
+
*/
|
|
159
|
+
put(
|
|
160
|
+
aContextNodeIdentifier: String | string,
|
|
161
|
+
aOperationName: String | string,
|
|
162
|
+
aOperationNodeIdentifier: String | string,
|
|
163
|
+
aOperationOptions: unknown
|
|
164
|
+
): unknown;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Executes a DELETE endpoint of the REST API.
|
|
168
|
+
*
|
|
169
|
+
* <p>
|
|
170
|
+
* Delegates execution to {@link RestApi#delete(javax.jcr.Node, String) RestApi.delete(Node,String)}
|
|
171
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
172
|
+
* </p>
|
|
173
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
174
|
+
* @param aOperationName the endpoint operation name/method
|
|
175
|
+
* @return the result of the {@link RestApi#delete(javax.jcr.Node, String) RestApi.delete(Node,String)} invocation
|
|
176
|
+
* @throws NullPointerException if aContextNodeIdentifier or aOperationName is null
|
|
177
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier or aOperationName is empty or blank
|
|
178
|
+
*/
|
|
179
|
+
delete(
|
|
180
|
+
aContextNodeIdentifier: String | string,
|
|
181
|
+
aOperationName: String | string
|
|
182
|
+
): unknown;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Executes a DELETE endpoint of the REST API, targeting an instance of the context.
|
|
186
|
+
*
|
|
187
|
+
* <p>
|
|
188
|
+
* Delegates execution to {@link RestApi#delete(javax.jcr.Node, String, javax.jcr.Node) RestApi.delete(Node,String,Node)}
|
|
189
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
190
|
+
* </p>
|
|
191
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
192
|
+
* @param aOperationName the endpoint operation name/method
|
|
193
|
+
* @param aOperationNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint operation Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
194
|
+
* @return the result of the {@link RestApi#delete(javax.jcr.Node, String, javax.jcr.Node) RestApi.delete(Node,String,Node)} invocation
|
|
195
|
+
* @throws NullPointerException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is null
|
|
196
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is empty or blank
|
|
197
|
+
*/
|
|
198
|
+
delete(
|
|
199
|
+
aContextNodeIdentifier: String | string,
|
|
200
|
+
aOperationName: String | string,
|
|
201
|
+
aOperationNodeIdentifier: String | string
|
|
202
|
+
): unknown;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Executes a DELETE endpoint of the REST API, targeting an instance of the context.
|
|
206
|
+
*
|
|
207
|
+
* <p>
|
|
208
|
+
* Delegates execution to {@link RestApi#delete(javax.jcr.Node, String, javax.jcr.Node, Object) RestApi.delete(Node,String,Node,Options)}
|
|
209
|
+
* in the {@link #getVersion() version} specified by this instance.
|
|
210
|
+
* </p>
|
|
211
|
+
* @param aContextNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint context Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
212
|
+
* @param aOperationName the endpoint operation name/method
|
|
213
|
+
* @param aOperationNodeIdentifier the {@link javax.jcr.Node#getIdentifier() identifier} for the endpoint operation Node.
 Note that there is no guarantee that such a Node exists in the version specified by this instance.
|
|
214
|
+
* @param aOperationOptions the operation data/parameters
|
|
215
|
+
* @return the result of the {@link RestApi#delete(javax.jcr.Node, String, javax.jcr.Node, Object) RestApi.delete(Node,String,Node,Options)}
 invocation
|
|
216
|
+
* @throws NullPointerException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is null
|
|
217
|
+
* @throws IllegalArgumentException if aContextNodeIdentifier, aOperationName or aOperationNodeIdentifier is empty or blank
|
|
218
|
+
*/
|
|
219
|
+
delete(
|
|
220
|
+
aContextNodeIdentifier: String | string,
|
|
221
|
+
aOperationName: String | string,
|
|
222
|
+
aOperationNodeIdentifier: String | string,
|
|
223
|
+
aOperationOptions: unknown
|
|
224
|
+
): unknown;
|
|
225
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
getVersion: function getVersion() {},
|
|
9
|
+
get: function get() {},
|
|
10
|
+
post: function post() {},
|
|
11
|
+
put: function put() {},
|
|
12
|
+
"delete": function _delete() {}
|
|
13
|
+
};
|
|
14
|
+
exports["default"] = _default;
|