@jahia/cypress 3.7.0 → 3.9.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.
@@ -8,5 +8,6 @@ export declare const addNode: (variables: {
8
8
  properties?: any[];
9
9
  children?: any[];
10
10
  }) => Cypress.Chainable;
11
- export declare const getNodeByPath: (path: string, properties?: string[], language?: string) => Cypress.Chainable;
11
+ export declare const getNodeByPath: (path: string, properties?: string[], language?: string, childrenTypes?: string[]) => Cypress.Chainable;
12
+ export declare const getNodeAcl: (path: string) => Cypress.Chainable;
12
13
  export declare const moveNode: (pathOrId: string, destParentPathOrId: string, destName?: string) => Cypress.Chainable;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.moveNode = exports.getNodeByPath = exports.addNode = exports.deleteNodeProperty = exports.deleteNode = exports.setNodeProperty = void 0;
3
+ exports.moveNode = exports.getNodeAcl = exports.getNodeByPath = exports.addNode = exports.deleteNodeProperty = exports.deleteNode = exports.setNodeProperty = void 0;
4
4
  var setNodeProperty = function (pathOrId, property, value, language) {
5
5
  var mutationFile = 'graphql/jcr/mutation/setProperty.graphql';
6
6
  if (value instanceof Array) {
@@ -45,17 +45,28 @@ var addNode = function (variables) {
45
45
  });
46
46
  };
47
47
  exports.addNode = addNode;
48
- var getNodeByPath = function (path, properties, language) {
48
+ var getNodeByPath = function (path, properties, language, childrenTypes) {
49
+ if (childrenTypes === void 0) { childrenTypes = []; }
49
50
  return cy.apollo({
50
51
  variables: {
51
52
  path: path,
52
53
  properties: properties,
53
- language: language
54
+ language: language,
55
+ childrenTypes: childrenTypes
54
56
  },
55
57
  queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
56
58
  });
57
59
  };
58
60
  exports.getNodeByPath = getNodeByPath;
61
+ var getNodeAcl = function (path) {
62
+ return cy.apollo({
63
+ variables: {
64
+ path: path
65
+ },
66
+ queryFile: 'graphql/jcr/query/getNodeAcl.graphql'
67
+ });
68
+ };
69
+ exports.getNodeAcl = getNodeAcl;
59
70
  var moveNode = function (pathOrId, destParentPathOrId, destName) {
60
71
  return cy.apollo({
61
72
  variables: {
@@ -0,0 +1,17 @@
1
+ query getAcl($path: String!) {
2
+ jcr {
3
+ nodeByPath(path: $path) {
4
+ acl {
5
+ aclEntries {
6
+ aclEntryType
7
+ role {
8
+ name
9
+ }
10
+ principal {
11
+ name
12
+ }
13
+ }
14
+ }
15
+ }
16
+ }
17
+ }
@@ -1,15 +1,33 @@
1
- query getNodeByPath($path: String!, $properties: [String]=[], $language: String="") {
1
+ query getNodeByPath($path: String!, $properties: [String]=[], $language: String="", $childrenTypes: [String] = []) {
2
2
  jcr {
3
3
  nodeByPath(path: $path) {
4
4
  uuid
5
5
  name
6
- properties(names: $properties, language: $language){
7
- name
8
- value
6
+ properties(names: $properties, language: $language){
7
+ name
8
+ value
9
+ values
9
10
  }
10
11
  primaryNodeType {
11
12
  name
12
13
  }
14
+ children(typesFilter: { types: $childrenTypes }) {
15
+ nodes {
16
+ name
17
+ children {
18
+ nodes {
19
+ properties {
20
+ name
21
+ value
22
+ values
23
+ }
24
+ primaryNodeType {
25
+ name
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
13
31
  }
14
32
  }
15
- }
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.7.0",
3
+ "version": "3.9.0",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -43,17 +43,27 @@ export const addNode = (variables: { parentPathOrId: string, primaryNodeType: st
43
43
  });
44
44
  };
45
45
 
46
- export const getNodeByPath = (path: string, properties?: string[], language?:string): Cypress.Chainable => {
46
+ export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = []): Cypress.Chainable => {
47
47
  return cy.apollo({
48
48
  variables: {
49
49
  path: path,
50
50
  properties: properties,
51
- language: language
51
+ language: language,
52
+ childrenTypes: childrenTypes
52
53
  },
53
54
  queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
54
55
  });
55
56
  };
56
57
 
58
+ export const getNodeAcl = (path: string): Cypress.Chainable => {
59
+ return cy.apollo({
60
+ variables: {
61
+ path: path
62
+ },
63
+ queryFile: 'graphql/jcr/query/getNodeAcl.graphql'
64
+ });
65
+ };
66
+
57
67
  export const moveNode = (pathOrId: string, destParentPathOrId: string, destName?: string): Cypress.Chainable => {
58
68
  return cy.apollo({
59
69
  variables: {