@nightlybuildgroup/vault 1.7.1 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nightlybuildgroup/vault",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Store Vaultwarden/Bitwarden credentials in the macOS Keychain and read secrets back for local agents.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -139,20 +139,20 @@ export async function runAdd(args, deps) {
139
139
 
140
140
  if (entry.folder) entry.folderId = await resolveFolderId(bw, session, entry.folder);
141
141
 
142
- const created = await bw.createItem({ item: buildLoginItem(entry), session });
142
+ const item = buildLoginItem(entry);
143
143
 
144
+ // Create the item DIRECTLY in the org collection (org id + collection ids in
145
+ // the create payload). Creating-then-moving leaves the item in a state that
146
+ // the org collection listing / web vault don't show — direct create does.
144
147
  let shared = '';
145
148
  if (collectionName) {
146
149
  const col = await resolveCollection(bw, session, collectionName, organizationName);
147
- await bw.moveItemToCollection({
148
- itemId: created.id,
149
- organizationId: col.organizationId,
150
- collectionIds: [col.id],
151
- session,
152
- });
150
+ item.organizationId = col.organizationId;
151
+ item.collectionIds = [col.id];
153
152
  shared = ` → shared to "${col.name}"`;
154
153
  }
155
154
 
155
+ const created = await bw.createItem({ item, session });
156
156
  out(`Created "${created.name}" (${created.id})${shared}\n`);
157
157
  return 0;
158
158
  }