appium-xcuitest-driver 10.4.0 → 10.4.1

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.
@@ -1,84 +0,0 @@
1
- "use strict";
2
- /*
3
- * derived from jQuery Cookie Plugin v1.4.1
4
- * https://github.com/carhartl/jquery-cookie
5
- */
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.createJSCookie = createJSCookie;
11
- exports.createJWPCookie = createJWPCookie;
12
- exports.getValue = getValue;
13
- exports.expireCookie = expireCookie;
14
- // needed to communicate/translate between JSONWire cookies and regular JavaScript cookies
15
- const lodash_1 = __importDefault(require("lodash"));
16
- const support_1 = require("appium/support");
17
- const log = support_1.logger.getLogger('Cookie');
18
- // parses the value if needed and converts the value if a converter is provided
19
- // internal function, not exported
20
- function convertCookie(value, converter) {
21
- if (value.indexOf('"') === 0) {
22
- // this is a quoted cookied according to RFC2068
23
- // remove enclosing quotes and internal quotes and backslashes
24
- value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
25
- }
26
- let parsedValue;
27
- try {
28
- parsedValue = decodeURIComponent(value.replace(/\+/g, ' '));
29
- }
30
- catch (e) {
31
- // no need to fail if we can't decode
32
- log.warn(e);
33
- }
34
- return converter ? converter(parsedValue) : parsedValue;
35
- }
36
- // takes arguments given and creates a JavaScript Cookie
37
- function createJSCookie(key, value, options = {}) {
38
- return [
39
- encodeURIComponent(key),
40
- '=',
41
- value,
42
- options.expires ? `; expires=${options.expires}` : '',
43
- options.path ? `; path=${options.path}` : '',
44
- options.domain ? `; domain=${options.domain}` : '',
45
- options.secure ? '; secure' : '',
46
- ].join('');
47
- }
48
- // takes the JavaScript cookieString and translates it into a JSONWire formatted cookie
49
- function createJWPCookie(key, cookieString, converter = null) {
50
- let result = {};
51
- let cookies = cookieString ? cookieString.split('; ') : [];
52
- for (let cookie of cookies) {
53
- let parts = cookie.split('=');
54
- // get the first and second element as name and value
55
- let name = decodeURIComponent(parts.shift());
56
- let val = parts[0];
57
- // if name is key, this is the central element of the cookie, so add as `name`
58
- // otherwise it is an optional element
59
- if (key && key === name) {
60
- result.name = key;
61
- result.value = convertCookie(val, converter);
62
- }
63
- else {
64
- result[name] = convertCookie(val, converter);
65
- }
66
- }
67
- return result;
68
- }
69
- // takes a JavaScript cookiestring and parses it for the value given the key
70
- function getValue(key, cookieString, converter = null) {
71
- let result = createJWPCookie(key, cookieString, converter);
72
- // if `key` is undefined we want the entire cookie
73
- return lodash_1.default.isUndefined(key) ? result : result.value;
74
- }
75
- // returns a cookie that expires on 01 Jan 1970
76
- // assign the returned cookie to an existing cookie to delete that cookie
77
- function expireCookie(key, options) {
78
- // override `expires` in `options`, and then make the cookie
79
- return createJSCookie(key, '', lodash_1.default.assign({}, options, {
80
- expires: 'Thu, 01 Jan 1970 00:00:00 GMT',
81
- }));
82
- }
83
- exports.default = { createJSCookie, createJWPCookie, getValue, expireCookie };
84
- //# sourceMappingURL=cookies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../lib/cookies.js"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAuFK,wCAAc;AAAE,0CAAe;AAAE,4BAAQ;AAAE,oCAAY;AArF/D,0FAA0F;AAE1F,oDAAuB;AACvB,4CAAsC;AAEtC,MAAM,GAAG,GAAG,gBAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEvC,+EAA+E;AAC/E,kCAAkC;AAClC,SAAS,aAAa,CAAC,KAAK,EAAE,SAAS;IACrC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,gDAAgD;QAChD,8DAA8D;QAC9D,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM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}
package/lib/cookies.js DELETED
@@ -1,92 +0,0 @@
1
- /*
2
- * derived from jQuery Cookie Plugin v1.4.1
3
- * https://github.com/carhartl/jquery-cookie
4
- */
5
-
6
- // needed to communicate/translate between JSONWire cookies and regular JavaScript cookies
7
-
8
- import _ from 'lodash';
9
- import {logger} from 'appium/support';
10
-
11
- const log = logger.getLogger('Cookie');
12
-
13
- // parses the value if needed and converts the value if a converter is provided
14
- // internal function, not exported
15
- function convertCookie(value, converter) {
16
- if (value.indexOf('"') === 0) {
17
- // this is a quoted cookied according to RFC2068
18
- // remove enclosing quotes and internal quotes and backslashes
19
- value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
20
- }
21
-
22
- let parsedValue;
23
- try {
24
- parsedValue = decodeURIComponent(value.replace(/\+/g, ' '));
25
- } catch (e) {
26
- // no need to fail if we can't decode
27
- log.warn(e);
28
- }
29
-
30
- return converter ? converter(parsedValue) : parsedValue;
31
- }
32
-
33
- // takes arguments given and creates a JavaScript Cookie
34
- function createJSCookie(key, value, options = {}) {
35
- return [
36
- encodeURIComponent(key),
37
- '=',
38
- value,
39
- options.expires ? `; expires=${options.expires}` : '',
40
- options.path ? `; path=${options.path}` : '',
41
- options.domain ? `; domain=${options.domain}` : '',
42
- options.secure ? '; secure' : '',
43
- ].join('');
44
- }
45
-
46
- // takes the JavaScript cookieString and translates it into a JSONWire formatted cookie
47
- function createJWPCookie(key, cookieString, converter = null) {
48
- let result = {};
49
- let cookies = cookieString ? cookieString.split('; ') : [];
50
- for (let cookie of cookies) {
51
- let parts = cookie.split('=');
52
-
53
- // get the first and second element as name and value
54
- let name = decodeURIComponent(parts.shift());
55
- let val = parts[0];
56
-
57
- // if name is key, this is the central element of the cookie, so add as `name`
58
- // otherwise it is an optional element
59
- if (key && key === name) {
60
- result.name = key;
61
- result.value = convertCookie(val, converter);
62
- } else {
63
- result[name] = convertCookie(val, converter);
64
- }
65
- }
66
- return result;
67
- }
68
-
69
- // takes a JavaScript cookiestring and parses it for the value given the key
70
- function getValue(key, cookieString, converter = null) {
71
- let result = createJWPCookie(key, cookieString, converter);
72
-
73
- // if `key` is undefined we want the entire cookie
74
- return _.isUndefined(key) ? result : result.value;
75
- }
76
-
77
- // returns a cookie that expires on 01 Jan 1970
78
- // assign the returned cookie to an existing cookie to delete that cookie
79
- function expireCookie(key, options) {
80
- // override `expires` in `options`, and then make the cookie
81
- return createJSCookie(
82
- key,
83
- '',
84
- _.assign({}, options, {
85
- expires: 'Thu, 01 Jan 1970 00:00:00 GMT',
86
- }),
87
- );
88
- }
89
-
90
- // export individually and also (as default) as an object
91
- export {createJSCookie, createJWPCookie, getValue, expireCookie};
92
- export default {createJSCookie, createJWPCookie, getValue, expireCookie};