cicy-desktop 2.1.214 → 2.1.215
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
|
@@ -148,8 +148,34 @@ function writeChromeConfig(next) {
|
|
|
148
148
|
} catch {}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
// Identity is recorded in the `accounts` map (accounts.gmail / .google / .github
|
|
152
|
+
// → {account,password,totp}) via the account CLI; older code only wrote a bare
|
|
153
|
+
// top-level `gmail`. normalizeAccounts coerces the map; resolveGmail prefers the
|
|
154
|
+
// accounts map and falls back to the legacy field — so gmail shows whichever way
|
|
155
|
+
// it was recorded (this is why panels showed empty: read top-level, wrote accounts).
|
|
156
|
+
function normalizeAccounts(raw) {
|
|
157
|
+
const out = {};
|
|
158
|
+
if (raw && typeof raw === "object" && !Array.isArray(raw)) {
|
|
159
|
+
for (const [svc, val] of Object.entries(raw)) {
|
|
160
|
+
if (typeof val === "string") out[svc] = { account: val };
|
|
161
|
+
else if (val && typeof val === "object" && !Array.isArray(val)) out[svc] = val;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
function resolveGmail(accounts, fallback) {
|
|
167
|
+
const a = accounts || {};
|
|
168
|
+
return (
|
|
169
|
+
(a.gmail && a.gmail.account) ||
|
|
170
|
+
(a.google && a.google.account) ||
|
|
171
|
+
(typeof fallback === "string" ? fallback : "") ||
|
|
172
|
+
""
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
151
176
|
function chromeView(idx, entry) {
|
|
152
177
|
const e = entry && typeof entry === "object" ? entry : {};
|
|
178
|
+
const accounts = normalizeAccounts(e.accounts);
|
|
153
179
|
return {
|
|
154
180
|
id: `chrome-${idx}`,
|
|
155
181
|
backend: "chrome",
|
|
@@ -159,7 +185,8 @@ function chromeView(idx, entry) {
|
|
|
159
185
|
logins: (Array.isArray(e.logins) ? e.logins : []).map(normalizeLogin),
|
|
160
186
|
note: typeof e.note === "string" ? e.note : "",
|
|
161
187
|
// chrome-specific extras (read-only passthrough)
|
|
162
|
-
gmail:
|
|
188
|
+
gmail: resolveGmail(accounts, e.gmail),
|
|
189
|
+
accounts,
|
|
163
190
|
port: typeof e.port === "number" ? e.port : 11000 + idx,
|
|
164
191
|
rpaDir: typeof e.rpaDir === "string" ? e.rpaDir : `~/chrome/profile_${idx}`,
|
|
165
192
|
platform: e.platform && typeof e.platform === "object" ? e.platform : {},
|
|
@@ -208,6 +235,9 @@ function writeAccount(data) {
|
|
|
208
235
|
function electronView(idx, data) {
|
|
209
236
|
const d = data && typeof data === "object" ? data : { accountIdx: idx };
|
|
210
237
|
const meta = d.metadata && typeof d.metadata === "object" ? d.metadata : {};
|
|
238
|
+
// Electron identities may live on the account file directly (d.accounts) or
|
|
239
|
+
// under metadata (meta.accounts / meta.gmail); resolve from whichever is set.
|
|
240
|
+
const accounts = normalizeAccounts(d.accounts || meta.accounts);
|
|
211
241
|
return {
|
|
212
242
|
id: `electron-${idx}`,
|
|
213
243
|
backend: "electron",
|
|
@@ -216,6 +246,8 @@ function electronView(idx, data) {
|
|
|
216
246
|
proxy: normalizeProxy(d.proxy),
|
|
217
247
|
logins: (Array.isArray(d.logins) ? d.logins : []).map(normalizeLogin),
|
|
218
248
|
note: typeof d.note === "string" ? d.note : meta.description || "",
|
|
249
|
+
gmail: resolveGmail(accounts, d.gmail || meta.gmail),
|
|
250
|
+
accounts,
|
|
219
251
|
partition: `persist:sandbox-${idx}`,
|
|
220
252
|
ipInfo: normalizeIpInfo(d.ipInfo),
|
|
221
253
|
};
|