@commercetools-frontend/cypress 20.12.0 → 20.13.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.
@@ -12,9 +12,8 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
12
12
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
13
13
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
14
14
  var uuid = require('uuid');
15
- var constants = require('../../dist/constants-c43c43f2.cjs.dev.js');
16
- var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
17
- var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
15
+ var constants = require('../../dist/constants-42a0ebf5.cjs.dev.js');
16
+ var ssr = require('@commercetools-frontend/application-shell/ssr');
18
17
 
19
18
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
20
19
 
@@ -28,40 +27,6 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
28
27
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
29
28
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
30
29
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
31
- var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
32
-
33
- var buildOidcScope = function buildOidcScope(options) {
34
- var _context7;
35
-
36
- var claims = [];
37
-
38
- if (options.projectKey) {
39
- var _context, _context2, _options$oAuthScopes$, _options$oAuthScopes, _context4, _options$oAuthScopes$2, _options$oAuthScopes2;
40
-
41
- claims.push(_concatInstanceProperty__default["default"](_context = "".concat(constants.OIDC_CLAIMS.PROJECT_KEY, ":")).call(_context, options.projectKey));
42
- claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty__default["default"](_context2 = (_options$oAuthScopes$ = (_options$oAuthScopes = options.oAuthScopes) === null || _options$oAuthScopes === void 0 ? void 0 : _options$oAuthScopes.view) !== null && _options$oAuthScopes$ !== void 0 ? _options$oAuthScopes$ : []).call(_context2, function (scope) {
43
- var _context3;
44
-
45
- return _concatInstanceProperty__default["default"](_context3 = "".concat(constants.OIDC_CLAIMS.VIEW, ":")).call(_context3, scope);
46
- })));
47
- claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty__default["default"](_context4 = (_options$oAuthScopes$2 = (_options$oAuthScopes2 = options.oAuthScopes) === null || _options$oAuthScopes2 === void 0 ? void 0 : _options$oAuthScopes2.manage) !== null && _options$oAuthScopes$2 !== void 0 ? _options$oAuthScopes$2 : []).call(_context4, function (scope) {
48
- var _context5;
49
-
50
- return _concatInstanceProperty__default["default"](_context5 = "".concat(constants.OIDC_CLAIMS.MANAGE, ":")).call(_context5, scope);
51
- })));
52
- }
53
-
54
- var teamId = options.teamId;
55
-
56
- if (teamId) {
57
- var _context6;
58
-
59
- claims.push(_concatInstanceProperty__default["default"](_context6 = "".concat(constants.OIDC_CLAIMS.TEAM_ID, ":")).call(_context6, teamId));
60
- }
61
-
62
- return _concatInstanceProperty__default["default"](_context7 = [// This is required as per OIDC spec.
63
- constants.OIDC_CLAIMS.OPEN_ID]).call(_context7, claims).join(' ');
64
- };
65
30
 
66
31
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
67
32
 
@@ -91,7 +56,7 @@ Cypress.Commands.add('loginByOidc', function (commandOptions) {
91
56
  message: appConfig
92
57
  });
93
58
  var applicationId = appConfig.applicationId;
94
- var sessionScope = buildOidcScope({
59
+ var sessionScope = ssr.buildOidcScope({
95
60
  projectKey: projectKey,
96
61
  oAuthScopes: (_appConfig$__DEVELOPM = appConfig.__DEVELOPMENT__) === null || _appConfig$__DEVELOPM === void 0 ? void 0 : (_appConfig$__DEVELOPM2 = _appConfig$__DEVELOPM.oidc) === null || _appConfig$__DEVELOPM2 === void 0 ? void 0 : _appConfig$__DEVELOPM2.oAuthScopes,
97
62
  teamId: (_appConfig$__DEVELOPM3 = appConfig.__DEVELOPMENT__) === null || _appConfig$__DEVELOPM3 === void 0 ? void 0 : (_appConfig$__DEVELOPM4 = _appConfig$__DEVELOPM3.oidc) === null || _appConfig$__DEVELOPM4 === void 0 ? void 0 : _appConfig$__DEVELOPM4.teamId
@@ -12,9 +12,8 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
12
12
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
13
13
  var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
14
14
  var uuid = require('uuid');
15
- var constants = require('../../dist/constants-b05c60de.cjs.prod.js');
16
- var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
17
- var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
15
+ var constants = require('../../dist/constants-4d9d4b7b.cjs.prod.js');
16
+ var ssr = require('@commercetools-frontend/application-shell/ssr');
18
17
 
19
18
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
20
19
 
@@ -28,40 +27,6 @@ var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$def
28
27
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
29
28
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
30
29
  var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
31
- var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
32
-
33
- var buildOidcScope = function buildOidcScope(options) {
34
- var _context7;
35
-
36
- var claims = [];
37
-
38
- if (options.projectKey) {
39
- var _context, _context2, _options$oAuthScopes$, _options$oAuthScopes, _context4, _options$oAuthScopes$2, _options$oAuthScopes2;
40
-
41
- claims.push(_concatInstanceProperty__default["default"](_context = "".concat(constants.OIDC_CLAIMS.PROJECT_KEY, ":")).call(_context, options.projectKey));
42
- claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty__default["default"](_context2 = (_options$oAuthScopes$ = (_options$oAuthScopes = options.oAuthScopes) === null || _options$oAuthScopes === void 0 ? void 0 : _options$oAuthScopes.view) !== null && _options$oAuthScopes$ !== void 0 ? _options$oAuthScopes$ : []).call(_context2, function (scope) {
43
- var _context3;
44
-
45
- return _concatInstanceProperty__default["default"](_context3 = "".concat(constants.OIDC_CLAIMS.VIEW, ":")).call(_context3, scope);
46
- })));
47
- claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty__default["default"](_context4 = (_options$oAuthScopes$2 = (_options$oAuthScopes2 = options.oAuthScopes) === null || _options$oAuthScopes2 === void 0 ? void 0 : _options$oAuthScopes2.manage) !== null && _options$oAuthScopes$2 !== void 0 ? _options$oAuthScopes$2 : []).call(_context4, function (scope) {
48
- var _context5;
49
-
50
- return _concatInstanceProperty__default["default"](_context5 = "".concat(constants.OIDC_CLAIMS.MANAGE, ":")).call(_context5, scope);
51
- })));
52
- }
53
-
54
- var teamId = options.teamId;
55
-
56
- if (teamId) {
57
- var _context6;
58
-
59
- claims.push(_concatInstanceProperty__default["default"](_context6 = "".concat(constants.OIDC_CLAIMS.TEAM_ID, ":")).call(_context6, teamId));
60
- }
61
-
62
- return _concatInstanceProperty__default["default"](_context7 = [// This is required as per OIDC spec.
63
- constants.OIDC_CLAIMS.OPEN_ID]).call(_context7, claims).join(' ');
64
- };
65
30
 
66
31
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); if (enumerableOnly) { symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
67
32
 
@@ -91,7 +56,7 @@ Cypress.Commands.add('loginByOidc', function (commandOptions) {
91
56
  message: appConfig
92
57
  });
93
58
  var applicationId = appConfig.applicationId;
94
- var sessionScope = buildOidcScope({
59
+ var sessionScope = ssr.buildOidcScope({
95
60
  projectKey: projectKey,
96
61
  oAuthScopes: (_appConfig$__DEVELOPM = appConfig.__DEVELOPMENT__) === null || _appConfig$__DEVELOPM === void 0 ? void 0 : (_appConfig$__DEVELOPM2 = _appConfig$__DEVELOPM.oidc) === null || _appConfig$__DEVELOPM2 === void 0 ? void 0 : _appConfig$__DEVELOPM2.oAuthScopes,
97
62
  teamId: (_appConfig$__DEVELOPM3 = appConfig.__DEVELOPMENT__) === null || _appConfig$__DEVELOPM3 === void 0 ? void 0 : (_appConfig$__DEVELOPM4 = _appConfig$__DEVELOPM3.oidc) === null || _appConfig$__DEVELOPM4 === void 0 ? void 0 : _appConfig$__DEVELOPM4.teamId
@@ -10,42 +10,8 @@ import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
10
10
  import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
11
11
  import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
12
12
  import { v4 } from 'uuid';
13
- import { a as OIDC_CLAIMS, S as STORAGE_KEYS, O as OIDC_RESPONSE_TYPES } from '../../dist/constants-d5478c94.esm.js';
14
- import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray';
15
- import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
16
-
17
- var buildOidcScope = function buildOidcScope(options) {
18
- var _context7;
19
-
20
- var claims = [];
21
-
22
- if (options.projectKey) {
23
- var _context, _context2, _options$oAuthScopes$, _options$oAuthScopes, _context4, _options$oAuthScopes$2, _options$oAuthScopes2;
24
-
25
- claims.push(_concatInstanceProperty(_context = "".concat(OIDC_CLAIMS.PROJECT_KEY, ":")).call(_context, options.projectKey));
26
- claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty(_context2 = (_options$oAuthScopes$ = (_options$oAuthScopes = options.oAuthScopes) === null || _options$oAuthScopes === void 0 ? void 0 : _options$oAuthScopes.view) !== null && _options$oAuthScopes$ !== void 0 ? _options$oAuthScopes$ : []).call(_context2, function (scope) {
27
- var _context3;
28
-
29
- return _concatInstanceProperty(_context3 = "".concat(OIDC_CLAIMS.VIEW, ":")).call(_context3, scope);
30
- })));
31
- claims.push.apply(claims, _toConsumableArray(_mapInstanceProperty(_context4 = (_options$oAuthScopes$2 = (_options$oAuthScopes2 = options.oAuthScopes) === null || _options$oAuthScopes2 === void 0 ? void 0 : _options$oAuthScopes2.manage) !== null && _options$oAuthScopes$2 !== void 0 ? _options$oAuthScopes$2 : []).call(_context4, function (scope) {
32
- var _context5;
33
-
34
- return _concatInstanceProperty(_context5 = "".concat(OIDC_CLAIMS.MANAGE, ":")).call(_context5, scope);
35
- })));
36
- }
37
-
38
- var teamId = options.teamId;
39
-
40
- if (teamId) {
41
- var _context6;
42
-
43
- claims.push(_concatInstanceProperty(_context6 = "".concat(OIDC_CLAIMS.TEAM_ID, ":")).call(_context6, teamId));
44
- }
45
-
46
- return _concatInstanceProperty(_context7 = [// This is required as per OIDC spec.
47
- OIDC_CLAIMS.OPEN_ID]).call(_context7, claims).join(' ');
48
- };
13
+ import { S as STORAGE_KEYS, O as OIDC_RESPONSE_TYPES } from '../../dist/constants-0e882d21.esm.js';
14
+ import { buildOidcScope } from '@commercetools-frontend/application-shell/ssr';
49
15
 
50
16
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) { symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
51
17
 
@@ -2,12 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var constants = require('./constants-c43c43f2.cjs.dev.js');
5
+ var constants = require('./constants-42a0ebf5.cjs.dev.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "20.12.0";
8
+ var version = "20.13.0";
9
9
 
10
- exports.OIDC_CLAIMS = constants.OIDC_CLAIMS;
11
10
  exports.OIDC_RESPONSE_TYPES = constants.OIDC_RESPONSE_TYPES;
12
11
  exports.STORAGE_KEYS = constants.STORAGE_KEYS;
13
12
  exports.version = version;
@@ -2,12 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var constants = require('./constants-b05c60de.cjs.prod.js');
5
+ var constants = require('./constants-4d9d4b7b.cjs.prod.js');
6
6
 
7
7
  // NOTE: This string will be replaced on build time with the package version.
8
- var version = "20.12.0";
8
+ var version = "20.13.0";
9
9
 
10
- exports.OIDC_CLAIMS = constants.OIDC_CLAIMS;
11
10
  exports.OIDC_RESPONSE_TYPES = constants.OIDC_RESPONSE_TYPES;
12
11
  exports.STORAGE_KEYS = constants.STORAGE_KEYS;
13
12
  exports.version = version;
@@ -1,6 +1,6 @@
1
- export { a as OIDC_CLAIMS, O as OIDC_RESPONSE_TYPES, S as STORAGE_KEYS } from './constants-d5478c94.esm.js';
1
+ export { O as OIDC_RESPONSE_TYPES, S as STORAGE_KEYS } from './constants-0e882d21.esm.js';
2
2
 
3
3
  // NOTE: This string will be replaced on build time with the package version.
4
- var version = "20.12.0";
4
+ var version = "20.13.0";
5
5
 
6
6
  export { version };
@@ -0,0 +1,10 @@
1
+ var STORAGE_KEYS = {
2
+ NONCE: 'nonce',
3
+ SESSION_SCOPE: 'sessionScope',
4
+ ACTIVE_PROJECT_KEY: 'activeProjectKey'
5
+ };
6
+ var OIDC_RESPONSE_TYPES = {
7
+ ID_TOKEN: 'id_token'
8
+ };
9
+
10
+ export { OIDC_RESPONSE_TYPES as O, STORAGE_KEYS as S };
@@ -8,14 +8,6 @@ var STORAGE_KEYS = {
8
8
  var OIDC_RESPONSE_TYPES = {
9
9
  ID_TOKEN: 'id_token'
10
10
  };
11
- var OIDC_CLAIMS = {
12
- OPEN_ID: 'openid',
13
- PROJECT_KEY: 'project_key',
14
- TEAM_ID: 'team_id',
15
- VIEW: 'view',
16
- MANAGE: 'manage'
17
- };
18
11
 
19
- exports.OIDC_CLAIMS = OIDC_CLAIMS;
20
12
  exports.OIDC_RESPONSE_TYPES = OIDC_RESPONSE_TYPES;
21
13
  exports.STORAGE_KEYS = STORAGE_KEYS;
@@ -8,14 +8,6 @@ var STORAGE_KEYS = {
8
8
  var OIDC_RESPONSE_TYPES = {
9
9
  ID_TOKEN: 'id_token'
10
10
  };
11
- var OIDC_CLAIMS = {
12
- OPEN_ID: 'openid',
13
- PROJECT_KEY: 'project_key',
14
- TEAM_ID: 'team_id',
15
- VIEW: 'view',
16
- MANAGE: 'manage'
17
- };
18
11
 
19
- exports.OIDC_CLAIMS = OIDC_CLAIMS;
20
12
  exports.OIDC_RESPONSE_TYPES = OIDC_RESPONSE_TYPES;
21
13
  exports.STORAGE_KEYS = STORAGE_KEYS;
@@ -6,10 +6,3 @@ export declare const STORAGE_KEYS: {
6
6
  export declare const OIDC_RESPONSE_TYPES: {
7
7
  ID_TOKEN: string;
8
8
  };
9
- export declare const OIDC_CLAIMS: {
10
- OPEN_ID: string;
11
- PROJECT_KEY: string;
12
- TEAM_ID: string;
13
- VIEW: string;
14
- MANAGE: string;
15
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/cypress",
3
- "version": "20.12.0",
3
+ "version": "20.13.0",
4
4
  "description": "Cypress commands and utilities for Custom Applications",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -35,16 +35,17 @@
35
35
  "README.md"
36
36
  ],
37
37
  "dependencies": {
38
- "@babel/runtime": "7.15.4",
39
- "@babel/runtime-corejs3": "7.15.4",
40
- "@commercetools-frontend/application-config": "20.12.0",
41
- "@manypkg/get-packages": "1.1.1",
38
+ "@babel/runtime": "7.16.5",
39
+ "@babel/runtime-corejs3": "7.16.5",
40
+ "@commercetools-frontend/application-config": "20.12.3",
41
+ "@commercetools-frontend/application-shell": "20.13.0",
42
+ "@manypkg/get-packages": "1.1.3",
42
43
  "uuid": "8.3.2"
43
44
  },
44
45
  "devDependencies": {
45
- "cypress": "8.7.0"
46
+ "cypress": "9.3.1"
46
47
  },
47
48
  "peerDependencies": {
48
- "cypress": "5.x || 6.x || 7.x || 8.x"
49
+ "cypress": "5.x || 6.x || 7.x || 8.x || 9.x"
49
50
  }
50
51
  }
@@ -1,17 +0,0 @@
1
- var STORAGE_KEYS = {
2
- NONCE: 'nonce',
3
- SESSION_SCOPE: 'sessionScope',
4
- ACTIVE_PROJECT_KEY: 'activeProjectKey'
5
- };
6
- var OIDC_RESPONSE_TYPES = {
7
- ID_TOKEN: 'id_token'
8
- };
9
- var OIDC_CLAIMS = {
10
- OPEN_ID: 'openid',
11
- PROJECT_KEY: 'project_key',
12
- TEAM_ID: 'team_id',
13
- VIEW: 'view',
14
- MANAGE: 'manage'
15
- };
16
-
17
- export { OIDC_RESPONSE_TYPES as O, STORAGE_KEYS as S, OIDC_CLAIMS as a };
@@ -1,8 +0,0 @@
1
- import type { ApplicationOidcForDevelopmentConfig } from '@commercetools-frontend/constants';
2
- declare type BuilOidcScopeOptions = {
3
- projectKey?: ApplicationOidcForDevelopmentConfig['initialProjectKey'];
4
- oAuthScopes?: ApplicationOidcForDevelopmentConfig['oAuthScopes'];
5
- teamId?: ApplicationOidcForDevelopmentConfig['teamId'];
6
- };
7
- declare const buildOidcScope: (options: BuilOidcScopeOptions) => string;
8
- export default buildOidcScope;