@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 +1 -1
- package/src/commands/add.js +7 -7
package/package.json
CHANGED
package/src/commands/add.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
148
|
-
|
|
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
|
}
|