@qui-cli/env-1password 1.2.2 → 1.2.3

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,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.2.3](https://github.com/battis/qui-cli/compare/env-1password/1.2.2...env-1password/1.2.3) (2025-12-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * handle inconsistencies of 1password-sdk sectionIds more gracefully ([bfa2be1](https://github.com/battis/qui-cli/commit/bfa2be1750da265676b31f7162f24e7d75a31502))
11
+
5
12
  ## [1.2.2](https://github.com/battis/qui-cli/compare/env-1password/1.2.1...env-1password/1.2.2) (2025-12-24)
6
13
 
7
14
 
package/README.md CHANGED
@@ -38,7 +38,7 @@ This package integrates with [@1password/sdk](https://www.npmjs.com/package/@1pa
38
38
  3. Update environment variables to be [secret references](https://developer.1password.com/docs/cli/secret-references)
39
39
  4. Run!
40
40
 
41
- See [dev-1password-env](https://github.com/battis/qui-cli/tree/main/examples/dev-1password-env#readme) for an example using the 1Password implementation of this package.
41
+ See [dev-env-1password](https://github.com/battis/qui-cli/tree/main/examples/dev-env-1password#readme) for an example using the 1Password implementation of this package.
42
42
 
43
43
  ## Configuration
44
44
 
package/dist/1Password.js CHANGED
@@ -67,7 +67,7 @@ export function options() {
67
67
  default: config.opAccount
68
68
  },
69
69
  opItem: {
70
- description: `Name or ID of the 1Password API Credential item storing the 1Password service account token; will use environmen variable ${Colors.varName('OP_ITEM')} if present`,
70
+ description: `Name or ID of the 1Password API Credential item storing the 1Password service account token; will use environment variable ${Colors.varName('OP_ITEM')} if present`,
71
71
  hint: '1Password unique identifier',
72
72
  default: config.opItem
73
73
  },
@@ -100,6 +100,8 @@ function isSecretReference(value) {
100
100
  function secretReferences(parsed) {
101
101
  return Object.fromEntries(Object.entries(parsed).filter((entry) => isSecretReference(entry[1])));
102
102
  }
103
+ // FIXME parse is not loading 1Password secrets into process.env
104
+ // Issue URL: https://github.com/battis/qui-cli/issues/81
103
105
  export async function parse(file) {
104
106
  const parsed = await Env.parse(file);
105
107
  if (client) {
@@ -120,8 +122,14 @@ export async function exists({ key, file }) {
120
122
  return Env.exists({ key, file });
121
123
  }
122
124
  function secretFrom(secretReference) {
123
- const [, vault, item, , section, field] = secretReference.match(/^op:\/\/([^/]+)\/([^/]+)\/(([^/]+)\/)?([^/]+)$/) ||
124
- [];
125
+ // eslint-disable-next-line prefer-const
126
+ let [vault, item, section, field] = secretReference
127
+ .replace(/^op:\/\//, '')
128
+ .split('/');
129
+ if (field === undefined) {
130
+ field = section;
131
+ section = '';
132
+ }
125
133
  return { vault, item, section, field };
126
134
  }
127
135
  async function itemFrom(secret) {
@@ -153,7 +161,8 @@ export async function set({ key, value, file, ...rest }) {
153
161
  fields: item.fields.map((field) => {
154
162
  const section = item.sections.find((s) => s.id === field.sectionId);
155
163
  if (secret.field === field.title || secret.field === field.id) {
156
- if ((!secret.section && field.sectionId === 'add more') ||
164
+ if ((!secret.section &&
165
+ (field.sectionId === '' || field.sectionId === 'add more')) ||
157
166
  secret.section === section?.title ||
158
167
  secret.section === section?.id) {
159
168
  return { ...field, value };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qui-cli/env-1password",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "@qui-cli Plugin: Standardized environment configuration",
5
5
  "homepage": "https://github.com/battis/qui-cli/tree/main/packages/env-1password#readme",
6
6
  "repository": {
@@ -28,12 +28,12 @@
28
28
  "del-cli": "^6.0.0",
29
29
  "npm-run-all": "^4.1.5",
30
30
  "typescript": "^5.9.3",
31
- "@qui-cli/colors": "3.1.1",
32
31
  "@qui-cli/env": "5.0.2",
33
32
  "@qui-cli/log": "4.0.1",
33
+ "@qui-cli/colors": "3.1.1",
34
34
  "@qui-cli/plugin": "4.0.0",
35
- "@qui-cli/shell": "3.0.3",
36
- "@qui-cli/root": "3.0.4"
35
+ "@qui-cli/root": "3.0.4",
36
+ "@qui-cli/shell": "3.0.3"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@qui-cli/env": "5.x",