arcadible 0.1.17 → 0.1.19

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.
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // [import]
5
+
6
+ const path = require("node:path");
7
+
8
+ // [import]
9
+
10
+ const hideBin = require("yargs/helpers").hideBin;
11
+ const yargs = require("yargs/yargs");
12
+
13
+ // [import]
14
+
15
+ const count = require("../src/cli/count");
16
+ const log = require("../src/util/log");
17
+ const output = require("../src/util/output");
18
+ const pkg = require("../package.json");
19
+ const rc = require("../src/util/rc");
20
+
21
+ // [use]
22
+
23
+ const findRc = rc.findRc;
24
+ const print = output.print;
25
+ const resolve = path.resolve;
26
+
27
+ // [declare]
28
+
29
+ const CMD = "arc";
30
+ const SUBCMD = "count";
31
+
32
+ // [define]
33
+
34
+ const conf = {
35
+ game: "self",
36
+ json: false,
37
+ selector: "",
38
+ ...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
39
+ };
40
+
41
+ // [function]
42
+
43
+ const start = function (argv) {
44
+ const json = argv.json;
45
+ const selector = argv.selector;
46
+ return count({
47
+ game: argv.game,
48
+ root: resolve(process.cwd(), argv.cwd),
49
+ selector,
50
+ })
51
+ .then((data) => {
52
+ print(data, { key: selector, toml: !json });
53
+ })
54
+ .catch((ex) => {
55
+ const message = ex.message;
56
+ if (json) {
57
+ print({ error: { message } });
58
+ } else {
59
+ log.hd("Count aborted.");
60
+ log.p(message);
61
+ }
62
+ process.exit(1);
63
+ });
64
+ };
65
+
66
+ // [function]
67
+
68
+ const main = function (argv) {
69
+ return start(
70
+ yargs(hideBin(argv))
71
+ .scriptName(`${CMD} ${SUBCMD}`)
72
+ .usage("$0 [selector] [options]")
73
+ .command("$0 [selector]", false, (cli) =>
74
+ cli.positional("selector", {
75
+ default: conf.selector,
76
+ describe: "Property selector",
77
+ type: "string",
78
+ }),
79
+ )
80
+ .option("game", {
81
+ alias: "g",
82
+ default: conf.game,
83
+ describe: "Game handle or ID",
84
+ type: "string",
85
+ })
86
+ .option("json", {
87
+ alias: "j",
88
+ default: conf.json,
89
+ describe: "Format output as JSON",
90
+ type: "boolean",
91
+ })
92
+ .option("cwd", {
93
+ alias: "C",
94
+ default: ".",
95
+ describe: "Set the working directory",
96
+ type: "string",
97
+ })
98
+ .help("help")
99
+ .alias("help", "h")
100
+ .version(pkg.version)
101
+ .alias("version", "v")
102
+ .strict()
103
+ .parse(),
104
+ );
105
+ };
106
+
107
+ // [main]
108
+
109
+ if (require.main === module) {
110
+ main(process.argv);
111
+ }
112
+
113
+ // [export]
114
+
115
+ module.exports = { main };
@@ -33,7 +33,9 @@ const main = function (argv) {
33
33
  .command("init", "Initialize a project")
34
34
  .command("validate", "Validate project workspace")
35
35
  .command("deploy", "Deploy to Arcadible")
36
- .command("inspect", "Inspect project metadata")
36
+ .command("inspect", "Inspect project")
37
+ .command("count", "Show game counts")
38
+ .command("play", "Play a game")
37
39
  .command("login", "Log in to Arcadible")
38
40
  .command("logout", "Log out of Arcadible")
39
41
  .command("whoami", "Show Arcadible account")
@@ -32,8 +32,9 @@ const SUBCMD = "inspect";
32
32
  // [define]
33
33
 
34
34
  const conf = {
35
+ game: "self",
35
36
  json: false,
36
- key: "",
37
+ selector: "",
37
38
  ...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
38
39
  };
39
40
 
@@ -41,13 +42,14 @@ const conf = {
41
42
 
42
43
  const start = function (argv) {
43
44
  const json = argv.json;
44
- const key = argv.key;
45
+ const selector = argv.selector;
45
46
  return inspect({
46
- key,
47
+ game: argv.game,
47
48
  root: resolve(process.cwd(), argv.cwd),
49
+ selector,
48
50
  })
49
51
  .then((data) => {
50
- print(data, { key, toml: !json });
52
+ print(data, { key: selector, toml: !json });
51
53
  })
52
54
  .catch((ex) => {
53
55
  const message = ex.message;
@@ -67,14 +69,20 @@ const main = function (argv) {
67
69
  return start(
68
70
  yargs(hideBin(argv))
69
71
  .scriptName(`${CMD} ${SUBCMD}`)
70
- .usage("$0 [key] [options]")
71
- .command("$0 [key]", false, (cli) =>
72
- cli.positional("key", {
73
- default: conf.key,
74
- describe: "Metadata key",
72
+ .usage("$0 [selector] [options]")
73
+ .command("$0 [selector]", false, (cli) =>
74
+ cli.positional("selector", {
75
+ default: conf.selector,
76
+ describe: "Property selector",
75
77
  type: "string",
76
78
  }),
77
79
  )
80
+ .option("game", {
81
+ alias: "g",
82
+ default: conf.game,
83
+ describe: "Game handle or ID",
84
+ type: "string",
85
+ })
78
86
  .option("json", {
79
87
  alias: "j",
80
88
  default: conf.json,
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // [import]
5
+
6
+ const path = require("node:path");
7
+
8
+ // [import]
9
+
10
+ const hideBin = require("yargs/helpers").hideBin;
11
+ const yargs = require("yargs/yargs");
12
+
13
+ // [import]
14
+
15
+ const log = require("../src/util/log");
16
+ const pkg = require("../package.json");
17
+ const play = require("../src/cli/play");
18
+ const rc = require("../src/util/rc");
19
+
20
+ // [use]
21
+
22
+ const findRc = rc.findRc;
23
+ const resolve = path.resolve;
24
+
25
+ // [declare]
26
+
27
+ const CMD = "arc";
28
+ const SUBCMD = "play";
29
+
30
+ // [define]
31
+
32
+ const conf = {
33
+ browser: true,
34
+ game: "self",
35
+ ...findRc(CMD, SUBCMD, process.argv, ["--cwd", "-C"]),
36
+ };
37
+
38
+ // [function]
39
+
40
+ const start = function (argv) {
41
+ return play({
42
+ browser: argv.browser,
43
+ game: argv.game,
44
+ root: resolve(process.cwd(), argv.cwd),
45
+ }).catch((ex) => {
46
+ log.hd("Play aborted.");
47
+ log.p(ex.message);
48
+ process.exit(1);
49
+ });
50
+ };
51
+
52
+ // [function]
53
+
54
+ const main = function (argv) {
55
+ return start(
56
+ yargs(hideBin(argv))
57
+ .scriptName(`${CMD} ${SUBCMD}`)
58
+ .usage("$0 [options]")
59
+ .option("game", {
60
+ alias: "g",
61
+ default: conf.game,
62
+ describe: "Game handle or ID",
63
+ type: "string",
64
+ })
65
+ .option("browser", {
66
+ default: conf.browser,
67
+ describe: "Open in a web browser",
68
+ type: "boolean",
69
+ })
70
+ .option("cwd", {
71
+ alias: "C",
72
+ default: ".",
73
+ describe: "Set the working directory",
74
+ type: "string",
75
+ })
76
+ .help("help")
77
+ .alias("help", "h")
78
+ .version(pkg.version)
79
+ .alias("version", "v")
80
+ .strict()
81
+ .parse(),
82
+ );
83
+ };
84
+
85
+ // [main]
86
+
87
+ if (require.main === module) {
88
+ main(process.argv);
89
+ }
90
+
91
+ // [export]
92
+
93
+ module.exports = { main };
package/package.json CHANGED
@@ -2,12 +2,14 @@
2
2
  "bin": {
3
3
  "arc": "bin/arc.js",
4
4
  "arc-build": "bin/arc-build.js",
5
+ "arc-count": "bin/arc-count.js",
5
6
  "arc-deploy": "bin/arc-deploy.js",
6
7
  "arc-init": "bin/arc-init.js",
7
8
  "arc-inspect": "bin/arc-inspect.js",
8
9
  "arc-login": "bin/arc-login.js",
9
10
  "arc-logout": "bin/arc-logout.js",
10
11
  "arc-pack": "bin/arc-pack.js",
12
+ "arc-play": "bin/arc-play.js",
11
13
  "arc-predeploy": "bin/arc-predeploy.js",
12
14
  "arc-validate": "bin/arc-validate.js",
13
15
  "arc-whoami": "bin/arc-whoami.js"
@@ -41,12 +43,14 @@
41
43
  },
42
44
  "exports": {
43
45
  "./build": "./src/cli/build.js",
46
+ "./count": "./src/cli/count.js",
44
47
  "./deploy": "./src/cli/deploy.js",
45
48
  "./init": "./src/cli/init.js",
46
49
  "./inspect": "./src/cli/inspect.js",
47
50
  "./login": "./src/cli/login.js",
48
51
  "./logout": "./src/cli/logout.js",
49
52
  "./pack": "./src/cli/pack.js",
53
+ "./play": "./src/cli/play.js",
50
54
  "./predeploy": "./src/cli/predeploy.js",
51
55
  "./validate": "./src/cli/validate.js",
52
56
  "./whoami": "./src/cli/whoami.js"
@@ -58,5 +62,5 @@
58
62
  "license": "Apache-2.0",
59
63
  "main": "./src/cli/index.js",
60
64
  "name": "arcadible",
61
- "version": "0.1.17"
65
+ "version": "0.1.19"
62
66
  }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ // [import]
4
+
5
+ const dotProp = require("dot-prop");
6
+
7
+ // [import]
8
+
9
+ const api = require("../../api");
10
+ const media = require("./media");
11
+ const phrase = require("../../phrase");
12
+ const project = require("../../parser/project");
13
+
14
+ // [function]
15
+
16
+ const inspect = function (proj, key) {
17
+ return key ? dotProp.get(proj, key, null) : proj;
18
+ };
19
+
20
+ // [function]
21
+
22
+ const main = function ({ game, root, selector }) {
23
+ if (!game || game === "self") {
24
+ return project(root).then((proj) => inspect(proj, selector));
25
+ }
26
+ return api
27
+ .discoverGameBuilds(game, {
28
+ channel: "production",
29
+ select: "manifest",
30
+ })
31
+ .then((builds) => {
32
+ if (!builds.length) {
33
+ throw new Error(phrase.noProductionBuild(game));
34
+ }
35
+ const manifest = builds[0].manifest || {};
36
+ if (manifest.game) {
37
+ media.dehydrate(manifest.game);
38
+ }
39
+ return inspect(manifest, selector);
40
+ });
41
+ };
42
+
43
+ // [export]
44
+
45
+ module.exports = main;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ // [declare]
4
+
5
+ const ART = [
6
+ "banner",
7
+ "banner_video",
8
+ "cover",
9
+ "cover_video",
10
+ "icon",
11
+ "icon_video",
12
+ "poster",
13
+ "poster_video",
14
+ "wordmark",
15
+ "wordmark_animated",
16
+ ];
17
+
18
+ // [declare]
19
+
20
+ const MEDIA = ".arcadible";
21
+
22
+ // [function]
23
+
24
+ const dehydrate = function (game) {
25
+ for (const key of ART) {
26
+ const media = game[key];
27
+ if (media && typeof media === "object" && media.src) {
28
+ const index = media.src.indexOf(MEDIA);
29
+ if (index !== -1) {
30
+ game[key] = media.src.slice(index);
31
+ }
32
+ }
33
+ }
34
+ return game;
35
+ };
36
+
37
+ // [export]
38
+
39
+ module.exports = { dehydrate };
@@ -6,6 +6,9 @@ const dotProp = require("dot-prop");
6
6
 
7
7
  // [import]
8
8
 
9
+ const api = require("../../api");
10
+ const media = require("./media");
11
+ const phrase = require("../../phrase");
9
12
  const project = require("../../parser/project");
10
13
 
11
14
  // [function]
@@ -16,8 +19,25 @@ const inspect = function (proj, key) {
16
19
 
17
20
  // [function]
18
21
 
19
- const main = function ({ key, root }) {
20
- return project(root).then((proj) => inspect(proj, key));
22
+ const main = function ({ game, root, selector }) {
23
+ if (!game || game === "self") {
24
+ return project(root).then((proj) => inspect(proj, selector));
25
+ }
26
+ return api
27
+ .discoverGameBuilds(game, {
28
+ channel: "production",
29
+ select: "manifest",
30
+ })
31
+ .then((builds) => {
32
+ if (!builds.length) {
33
+ throw new Error(phrase.noProductionBuild(game));
34
+ }
35
+ const manifest = builds[0].manifest || {};
36
+ if (manifest.game) {
37
+ media.dehydrate(manifest.game);
38
+ }
39
+ return inspect(manifest, selector);
40
+ });
21
41
  };
22
42
 
23
43
  // [export]
@@ -31,16 +31,16 @@ const POLL = {
31
31
 
32
32
  const postFlow = function ({ expiresAt, secret, type }) {
33
33
  const form = new FormData();
34
- form.append("expires_at", expiresAt.toISOString());
35
34
  form.append("secret", secret);
36
35
  form.append("type", type);
36
+ form.append("expires_at", expiresAt.toISOString());
37
37
  return api.postFlow(form);
38
38
  };
39
39
 
40
40
  // [function]
41
41
 
42
- const getFlow = function ({ id, secret: token }) {
43
- return api.getFlow(id, { token });
42
+ const flow = function ({ id, secret: token }) {
43
+ return api.flow(id, { token });
44
44
  };
45
45
 
46
46
  // [function]
@@ -56,8 +56,8 @@ const createFlow = function ({ expiresAt, secret, type }, onLoginCreated) {
56
56
 
57
57
  // [function]
58
58
 
59
- const pollFlow = function ({ id, secret }, onLoginPoll) {
60
- return getFlow({ id, secret }).then(({ data, status }) => {
59
+ const pollFlow = function (value, onLoginPoll) {
60
+ return flow(value).then(({ data, status }) => {
61
61
  if (onLoginPoll) {
62
62
  onLoginPoll({ status });
63
63
  }
@@ -89,7 +89,7 @@ const main = function ({ onLoginCreated, onLoginPoll }) {
89
89
  ).then(({ id }) => {
90
90
  const timeout = Math.max(0, expiresAt.getTime() - Date.now() - time.s(15));
91
91
  return poll(
92
- (flow) => pollFlow(flow, onLoginPoll),
92
+ (value) => pollFlow(value, onLoginPoll),
93
93
  { id, secret },
94
94
  { ...POLL, timeout },
95
95
  );
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ // [import]
4
+
5
+ const dotProp = require("dot-prop");
6
+
7
+ // [import]
8
+
9
+ const api = require("../../api");
10
+ const media = require("./media");
11
+ const phrase = require("../../phrase");
12
+ const project = require("../../parser/project");
13
+
14
+ // [function]
15
+
16
+ const inspect = function (proj, key) {
17
+ return key ? dotProp.get(proj, key, null) : proj;
18
+ };
19
+
20
+ // [function]
21
+
22
+ const main = function ({ game, root, selector }) {
23
+ if (!game || game === "self") {
24
+ return project(root).then((proj) => inspect(proj, selector));
25
+ }
26
+ return api
27
+ .discoverGameBuilds(game, {
28
+ channel: "production",
29
+ select: "manifest",
30
+ })
31
+ .then((builds) => {
32
+ if (!builds.length) {
33
+ throw new Error(phrase.noProductionBuild(game));
34
+ }
35
+ const manifest = builds[0].manifest || {};
36
+ if (manifest.game) {
37
+ media.dehydrate(manifest.game);
38
+ }
39
+ return inspect(manifest, selector);
40
+ });
41
+ };
42
+
43
+ // [export]
44
+
45
+ module.exports = main;
@@ -31,7 +31,7 @@ const uploadBuild = function (
31
31
 
32
32
  const ensureVersion = function (session, { id, version }, cb) {
33
33
  const token = session?.access_token;
34
- return api.getGameBuild(id, version, { token }).then(
34
+ return api.gameBuild(id, version, { token }).then(
35
35
  () => cb(new Error(phrase.versionExists(version))),
36
36
  (err) => {
37
37
  if (err.status === 404) {
package/src/api.js CHANGED
@@ -18,39 +18,46 @@ const endpoint = function (path) {
18
18
 
19
19
  // [function]
20
20
 
21
- const postAuthRefresh = function (form, options) {
22
- return request.post(endpoint("/auth/refresh"), form, options);
21
+ const postAuthRefresh = function (form, opts) {
22
+ return request.post(endpoint("/auth/refresh"), form, opts);
23
23
  };
24
24
 
25
25
  // [function]
26
26
 
27
- const postFlow = function (form, options) {
28
- return request.post(endpoint("/flows"), form, options);
27
+ const postFlow = function (form, opts) {
28
+ return request.post(endpoint("/flows"), form, opts);
29
29
  };
30
30
 
31
31
  // [function]
32
32
 
33
- const getFlow = function (flow, options) {
34
- return request.get(endpoint(`/flows/${flow}`), options);
33
+ const flow = function (id, opts) {
34
+ return request.get(endpoint(`/flows/${id}`), opts);
35
35
  };
36
36
 
37
37
  // [function]
38
38
 
39
- const postUpload = function (form, options) {
40
- return request.post(endpoint("/uploads"), form, options);
39
+ const postUpload = function (form, opts) {
40
+ return request.post(endpoint("/uploads"), form, opts);
41
41
  };
42
42
 
43
43
  // [function]
44
44
 
45
- const getGameBuild = function (game, version, options) {
46
- return request.get(endpoint(`/games/${game}/builds/${version}`), options);
45
+ const discoverGameBuilds = function (id, opts) {
46
+ return request.get(endpoint(`/discover/games/${id}/builds`), opts);
47
+ };
48
+
49
+ // [function]
50
+
51
+ const gameBuild = function (id, version, opts) {
52
+ return request.get(endpoint(`/games/${id}/builds/${version}`), opts);
47
53
  };
48
54
 
49
55
  // [export]
50
56
 
51
57
  module.exports = {
52
- getFlow,
53
- getGameBuild,
58
+ discoverGameBuilds,
59
+ flow,
60
+ gameBuild,
54
61
  postAuthRefresh,
55
62
  postFlow,
56
63
  postUpload,
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ // [import]
4
+
5
+ const countTool = require("../action/count/tool");
6
+
7
+ // [function]
8
+
9
+ const main = function (conf) {
10
+ return countTool(conf);
11
+ };
12
+
13
+ // [export]
14
+
15
+ module.exports = main;
package/src/cli/index.js CHANGED
@@ -3,12 +3,14 @@
3
3
  // [import]
4
4
 
5
5
  const build = require("./build");
6
+ const count = require("./count");
6
7
  const deploy = require("./deploy");
7
8
  const init = require("./init");
8
9
  const inspect = require("./inspect");
9
10
  const login = require("./login");
10
11
  const logout = require("./logout");
11
12
  const pack = require("./pack");
13
+ const play = require("./play");
12
14
  const predeploy = require("./predeploy");
13
15
  const validate = require("./validate");
14
16
  const whoami = require("./whoami");
@@ -17,12 +19,14 @@ const whoami = require("./whoami");
17
19
 
18
20
  module.exports = {
19
21
  build,
22
+ count,
20
23
  deploy,
21
24
  init,
22
25
  inspect,
23
26
  login,
24
27
  logout,
25
28
  pack,
29
+ play,
26
30
  predeploy,
27
31
  validate,
28
32
  whoami,
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ // [import]
4
+
5
+ const playTool = require("../action/play/tool");
6
+
7
+ // [function]
8
+
9
+ const main = function (conf) {
10
+ return playTool(conf);
11
+ };
12
+
13
+ // [export]
14
+
15
+ module.exports = main;
package/src/phrase.js CHANGED
@@ -74,6 +74,12 @@ const loginFailed = function () {
74
74
 
75
75
  // [function]
76
76
 
77
+ const noProductionBuild = function () {
78
+ return "No production build found.";
79
+ };
80
+
81
+ // [function]
82
+
77
83
  const notLoggedIn = function () {
78
84
  return "Not logged in. Run `arc login` to log in.";
79
85
  };
@@ -144,6 +150,7 @@ module.exports = {
144
150
  issuesFound,
145
151
  loginExpired,
146
152
  loginFailed,
153
+ noProductionBuild,
147
154
  noVideoMetadata,
148
155
  noVideoTrack,
149
156
  notLoggedIn,
@@ -10,7 +10,7 @@ module.exports = {
10
10
  select: {
11
11
  choices: [
12
12
  {
13
- description: "Zero-build static starter.",
13
+ description: "Plain JavaScript starter.",
14
14
  name: "Default",
15
15
  value: `${REPO}/starter`,
16
16
  },
@@ -71,7 +71,7 @@ const zDeployDir = function (root, { build }) {
71
71
  (file) => build || existsCheck(root, file),
72
72
  message(field, [
73
73
  "Must exist when no build step is defined.",
74
- "Run `arc inspect workflow` for details.",
74
+ "Run `arc inspect` for details.",
75
75
  ]),
76
76
  );
77
77
  };
@@ -30,7 +30,7 @@ const formatBytes = function (bytes) {
30
30
 
31
31
  // [function]
32
32
 
33
- const formatValue = function (value, options, type) {
33
+ const formatValue = function (value, opts, type) {
34
34
  if (type === "percentage") {
35
35
  return value;
36
36
  }
@@ -27,39 +27,46 @@ const parse = function (resp) {
27
27
 
28
28
  // [function]
29
29
 
30
- const send = function (method, url, body, { token } = {}) {
31
- const headers = {
32
- "X-Arc-Client-Id": CLIENT_ID,
33
- "X-Arc-Client-Version": CLIENT_VERSION,
34
- };
30
+ const send = function (method, url, form, { token } = {}) {
31
+ const headers = [
32
+ ["X-Arcadible-Client-Id", CLIENT_ID],
33
+ ["X-Arcadible-Client-Version", CLIENT_VERSION],
34
+ ];
35
35
  if (token) {
36
- headers.authorization = `Bearer ${token}`;
36
+ headers.push(["Authorization", `Bearer ${token}`]);
37
37
  }
38
- return fetch(url, { body, headers, method }).then(parse);
38
+ if (form) {
39
+ headers.push(["Content-Type", "application/json"]);
40
+ }
41
+ return fetch(url, {
42
+ body: form ? JSON.stringify(Object.fromEntries(form)) : null,
43
+ headers,
44
+ method,
45
+ }).then(parse);
39
46
  };
40
47
 
41
48
  // [function]
42
49
 
43
- const get = function (url, options) {
44
- return send("GET", url, null, options);
50
+ const get = function (url, opts) {
51
+ return send("GET", url, null, opts);
45
52
  };
46
53
 
47
54
  // [function]
48
55
 
49
- const post = function (url, body, options) {
50
- return send("POST", url, body, options);
56
+ const post = function (url, form, opts) {
57
+ return send("POST", url, form, opts);
51
58
  };
52
59
 
53
60
  // [function]
54
61
 
55
- const patch = function (url, body, options) {
56
- return send("PATCH", url, body, options);
62
+ const patch = function (url, form, opts) {
63
+ return send("PATCH", url, form, opts);
57
64
  };
58
65
 
59
66
  // [function]
60
67
 
61
- const del = function (url, options) {
62
- return send("DELETE", url, null, options);
68
+ const del = function (url, opts) {
69
+ return send("DELETE", url, null, opts);
63
70
  };
64
71
 
65
72
  // [export]
package/src/util/s3.js CHANGED
@@ -16,7 +16,7 @@ const request = https.request;
16
16
 
17
17
  // [function]
18
18
 
19
- const requestOptions = function (size) {
19
+ const requestOpts = function (size) {
20
20
  return {
21
21
  headers: {
22
22
  "Content-Length": size,
@@ -29,7 +29,7 @@ const requestOptions = function (size) {
29
29
  // [function]
30
30
 
31
31
  const upload = function (url, { path, size }, onProgress, cb) {
32
- const req = request(url, requestOptions(size), (resp) => {
32
+ const req = request(url, requestOpts(size), (resp) => {
33
33
  resp.resume();
34
34
  const status = resp.statusCode;
35
35
  if (status >= 200 && status < 300) {