@alfalab/core-components-confirmation 12.5.1 → 12.5.2

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.
Files changed (89) hide show
  1. package/component.desktop.js +1 -1
  2. package/component.mobile.js +2 -2
  3. package/component.responsive.js +1 -1
  4. package/components/base-confirmation/component.js +2 -2
  5. package/components/base-confirmation/index.css +2 -2
  6. package/components/base-confirmation/index.js +1 -1
  7. package/components/countdown-loader/component.js +1 -1
  8. package/components/countdown-loader/index.css +2 -2
  9. package/components/header/component.js +1 -1
  10. package/components/header/index.css +4 -4
  11. package/components/index.js +1 -1
  12. package/components/screens/fatal-error/component.js +1 -1
  13. package/components/screens/fatal-error/index.css +6 -6
  14. package/components/screens/hint/component.js +1 -1
  15. package/components/screens/hint/index.css +12 -12
  16. package/components/screens/index.js +1 -1
  17. package/components/screens/initial/component.js +1 -1
  18. package/components/screens/initial/countdown-section.js +1 -1
  19. package/components/screens/initial/index.css +18 -18
  20. package/components/screens/initial/index.js +1 -1
  21. package/components/screens/temp-block/component.js +1 -1
  22. package/components/screens/temp-block/index.css +7 -7
  23. package/{countdown-section-334c7c84.js → countdown-section-41f47745.js} +1 -1
  24. package/desktop.js +1 -1
  25. package/esm/component.desktop.js +1 -1
  26. package/esm/component.mobile.js +2 -2
  27. package/esm/component.responsive.js +1 -1
  28. package/esm/components/base-confirmation/component.js +2 -2
  29. package/esm/components/base-confirmation/index.css +2 -2
  30. package/esm/components/base-confirmation/index.js +1 -1
  31. package/esm/components/countdown-loader/component.js +1 -1
  32. package/esm/components/countdown-loader/index.css +2 -2
  33. package/esm/components/header/component.js +1 -1
  34. package/esm/components/header/index.css +4 -4
  35. package/esm/components/index.js +1 -1
  36. package/esm/components/screens/fatal-error/component.js +1 -1
  37. package/esm/components/screens/fatal-error/index.css +6 -6
  38. package/esm/components/screens/hint/component.js +1 -1
  39. package/esm/components/screens/hint/index.css +12 -12
  40. package/esm/components/screens/index.js +1 -1
  41. package/esm/components/screens/initial/component.js +1 -1
  42. package/esm/components/screens/initial/countdown-section.js +1 -1
  43. package/esm/components/screens/initial/index.css +18 -18
  44. package/esm/components/screens/initial/index.js +1 -1
  45. package/esm/components/screens/temp-block/component.js +1 -1
  46. package/esm/components/screens/temp-block/index.css +7 -7
  47. package/esm/{countdown-section-6200b5cd.js → countdown-section-83bf5f20.js} +1 -1
  48. package/esm/desktop.js +1 -1
  49. package/esm/index.js +1 -1
  50. package/esm/mobile.css +2 -2
  51. package/esm/mobile.js +1 -1
  52. package/esm/responsive.js +1 -1
  53. package/index.js +1 -1
  54. package/mobile.css +2 -2
  55. package/mobile.js +1 -1
  56. package/modern/component.desktop.js +1 -1
  57. package/modern/component.mobile.js +2 -2
  58. package/modern/component.responsive.js +1 -1
  59. package/modern/components/base-confirmation/component.js +2 -2
  60. package/modern/components/base-confirmation/index.css +2 -2
  61. package/modern/components/base-confirmation/index.js +1 -1
  62. package/modern/components/countdown-loader/component.js +1 -1
  63. package/modern/components/countdown-loader/index.css +2 -2
  64. package/modern/components/header/component.js +1 -1
  65. package/modern/components/header/index.css +4 -4
  66. package/modern/components/index.js +1 -1
  67. package/modern/components/screens/fatal-error/component.js +1 -1
  68. package/modern/components/screens/fatal-error/index.css +6 -6
  69. package/modern/components/screens/hint/component.js +1 -1
  70. package/modern/components/screens/hint/index.css +12 -12
  71. package/modern/components/screens/index.js +1 -1
  72. package/modern/components/screens/initial/component.js +1 -1
  73. package/modern/components/screens/initial/countdown-section.js +1 -1
  74. package/modern/components/screens/initial/index.css +18 -18
  75. package/modern/components/screens/initial/index.js +1 -1
  76. package/modern/components/screens/temp-block/component.js +1 -1
  77. package/modern/components/screens/temp-block/index.css +7 -7
  78. package/modern/{countdown-section-6f58a9b1.js → countdown-section-a28d693c.js} +1 -1
  79. package/modern/desktop.js +1 -1
  80. package/modern/index.js +1 -1
  81. package/modern/mobile.css +2 -2
  82. package/modern/mobile.js +1 -1
  83. package/modern/responsive.js +1 -1
  84. package/package.json +6 -9
  85. package/responsive.js +1 -1
  86. package/send-stats.js +0 -82
  87. /package/{countdown-section-334c7c84.d.ts → countdown-section-41f47745.d.ts} +0 -0
  88. /package/esm/{countdown-section-6200b5cd.d.ts → countdown-section-83bf5f20.d.ts} +0 -0
  89. /package/modern/{countdown-section-6f58a9b1.d.ts → countdown-section-a28d693c.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- /* hash: 8s4rw */
1
+ /* hash: 13np8 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -33,38 +33,38 @@
33
33
  --confirmation-text-color: var(--color-light-text-primary)
34
34
 
35
35
  /* header */
36
- } .confirmation__component_1owi6 {
36
+ } .confirmation__component_1ft06 {
37
37
  display: flex;
38
38
  flex-direction: column;
39
39
  align-items: flex-start
40
- } .confirmation__component_1owi6 span:last-of-type {
40
+ } .confirmation__component_1ft06 span:last-of-type {
41
41
  margin-bottom: 0;
42
- } .confirmation__center_1owi6 {
42
+ } .confirmation__center_1ft06 {
43
43
  align-items: center;
44
44
  text-align: center;
45
- } .confirmation__text_1owi6.confirmation__text_1owi6 {
45
+ } .confirmation__text_1ft06.confirmation__text_1ft06 {
46
46
  margin-bottom: var(--gap-xl);
47
- } .confirmation__typographyTheme_1owi6.confirmation__typographyTheme_1owi6 {
47
+ } .confirmation__typographyTheme_1ft06.confirmation__typographyTheme_1ft06 {
48
48
  font-size: var(--confirmation-text-font-size);
49
49
  line-height: var(--confirmation-text-line-height);
50
50
  font-weight: var(--confirmation-text-font-weight);
51
51
  font-family: var(--confirmation-text-font-family);
52
52
  color: var(--confirmation-text-color);
53
- } .confirmation__phonesWrap_1owi6 {
53
+ } .confirmation__phonesWrap_1ft06 {
54
54
  display: flex;
55
55
  flex-direction: column;
56
56
  margin-bottom: var(--gap-xl);
57
- } .confirmation__phoneWrap_1owi6 {
57
+ } .confirmation__phoneWrap_1ft06 {
58
58
  margin-bottom: var(--gap-xs)
59
- } .confirmation__phoneWrap_1owi6:last-child {
59
+ } .confirmation__phoneWrap_1ft06:last-child {
60
60
  margin-bottom: 0;
61
- } .confirmation__phoneLink_1owi6.confirmation__phoneLink_1owi6 {
61
+ } .confirmation__phoneLink_1ft06.confirmation__phoneLink_1ft06 {
62
62
  font-size: 16px;
63
63
  line-height: 24px;
64
64
  font-weight: 500;
65
- } .confirmation__hintButton_1owi6 {
65
+ } .confirmation__hintButton_1ft06 {
66
66
  margin-top: var(--gap-2xl);
67
- } .confirmation__phoneContentMobile_1owi6 {
67
+ } .confirmation__phoneContentMobile_1ft06 {
68
68
  display: flex;
69
69
  flex-direction: column;
70
70
  align-items: center;
@@ -12,6 +12,6 @@ import '@alfalab/hooks';
12
12
  import '../../context.js';
13
13
  import '../../utils.js';
14
14
  import '../header/component.js';
15
- import '../../countdown-section-6f58a9b1.js';
15
+ import '../../countdown-section-a28d693c.js';
16
16
  import '@alfalab/core-components-loader/modern';
17
17
  import '../countdown-loader/component.js';
@@ -7,7 +7,7 @@ import { Typography } from '@alfalab/core-components-typography/modern';
7
7
  import { usePrevious } from '@alfalab/hooks';
8
8
  import { ConfirmationContext } from '../../../context.js';
9
9
  import { Header } from '../../header/component.js';
10
- import { s as styles, C as CountdownSection } from '../../../countdown-section-6f58a9b1.js';
10
+ import { s as styles, C as CountdownSection } from '../../../countdown-section-a28d693c.js';
11
11
  import '../../../utils.js';
12
12
  import '@alfalab/core-components-loader/modern';
13
13
 
@@ -5,4 +5,4 @@ import '@alfalab/core-components-loader/modern';
5
5
  import '@alfalab/core-components-typography/modern';
6
6
  import '../../../context.js';
7
7
  import '../../../utils.js';
8
- export { C as CountdownSection } from '../../../countdown-section-6f58a9b1.js';
8
+ export { C as CountdownSection } from '../../../countdown-section-a28d693c.js';
@@ -1,4 +1,4 @@
1
- /* hash: hjmrp */
1
+ /* hash: 1hf3q */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e;
@@ -38,51 +38,51 @@
38
38
  --confirmation-text-color: var(--color-light-text-primary)
39
39
 
40
40
  /* header */
41
- } .confirmation__component_tqjuq {
41
+ } .confirmation__component_16lwf {
42
42
  display: flex;
43
43
  flex-direction: column;
44
- } .confirmation__typographyTheme_tqjuq.confirmation__typographyTheme_tqjuq {
44
+ } .confirmation__typographyTheme_16lwf.confirmation__typographyTheme_16lwf {
45
45
  font-size: var(--confirmation-text-font-size);
46
46
  line-height: var(--confirmation-text-line-height);
47
47
  font-weight: var(--confirmation-text-font-weight);
48
48
  font-family: var(--confirmation-text-font-family);
49
49
  color: var(--confirmation-text-color);
50
- } .confirmation__phone_tqjuq.confirmation__phone_tqjuq {
50
+ } .confirmation__phone_16lwf.confirmation__phone_16lwf {
51
51
  color: var(--color-light-text-primary);
52
52
  margin-bottom: var(--gap-2xl);
53
- } .confirmation__compact_tqjuq {
53
+ } .confirmation__compact_16lwf {
54
54
  margin-bottom: var(--gap-xl);
55
- } .confirmation__loaderWrap_tqjuq {
55
+ } .confirmation__loaderWrap_16lwf {
56
56
  display: flex;
57
57
  align-items: center;
58
- } .confirmation__left_tqjuq {
58
+ } .confirmation__left_16lwf {
59
59
  align-items: flex-start;
60
- } .confirmation__center_tqjuq {
60
+ } .confirmation__center_16lwf {
61
61
  align-items: center;
62
62
  text-align: center
63
- } .confirmation__center_tqjuq .confirmation__loaderWrap_tqjuq {
63
+ } .confirmation__center_16lwf .confirmation__loaderWrap_16lwf {
64
64
  justify-content: center;
65
- } .confirmation__center_tqjuq input {
65
+ } .confirmation__center_16lwf input {
66
66
  margin: 0 var(--gap-2xs);
67
- } .confirmation__codeInput_tqjuq {
67
+ } .confirmation__codeInput_16lwf {
68
68
  margin-bottom: var(--gap-s);
69
- } .confirmation__smsComeLink_tqjuq.confirmation__smsComeLink_tqjuq {
69
+ } .confirmation__smsComeLink_16lwf.confirmation__smsComeLink_16lwf {
70
70
  font-size: 14px;
71
71
  line-height: 20px;
72
72
  font-weight: 500;
73
- } .confirmation__countdownContainer_tqjuq.confirmation__countdownContainer_tqjuq {
73
+ } .confirmation__countdownContainer_16lwf.confirmation__countdownContainer_16lwf {
74
74
  color: var(--color-light-text-secondary);
75
75
  margin-bottom: var(--gap-xl);
76
- } .confirmation__countdownMobile_tqjuq.confirmation__countdownMobile_tqjuq {
76
+ } .confirmation__countdownMobile_16lwf.confirmation__countdownMobile_16lwf {
77
77
  margin-bottom: var(--gap-l);
78
- } .confirmation__countdownLoaderMobile_tqjuq.confirmation__countdownLoaderMobile_tqjuq {
78
+ } .confirmation__countdownLoaderMobile_16lwf.confirmation__countdownLoaderMobile_16lwf {
79
79
  margin-bottom: var(--gap-m);
80
- } .confirmation__getCodeButton_tqjuq {
80
+ } .confirmation__getCodeButton_16lwf {
81
81
  position: relative;
82
82
  top: var(--gap-2xs-neg);
83
83
  margin-bottom: var(--gap-m);
84
- } .confirmation__getCodeButtonMobile_tqjuq {
84
+ } .confirmation__getCodeButtonMobile_16lwf {
85
85
  margin-bottom: 0;
86
- } .confirmation__containerInput_tqjuq {
86
+ } .confirmation__containerInput_16lwf {
87
87
  min-height: 80px;
88
88
  }
@@ -9,5 +9,5 @@ import '@alfalab/hooks';
9
9
  import '../../../context.js';
10
10
  import '../../../utils.js';
11
11
  import '../../header/component.js';
12
- import '../../../countdown-section-6f58a9b1.js';
12
+ import '../../../countdown-section-a28d693c.js';
13
13
  import '@alfalab/core-components-loader/modern';
@@ -6,7 +6,7 @@ import { useCountdown, formatMsAsMinutes } from '../../../utils.js';
6
6
  import { CountdownLoader } from '../../countdown-loader/component.js';
7
7
  import { Header } from '../../header/component.js';
8
8
 
9
- const styles = {"component":"confirmation__component_4fj04","center":"confirmation__center_4fj04","typographyTheme":"confirmation__typographyTheme_4fj04","description":"confirmation__description_4fj04","countdownWrap":"confirmation__countdownWrap_4fj04","loader":"confirmation__loader_4fj04"};
9
+ const styles = {"component":"confirmation__component_1q9mt","center":"confirmation__center_1q9mt","typographyTheme":"confirmation__typographyTheme_1q9mt","description":"confirmation__description_1q9mt","countdownWrap":"confirmation__countdownWrap_1q9mt","loader":"confirmation__loader_1q9mt"};
10
10
  require('./index.css')
11
11
 
12
12
  const TempBlock = ({ mobile }) => {
@@ -1,4 +1,4 @@
1
- /* hash: c3smz */
1
+ /* hash: 1bz9l */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -31,23 +31,23 @@
31
31
  --confirmation-text-color: var(--color-light-text-primary)
32
32
 
33
33
  /* header */
34
- } .confirmation__component_4fj04 {
34
+ } .confirmation__component_1q9mt {
35
35
  display: flex;
36
36
  flex-direction: column;
37
- } .confirmation__center_4fj04 {
37
+ } .confirmation__center_1q9mt {
38
38
  align-items: center;
39
39
  text-align: center;
40
- } .confirmation__typographyTheme_4fj04.confirmation__typographyTheme_4fj04 {
40
+ } .confirmation__typographyTheme_1q9mt.confirmation__typographyTheme_1q9mt {
41
41
  font-size: var(--confirmation-text-font-size);
42
42
  line-height: var(--confirmation-text-line-height);
43
43
  font-weight: var(--confirmation-text-font-weight);
44
44
  font-family: var(--confirmation-text-font-family);
45
45
  color: var(--confirmation-text-color);
46
- } .confirmation__description_4fj04.confirmation__description_4fj04 {
46
+ } .confirmation__description_1q9mt.confirmation__description_1q9mt {
47
47
  margin-bottom: var(--gap-xs);
48
- } .confirmation__countdownWrap_4fj04 {
48
+ } .confirmation__countdownWrap_1q9mt {
49
49
  display: flex;
50
50
  align-items: center;
51
- } .confirmation__loader_4fj04 {
51
+ } .confirmation__loader_1q9mt {
52
52
  margin-right: var(--gap-xs);
53
53
  }
@@ -6,7 +6,7 @@ import { Typography } from '@alfalab/core-components-typography/modern';
6
6
  import { ConfirmationContext } from './context.js';
7
7
  import { formatMsAsMinutes } from './utils.js';
8
8
 
9
- const styles = {"component":"confirmation__component_tqjuq","typographyTheme":"confirmation__typographyTheme_tqjuq","phone":"confirmation__phone_tqjuq","compact":"confirmation__compact_tqjuq","loaderWrap":"confirmation__loaderWrap_tqjuq","left":"confirmation__left_tqjuq","center":"confirmation__center_tqjuq","codeInput":"confirmation__codeInput_tqjuq","smsComeLink":"confirmation__smsComeLink_tqjuq","countdownContainer":"confirmation__countdownContainer_tqjuq","countdownMobile":"confirmation__countdownMobile_tqjuq","countdownLoaderMobile":"confirmation__countdownLoaderMobile_tqjuq","getCodeButton":"confirmation__getCodeButton_tqjuq","getCodeButtonMobile":"confirmation__getCodeButtonMobile_tqjuq","containerInput":"confirmation__containerInput_tqjuq"};
9
+ const styles = {"component":"confirmation__component_16lwf","typographyTheme":"confirmation__typographyTheme_16lwf","phone":"confirmation__phone_16lwf","compact":"confirmation__compact_16lwf","loaderWrap":"confirmation__loaderWrap_16lwf","left":"confirmation__left_16lwf","center":"confirmation__center_16lwf","codeInput":"confirmation__codeInput_16lwf","smsComeLink":"confirmation__smsComeLink_16lwf","countdownContainer":"confirmation__countdownContainer_16lwf","countdownMobile":"confirmation__countdownMobile_16lwf","countdownLoaderMobile":"confirmation__countdownLoaderMobile_16lwf","getCodeButton":"confirmation__getCodeButton_16lwf","getCodeButtonMobile":"confirmation__getCodeButtonMobile_16lwf","containerInput":"confirmation__containerInput_16lwf"};
10
10
  require('./components/screens/initial/index.css')
11
11
 
12
12
  const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile, handleSmsRetryClick, }) => {
package/modern/desktop.js CHANGED
@@ -12,7 +12,7 @@ import '@alfalab/core-components-code-input/modern';
12
12
  import '@alfalab/core-components-link/modern';
13
13
  import '@alfalab/core-components-typography/modern';
14
14
  import './components/header/component.js';
15
- import './countdown-section-6f58a9b1.js';
15
+ import './countdown-section-a28d693c.js';
16
16
  import '@alfalab/core-components-loader/modern';
17
17
  import './components/screens/hint/component.js';
18
18
  import './components/screens/fatal-error/component.js';
package/modern/index.js CHANGED
@@ -18,5 +18,5 @@ import '@alfalab/core-components-code-input/modern';
18
18
  import '@alfalab/core-components-link/modern';
19
19
  import '@alfalab/core-components-typography/modern';
20
20
  import './components/header/component.js';
21
- import './countdown-section-6f58a9b1.js';
21
+ import './countdown-section-a28d693c.js';
22
22
  import '@alfalab/core-components-loader/modern';
package/modern/mobile.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 14qkz */
2
- .confirmation__container_t00e2 {
1
+ /* hash: 5kxvr */
2
+ .confirmation__container_1gfq6 {
3
3
  max-width: 288px;
4
4
  }
package/modern/mobile.js CHANGED
@@ -12,7 +12,7 @@ import '@alfalab/core-components-code-input/modern';
12
12
  import '@alfalab/core-components-link/modern';
13
13
  import '@alfalab/core-components-typography/modern';
14
14
  import './components/header/component.js';
15
- import './countdown-section-6f58a9b1.js';
15
+ import './countdown-section-a28d693c.js';
16
16
  import '@alfalab/core-components-loader/modern';
17
17
  import './components/screens/hint/component.js';
18
18
  import './components/screens/fatal-error/component.js';
@@ -13,7 +13,7 @@ import '@alfalab/core-components-code-input/modern';
13
13
  import '@alfalab/core-components-link/modern';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './components/header/component.js';
16
- import './countdown-section-6f58a9b1.js';
16
+ import './countdown-section-a28d693c.js';
17
17
  import '@alfalab/core-components-loader/modern';
18
18
  import './components/screens/hint/component.js';
19
19
  import './components/screens/fatal-error/component.js';
package/package.json CHANGED
@@ -1,24 +1,21 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-confirmation",
3
- "version": "12.5.1",
3
+ "version": "12.5.2",
4
4
  "description": "Sms confirmation component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
7
7
  "main": "index.js",
8
8
  "module": "./esm/index.js",
9
- "scripts": {
10
- "postinstall": "node -e \"if (require('fs').existsSync('./send-stats.js')){require('./send-stats.js')} \""
11
- },
12
9
  "publishConfig": {
13
10
  "access": "public",
14
11
  "directory": "dist"
15
12
  },
16
13
  "dependencies": {
17
- "@alfalab/core-components-button": "^8.5.0",
18
- "@alfalab/core-components-code-input": "^2.3.3",
19
- "@alfalab/core-components-link": "^5.0.5",
20
- "@alfalab/core-components-loader": "^3.0.6",
21
- "@alfalab/core-components-typography": "^3.2.1",
14
+ "@alfalab/core-components-button": "^8.5.1",
15
+ "@alfalab/core-components-code-input": "^2.3.4",
16
+ "@alfalab/core-components-link": "^5.0.6",
17
+ "@alfalab/core-components-loader": "^3.0.7",
18
+ "@alfalab/core-components-typography": "^3.2.2",
22
19
  "@alfalab/hooks": "^1.13.0",
23
20
  "classnames": "^2.3.1",
24
21
  "tslib": "^2.4.0"
package/responsive.js CHANGED
@@ -18,7 +18,7 @@ require('@alfalab/core-components-code-input');
18
18
  require('@alfalab/core-components-link');
19
19
  require('@alfalab/core-components-typography');
20
20
  require('./components/header/component.js');
21
- require('./countdown-section-334c7c84.js');
21
+ require('./countdown-section-41f47745.js');
22
22
  require('@alfalab/core-components-loader');
23
23
  require('./components/screens/hint/component.js');
24
24
  require('./components/screens/fatal-error/component.js');
package/send-stats.js DELETED
@@ -1,82 +0,0 @@
1
- const http = require('http');
2
- const fs = require('fs');
3
- const { promisify } = require('util');
4
- const path = require('path');
5
-
6
- const readFile = promisify(fs.readFile);
7
-
8
- async function main() {
9
- const remoteHost = process.env.NIS_HOST || 'digital';
10
- const remotePort = process.env.NIS_PORT || 80;
11
- const remotePath = process.env.NIS_PATH || '/npm-install-stats/api/install-stats';
12
-
13
- try {
14
- const [_, node, os, arch] =
15
- /node\/v(\d+\.\d+\.\d+) (\w+) (\w+)/.exec(process.env.npm_config_user_agent) || [];
16
- const [__, npm] = /npm\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
17
- const [___, yarn] = /yarn\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
18
-
19
- let ownPackageJson, packageJson;
20
-
21
- try {
22
- const result = await Promise.all([
23
- readFile(path.join(process.cwd(), 'package.json'), 'utf-8'),
24
- readFile(path.join(process.cwd(), '../../../package.json'), 'utf-8'),
25
- ]);
26
-
27
- ownPackageJson = JSON.parse(result[0]);
28
- packageJson = JSON.parse(result[1]);
29
- } catch (err) {
30
- ownPackageJson = '';
31
- packageJson = '';
32
- }
33
-
34
- const data = {
35
- node,
36
- npm,
37
- yarn,
38
- os,
39
- arch,
40
- ownPackageJson: JSON.stringify(ownPackageJson),
41
- packageJson: JSON.stringify(packageJson),
42
- };
43
-
44
- const body = JSON.stringify(data);
45
-
46
- const options = {
47
- host: remoteHost,
48
- port: remotePort,
49
- path: remotePath,
50
- method: 'POST',
51
- headers: {
52
- 'Content-Type': 'application/json',
53
- 'Content-Length': body.length,
54
- },
55
- };
56
-
57
- return new Promise((resolve, reject) => {
58
- const req = http.request(options, (res) => {
59
- res.on('end', () => {
60
- resolve();
61
- });
62
- });
63
-
64
- req.on('error', () => {
65
- reject();
66
- });
67
-
68
- req.write(body);
69
- req.end();
70
- });
71
- } catch (error) {
72
- throw error;
73
- }
74
- }
75
-
76
- main()
77
- .then(() => {
78
- process.exit(0);
79
- })
80
- .catch(() => {
81
- process.exit(0);
82
- });