@sitevision/api 1.0.9 → 1.0.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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Listen to a given event
3
+ *
4
+ * @param eventName The name of the event
5
+ * @param callback The callback to trigger for the given event
6
+ */
7
+ export function on(eventName: string, callback: (options: any) => void): void;
8
+ /**
9
+ * Emit a server side event
10
+ *
11
+ * Note! Server side only
12
+ *
13
+ * @param eventName The name of the event to emit
14
+ * @param options The options for the event
15
+ */
16
+ export function emit(eventName: string, options: any): void;
17
+ /**
18
+ * Trigger a client side event
19
+ *
20
+ * Note! Client side only
21
+ *
22
+ * @param eventName The name of the event to trigger
23
+ * @param options The options for the event
24
+ */
25
+ export function trigger(eventName: string, options: any): void;
26
+
27
+ declare namespace events {
28
+ export { on, emit, trigger };
29
+ }
30
+
31
+ export default events;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _default = {
8
8
  on: function on() {},
9
- emit: function emit() {}
9
+ emit: function emit() {},
10
+ trigger: function trigger() {}
10
11
  };
11
12
  exports["default"] = _default;
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import './client/toasts';
4
4
  import './common/app';
5
5
  import './common/i18n';
6
6
  import './common/router';
7
+ import './common/events';
7
8
 
8
9
  import './server/appData';
9
10
  import './server/appResource';
@@ -17,7 +18,6 @@ import './server/CollaborationGroupType';
17
18
  import './server/CollaborationGroupUtil';
18
19
  import './server/CollaborationGroupWrapper';
19
20
  import './server/DateUtil';
20
- import './server/events';
21
21
  import './server/globalAppData';
22
22
  import './server/hooks';
23
23
  import './server/LandingPageUtil';
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@sitevision/api",
3
- "version": "1.0.9",
3
+ "version": "1.0.12",
4
4
  "author": "Sitevision AB",
5
5
  "license": "MIT",
6
6
  "types": "index.d.ts",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/sitevision/siteivision-apps.git",
9
+ "url": "https://github.com/sitevision/sitevision-apps.git",
10
10
  "directory": "packages/api"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.com/sitevision/siteivision-apps/issues"
13
+ "url": "https://github.com/sitevision/sitevision-apps/issues"
14
14
  },
15
15
  "scripts": {
16
16
  "prepare": "yarn build",
@@ -26,5 +26,5 @@
26
26
  "access": "public",
27
27
  "directory": "dist"
28
28
  },
29
- "gitHead": "2b76525fb1911135b26fcb3930552ae3756862d2"
29
+ "gitHead": "d514eb8b9219d901e11cbda190e5812a5522fbdc"
30
30
  }
@@ -24,38 +24,51 @@ export const PROPERTY_SHORTID: string;
24
24
  export const PROPERTY_VISIBLE_IN_MENUS: string;
25
25
 
26
26
  /**
27
- * Creates an article as sub node to a specified parent.
28
- * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
29
- * @param {Node} aParent - the parent node of the article. May not be null
30
- * @param {Node} aTemplate - the template used for the article. May not be null
31
- * @param {string} aName - the name of the sv:article. May not be null
32
- */
33
- export function createArticle(aParent: Node, aTemplate: Node, aName: string): Node;
27
+ * Creates an article as sub node to a specified parent.
28
+ * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
29
+ * @param {Node} aParent - the parent node of the article. May not be null
30
+ * @param {Node} aTemplate - the template used for the article. May not be null
31
+ * @param {string} aName - the name of the sv:article. May not be null
32
+ */
33
+ export function createArticle(
34
+ aParent: Node,
35
+ aTemplate: Node,
36
+ aName: string
37
+ ): Node;
34
38
 
35
39
  /**
36
- * Creates an article with properties and web content.
37
- * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
38
- * @param {Node} aParent - the parent node of the article. May not be null
39
- * @param {Node} aTemplate - the sv:template node to be used for the article. May not be null
40
- * @param {string} aName - the name of the sv:article. May not be null
41
- * @param {Map<string, any>} properties - the article properties. May be null
42
- * @param {Map<string, string>} content - a map containing the HTML content. The keys must correspond to layout names on the node. May be null
43
- */
44
- export function createArticle(aParent: Node, aTemplate: Node, aName: string, properties: Map<string, any>, content: Map<string, string>): Node;
40
+ * Creates an article with properties and web content.
41
+ * @returns {Node} a sv:article node corresponding to the newly created article. Will never return null
42
+ * @param {Node} aParent - the parent node of the article. May not be null
43
+ * @param {Node} aTemplate - the sv:template node to be used for the article. May not be null
44
+ * @param {string} aName - the name of the sv:article. May not be null
45
+ * @param {Map<string, any>} properties - the article properties. May be null
46
+ * @param {Map<string, string>} content - a map containing the HTML content. The keys must correspond to layout names on the node. May be null
47
+ */
48
+ export function createArticle(
49
+ aParent: Node,
50
+ aTemplate: Node,
51
+ aName: string,
52
+ properties: Map<string, any>,
53
+ content: Map<string, string>
54
+ ): Node;
45
55
 
46
56
  /**
47
- * Alters the name of an article.
48
- * @param {Node} anArticle - the article that should be renamed. May not be null
49
- * @param {string} aName - the new name of the article. May not be null
50
- */
57
+ * Alters the name of an article.
58
+ * @param {Node} anArticle - the article that should be renamed. May not be null
59
+ * @param {string} aName - the new name of the article. May not be null
60
+ */
51
61
  export function renameArticle(anArticle: Node, aName: string): void;
52
62
 
53
63
  /**
54
- * Updates the properties of an article.
55
- * @param {Node} anArticle - the sv:article that will be altered. May not be null
56
- * @param {Map<string, any>} properties - the article properties. May not be null
57
- */
58
- export function updateArticle(anArticle: Node, properties: Map<string, any>): void;
64
+ * Updates the properties of an article.
65
+ * @param {Node} anArticle - the sv:article that will be altered. May not be null
66
+ * @param {Map<string, any>} properties - the article properties. May not be null
67
+ */
68
+ export function updateArticle(
69
+ anArticle: Node,
70
+ properties: Map<string, any>
71
+ ): void;
59
72
 
60
73
  declare namespace articleUtil {
61
74
  export {
@@ -79,5 +92,3 @@ declare namespace articleUtil {
79
92
  }
80
93
 
81
94
  export default articleUtil;
82
-
83
- PROPERTY_CREATED_BY
@@ -0,0 +1,95 @@
1
+ import List from '../../builtins/List';
2
+ import Node from '../../builtins/Node';
3
+
4
+ /**
5
+ * Returns a list of <code>Node</code> objects for all bookmarks belonging to
6
+ * the current user regardless of category. This method only returns valid bookmarks
7
+ * (existing, published objects)
8
+ *
9
+ * @return {List<Node>} a list of bookmark nodes. Is never <code>null</code>
10
+ */
11
+ export function getBookmarks(): List<Node>;
12
+
13
+ /**
14
+ * Returns a list of <code>Node</code> objects corresponding to the bookmarks for
15
+ * the current user and the provided categories. This method only returns valid bookmarks
16
+ * (existing, published objects)
17
+ *
18
+ * @param {string} category a comma separated list of categories or <code>null</code> for no category
19
+ * @return {List<Node>} a list of bookmark nodes. Is never <code>null</code>
20
+ */
21
+ export function getBookmarks(category: string): List<Node>;
22
+
23
+ /**
24
+ * Adds a bookmark for the current user. This operation is synchronized
25
+ *
26
+ * @param {Node} bookmark the node to be bookmarked must be a <code>sv:page</code>,
27
+ * <code>sv:sitePage</code> or an <code>sv:article</code>
28
+ * @param {string} categories a comma separated list of categories to where this bookmark belongs
29
+ * @throws IllegalArgumentException if <code>bookmark</code> is node of wrong type
30
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
31
+ * @deprecated Use {@link #add(javax.jcr.Node)}, categories will be resolved from metadata.
32
+ */
33
+ export function add(bookmark: Node, categories: string): void;
34
+
35
+ /**
36
+ * Adds a bookmark for the current user. This operation is synchronized
37
+ *
38
+ * @param {Node} bookmark the node to be bookmarked must be a <code>sv:page</code>,
39
+ * <code>sv:sitePage</code> or an <code>sv:article</code>
40
+ * @throws IllegalArgumentException if bookmark is node of wrong type
41
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
42
+ */
43
+ export function add(bookmark: Node): void;
44
+
45
+ /**
46
+ * Removes a bookmark for the current user. This operation is synchronized
47
+ *
48
+ * @param {Node} bookmark the bookmark
49
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
50
+ */
51
+ export function remove(bookmark: Node): void;
52
+
53
+ /**
54
+ * Checks if the current user has the provided bookmark
55
+ *
56
+ * @param {Node} bookmark the bookmark
57
+ * @return if the user has provided bookmark
58
+ * @throws NullPointerException if <code>bookmark</code> is <code>null</code>
59
+ */
60
+ export function contains(bookmark: Node): boolean;
61
+
62
+ /**
63
+ * Accesses a <code>boolean</code> indicating if the current site has a limited number of bookmarks.
64
+ *
65
+ * To get the max number of bookmarks, use {@link #getMaxNofBookmarks()}.
66
+ *
67
+ * @return {boolean} a <code>boolean</code> indicating if the current site has a limited number of bookmarks
68
+ * @throws NullPointerException if current site is indeterminable
69
+ * @see #getMaxNofBookmarks()
70
+ * @since Sitevision 2.6.1_01
71
+ */
72
+ export function getLimitNofBookmarks(): boolean;
73
+
74
+ /**
75
+ * Accessor to max number of bookmarks for the current site.
76
+ *
77
+ * @return {number} max number of bookmarks for the current site
78
+ * @throws NullPointerException if current site is indeterminable
79
+ * @see #getLimitNofBookmarks()
80
+ * @since Sitevision 2.6.1_01
81
+ */
82
+ export function getMaxNofBookmarks(): number;
83
+
84
+ declare namespace bookmarkUtil {
85
+ export {
86
+ getBookmarks,
87
+ add,
88
+ remove,
89
+ contains,
90
+ getLimitNofBookmarks,
91
+ getMaxNofBookmarks,
92
+ };
93
+ }
94
+
95
+ export default bookmarkUtil;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getBookmarks: function getBookmarks() {},
9
+ add: function add() {},
10
+ remove: function remove() {},
11
+ contains: function contains() {},
12
+ getLimitNofBookmarks: function getLimitNofBookmarks() {},
13
+ getMaxNofBookmarks: function getMaxNofBookmarks() {}
14
+ };
15
+ exports["default"] = _default;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Gets the Internet Protocol (IP) address of the client (or last proxy) that initiated currently executing request.
3
+ *
4
+ * @return {string} a <code>String</code> containing the IP address of the client that sent the request, or <code>null</code> if indeterminable
5
+ */
6
+ export function getClientAddress(): string;
7
+
8
+ declare namespace clientUtil {
9
+ export { getClientAddress };
10
+ }
11
+
12
+ export default clientUtil;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ getClientAddress: function getClientAddress() {}
9
+ };
10
+ exports["default"] = _default;
@@ -0,0 +1,44 @@
1
+ import Node from '../../builtins/Node';
2
+
3
+ /**
4
+ * Gets the color with a given name
5
+ *
6
+ * @param {string} aColorName the name of the font
7
+ * @return {Node} the first color with name aColorName, or <code>null</code> if no color matches
8
+ */
9
+ export function getColorByName(aColorName: string): Node;
10
+
11
+ /**
12
+ * Gets the color with a given name with a fallback value if no color matches
13
+ *
14
+ * @param {string} aColorName the name of the font
15
+ * @param {Node} aDefaultValue fallback value
16
+ * @return {Node} the first color with name aColorName, or aDefaultValue if no color matches
17
+ */
18
+ export function getColorByName(aColorName: string, aDefaultValue: Node): Node;
19
+
20
+ /**
21
+ * Gets the color with a given html hex value (i.e. a '#' followed by 6 characters [0-9,a-f,A-F]).
22
+ *
23
+ * @param {string} aHexString the hex string value of the font (starts with a '#' and ends with 6 characters [0-9,a-f,A-F])
24
+ * @return {Node} the first color with the corresponding hex string, or <code>null</code> if no color matches
25
+ */
26
+ export function getColorByHtmlHexValue(aHexString: string): Node;
27
+
28
+ /**
29
+ * Gets the color with a given html hex value (i.e. a '#' followed by 6 characters [0-9,a-f,A-F]) with a fallback value if no color matches.
30
+ *
31
+ * @param {string} aHexString the hex string value of the font (starts with a '#' and ends with 6 characters [0-9,a-f,A-F])
32
+ * @param {Node} aDefaultValue fallback value
33
+ * @return {Node} the first color with the corresponding hex string, or aDefaultValue if no color matches
34
+ */
35
+ export function getColorByHtmlHexValue(
36
+ aHexString: string,
37
+ aDefaultValue: Node
38
+ ): Node;
39
+
40
+ declare namespace colorUtil {
41
+ export { getColorByName, getColorByHtmlHexValue };
42
+ }
43
+
44
+ export default colorUtil;
@@ -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
+ getColorByName: function getColorByName() {},
9
+ getColorByHtmlHexValue: function getColorByHtmlHexValue() {}
10
+ };
11
+ exports["default"] = _default;
@@ -1,8 +0,0 @@
1
- export function on(eventName: string, callback: (options: any) => void): void;
2
- export function emit(eventName: string, options: any): void;
3
-
4
- declare namespace events {
5
- export { on, emit };
6
- }
7
-
8
- export default events;