bdy 1.18.7-dev → 1.18.8-dev
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/distTs/package.json
CHANGED
|
@@ -33,16 +33,15 @@ const OAUTH_CLIENT_APP_SCOPES = [
|
|
|
33
33
|
];
|
|
34
34
|
async function oauthServer(api, clientId, clientSecret) {
|
|
35
35
|
const ApiClient = require('../api/client').default;
|
|
36
|
-
const open = require('open');
|
|
37
|
-
return new Promise((resolve
|
|
36
|
+
const open = require('open').default;
|
|
37
|
+
return new Promise((resolve) => {
|
|
38
38
|
const s = node_http_1.default.createServer(async (req, res) => {
|
|
39
39
|
const url = new URL(req.url || '', `http://${OAUTH_CLIENT_APP_HOST}`);
|
|
40
40
|
const urlCode = url.searchParams.get('code');
|
|
41
41
|
if (!urlCode) {
|
|
42
42
|
res.end(texts_1.ERR_LOGIN_HTTP_FAILED);
|
|
43
43
|
s.close();
|
|
44
|
-
|
|
45
|
-
return;
|
|
44
|
+
output_1.default.exitError(texts_1.ERR_LOGIN_HTTP_FAILED);
|
|
46
45
|
}
|
|
47
46
|
const client = new ApiClient(new URL(`https://${api}`));
|
|
48
47
|
try {
|
|
@@ -57,17 +56,17 @@ async function oauthServer(api, clientId, clientSecret) {
|
|
|
57
56
|
catch {
|
|
58
57
|
res.end(texts_1.ERR_LOGIN_HTTP_FAILED);
|
|
59
58
|
s.close();
|
|
60
|
-
|
|
61
|
-
return;
|
|
59
|
+
output_1.default.exitError(texts_1.ERR_LOGIN_HTTP_FAILED);
|
|
62
60
|
}
|
|
63
61
|
});
|
|
64
62
|
s.on('error', () => {
|
|
65
63
|
s.close();
|
|
66
|
-
|
|
64
|
+
output_1.default.exitError(texts_1.ERR_LOGIN_HTTP_SERVER_PORT_TAKEN);
|
|
65
|
+
});
|
|
66
|
+
s.listen(OAUTH_CLIENT_APP_PORT, OAUTH_CLIENT_APP_HOST, () => {
|
|
67
|
+
const url = `https://${api}/oauth2/authorize?type=web_server&client_id=${encodeURIComponent(clientId)}&redirect_uri=${encodeURIComponent(OAUTH_CLIENT_APP_REDIRECT_URL)}&response_type=code&scope=${encodeURIComponent(OAUTH_CLIENT_APP_SCOPES.join(' '))}`;
|
|
68
|
+
open(url);
|
|
67
69
|
});
|
|
68
|
-
s.listen(OAUTH_CLIENT_APP_PORT, OAUTH_CLIENT_APP_HOST);
|
|
69
|
-
const url = `https://${api}/oauth2/authorize?type=web_server&client_id=${encodeURIComponent(clientId)}&redirect_uri=${encodeURIComponent(OAUTH_CLIENT_APP_REDIRECT_URL)}&response_type=code&scope=${encodeURIComponent(OAUTH_CLIENT_APP_SCOPES.join(' '))}`;
|
|
70
|
-
open(url);
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
72
|
async function getOrCreateApp(api) {
|
|
@@ -39,7 +39,7 @@ commandUtUpload.action(async (input, options) => {
|
|
|
39
39
|
});
|
|
40
40
|
exports.default = commandUtUpload;
|
|
41
41
|
function validateInputAndOptions(input, options) {
|
|
42
|
-
const z = require('zod')
|
|
42
|
+
const z = require('zod');
|
|
43
43
|
const { ZodError } = require('zod');
|
|
44
44
|
const globSchema = z.string();
|
|
45
45
|
const optionsSchema = z.object({
|