arcadible 1.0.16 → 1.0.18
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/account.js +12 -11
- package/src/phrase.js +13 -6
package/package.json
CHANGED
package/src/account.js
CHANGED
|
@@ -153,20 +153,21 @@ const getSaved = function (onRefresh) {
|
|
|
153
153
|
|
|
154
154
|
// [function]
|
|
155
155
|
|
|
156
|
-
// the account an
|
|
157
|
-
// user yet, so this is a placeholder with a real user's shape, to be
|
|
158
|
-
// by the API's answer without changing it.
|
|
156
|
+
// the account an ARCADIBLE_TOKEN stands for. The API doesn't describe a
|
|
157
|
+
// token's user yet, so this is a placeholder with a real user's shape, to be
|
|
158
|
+
// replaced by the API's answer without changing it.
|
|
159
159
|
const fromToken = function (token) {
|
|
160
160
|
return { session: { access_token: token }, token: true, user: TOKEN_USER }; // eslint-disable-line camelcase
|
|
161
161
|
};
|
|
162
162
|
|
|
163
163
|
// [function]
|
|
164
164
|
|
|
165
|
-
// the account commands use:
|
|
166
|
-
// over the saved session, or else the saved session, refreshed if
|
|
165
|
+
// the account commands use: ARCADIBLE_TOKEN when it's set, which takes
|
|
166
|
+
// precedence over the saved session, or else the saved session, refreshed if
|
|
167
|
+
// needed.
|
|
167
168
|
const get = function (onRefresh) {
|
|
168
|
-
if (process.env.
|
|
169
|
-
return Promise.resolve(fromToken(process.env.
|
|
169
|
+
if (process.env.ARCADIBLE_TOKEN) {
|
|
170
|
+
return Promise.resolve(fromToken(process.env.ARCADIBLE_TOKEN));
|
|
170
171
|
}
|
|
171
172
|
return getSaved(onRefresh);
|
|
172
173
|
};
|
|
@@ -179,8 +180,8 @@ const get = function (onRefresh) {
|
|
|
179
180
|
// this one's. A refresh tells them apart: refused, the session is over, so
|
|
180
181
|
// it's removed and the error says to log in (session_expired); renewed, the
|
|
181
182
|
// session is kept, and the request's own error stands, so running the
|
|
182
|
-
// command again works. An
|
|
183
|
-
// in doesn't change the token.
|
|
183
|
+
// command again works. An ARCADIBLE_TOKEN's refusal stays as it is, since
|
|
184
|
+
// logging in doesn't change the token.
|
|
184
185
|
const ended = function (current) {
|
|
185
186
|
return (ex) => {
|
|
186
187
|
if (
|
|
@@ -229,8 +230,8 @@ const revoke = function (session) {
|
|
|
229
230
|
// working, then removed. Never an error: a refused refresh means the session
|
|
230
231
|
// was already over, and a failure to reach the API (offline, an outage)
|
|
231
232
|
// leaves it to expire after 90 idle days, while the file is removed either
|
|
232
|
-
// way. It ends only the saved session: never an
|
|
233
|
-
// session.
|
|
233
|
+
// way. It ends only the saved session: never an ARCADIBLE_TOKEN, nor any
|
|
234
|
+
// other session.
|
|
234
235
|
const end = function () {
|
|
235
236
|
return readSaved()
|
|
236
237
|
.then((current) => {
|
package/src/phrase.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// [import]
|
|
4
4
|
|
|
5
|
+
const cfgfile = require("./config/file");
|
|
5
6
|
const cfgproduct = require("./config/product");
|
|
6
7
|
|
|
7
8
|
// [declare]
|
|
@@ -9,6 +10,14 @@ const cfgproduct = require("./config/product");
|
|
|
9
10
|
const HANDLE = cfgproduct.handle;
|
|
10
11
|
const TITLE = cfgproduct.title;
|
|
11
12
|
const TOOL = cfgproduct.tool;
|
|
13
|
+
|
|
14
|
+
// [declare]
|
|
15
|
+
|
|
16
|
+
const MANIFEST = cfgfile.MANIFEST;
|
|
17
|
+
const MEDIA = cfgfile.MEDIA;
|
|
18
|
+
|
|
19
|
+
// [declare]
|
|
20
|
+
|
|
12
21
|
const TAIL_LINES = 20;
|
|
13
22
|
|
|
14
23
|
// [function]
|
|
@@ -276,7 +285,7 @@ const errorCode = function (code) {
|
|
|
276
285
|
const gameHandleTaken = function (handle) {
|
|
277
286
|
return blocks(
|
|
278
287
|
`Handle taken: ${handle}`,
|
|
279
|
-
|
|
288
|
+
`Choose another handle in ${MANIFEST}.`,
|
|
280
289
|
);
|
|
281
290
|
};
|
|
282
291
|
|
|
@@ -286,7 +295,7 @@ const gameHandleTaken = function (handle) {
|
|
|
286
295
|
// deploy does.
|
|
287
296
|
const gameHandleChanged = function (handle, current) {
|
|
288
297
|
return blocks(
|
|
289
|
-
`The handle in
|
|
298
|
+
`The handle in ${MANIFEST} (${handle ?? "none"}) isn't the game's on ${TITLE} (${current ?? "none"}).`,
|
|
290
299
|
`Only ${cmdDeploy()} changes a handle: deploy with it, or set the handle back.`,
|
|
291
300
|
);
|
|
292
301
|
};
|
|
@@ -399,9 +408,7 @@ const portInUse = function (port) {
|
|
|
399
408
|
// what one of Arcadible's files is, for arc serve's warnings: `host`, the play
|
|
400
409
|
// page's, or a path under /arcadible/, such as sdk/v1.js.
|
|
401
410
|
const remoteName = function (name) {
|
|
402
|
-
return name === "host"
|
|
403
|
-
? "the play page's host"
|
|
404
|
-
: `/${cfgproduct.handle}/${name}`;
|
|
411
|
+
return name === "host" ? "the play page's host" : `/${HANDLE}/${name}`;
|
|
405
412
|
};
|
|
406
413
|
|
|
407
414
|
// [function]
|
|
@@ -823,7 +830,7 @@ const packagePathReserved = function (name) {
|
|
|
823
830
|
const packageTooLarge = function (size) {
|
|
824
831
|
return blocks(
|
|
825
832
|
`Package is larger than ${size} MB.`,
|
|
826
|
-
|
|
833
|
+
`${MEDIA}/ doesn't count toward it.`,
|
|
827
834
|
);
|
|
828
835
|
};
|
|
829
836
|
|