@jahia/javascript-modules-library 0.5.6 → 0.6.0

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 (31) hide show
  1. package/README.md +215 -22
  2. package/dist/core/server/components/AbsoluteArea.d.ts +43 -18
  3. package/dist/core/server/components/AddResources.d.ts +1 -1
  4. package/dist/core/server/components/Area.d.ts +32 -16
  5. package/dist/core/server/components/render/HydrateInBrowser.d.ts +1 -1
  6. package/dist/core/server/components/render/Render.d.ts +4 -4
  7. package/dist/core/server/components/render/RenderChild.d.ts +16 -0
  8. package/dist/core/server/components/render/RenderChildren.d.ts +33 -0
  9. package/dist/core/server/framework/jahiaComponent.d.ts +7 -0
  10. package/dist/core/server/hooks/useServerContext.d.ts +4 -2
  11. package/dist/core/server/utils/i18n.d.ts +11 -0
  12. package/dist/core/server/utils/jcr/getChildNodes.d.ts +1 -2
  13. package/dist/core/server/utils/jcr/getNodesByJCRQuery.d.ts +1 -1
  14. package/dist/core/server/utils/urlBuilder/urlBuilder.d.ts +52 -15
  15. package/dist/globals.d.ts +3 -0
  16. package/dist/index.d.ts +6 -3
  17. package/dist/java.io.d.ts +164 -0
  18. package/dist/java.lang.d.ts +16 -0
  19. package/dist/java.util.d.ts +2 -1
  20. package/dist/javax.jcr.d.ts +13 -0
  21. package/dist/javax.servlet.http.d.ts +70 -0
  22. package/dist/nav/server/navBuilder/navBuilder.d.ts +5 -3
  23. package/dist/org.jahia.modules.javascript.modules.engine.js.server.d.ts +56 -50
  24. package/dist/org.jahia.services.content.d.ts +41 -1
  25. package/dist/org.jahia.services.content.decorator.d.ts +97 -2
  26. package/dist/org.jahia.services.render.d.ts +6 -0
  27. package/dist/org.jahia.services.usermanager.d.ts +11 -0
  28. package/dist/package.tgz +0 -0
  29. package/package.json +5 -1
  30. package/dist/core/server/hooks/useUrlBuilder.d.ts +0 -52
  31. package/dist/core/server/utils/jcr/getNodeFromPathOrId.d.ts +0 -14
@@ -1,6 +1,6 @@
1
1
  declare module 'org.jahia.services.content.decorator' {
2
2
  import { Locale, Set, List } from 'java.util';
3
- import { JCRNodeWrapper } from 'org.jahia.services.content';
3
+ import { JCRNodeWrapper, JCRNodeIteratorWrapper } from 'org.jahia.services.content';
4
4
  /**
5
5
  * JCR node representing the Jahia virtual site.
6
6
  *
@@ -8,7 +8,7 @@ import { JCRNodeWrapper } from 'org.jahia.services.content';
8
8
  * Date: Mar 30, 2010
9
9
  * Time: 12:37:45 PM
10
10
  */
11
- export class JCRSiteNode {
11
+ export interface JCRSiteNode extends JCRNodeWrapper {
12
12
  /**
13
13
  * @return list of inactive live languages
14
14
  */
@@ -58,6 +58,7 @@ export class JCRSiteNode {
58
58
  getServerName(): string;
59
59
  getServerNameAliases(): string[];
60
60
  getAllServerNames(): string[];
61
+ getSiteKey(): string;
61
62
  getInstalledModules(): string[];
62
63
  /**
63
64
  * Returns a set of all installed modules for this site, their direct and transitive dependencies (the whole dependency tree).
@@ -87,6 +88,100 @@ export class JCRSiteNode {
87
88
  * @return true if this site is the default one on the server
88
89
  */
89
90
  isDefault(): boolean;
91
+ /**
92
+ * Returns a list holding the primary node type and all mixin node types for this node
93
+ *
94
+ * @return a list holding the primary node type and all mixin node types
95
+ * @throws RepositoryException in case of JCR-related errors
96
+ */
97
+ getNodeTypes(): string[];
98
+ /**
99
+ * {@inheritDoc}
100
+ *
101
+ * @return The wrapped node at relPath.
102
+ */
103
+ getNode(s: string): JCRNodeWrapper;
104
+ /**
105
+ * Returns all child nodes of this node accessible through the current
106
+ * Session. Does not include properties of this
107
+ * Node. The same reacquisition semantics apply as with {@link
108
+ * #getNode(String)}. If this node has no accessible child nodes, then an
109
+ * empty iterator is returned.
110
+ *
111
+ * @return A NodeIterator over all child Nodes of
112
+ * this Node.
113
+ * @throws RepositoryException if an error occurs.
114
+ */
115
+ getNodes(): JCRNodeIteratorWrapper;
116
+ /**
117
+ * Gets all child nodes of this node accessible through the current
118
+ * Session that match namePattern. The pattern may
119
+ * be a full name or a partial name with one or more wildcard characters
120
+ * ("*"), or a disjunction (using the "|"
121
+ * character to represent logical OR) of these. For example,
122
+ *
123
+ * N.getNodes("jcr:* | myapp:report | my doc")
124
+ *
125
+ * would return a NodeIterator holding all accessible child
126
+ * nodes of N that are either called 'myapp:report',
127
+ * begin with the prefix 'jcr:' or are called 'my
128
+ * doc'.
129
+ *
130
+ * The substrings within the pattern that are delimited by "|"
131
+ * characters and which may contain wildcard characters ("*")
132
+ * are called globs.
133
+ *
134
+ * Note that leading and trailing whitespace around a glob is ignored, but
135
+ * whitespace within a disjunct forms part of the pattern to be matched.
136
+ *
137
+ * The pattern is matched against the names (not the paths) of the immediate
138
+ * child nodes of this node.
139
+ *
140
+ * If this node has no accessible matching child nodes, then an empty
141
+ * iterator is returned.
142
+ *
143
+ * The same reacquisition semantics apply as with {@link
144
+ * #getNode(String)}.
145
+ *
146
+ * @param namePattern a name pattern.
147
+ * @return a NodeIterator.
148
+ * @throws RepositoryException if an unexpected error occurs.
149
+ */
150
+ getNodes(s: string): JCRNodeIteratorWrapper;
151
+ /**
152
+ * Gets all child nodes of this node accessible through the current
153
+ * Session that match one or more of the nameGlob
154
+ * strings in the passed array.
155
+ *
156
+ * A glob may be a full name or a partial name with one or more wildcard
157
+ * characters ("*"). For example,
158
+ *
159
+ * N.getNodes(new String[] {"jcr:*", "myapp:report", "my
160
+ * doc"})
161
+ *
162
+ * would return a NodeIterator holding all accessible child
163
+ * nodes of N that are either called 'myapp:report',
164
+ * begin with the prefix 'jcr:' or are called 'my
165
+ * doc'.
166
+ *
167
+ * Note that unlike in the case of the {@link #getNodes(String)} leading and
168
+ * trailing whitespace around a glob is not ignored.
169
+ *
170
+ * The globs are matched against the names (not the paths) of the immediate
171
+ * child nodes of this node.
172
+ *
173
+ * If this node has no accessible matching child nodes, then an empty
174
+ * iterator is returned.
175
+ *
176
+ * The same reacquisition semantics apply as with {@link
177
+ * #getNode(String)}.
178
+ *
179
+ * @param nameGlobs an array of globbing strings.
180
+ * @return a NodeIterator.
181
+ * @throws RepositoryException if an unexpected error occurs.
182
+ * @since JCR 2.0
183
+ */
184
+ getNodes(nameGlobs: string[]): JCRNodeIteratorWrapper;
90
185
  }
91
186
 
92
187
  }
@@ -1,9 +1,12 @@
1
1
  declare module 'org.jahia.services.render' {
2
2
  import { Locale, Set, List, Map } from 'java.util';
3
3
  import { JCRNodeWrapper } from 'org.jahia.services.content';
4
+ import { Serializable } from 'java.io';
4
5
  import { HttpServletRequest, HttpServletResponse } from 'javax.servlet.http';
6
+ import { SettingsBean } from 'org.jahia.settings';
5
7
  import { JCRSiteNode } from 'org.jahia.services.content.decorator';
6
8
  import { JahiaUser } from 'org.jahia.services.usermanager';
9
+ import { ExtendedNodeType } from 'org.jahia.services.content.nodetypes';
7
10
  /**
8
11
  * Template rendering context with the information about current request/response pair and optional template parameters.
9
12
  *
@@ -39,6 +42,7 @@ export class RenderContext {
39
42
  */
40
43
  getRedirect(): string;
41
44
  isEnterpriseEdition(): boolean;
45
+ getSettings(): SettingsBean;
42
46
  /**
43
47
  * @param node to check
44
48
  * @return true if the node is visible (in visibleTypes or without nonVisibleTypes)
@@ -89,7 +93,9 @@ export class Resource {
89
93
  getDependencies(): Set<string>;
90
94
  getRegexpDependencies(): Set<string>;
91
95
  getMissingResources(): string[];
96
+ getModuleParams(): Map<string, Serializable>;
92
97
  getPath(): string;
98
+ getResourceNodeType(): ExtendedNodeType;
93
99
  getNodePath(): string;
94
100
  }
95
101
  /**
@@ -1,4 +1,5 @@
1
1
  declare module 'org.jahia.services.usermanager' {
2
+ import { Properties } from 'java.util';
2
3
  /**
3
4
  * A JahiaUser represents a physical person who is defined by a username and
4
5
  * a password for authentication purpose. Every other property of a JahiaUser
@@ -22,6 +23,16 @@ export class JahiaUser {
22
23
  * @return the unique String identifier of this user.
23
24
  */
24
25
  getUserKey(): string;
26
+ /**
27
+ * Get user's properties list.
28
+ * The properties here should not be modified, as the modifications will
29
+ * not be serialized. Use the setProperty() method to modify a user's
30
+ * properties.
31
+ *
32
+ * @return Return a reference on the user's properties list, or null if no
33
+ * property is present.
34
+ */
35
+ getProperties(): Properties;
25
36
  /**
26
37
  * Retrieve the requested user property.
27
38
  *
package/dist/package.tgz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@jahia/javascript-modules-library",
3
- "version": "0.5.6",
3
+ "version": "0.6.0",
4
+ "homepage": "https://github.com/Jahia/javascript-modules/tree/main/javascript-modules-library#readme",
5
+ "bugs": {
6
+ "url": "https://github.com/Jahia/javascript-modules/issues"
7
+ },
4
8
  "repository": {
5
9
  "type": "git",
6
10
  "url": "git+https://github.com:Jahia/javascript-modules.git",
@@ -1,52 +0,0 @@
1
- interface UrlBuilderType {
2
- /**
3
- * Builds a static URL for an asset.
4
- *
5
- * @returns The built URL.
6
- */
7
- buildStaticUrl(props: {
8
- /** The path of the asset */
9
- assetPath: string;
10
- /**
11
- * The name of the module used as prefix for the URL. If not provided, the current module is
12
- * used.
13
- */
14
- moduleName?: string;
15
- /** The parameters to append to the URL */
16
- parameters?: Record<string, string>;
17
- }): string;
18
- /**
19
- * Builds a URL for a JCR node.
20
- *
21
- * @returns {string} The built URL.
22
- */
23
- buildNodeUrl(props: {
24
- /** The path of JCR node */
25
- nodePath: string;
26
- /** The extension to use to build the URL */
27
- extension?: string;
28
- /** The language to use to build the URL */
29
- language?: string;
30
- /** The mode to use to build the URL ('edit', 'preview', 'live') */
31
- mode?: "edit" | "preview" | "live";
32
- /** The parameters to append to the URL */
33
- parameters?: Record<string, string>;
34
- }): string;
35
- /**
36
- * Builds an HTML fragment URL for a JCR node.
37
- *
38
- * @returns {string} The built URL.
39
- */
40
- buildHtmlFragmentUrl(props: {
41
- /** The path of JCR node */
42
- nodePath: string;
43
- /** The language to use to build the URL */
44
- language?: string;
45
- /** The mode to use to build the URL ('edit', 'preview', 'live') */
46
- mode?: "edit" | "preview" | "live";
47
- /** The parameters to append to the URL */
48
- parameters?: Record<string, string>;
49
- }): string;
50
- }
51
- export declare function useUrlBuilder(): UrlBuilderType;
52
- export {};
@@ -1,14 +0,0 @@
1
- import type { JCRNodeWrapper, JCRSessionWrapper } from "org.jahia.services.content";
2
- /**
3
- * Returns a node from a path or identifier
4
- *
5
- * @param session - The JCR session.
6
- * @returns The node.
7
- */
8
- export declare function getNodeFromPathOrId(props: {
9
- /** The node identifier */
10
- identifier: string;
11
- } | {
12
- /** The node path */
13
- path: string;
14
- }, session: JCRSessionWrapper): JCRNodeWrapper | null;