@qui-cli/env-1password 1.2.0 → 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 +14 -0
- package/dist/1Password.js +10 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
12
|
+
## [1.2.1](https://github.com/battis/qui-cli/compare/env-1password/1.2.0...env-1password/1.2.1) (2025-12-23)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* fix crucial typo in documentation ([5fca554](https://github.com/battis/qui-cli/commit/5fca55433d9c8261122614c7786954bde779d63a))
|
|
18
|
+
|
|
5
19
|
## [1.2.0](https://github.com/battis/qui-cli/compare/env-1password/1.1.0...env-1password/1.2.0) (2025-12-23)
|
|
6
20
|
|
|
7
21
|
|
package/dist/1Password.js
CHANGED
|
@@ -56,7 +56,7 @@ export function options() {
|
|
|
56
56
|
text: 'Store 1Password secret references in your environment, rather than the actual secrets.'
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
|
-
text: `If 1Password secret references are stored in the environment, a 1Password service account token is required to access the secret values, which will be loaded into ${Colors.value('process.env')}. The service account token can be passed directly as the ${Colors.optionArg('--opToken')} argument (e.g. ${Colors.command(`${Colors.keyword('example')} --opToken "(${Colors.keyword('op')} item get myToken)"`)}) or, if the 1Password CLI tool is also installed, by simply passing the name or ID of the API Credential in your 1Password vault that holds the service account token (e.g. ${Colors.command(`${Colors.keyword('example')} --opItem myToken`)}). If you are signed into multiple 1Password account, use the ${Colors.optionArg('--opAccount')} argument to specify the account containing the token.`
|
|
59
|
+
text: `If 1Password secret references are stored in the environment, a 1Password service account token is required to access the secret values, which will be loaded into ${Colors.value('process.env')}. The service account token can be passed directly as the ${Colors.optionArg('--opToken')} argument (e.g. ${Colors.command(`${Colors.keyword('example')} --opToken "$(${Colors.keyword('op')} item get myToken)"`)}) or, if the 1Password CLI tool is also installed, by simply passing the name or ID of the API Credential in your 1Password vault that holds the service account token (e.g. ${Colors.command(`${Colors.keyword('example')} --opItem myToken`)}). If you are signed into multiple 1Password account, use the ${Colors.optionArg('--opAccount')} argument to specify the account containing the token.`
|
|
60
60
|
},
|
|
61
61
|
{ text: Colors.url('https://developer.1password.com/docs/cli') }
|
|
62
62
|
],
|
|
@@ -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
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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.
|
|
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": {
|
|
@@ -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",
|
|
31
32
|
"@qui-cli/env": "5.0.2",
|
|
32
33
|
"@qui-cli/log": "4.0.1",
|
|
33
34
|
"@qui-cli/plugin": "4.0.0",
|
|
34
|
-
"@qui-cli/
|
|
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",
|