@youcan/cli-kit 1.1.0-beta.3 → 1.1.0-beta.7
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/dist/node/env.js +4 -4
- package/dist/node/session.js +3 -15
- package/package.json +1 -1
package/dist/node/env.js
CHANGED
|
@@ -11,7 +11,7 @@ function oauthClientId() {
|
|
|
11
11
|
return '8';
|
|
12
12
|
case 'prod':
|
|
13
13
|
default:
|
|
14
|
-
return '
|
|
14
|
+
return '7';
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
function oauthClientSecret() {
|
|
@@ -22,7 +22,7 @@ function oauthClientSecret() {
|
|
|
22
22
|
return '8';
|
|
23
23
|
case 'prod':
|
|
24
24
|
default:
|
|
25
|
-
return '
|
|
25
|
+
return 'eCU2eKdDyMlLf1A6LweWL6BjDMixok4IV86rUm3u';
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
function sellerAreaHostname() {
|
|
@@ -33,7 +33,7 @@ function sellerAreaHostname() {
|
|
|
33
33
|
return 'seller-area.testyoucan.shop';
|
|
34
34
|
case 'prod':
|
|
35
35
|
default:
|
|
36
|
-
return 'seller-area.
|
|
36
|
+
return 'seller-area.youcanshop.dev';
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
function apiHostname() {
|
|
@@ -44,7 +44,7 @@ function apiHostname() {
|
|
|
44
44
|
return 'api.testyoucan.shop';
|
|
45
45
|
case 'prod':
|
|
46
46
|
default:
|
|
47
|
-
return 'api.
|
|
47
|
+
return 'api.youcanshop.dev';
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
package/dist/node/session.js
CHANGED
|
@@ -79,23 +79,11 @@ async function authenticate(command) {
|
|
|
79
79
|
return existingSession;
|
|
80
80
|
}
|
|
81
81
|
const accessToken = await exchange(await authorize(command));
|
|
82
|
-
const
|
|
83
|
-
const active = stores.filter(s => s.is_active);
|
|
84
|
-
if (!active.length) {
|
|
85
|
-
throw new Error('No active stores found');
|
|
86
|
-
}
|
|
87
|
-
const { selected } = await command.prompt({
|
|
88
|
-
type: 'select',
|
|
89
|
-
name: 'selected',
|
|
90
|
-
message: 'Select a store to log into',
|
|
91
|
-
choices: active.map(s => ({ title: s.slug, value: s.store_id })),
|
|
92
|
-
});
|
|
93
|
-
const store = stores.find(s => s.store_id === selected);
|
|
94
|
-
const { token: storeAccessToken } = await post(`${apiHostname()}/switch-store/${store.store_id}`, { headers: { Authorization: `Bearer ${accessToken}` } });
|
|
82
|
+
const store = await get$1(`${apiHostname()}/me`, { headers: { Authorization: `Bearer ${accessToken}` } });
|
|
95
83
|
const session = {
|
|
96
84
|
slug: store.slug,
|
|
97
|
-
id: store.
|
|
98
|
-
access_token:
|
|
85
|
+
id: store.id,
|
|
86
|
+
access_token: accessToken,
|
|
99
87
|
};
|
|
100
88
|
manager({ projectName: 'youcan-cli' })
|
|
101
89
|
.set('store_session', session);
|
package/package.json
CHANGED