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

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.2](https://github.com/battis/qui-cli/compare/env-1password/1.2.1...env-1password/1.2.2) (2025-12-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * handle 1Password secret reference not in sections ([bd57bb6](https://github.com/battis/qui-cli/commit/bd57bb67f5027135425dfdd61fef5b3c1c2301c7))
11
+
5
12
  ## [1.2.1](https://github.com/battis/qui-cli/compare/env-1password/1.2.0...env-1password/1.2.1) (2025-12-23)
6
13
 
7
14
 
package/dist/1Password.js CHANGED
@@ -120,9 +120,8 @@ export async function exists({ key, file }) {
120
120
  return Env.exists({ key, file });
121
121
  }
122
122
  function secretFrom(secretReference) {
123
- const [vault, item, section, field] = secretReference
124
- .replace('op://', '')
125
- .split('/');
123
+ const [, vault, item, , section, field] = secretReference.match(/^op:\/\/([^/]+)\/([^/]+)\/(([^/]+)\/)?([^/]+)$/) ||
124
+ [];
126
125
  return { vault, item, section, field };
127
126
  }
128
127
  async function itemFrom(secret) {
@@ -152,14 +151,13 @@ export async function set({ key, value, file, ...rest }) {
152
151
  const updated = {
153
152
  ...item,
154
153
  fields: item.fields.map((field) => {
155
- if (field.title === secret.field &&
156
- ((/^Section_.+/.test(secret.section) &&
157
- field.sectionId == secret.section.replace(/^Section_/, '')) ||
158
- field.sectionId ==
159
- item.sections
160
- .filter((section) => section.title === secret.section)
161
- .shift()?.id)) {
162
- return { ...field, value };
154
+ const section = item.sections.find((s) => s.id === field.sectionId);
155
+ if (secret.field === field.title || secret.field === field.id) {
156
+ if ((!secret.section && field.sectionId === 'add more') ||
157
+ secret.section === section?.title ||
158
+ secret.section === section?.id) {
159
+ return { ...field, value };
160
+ }
163
161
  }
164
162
  return field;
165
163
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qui-cli/env-1password",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
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": {
@@ -29,11 +29,11 @@
29
29
  "npm-run-all": "^4.1.5",
30
30
  "typescript": "^5.9.3",
31
31
  "@qui-cli/colors": "3.1.1",
32
- "@qui-cli/log": "4.0.1",
33
32
  "@qui-cli/env": "5.0.2",
33
+ "@qui-cli/log": "4.0.1",
34
34
  "@qui-cli/plugin": "4.0.0",
35
- "@qui-cli/root": "3.0.4",
36
- "@qui-cli/shell": "3.0.3"
35
+ "@qui-cli/shell": "3.0.3",
36
+ "@qui-cli/root": "3.0.4"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@qui-cli/env": "5.x",