@theholocron/holocron-plugin-1password 5.0.0-alpha.370 → 5.0.0-alpha.372

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/README.md CHANGED
@@ -118,7 +118,7 @@ holocron.
118
118
 
119
119
  ```
120
120
 
121
- - `vault` (optional) — the 1Password vault name items live in. Only `list()` needs it (`read` and `write` take the vault from the `op://` reference), and Environments are not in a vault, so a project that only reads an Environment can leave it out.
121
+ - `vault` (optional) — the 1Password vault name items live in. `list()` needs it, or an `environment` (see below) (`read` and `write` take the vault from the `op://` reference), and Environments are not in a vault, so a project that only reads an Environment can leave it out.
122
122
  - `account` (optional) — 1P account UUID. Passes `--account <UUID>`
123
123
  on every `op` call so the integration targets a specific account
124
124
  even when the developer has multiple signed in (e.g., work +
@@ -130,7 +130,7 @@ holocron.
130
130
  | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
131
131
  | `read(reference)` | `op read <reference>` — resolves `op://Vault/Item/field`. `--no-newline`. |
132
132
  | `write(reference, v)` | Probe + `op item edit` if exists, else `op item create --category=API Credential`. |
133
- | `list()` | `op item list --vault=<vault> --format=json` — names of items in the vault. |
133
+ | `list()` | `op item list --vault=<vault> --format=json` — names of items in the vault; with only an `environment` set, the variable names of that Environment (`repo setup` calls it). Neither is an error. |
134
134
  | `readSecret(name)` | Reads one variable of the Environment named by the `environment` option, through the same `op environment secret list`; refuses without that option. Lets a caller (the `comlink deliver` probe) ask for a secret by its bare name. |
135
135
  | `readEnvironment(name or id)` | `op environment secret list <name or id> --reveal --format=dotenv` — parses the variables into a record (a multi-line PEM key, which `op` prints unquoted, is read whole). `op environment read` takes only an id, so this reads through `secret list`, which takes either. |
136
136
 
package/dist/index.d.mts CHANGED
@@ -90,6 +90,10 @@ export declare class OpVault implements Vault {
90
90
  constructor(shell: OpShell, opts?: OpVaultOptions);
91
91
  read(reference: string): Promise<string>;
92
92
  write(reference: string, value: string): Promise<void>;
93
+ /**
94
+ * The names this vault holds: the item titles of its `vault`, or, when only an `environment` is set (an Environment
95
+ * is not in a vault), that Environment's variable names. Values are read in memory and never returned.
96
+ */
93
97
  list(): Promise<string[]>;
94
98
  /**
95
99
  * Every variable of a 1Password Environment, by its name or id. `op environment read` takes only an id, while
package/dist/index.mjs CHANGED
@@ -209,8 +209,13 @@ var OpVault = class {
209
209
  `${parsed.field}=${value}`
210
210
  ], `item create ${parsed.item}`);
211
211
  }
212
+ /**
213
+ * The names this vault holds: the item titles of its `vault`, or, when only an `environment` is set (an Environment
214
+ * is not in a vault), that Environment's variable names. Values are read in memory and never returned.
215
+ */
212
216
  async list() {
213
- if (!this.vaultName) throw new ProviderApiError("1Password `list` needs a `vault` in the plugin options: it lists the items in one vault", 400, void 0);
217
+ if (!this.vaultName && this.environmentName) return Object.keys(await this.readEnvironment(this.environmentName));
218
+ if (!this.vaultName) throw new ProviderApiError("1Password `list` needs a `vault` or an `environment` in the plugin options: it lists the items in one vault, or the variable names of one Environment", 400, void 0);
214
219
  const stdout = this.shell.runOrThrow([
215
220
  "item",
216
221
  "list",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-1password",
3
- "version": "5.0.0-alpha.370",
3
+ "version": "5.0.0-alpha.372",
4
4
  "description": "Holocron plugin for 1Password. Implements the vault capability via shell-out to the `op` CLI (https://developer.1password.com/docs/cli).",
5
5
  "keywords": [
6
6
  "1password",
@@ -40,14 +40,14 @@
40
40
  "tsx": "4.23.15",
41
41
  "typescript": "^5.9.3",
42
42
  "vitest": "^5.1.0",
43
- "@theholocron/cli": "5.0.0-alpha.370",
44
- "@theholocron/eslint-config": "^8.9.0-alpha.11",
45
- "@theholocron/tsconfig": "^8.9.0-alpha.11",
46
- "@theholocron/tsdown-config": "^8.9.0-alpha.11",
47
- "@theholocron/vitest-config": "^8.9.0-alpha.11"
43
+ "@theholocron/cli": "5.0.0-alpha.372",
44
+ "@theholocron/eslint-config": "^8.9.0-alpha.12",
45
+ "@theholocron/tsdown-config": "^8.9.0-alpha.12",
46
+ "@theholocron/vitest-config": "^8.9.0-alpha.12",
47
+ "@theholocron/tsconfig": "^8.9.0-alpha.12"
48
48
  },
49
49
  "peerDependencies": {
50
- "@theholocron/cli": "5.0.0-alpha.370"
50
+ "@theholocron/cli": "5.0.0-alpha.372"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=22"