@dotenvx/dotenvx-ops 0.43.0 → 0.45.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 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.43.0...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.45.0...main)
6
+
7
+ ## [0.45.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.44.0...v0.45.0) (2026-05-07)
8
+
9
+ ### Added
10
+
11
+ * Prompt for team on `armor push`(if member of multiple teams) ([#66](https://github.com/dotenvx/dotenvx-ops/pull/66))
12
+
13
+ ## [0.44.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.43.0...v0.44.0) (2026-05-07)
14
+
15
+ ### Added
16
+
17
+ * Prompt for team on `armor up` (if member of multiple teams) ([#65](https://github.com/dotenvx/dotenvx-ops/pull/65))
6
18
 
7
19
  ## [0.43.0](https://github.com/dotenvx/dotenvx-ops/compare/v0.42.1...v0.43.0) (2026-05-06)
8
20
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.43.0",
2
+ "version": "0.45.0",
3
3
  "name": "@dotenvx/dotenvx-ops",
4
4
  "description": "Secrets for agents–from the creator of `dotenv` and `dotenvx`",
5
5
  "author": "@motdotla",
@@ -4,23 +4,26 @@ const packageJson = require('../../lib/helpers/packageJson')
4
4
  const normalizeToken = require('../../lib/helpers/normalizeToken')
5
5
 
6
6
  class PostArmorPush {
7
- constructor (hostname, token, devicePublicKey, privateKey) {
7
+ constructor (hostname, token, devicePublicKey, privateKey, team) {
8
8
  this.hostname = hostname || 'https://ops.dotenvx.com'
9
9
  this.token = token
10
10
  this.devicePublicKey = devicePublicKey
11
11
  this.privateKey = privateKey
12
+ this.team = team
12
13
  }
13
14
 
14
15
  async run () {
15
16
  const token = normalizeToken(this.token)
16
17
  const devicePublicKey = this.devicePublicKey
17
18
  const privateKey = this.privateKey
19
+ const team = this.team
18
20
  const url = `${this.hostname}/api/armor/push`
19
21
 
20
22
  const body = {
21
23
  device_public_key: devicePublicKey,
22
24
  cli_version: packageJson.version,
23
- private_key: privateKey
25
+ private_key: privateKey,
26
+ team
24
27
  }
25
28
 
26
29
  const resp = await http(url, {
@@ -4,12 +4,13 @@ const packageJson = require('../../lib/helpers/packageJson')
4
4
  const normalizeToken = require('../../lib/helpers/normalizeToken')
5
5
 
6
6
  class PostArmorUp {
7
- constructor (hostname, token, devicePublicKey, publicKey, privateKey) {
7
+ constructor (hostname, token, devicePublicKey, publicKey, privateKey, team) {
8
8
  this.hostname = hostname || 'https://ops.dotenvx.com'
9
9
  this.token = token
10
10
  this.devicePublicKey = devicePublicKey
11
11
  this.publicKey = publicKey
12
12
  this.privateKey = privateKey
13
+ this.team = team
13
14
  }
14
15
 
15
16
  async run () {
@@ -17,13 +18,15 @@ class PostArmorUp {
17
18
  const devicePublicKey = this.devicePublicKey
18
19
  const publicKey = this.publicKey
19
20
  const privateKey = this.privateKey
21
+ const team = this.team
20
22
  const url = `${this.hostname}/api/armor/up`
21
23
 
22
24
  const body = {
23
25
  device_public_key: devicePublicKey,
24
26
  cli_version: packageJson.version,
25
27
  public_key: publicKey,
26
- private_key: privateKey
28
+ private_key: privateKey,
29
+ team
27
30
  }
28
31
 
29
32
  const resp = await http(url, {
@@ -1,5 +1,7 @@
1
1
  const dotenvx = require('@dotenvx/dotenvx')
2
+ const prompts = require('@inquirer/prompts')
2
3
  const PostArmorPush = require('../api/postArmorPush')
4
+ const GetAccount = require('../api/getAccount')
3
5
  const keyNamesForEnvFile = require('../helpers/keyNamesForEnvFile')
4
6
 
5
7
  class ArmorPush {
@@ -19,7 +21,21 @@ class ArmorPush {
19
21
  const { privateKeyName } = keyNamesForEnvFile(envFile)
20
22
 
21
23
  const privateKey = dotenvx.get(privateKeyName, { path: '.env.keys', strict: true, noOps: true })
22
- const json = await new PostArmorPush(hostname, token, devicePublicKey, privateKey).run()
24
+
25
+ const accountJson = await new GetAccount(hostname, token).run()
26
+ const choices = accountJson.organizations.map(o => ({
27
+ name: o.provider_slug,
28
+ value: o.provider_slug
29
+ }))
30
+ let team = choices[0] && choices[0].value
31
+ if (choices.length > 1) {
32
+ team = await prompts.select({
33
+ message: 'Select team',
34
+ choices
35
+ })
36
+ }
37
+
38
+ const json = await new PostArmorPush(hostname, token, devicePublicKey, privateKey, team).run()
23
39
 
24
40
  return {
25
41
  ...json,
@@ -1,5 +1,7 @@
1
1
  const dotenvx = require('@dotenvx/dotenvx')
2
+ const prompts = require('@inquirer/prompts')
2
3
  const PostArmorUp = require('../api/postArmorUp')
4
+ const GetAccount = require('../api/getAccount')
3
5
  const keyNamesForEnvFile = require('../helpers/keyNamesForEnvFile')
4
6
  const removeEnvKey = require('../helpers/removeEnvKey')
5
7
 
@@ -24,7 +26,21 @@ class ArmorUp {
24
26
 
25
27
  const publicKey = dotenvx.get(publicKeyName, { path: envFile, strict: true, ignore: ['MISSING_PRIVATE_KEY'], noOps: true })
26
28
  const privateKey = dotenvx.get(privateKeyName, { path: '.env.keys', strict: true, ignore: ['MISSING_KEY'], noOps: true })
27
- const json = await new PostArmorUp(hostname, token, devicePublicKey, publicKey, privateKey).run()
29
+
30
+ const accountJson = await new GetAccount(hostname, token).run()
31
+ const choices = accountJson.organizations.map(o => ({
32
+ name: o.provider_slug,
33
+ value: o.provider_slug
34
+ }))
35
+ let team = choices[0] && choices[0].value
36
+ if (choices.length > 1) {
37
+ team = await prompts.select({
38
+ message: 'Select team',
39
+ choices
40
+ })
41
+ }
42
+
43
+ const json = await new PostArmorUp(hostname, token, devicePublicKey, publicKey, privateKey, team).run()
28
44
  removeEnvKey(privateKeyName)
29
45
 
30
46
  return {