alexa-cookie2 4.1.3 → 4.2.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018-2022 Apollon77 <ingo@fischer-ka.de>
3
+ Copyright (c) 2018-2023 Apollon77 <ingo@fischer-ka.de>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -49,6 +49,9 @@ Partly based on [Amazon Alexa Remote Control](http://blog.loetzimmer.de/2017/10/
49
49
  Thank you for that work.
50
50
 
51
51
  ## Changelog:
52
+ ### 4.2.0 (2023-08-08)
53
+ * (Hive) Adds the ability to alter the close proxy message
54
+
52
55
  ### 4.1.3 (2022-08-03)
53
56
  * (Apollon77) Fix device registration and token exchange in other regions
54
57
  * (Apollon77) Use the chosen App name also for refreshing of tokens
package/alexa-cookie.js CHANGED
@@ -16,6 +16,7 @@ const defaultAmazonPage = 'amazon.de';
16
16
  const defaultUserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36';
17
17
  const defaultUserAgentLinux = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36';
18
18
  //const defaultUserAgentMacOs = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36';
19
+ const defaultProxyCloseWindowHTML = '<b>Amazon Alexa Cookie successfully retrieved. You can close the browser.</b>';
19
20
  const defaultAcceptLanguage = 'de-DE';
20
21
 
21
22
  const apiCallVersion = '2.2.485407.0';
@@ -177,8 +178,11 @@ function AlexaCookie() {
177
178
  _options.logger && _options.logger(`Alexa-Cookie: Use as User-Agent: ${_options.userAgent}`);
178
179
 
179
180
  _options.acceptLanguage = _options.acceptLanguage || defaultAcceptLanguage;
181
+
180
182
  _options.logger && _options.logger(`Alexa-Cookie: Use as Accept-Language: ${_options.acceptLanguage}`);
181
183
 
184
+ _options.proxyCloseWindowHTML = _options.proxyCloseWindowHTML || defaultProxyCloseWindowHTML;
185
+
182
186
  if (_options.setupProxy && !_options.proxyOwnIp) {
183
187
  _options.logger && _options.logger('Alexa-Cookie: Own-IP Setting missing for Proxy. Disabling!');
184
188
  _options.setupProxy = false;
@@ -21,7 +21,8 @@ const config = {
21
21
  amazonPageProxyLanguage: 'de_DE', // optional: language to be used for the Amazon Sign-in page the proxy calls. default is "de_DE")
22
22
  deviceAppName: '...', // optional: name of the device app name which will be registered with Amazon, leave empty to use a default one
23
23
  formerDataStorePath: '...', // optional: overwrite path where some of the formerRegistrationData are persisted to optimize against Amazon security measures
24
- formerRegistrationData: { ... } // optional/preferred: provide the result object from subsequent proxy usages here and some generated data will be reused for next proxy call too
24
+ formerRegistrationData: { ... }, // optional/preferred: provide the result object from subsequent proxy usages here and some generated data will be reused for next proxy call too
25
+ proxyCloseWindowHTML: '...' // optional: use in order to override the default html displayed when the proxy window can be closed, default is '<b>Amazon Alexa Cookie successfully retrieved. You can close the browser.</b>'
25
26
  };
26
27
 
27
28
 
package/lib/proxy.js CHANGED
@@ -372,7 +372,7 @@ function initAmazonProxy(_options, callbackCookie, callbackListening) {
372
372
 
373
373
  app.use(myProxy);
374
374
  app.get('/cookie-success', function(req, res) {
375
- res.send('<b>Amazon Alexa Cookie successfully retrieved. You can close the browser.</b>');
375
+ res.send(_options.proxyCloseWindowHTML);
376
376
  });
377
377
  const server = app.listen(_options.proxyPort, _options.proxyListenBind, function() {
378
378
  _options.logger && _options.logger('Alexa-Cookie: Proxy-Server listening on port ' + server.address().port);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alexa-cookie2",
3
- "version": "4.1.3",
3
+ "version": "4.2.0",
4
4
  "description": "Generate Cookie and CSRF for Alexa Remote",
5
5
  "author": {
6
6
  "name": "Apollon77",
@@ -22,16 +22,16 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "cookie": "^0.5.0",
25
- "express": "^4.18.1",
25
+ "express": "^4.18.2",
26
26
  "http-proxy-middleware": "^2.0.6",
27
27
  "http-proxy-response-rewrite": "^0.0.1",
28
28
  "https": "^1.0.0",
29
29
  "querystring": "^0.2.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@alcalzone/release-script": "^3.5.9",
32
+ "@alcalzone/release-script": "^3.6.0",
33
33
  "@alcalzone/release-script-plugin-license": "^3.5.9",
34
- "eslint": "^8.20.0"
34
+ "eslint": "^8.46.0"
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",