@todesktop/cli 1.13.0-0 → 1.14.0
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/README.md +56 -28
- package/dist/cli.js +123 -69
- package/dist/cli.js.map +4 -4
- package/package.json +3 -3
- package/schemas/schema.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -158,8 +158,9 @@ var init = () => {
|
|
|
158
158
|
if (hasInitialized) {
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
+
const envFile = process.env.NODE_ENV === "test" ? "../.env.test" : "../.env";
|
|
161
162
|
import_dotenv.default.config({
|
|
162
|
-
path: import_path.default.resolve(__dirname,
|
|
163
|
+
path: import_path.default.resolve(__dirname, envFile)
|
|
163
164
|
});
|
|
164
165
|
hasInitialized = true;
|
|
165
166
|
};
|
|
@@ -169,11 +170,11 @@ var getEnvironmentVariables_default = () => {
|
|
|
169
170
|
};
|
|
170
171
|
|
|
171
172
|
// src/utilities/firestore.ts
|
|
172
|
-
var import_app =
|
|
173
|
+
var import_app = require("firebase/app");
|
|
173
174
|
var import_firestore = require("firebase/firestore");
|
|
174
175
|
var import_auth = require("firebase/auth");
|
|
175
176
|
var environmentVariables = getEnvironmentVariables_default();
|
|
176
|
-
var
|
|
177
|
+
var firebaseApp = (0, import_app.initializeApp)({
|
|
177
178
|
apiKey: environmentVariables.TODESKTOP_CLI_FIREBASE_API_KEY,
|
|
178
179
|
authDomain: environmentVariables.TODESKTOP_CLI_FIREBASE_AUTH_DOMAIN,
|
|
179
180
|
databaseURL: environmentVariables.TODESKTOP_CLI_FIREBASE_DATABASE_URL,
|
|
@@ -182,14 +183,16 @@ var firebaseDB = import_app.default.initializeApp({
|
|
|
182
183
|
messagingSenderId: environmentVariables.TODESKTOP_CLI_FIREBASE_MESSAGING_SENDER_ID,
|
|
183
184
|
appId: environmentVariables.TODESKTOP_CLI_FIREBASE_ID
|
|
184
185
|
});
|
|
185
|
-
var
|
|
186
|
+
var auth = (0, import_auth.getAuth)(firebaseApp);
|
|
187
|
+
var db = (0, import_firestore.getFirestore)(firebaseApp);
|
|
188
|
+
var currentUser = () => auth.currentUser;
|
|
186
189
|
var signInWithCustomToken = async (token) => {
|
|
187
|
-
return
|
|
190
|
+
return (0, import_auth.signInWithCustomToken)(auth, token);
|
|
188
191
|
};
|
|
189
|
-
var onUserAuth = (handler) =>
|
|
192
|
+
var onUserAuth = (handler) => (0, import_auth.onAuthStateChanged)(auth, (user) => {
|
|
190
193
|
handler(user || {});
|
|
191
194
|
});
|
|
192
|
-
var firestore_default =
|
|
195
|
+
var firestore_default = db;
|
|
193
196
|
|
|
194
197
|
// src/utilities/configStore.ts
|
|
195
198
|
var fs2 = __toESM(require("fs"));
|
|
@@ -339,9 +342,6 @@ var useExit_default = () => {
|
|
|
339
342
|
const { exit } = (0, import_ink.useApp)();
|
|
340
343
|
return (error) => {
|
|
341
344
|
logger_default.debug({ error }, "Exit called");
|
|
342
|
-
firestore_default.terminate().catch(
|
|
343
|
-
(e) => logger_default.error(e)
|
|
344
|
-
);
|
|
345
345
|
let timeoutId;
|
|
346
346
|
Promise.race([
|
|
347
347
|
new Promise((resolve4) => flush(() => resolve4())),
|
|
@@ -624,14 +624,28 @@ var import_ink6 = require("ink");
|
|
|
624
624
|
var import_react4 = require("react");
|
|
625
625
|
|
|
626
626
|
// src/utilities/getCallableFirebaseFunction.ts
|
|
627
|
-
var import_firebase = __toESM(require("firebase"));
|
|
628
627
|
var import_functions = require("firebase/functions");
|
|
628
|
+
var import_app2 = require("firebase/app");
|
|
629
629
|
var env = getEnvironmentVariables_default();
|
|
630
|
+
var app = (0, import_app2.initializeApp)({
|
|
631
|
+
apiKey: env.TODESKTOP_CLI_FIREBASE_API_KEY,
|
|
632
|
+
authDomain: env.TODESKTOP_CLI_FIREBASE_AUTH_DOMAIN,
|
|
633
|
+
databaseURL: env.TODESKTOP_CLI_FIREBASE_DATABASE_URL,
|
|
634
|
+
projectId: env.TODESKTOP_CLI_FIREBASE_PROJECT_ID,
|
|
635
|
+
storageBucket: env.TODESKTOP_CLI_FIREBASE_STORAGE_BUCKET,
|
|
636
|
+
messagingSenderId: env.TODESKTOP_CLI_FIREBASE_MESSAGING_SENDER_ID,
|
|
637
|
+
appId: env.TODESKTOP_CLI_FIREBASE_ID
|
|
638
|
+
});
|
|
639
|
+
var functions = (0, import_functions.getFunctions)(app);
|
|
630
640
|
if (env.TODESKTOP_CLI_ENV === "development") {
|
|
631
641
|
const firebaseUrl = new URL(env.TODESKTOP_CLI_FIREBASE_FUNCTIONS_BASE);
|
|
632
|
-
|
|
642
|
+
(0, import_functions.connectFunctionsEmulator)(
|
|
643
|
+
functions,
|
|
644
|
+
firebaseUrl.hostname,
|
|
645
|
+
parseInt(firebaseUrl.port)
|
|
646
|
+
);
|
|
633
647
|
}
|
|
634
|
-
var getCallableFirebaseFunction_default = (functionName) =>
|
|
648
|
+
var getCallableFirebaseFunction_default = (functionName) => (0, import_functions.httpsCallable)(functions, functionName);
|
|
635
649
|
|
|
636
650
|
// src/components/CancelBuild.tsx
|
|
637
651
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -1535,8 +1549,8 @@ var schema_default = {
|
|
|
1535
1549
|
extends: {
|
|
1536
1550
|
type: "string",
|
|
1537
1551
|
minLength: 1,
|
|
1538
|
-
description: "This is the path to a base configuration file. This is especially useful for configuration sharing between staging and production
|
|
1539
|
-
examples: ["./todesktop.
|
|
1552
|
+
description: "This is the path to a base configuration file (`.json` or `.js`). This is especially useful for configuration sharing between different environments (e.g., staging and production). The base configuration file can be a relative path from the project root or an absolute path.",
|
|
1553
|
+
examples: ["./todesktop.base.json", "./todesktop.base.js"],
|
|
1540
1554
|
default: null
|
|
1541
1555
|
},
|
|
1542
1556
|
extraContentFiles: { $ref: "#/definitions/extraContentFilesProperty" },
|
|
@@ -2496,10 +2510,10 @@ You can disable this error by running todesktop build with the --ignore-extends-
|
|
|
2496
2510
|
function getProjectConfig(configPath, flags) {
|
|
2497
2511
|
if (!configPath) {
|
|
2498
2512
|
logger_default.debug("No config path provided, searching for one");
|
|
2499
|
-
configPath = import_find_up.default.sync("todesktop.json");
|
|
2513
|
+
configPath = import_find_up.default.sync(["todesktop.json", "todesktop.js"]);
|
|
2500
2514
|
if (!configPath) {
|
|
2501
2515
|
throw new Error(
|
|
2502
|
-
"Can not find todesktop.json in this folder or any parent folders"
|
|
2516
|
+
"Can not find todesktop.json or todesktop.js in this folder or any parent folders"
|
|
2503
2517
|
);
|
|
2504
2518
|
}
|
|
2505
2519
|
} else {
|
|
@@ -2583,6 +2597,7 @@ var getVersionControlInfo_default = async (directory) => {
|
|
|
2583
2597
|
|
|
2584
2598
|
// src/commands/build/utilities/spyBuild.ts
|
|
2585
2599
|
var import_events = __toESM(require("events"));
|
|
2600
|
+
var import_firestore3 = require("firebase/firestore");
|
|
2586
2601
|
function spyBuild() {
|
|
2587
2602
|
const emitter = new import_events.default();
|
|
2588
2603
|
let unsubscribeSnapshot;
|
|
@@ -2609,9 +2624,10 @@ function spyBuild() {
|
|
|
2609
2624
|
userId
|
|
2610
2625
|
}) {
|
|
2611
2626
|
const buildPath = `users/${userId}/applications/${appId}/builds/${buildId}`;
|
|
2612
|
-
unsubscribeSnapshot =
|
|
2627
|
+
unsubscribeSnapshot = (0, import_firestore3.onSnapshot)(
|
|
2628
|
+
(0, import_firestore3.doc)(firestore_default, buildPath),
|
|
2613
2629
|
(snapshot) => {
|
|
2614
|
-
latestBuildDoc = snapshot.exists ? snapshot.data() : void 0;
|
|
2630
|
+
latestBuildDoc = snapshot.exists() ? snapshot.data() : void 0;
|
|
2615
2631
|
emitter.emit("update", {
|
|
2616
2632
|
build: latestBuildDoc,
|
|
2617
2633
|
snapshot
|
|
@@ -2686,9 +2702,10 @@ var uploadToS3 = async ({
|
|
|
2686
2702
|
}
|
|
2687
2703
|
}) => {
|
|
2688
2704
|
const getSignedURL = getCallableFirebaseFunction_default("getSignedURL");
|
|
2689
|
-
const
|
|
2705
|
+
const result = await getSignedURL({
|
|
2690
2706
|
key
|
|
2691
2707
|
});
|
|
2708
|
+
const data = result.data;
|
|
2692
2709
|
const parts = await (0, import_stream_to_array.default)(inputStream);
|
|
2693
2710
|
const buffers = parts.map(
|
|
2694
2711
|
(part) => Buffer.isBuffer(part) ? part : Buffer.from(part)
|
|
@@ -3543,29 +3560,37 @@ var import_prop_types10 = __toESM(require("prop-types"));
|
|
|
3543
3560
|
var import_react11 = require("react");
|
|
3544
3561
|
|
|
3545
3562
|
// src/utilities/getLatestBuildId.ts
|
|
3563
|
+
var import_firestore8 = require("firebase/firestore");
|
|
3546
3564
|
async function getLatestBuildId({
|
|
3547
3565
|
appId,
|
|
3548
3566
|
userId
|
|
3549
3567
|
}) {
|
|
3550
3568
|
logger_default.debug({ appId }, "getLatestBuildId");
|
|
3551
|
-
const appRef =
|
|
3552
|
-
const appSnapshot = await
|
|
3553
|
-
if (!appSnapshot.exists) {
|
|
3569
|
+
const appRef = (0, import_firestore8.doc)(firestore_default, `users/${userId}/applications/${appId}`);
|
|
3570
|
+
const appSnapshot = await (0, import_firestore8.getDoc)(appRef);
|
|
3571
|
+
if (!appSnapshot.exists()) {
|
|
3554
3572
|
throw new Error(`Application with ID of ${appId} doesn't exist.`);
|
|
3555
3573
|
}
|
|
3556
|
-
const
|
|
3574
|
+
const buildsQuery = (0, import_firestore8.query)(
|
|
3575
|
+
(0, import_firestore8.collection)(firestore_default, `users/${userId}/applications/${appId}/builds`),
|
|
3576
|
+
(0, import_firestore8.orderBy)("createdAt", "desc"),
|
|
3577
|
+
(0, import_firestore8.limit)(1)
|
|
3578
|
+
);
|
|
3579
|
+
const buildsResult = await (0, import_firestore8.getDocs)(buildsQuery);
|
|
3557
3580
|
return buildsResult.empty ? void 0 : buildsResult.docs[0].id;
|
|
3558
3581
|
}
|
|
3559
3582
|
|
|
3560
3583
|
// src/utilities/subscribeToFirebaseDoc.ts
|
|
3584
|
+
var import_firestore10 = require("firebase/firestore");
|
|
3561
3585
|
async function subscribeToFirebaseDoc(key, receiver) {
|
|
3562
3586
|
return new Promise((resolve4, reject) => {
|
|
3563
3587
|
logger_default.debug({ key }, "subscribeToFirebaseDoc");
|
|
3564
|
-
const unsubscribe =
|
|
3588
|
+
const unsubscribe = (0, import_firestore10.onSnapshot)(
|
|
3589
|
+
(0, import_firestore10.doc)(firestore_default, key),
|
|
3565
3590
|
(snapshot) => {
|
|
3566
3591
|
receiver({
|
|
3567
3592
|
snapshot,
|
|
3568
|
-
data: snapshot.exists ? snapshot.data() : void 0
|
|
3593
|
+
data: snapshot.exists() ? snapshot.data() : void 0
|
|
3569
3594
|
});
|
|
3570
3595
|
resolve4(unsubscribe);
|
|
3571
3596
|
},
|
|
@@ -3592,14 +3617,14 @@ var subscribeToBuild_default = async ({ appId, buildId, onDataReceived, userId }
|
|
|
3592
3617
|
};
|
|
3593
3618
|
|
|
3594
3619
|
// src/utilities/findAppUserId.ts
|
|
3595
|
-
var
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3620
|
+
var import_firestore12 = require("firebase/firestore");
|
|
3621
|
+
var getCollection = async (collectionRef) => {
|
|
3622
|
+
const resp = await (0, import_firestore12.getDocs)(collectionRef);
|
|
3623
|
+
const result = [];
|
|
3624
|
+
resp.forEach((doc9) => result.push(doc9.data()));
|
|
3625
|
+
return result;
|
|
3601
3626
|
};
|
|
3602
|
-
var acceptedUsersCollection = (id) =>
|
|
3627
|
+
var acceptedUsersCollection = (id) => (0, import_firestore12.collection)(firestore_default, `users/${id}/acceptedUsers`);
|
|
3603
3628
|
var findAppUserId = async (appId) => {
|
|
3604
3629
|
const { uid, email } = currentUser();
|
|
3605
3630
|
const acceptedUsers = await getCollection(acceptedUsersCollection(uid));
|
|
@@ -3610,8 +3635,9 @@ var findAppUserId = async (appId) => {
|
|
|
3610
3635
|
];
|
|
3611
3636
|
for (const user of users) {
|
|
3612
3637
|
try {
|
|
3613
|
-
const
|
|
3614
|
-
|
|
3638
|
+
const docRef = (0, import_firestore12.doc)(firestore_default, `users/${user.id}/applications/${appId}`);
|
|
3639
|
+
const docSnap = await (0, import_firestore12.getDoc)(docRef);
|
|
3640
|
+
if (docSnap.exists())
|
|
3615
3641
|
return user;
|
|
3616
3642
|
} catch (err) {
|
|
3617
3643
|
console.error(err);
|
|
@@ -3782,6 +3808,7 @@ ViewBuild.propTypes = {
|
|
|
3782
3808
|
var ViewBuild_default = ViewBuild;
|
|
3783
3809
|
|
|
3784
3810
|
// src/commands/build/components/OngoingBuildGuard.tsx
|
|
3811
|
+
var import_firestore14 = require("firebase/firestore");
|
|
3785
3812
|
var import_is_ci5 = __toESM(require("is-ci"));
|
|
3786
3813
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3787
3814
|
var OngoingBuildGuard = ({
|
|
@@ -3811,7 +3838,16 @@ var OngoingBuildGuard = ({
|
|
|
3811
3838
|
const twentyFourHoursAgo = new Date(
|
|
3812
3839
|
now.getTime() - 24 * 60 * 60 * 1e3
|
|
3813
3840
|
);
|
|
3814
|
-
const
|
|
3841
|
+
const buildsQuery = (0, import_firestore14.query)(
|
|
3842
|
+
(0, import_firestore14.collection)(
|
|
3843
|
+
firestore_default,
|
|
3844
|
+
`users/${id}/applications/${applicationId}/builds`
|
|
3845
|
+
),
|
|
3846
|
+
(0, import_firestore14.where)("createdAt", ">=", twentyFourHoursAgo),
|
|
3847
|
+
(0, import_firestore14.orderBy)("createdAt", "desc"),
|
|
3848
|
+
(0, import_firestore14.limit)(10)
|
|
3849
|
+
);
|
|
3850
|
+
const buildsResult = await (0, import_firestore14.getDocs)(buildsQuery);
|
|
3815
3851
|
const stateUpdates = {
|
|
3816
3852
|
appId: applicationId,
|
|
3817
3853
|
isLoading: false,
|
|
@@ -3824,7 +3860,7 @@ var OngoingBuildGuard = ({
|
|
|
3824
3860
|
{ isRunning },
|
|
3825
3861
|
"OngoingBuildGuard component: got latest build"
|
|
3826
3862
|
);
|
|
3827
|
-
stateUpdates.builds = buildsResult.docs.map((
|
|
3863
|
+
stateUpdates.builds = buildsResult.docs.map((doc9) => doc9.data()).filter((build) => {
|
|
3828
3864
|
if (isBuildRunning(build) && build.status !== "preparation") {
|
|
3829
3865
|
return true;
|
|
3830
3866
|
}
|
|
@@ -4184,31 +4220,35 @@ var capitalize_default = (input) => {
|
|
|
4184
4220
|
};
|
|
4185
4221
|
|
|
4186
4222
|
// src/utilities/getBuilds.ts
|
|
4223
|
+
var import_firestore17 = require("firebase/firestore");
|
|
4187
4224
|
async function getBuilds({
|
|
4188
|
-
addWhereClauses = (
|
|
4225
|
+
addWhereClauses = () => [],
|
|
4189
4226
|
userId,
|
|
4190
4227
|
appId,
|
|
4191
|
-
limit = 5,
|
|
4228
|
+
limit: limit4 = 5,
|
|
4192
4229
|
startAfter = null
|
|
4193
4230
|
}) {
|
|
4194
|
-
logger_default.debug({ appId, limit, startAfter }, "getBuilds");
|
|
4195
|
-
const appRef =
|
|
4196
|
-
const appSnapshot = await
|
|
4197
|
-
if (!appSnapshot.exists) {
|
|
4231
|
+
logger_default.debug({ appId, limit: limit4, startAfter }, "getBuilds");
|
|
4232
|
+
const appRef = (0, import_firestore17.doc)(firestore_default, `users/${userId}/applications/${appId}`);
|
|
4233
|
+
const appSnapshot = await (0, import_firestore17.getDoc)(appRef);
|
|
4234
|
+
if (!appSnapshot.exists()) {
|
|
4198
4235
|
throw new Error(`Application with ID of ${appId} doesn't exist.`);
|
|
4199
4236
|
}
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4237
|
+
const buildsCollection = (0, import_firestore17.collection)(
|
|
4238
|
+
firestore_default,
|
|
4239
|
+
`users/${userId}/applications/${appId}/builds`
|
|
4203
4240
|
);
|
|
4241
|
+
const constraints = [...addWhereClauses(), (0, import_firestore17.orderBy)("createdAt", "desc")];
|
|
4204
4242
|
if (startAfter) {
|
|
4205
|
-
|
|
4243
|
+
constraints.push((0, import_firestore17.startAfter)(startAfter));
|
|
4206
4244
|
}
|
|
4207
|
-
|
|
4245
|
+
constraints.push((0, import_firestore17.limit)(limit4));
|
|
4246
|
+
const query4 = (0, import_firestore17.query)(buildsCollection, ...constraints);
|
|
4247
|
+
const buildsResult = await (0, import_firestore17.getDocs)(query4);
|
|
4208
4248
|
if (buildsResult.empty) {
|
|
4209
4249
|
return [];
|
|
4210
4250
|
}
|
|
4211
|
-
return buildsResult.docs.map((
|
|
4251
|
+
return buildsResult.docs.map((doc9) => doc9.data());
|
|
4212
4252
|
}
|
|
4213
4253
|
|
|
4214
4254
|
// src/utilities/getRelativeDateFromDateString.ts
|
|
@@ -4510,6 +4550,7 @@ var LogoutCommand_default = LogoutWrapper;
|
|
|
4510
4550
|
// src/components/BuildPicker.tsx
|
|
4511
4551
|
var import_ink29 = require("ink");
|
|
4512
4552
|
var import_react17 = require("react");
|
|
4553
|
+
var import_firestore23 = require("firebase/firestore");
|
|
4513
4554
|
|
|
4514
4555
|
// src/components/SelectTable.tsx
|
|
4515
4556
|
var import_ink28 = require("ink");
|
|
@@ -4575,15 +4616,21 @@ SelectTable.propTypes = {
|
|
|
4575
4616
|
};
|
|
4576
4617
|
var SelectTable_default = SelectTable;
|
|
4577
4618
|
|
|
4619
|
+
// src/utilities/getLatestReleasedBuild.ts
|
|
4620
|
+
var import_firestore21 = require("firebase/firestore");
|
|
4621
|
+
|
|
4578
4622
|
// src/utilities/getBuildById.ts
|
|
4623
|
+
var import_firestore19 = require("firebase/firestore");
|
|
4579
4624
|
async function getBuildById({
|
|
4580
4625
|
appId,
|
|
4581
4626
|
buildId,
|
|
4582
4627
|
userId
|
|
4583
4628
|
}) {
|
|
4584
4629
|
logger_default.debug({ appId, buildId }, "getBuildById");
|
|
4585
|
-
const snapshot = await
|
|
4586
|
-
|
|
4630
|
+
const snapshot = await (0, import_firestore19.getDoc)(
|
|
4631
|
+
(0, import_firestore19.doc)(firestore_default, `users/${userId}/applications/${appId}/builds/${buildId}`)
|
|
4632
|
+
);
|
|
4633
|
+
if (!snapshot.exists()) {
|
|
4587
4634
|
return null;
|
|
4588
4635
|
}
|
|
4589
4636
|
return snapshot.data();
|
|
@@ -4595,21 +4642,26 @@ async function getLatestReleasedBuild({
|
|
|
4595
4642
|
userId
|
|
4596
4643
|
}) {
|
|
4597
4644
|
var _a, _b;
|
|
4598
|
-
const appRef =
|
|
4599
|
-
const appSnapshot = await
|
|
4600
|
-
const
|
|
4601
|
-
if (!
|
|
4645
|
+
const appRef = (0, import_firestore21.doc)(firestore_default, `users/${userId}/applications/${appId}`);
|
|
4646
|
+
const appSnapshot = await (0, import_firestore21.getDoc)(appRef);
|
|
4647
|
+
const app2 = appSnapshot.exists() ? appSnapshot.data() : void 0;
|
|
4648
|
+
if (!app2) {
|
|
4602
4649
|
throw new Error(`Application with ID of ${appId} doesn't exist.`);
|
|
4603
4650
|
}
|
|
4604
|
-
if ((_a =
|
|
4651
|
+
if ((_a = app2.meta) == null ? void 0 : _a.latestReleaseBuildId) {
|
|
4605
4652
|
return await getBuildById({
|
|
4606
|
-
buildId: (_b =
|
|
4653
|
+
buildId: (_b = app2.meta) == null ? void 0 : _b.latestReleaseBuildId,
|
|
4607
4654
|
appId,
|
|
4608
4655
|
userId
|
|
4609
4656
|
}) || void 0;
|
|
4610
4657
|
}
|
|
4611
|
-
const
|
|
4612
|
-
|
|
4658
|
+
const buildsQuery = (0, import_firestore21.query)(
|
|
4659
|
+
(0, import_firestore21.collection)(firestore_default, `users/${userId}/applications/${appId}/builds`),
|
|
4660
|
+
(0, import_firestore21.orderBy)("releasedAt", "desc"),
|
|
4661
|
+
(0, import_firestore21.limit)(1)
|
|
4662
|
+
);
|
|
4663
|
+
const buildsResult = await (0, import_firestore21.getDocs)(buildsQuery);
|
|
4664
|
+
return buildsResult.empty ? void 0 : buildsResult.docs[0].data();
|
|
4613
4665
|
}
|
|
4614
4666
|
|
|
4615
4667
|
// src/components/BuildPicker.tsx
|
|
@@ -4732,7 +4784,7 @@ async function getBuildItems({
|
|
|
4732
4784
|
const { id: userId, label: userName } = await findAppUserId_default(appId);
|
|
4733
4785
|
const latestReleasedBuild = await getLatestReleasedBuild({ appId, userId });
|
|
4734
4786
|
const rawBuilds = await getBuilds({
|
|
4735
|
-
addWhereClauses: (
|
|
4787
|
+
addWhereClauses: () => [(0, import_firestore23.where)("status", "==", "succeeded")],
|
|
4736
4788
|
appId,
|
|
4737
4789
|
limit: 50,
|
|
4738
4790
|
userId
|
|
@@ -4802,7 +4854,7 @@ async function releaseBuild({
|
|
|
4802
4854
|
}
|
|
4803
4855
|
function isFirebaseFunctionError(error) {
|
|
4804
4856
|
return Boolean(
|
|
4805
|
-
typeof error === "object" && error && "code" in error && error.code === "string"
|
|
4857
|
+
typeof error === "object" && error && "code" in error && typeof error.code === "string"
|
|
4806
4858
|
);
|
|
4807
4859
|
}
|
|
4808
4860
|
|
|
@@ -5629,6 +5681,7 @@ async function queueSmokeTest({
|
|
|
5629
5681
|
}
|
|
5630
5682
|
|
|
5631
5683
|
// src/commands/smoke-test/utilities/waitUntilFinished.ts
|
|
5684
|
+
var import_firestore27 = require("firebase/firestore");
|
|
5632
5685
|
async function waitUntilFinished({
|
|
5633
5686
|
appId,
|
|
5634
5687
|
buildId,
|
|
@@ -5637,9 +5690,10 @@ async function waitUntilFinished({
|
|
|
5637
5690
|
}) {
|
|
5638
5691
|
const docPath = `users/${userId}/applications/${appId}/builds/${buildId}`;
|
|
5639
5692
|
return new Promise((resolve4, reject) => {
|
|
5640
|
-
const unsubscribe =
|
|
5693
|
+
const unsubscribe = (0, import_firestore27.onSnapshot)(
|
|
5694
|
+
(0, import_firestore27.doc)(firestore_default, docPath),
|
|
5641
5695
|
(snapshot) => {
|
|
5642
|
-
const data = snapshot.exists ? snapshot.data() : void 0;
|
|
5696
|
+
const data = snapshot.exists() ? snapshot.data() : void 0;
|
|
5643
5697
|
const progress = makeProgress(data);
|
|
5644
5698
|
onProgress(progress);
|
|
5645
5699
|
if (progress.isFinished) {
|
|
@@ -5790,17 +5844,17 @@ var import_ink38 = require("ink");
|
|
|
5790
5844
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5791
5845
|
var WhoAmI = () => {
|
|
5792
5846
|
const exit = useExit_default();
|
|
5793
|
-
const
|
|
5847
|
+
const auth2 = getAuthConfig();
|
|
5794
5848
|
const { hasAttemptedTracking } = useAnalyticsCommand("whoami", {}, {});
|
|
5795
5849
|
(0, import_react23.useEffect)(() => {
|
|
5796
5850
|
if (hasAttemptedTracking) {
|
|
5797
5851
|
exit();
|
|
5798
5852
|
}
|
|
5799
5853
|
}, [exit, hasAttemptedTracking]);
|
|
5800
|
-
if (!
|
|
5854
|
+
if (!auth2 || !auth2.email) {
|
|
5801
5855
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_ink38.Text, { children: "You're not signed in" });
|
|
5802
5856
|
}
|
|
5803
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_ink38.Text, { children:
|
|
5857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_ink38.Text, { children: auth2.email });
|
|
5804
5858
|
};
|
|
5805
5859
|
var WhoAmIWrapper = () => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ErrorBoundary_default, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(LoginHOC_default, { isInteractive: false, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WhoAmI, {}) }) });
|
|
5806
5860
|
var WhoamiCommand_default = WhoAmIWrapper;
|
|
@@ -5843,7 +5897,7 @@ var package_default = {
|
|
|
5843
5897
|
access: "public"
|
|
5844
5898
|
},
|
|
5845
5899
|
name: "@todesktop/cli",
|
|
5846
|
-
version: "1.
|
|
5900
|
+
version: "1.13.0",
|
|
5847
5901
|
license: "MIT",
|
|
5848
5902
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
5849
5903
|
homepage: "https://todesktop.com/cli",
|
|
@@ -5854,7 +5908,7 @@ var package_default = {
|
|
|
5854
5908
|
todesktop: "./dist/cli.js"
|
|
5855
5909
|
},
|
|
5856
5910
|
engines: {
|
|
5857
|
-
node: ">=
|
|
5911
|
+
node: ">=16"
|
|
5858
5912
|
},
|
|
5859
5913
|
scripts: {
|
|
5860
5914
|
dev: "cp-cli dev.env .env && npm run build:dev && npm link",
|
|
@@ -5900,7 +5954,7 @@ var package_default = {
|
|
|
5900
5954
|
"fast-glob": "^3.2.4",
|
|
5901
5955
|
"final-form": "^4.20.1",
|
|
5902
5956
|
"find-up": "^5.0.0",
|
|
5903
|
-
firebase: "^
|
|
5957
|
+
firebase: "^11.9.1",
|
|
5904
5958
|
"git-rev-sync": "^3.0.2",
|
|
5905
5959
|
ink: "^3.2.0",
|
|
5906
5960
|
"ink-gradient": "^2.0.0",
|