@jahia/cypress 3.8.0 → 3.10.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, childrenTypes?: string[]) => Cypress.Chainable;
11
+ export declare const getNodeByPath: (path: string, properties?: string[], language?: string, childrenTypes?: string[], workspace?: 'EDIT' | 'LIVE') => 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,19 +45,30 @@ var addNode = function (variables) {
45
45
  });
46
46
  };
47
47
  exports.addNode = addNode;
48
- var getNodeByPath = function (path, properties, language, childrenTypes) {
48
+ var getNodeByPath = function (path, properties, language, childrenTypes, workspace) {
49
49
  if (childrenTypes === void 0) { childrenTypes = []; }
50
+ if (workspace === void 0) { workspace = 'EDIT'; }
50
51
  return cy.apollo({
51
52
  variables: {
52
53
  path: path,
53
54
  properties: properties,
54
55
  language: language,
55
- childrenTypes: childrenTypes
56
+ childrenTypes: childrenTypes,
57
+ workspace: workspace
56
58
  },
57
59
  queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
58
60
  });
59
61
  };
60
62
  exports.getNodeByPath = getNodeByPath;
63
+ var getNodeAcl = function (path) {
64
+ return cy.apollo({
65
+ variables: {
66
+ path: path
67
+ },
68
+ queryFile: 'graphql/jcr/query/getNodeAcl.graphql'
69
+ });
70
+ };
71
+ exports.getNodeAcl = getNodeAcl;
61
72
  var moveNode = function (pathOrId, destParentPathOrId, destName) {
62
73
  return cy.apollo({
63
74
  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,5 +1,5 @@
1
- query getNodeByPath($path: String!, $properties: [String]=[], $language: String="", $childrenTypes: [String] = []) {
2
- jcr {
1
+ query getNodeByPath($path: String!, $properties: [String]=[], $language: String="", $childrenTypes: [String] = [], $workspace: Workspace = EDIT ) {
2
+ jcr (workspace: $workspace){
3
3
  nodeByPath(path: $path) {
4
4
  uuid
5
5
  name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jahia/cypress",
3
- "version": "3.8.0",
3
+ "version": "3.10.0",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "lint": "eslint src -c .eslintrc.json --ext .ts"
@@ -43,18 +43,28 @@ export const addNode = (variables: { parentPathOrId: string, primaryNodeType: st
43
43
  });
44
44
  };
45
45
 
46
- export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = []): Cypress.Chainable => {
46
+ export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = [], workspace: 'EDIT' | 'LIVE' = 'EDIT'): Cypress.Chainable => {
47
47
  return cy.apollo({
48
48
  variables: {
49
49
  path: path,
50
50
  properties: properties,
51
51
  language: language,
52
- childrenTypes: childrenTypes
52
+ childrenTypes: childrenTypes,
53
+ workspace: workspace
53
54
  },
54
55
  queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
55
56
  });
56
57
  };
57
58
 
59
+ export const getNodeAcl = (path: string): Cypress.Chainable => {
60
+ return cy.apollo({
61
+ variables: {
62
+ path: path
63
+ },
64
+ queryFile: 'graphql/jcr/query/getNodeAcl.graphql'
65
+ });
66
+ };
67
+
58
68
  export const moveNode = (pathOrId: string, destParentPathOrId: string, destName?: string): Cypress.Chainable => {
59
69
  return cy.apollo({
60
70
  variables: {