@dotenvx/dotenvx-ops 0.35.0 → 0.36.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/CHANGELOG.md +13 -1
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/cli/actions/settings/off.js +16 -0
- package/src/cli/actions/settings/on.js +16 -0
- package/src/cli/commands/settings.js +14 -0
- package/src/db/session.js +27 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
[Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.36.0...main)
|
|
6
|
+
|
|
7
|
+
## [0.36.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.35.1...v0.36.0) (2026-03-13)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* Turn ops on and off ([#29](https://github.com/dotenvx/dotenvx-ops/pull/29))
|
|
12
|
+
|
|
13
|
+
## [0.35.1](https://github.com/dotenvx/dotenvx-ops/compare/v0.35.0...v0.35.1) (2026-03-13)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* Change banner
|
|
6
18
|
|
|
7
19
|
## [0.35.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.34.0...v0.35.0) (2026-03-13)
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
[](https://dotenvx.com/ops)
|
|
2
2
|
|
|
3
|
-
> KEYS
|
|
3
|
+
> KEYS OFF COMPUTER by dotenvx
|
|
4
4
|
|
|
5
5
|
[Learn more](https://dotenvx.com/docs/ops)
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { logger } = require('@dotenvx/dotenvx')
|
|
2
|
+
|
|
3
|
+
const Session = require('./../../../db/session')
|
|
4
|
+
|
|
5
|
+
function off () {
|
|
6
|
+
try {
|
|
7
|
+
const sesh = new Session()
|
|
8
|
+
sesh.turnOff()
|
|
9
|
+
console.log('ops: off')
|
|
10
|
+
} catch (error) {
|
|
11
|
+
logger.error(error.message)
|
|
12
|
+
process.exit(1)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = off
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { logger } = require('@dotenvx/dotenvx')
|
|
2
|
+
|
|
3
|
+
const Session = require('./../../../db/session')
|
|
4
|
+
|
|
5
|
+
function on () {
|
|
6
|
+
try {
|
|
7
|
+
const sesh = new Session()
|
|
8
|
+
sesh.turnOn()
|
|
9
|
+
console.log('ops: on')
|
|
10
|
+
} catch (error) {
|
|
11
|
+
logger.error(error.message)
|
|
12
|
+
process.exit(1)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = on
|
|
@@ -43,4 +43,18 @@ settings
|
|
|
43
43
|
.description('print path to settings file')
|
|
44
44
|
.action(pathAction)
|
|
45
45
|
|
|
46
|
+
// dotenvx-ops settings on
|
|
47
|
+
const onAction = require('./../actions/settings/on')
|
|
48
|
+
settings
|
|
49
|
+
.command('on')
|
|
50
|
+
.description('turn ops on')
|
|
51
|
+
.action(onAction)
|
|
52
|
+
|
|
53
|
+
// dotenvx-ops settings off
|
|
54
|
+
const offAction = require('./../actions/settings/off')
|
|
55
|
+
settings
|
|
56
|
+
.command('off')
|
|
57
|
+
.description('turn ops off')
|
|
58
|
+
.action(offAction)
|
|
59
|
+
|
|
46
60
|
module.exports = settings
|
package/src/db/session.js
CHANGED
|
@@ -25,7 +25,7 @@ class Session {
|
|
|
25
25
|
|
|
26
26
|
status () {
|
|
27
27
|
// if logged in
|
|
28
|
-
if (this.username() && this.token()) {
|
|
28
|
+
if (this.username() && this.token() && this.on()) {
|
|
29
29
|
return 'on'
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -55,6 +55,14 @@ class Session {
|
|
|
55
55
|
return this.store.path
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
on () {
|
|
59
|
+
return (this.store.get('DOTENVX_OPS_ON') || 'true') === 'true'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
off () {
|
|
63
|
+
return (this.store.get('DOTENVX_OPS_ON') || 'true') === 'false'
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
async systemInformation () {
|
|
59
67
|
const system = await si.system()
|
|
60
68
|
const osInfo = await si.osInfo()
|
|
@@ -90,6 +98,7 @@ class Session {
|
|
|
90
98
|
this.store.set('DOTENVX_OPS_USERNAME', username)
|
|
91
99
|
this.store.set('DOTENVX_OPS_TOKEN', accessToken)
|
|
92
100
|
this.store.set('DOTENVX_OPS_HOSTNAME', hostname)
|
|
101
|
+
this.store.set('DOTENVX_OPS_ON', 'true')
|
|
93
102
|
|
|
94
103
|
return accessToken
|
|
95
104
|
}
|
|
@@ -111,8 +120,25 @@ class Session {
|
|
|
111
120
|
this.store.delete('DOTENVX_OPS_USERNAME')
|
|
112
121
|
this.store.delete('DOTENVX_OPS_TOKEN')
|
|
113
122
|
this.store.delete('DOTENVX_OPS_HOSTNAME')
|
|
123
|
+
this.store.delete('DOTENVX_OPS_ON')
|
|
114
124
|
return true
|
|
115
125
|
}
|
|
126
|
+
|
|
127
|
+
//
|
|
128
|
+
// on
|
|
129
|
+
//
|
|
130
|
+
turnOn () {
|
|
131
|
+
this.store.set('DOTENVX_OPS_ON', 'true')
|
|
132
|
+
return 'true'
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
//
|
|
136
|
+
// off
|
|
137
|
+
//
|
|
138
|
+
turnOff () {
|
|
139
|
+
this.store.set('DOTENVX_OPS_ON', 'false')
|
|
140
|
+
return 'false'
|
|
141
|
+
}
|
|
116
142
|
}
|
|
117
143
|
|
|
118
144
|
module.exports = Session
|