@dotenvx/dotenvx-ops 0.20.2 → 0.21.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 +7 -1
- package/package.json +1 -1
- package/src/cli/actions/observe.js +2 -1
- package/src/cli/dotenvx-ops.js +1 -0
- package/src/lib/api/postObserve.js +5 -2
- package/src/lib/main.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
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.21.0...main)
|
|
6
|
+
|
|
7
|
+
## [0.21.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.20.2...v0.21.0) (2025-10-11)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* Send `DOTENVX_PROJECT_ID` along with `observe` call ([#5](https://github.com/dotenvx/dotenvx-ops/pull/5))
|
|
6
12
|
|
|
7
13
|
## [0.20.2](https://github.com/dotenvx/dotenvx-ops/compare/v0.20.1...v0.20.2) (2025-10-07)
|
|
8
14
|
|
package/package.json
CHANGED
|
@@ -11,9 +11,10 @@ async function observe (base64) {
|
|
|
11
11
|
|
|
12
12
|
const hostname = options.hostname
|
|
13
13
|
const token = options.token
|
|
14
|
+
const dotenvxProjectId = options.dotenvxProjectId
|
|
14
15
|
|
|
15
16
|
try {
|
|
16
|
-
await main.observe(base64, { hostname, token })
|
|
17
|
+
await main.observe(base64, { hostname, token, dotenvxProjectId })
|
|
17
18
|
} catch (error) {
|
|
18
19
|
if (error.message) {
|
|
19
20
|
logger.error(error.message)
|
package/src/cli/dotenvx-ops.js
CHANGED
|
@@ -39,6 +39,7 @@ program.command('observe')
|
|
|
39
39
|
.argument('BASE64', 'BASE64')
|
|
40
40
|
.option('--hostname <url>', 'set hostname', sesh.hostname())
|
|
41
41
|
.option('--token <token>', 'set token')
|
|
42
|
+
.option('--dotenvxProjectId <identifier>', 'set DOTENVX_PROJECT_ID')
|
|
42
43
|
.action(function (...args) {
|
|
43
44
|
observeAction.apply(this, args)
|
|
44
45
|
})
|
|
@@ -3,7 +3,7 @@ const buildApiError = require('../../lib/helpers/buildApiError')
|
|
|
3
3
|
const packageJson = require('../../lib/helpers/packageJson')
|
|
4
4
|
|
|
5
5
|
class PostObserve {
|
|
6
|
-
constructor (hostname, token, encoded, pwd = null, gitUrl = null, gitBranch = null, systemUuid = null, osPlatform = null, osArch = null) {
|
|
6
|
+
constructor (hostname, token, encoded, pwd = null, gitUrl = null, gitBranch = null, systemUuid = null, osPlatform = null, osArch = null, dotenvxProjectId = null) {
|
|
7
7
|
this.hostname = hostname || 'https://ops.dotenvx.com'
|
|
8
8
|
this.token = token
|
|
9
9
|
this.encoded = encoded
|
|
@@ -13,6 +13,7 @@ class PostObserve {
|
|
|
13
13
|
this.systemUuid = systemUuid
|
|
14
14
|
this.osPlatform = osPlatform
|
|
15
15
|
this.osArch = osArch
|
|
16
|
+
this.dotenvxProjectId = dotenvxProjectId
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
async run () {
|
|
@@ -26,6 +27,7 @@ class PostObserve {
|
|
|
26
27
|
const systemUuid = this.systemUuid
|
|
27
28
|
const osPlatform = this.osPlatform
|
|
28
29
|
const osArch = this.osArch
|
|
30
|
+
const dotenvxProjectId = this.dotenvxProjectId
|
|
29
31
|
|
|
30
32
|
const resp = await http(url, {
|
|
31
33
|
method: 'POST',
|
|
@@ -42,7 +44,8 @@ class PostObserve {
|
|
|
42
44
|
system_uuid: systemUuid,
|
|
43
45
|
os_platform: osPlatform,
|
|
44
46
|
os_arch: osArch,
|
|
45
|
-
cli_version: packageJson.version
|
|
47
|
+
cli_version: packageJson.version,
|
|
48
|
+
dotenvx_project_id: dotenvxProjectId
|
|
46
49
|
})
|
|
47
50
|
})
|
|
48
51
|
|
package/src/lib/main.js
CHANGED
|
@@ -6,6 +6,7 @@ const PostObserve = require('./api/postObserve')
|
|
|
6
6
|
|
|
7
7
|
const gitUrl = require('./helpers/gitUrl')
|
|
8
8
|
const gitBranch = require('./helpers/gitBranch')
|
|
9
|
+
const dotenvxProjectId = require('./helpers/dotenvxProjectId')
|
|
9
10
|
|
|
10
11
|
const observe = async function (encoded, options = {}) {
|
|
11
12
|
const sesh = new Session() // TODO: handle scenario where constructor fails
|
|
@@ -21,6 +22,8 @@ const observe = async function (encoded, options = {}) {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
const _pwd = process.cwd()
|
|
25
|
+
const _dotenvxProjectId = process.env.DOTENVX_PROJECT_ID || options.dotenvxProjectId || dotenvxProjectId(_pwd, false)
|
|
26
|
+
|
|
24
27
|
const _gitUrl = gitUrl()
|
|
25
28
|
const _gitBranch = gitBranch()
|
|
26
29
|
|
|
@@ -31,7 +34,7 @@ const observe = async function (encoded, options = {}) {
|
|
|
31
34
|
const _osPlatform = osInfo.platform
|
|
32
35
|
const _osArch = osInfo.arch
|
|
33
36
|
|
|
34
|
-
const json = await new PostObserve(hostname, token, encoded, _pwd, _gitUrl, _gitBranch, _systemUuid, _osPlatform, _osArch).run()
|
|
37
|
+
const json = await new PostObserve(hostname, token, encoded, _pwd, _gitUrl, _gitBranch, _systemUuid, _osPlatform, _osArch, _dotenvxProjectId).run()
|
|
35
38
|
|
|
36
39
|
return json
|
|
37
40
|
}
|