arcadible 1.0.48 → 1.0.50

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.
Files changed (69) hide show
  1. package/README.md +5 -1
  2. package/dist/action/deploy/result.js +3 -3
  3. package/dist/action/deploy/tool-git.js +1 -1
  4. package/dist/action/deploy/tool.js +1 -1
  5. package/dist/action/deploy/wait.js +1 -1
  6. package/dist/action/function/logs.js +6 -4
  7. package/dist/action/function/tool.js +11 -10
  8. package/dist/action/key/tool.js +10 -4
  9. package/dist/action/secret/tool.js +2 -1
  10. package/dist/action/validate/unknown.js +1 -1
  11. package/dist/action/value/local.js +78 -0
  12. package/dist/action/value/tool.js +65 -27
  13. package/dist/action/wire/tool.js +1 -1
  14. package/dist/cli/command.js +13 -1
  15. package/dist/cli/options.js +7 -0
  16. package/dist/cli/prompt.js +1 -1
  17. package/dist/command/deploy/report.js +5 -5
  18. package/dist/command/function/index.js +2 -3
  19. package/dist/command/function/logs.js +4 -4
  20. package/dist/command/function/pause.js +1 -1
  21. package/dist/command/function/resume.js +1 -1
  22. package/dist/command/function/run.js +1 -1
  23. package/dist/command/function/secret/index.js +1 -1
  24. package/dist/command/function/secret/list.js +2 -1
  25. package/dist/command/function/secret/remove.js +2 -2
  26. package/dist/command/function/secret/run.js +1 -1
  27. package/dist/command/function/secret/set.js +1 -1
  28. package/dist/command/function/status.js +11 -11
  29. package/dist/command/game/delete.js +2 -2
  30. package/dist/command/game/index.js +2 -2
  31. package/dist/command/open.js +1 -1
  32. package/dist/command/play.js +1 -1
  33. package/dist/command/server/index.js +3 -3
  34. package/dist/command/server/key/create.js +4 -4
  35. package/dist/command/server/key/index.js +1 -1
  36. package/dist/command/server/key/list.js +3 -2
  37. package/dist/command/server/key/revoke.js +1 -1
  38. package/dist/command/server/key/run.js +1 -1
  39. package/dist/command/unstable/index.js +8 -13
  40. package/dist/command/value/get.js +12 -8
  41. package/dist/command/value/index.js +4 -4
  42. package/dist/command/value/list.js +14 -6
  43. package/dist/command/value/remove.js +22 -11
  44. package/dist/command/value/run.js +40 -0
  45. package/dist/command/value/set.js +27 -22
  46. package/dist/command/value/usage.js +34 -30
  47. package/dist/command/wire/index.js +1 -2
  48. package/dist/commands.js +28 -0
  49. package/dist/config/code.js +4 -2
  50. package/dist/config/limit.js +5 -5
  51. package/dist/config/retry.js +2 -0
  52. package/dist/parser/project.js +2 -1
  53. package/dist/phrase/common.js +12 -6
  54. package/dist/phrase/deploy.js +4 -3
  55. package/dist/phrase/function.js +27 -21
  56. package/dist/phrase/game.js +3 -3
  57. package/dist/phrase/pack.js +4 -1
  58. package/dist/phrase/serve.js +2 -2
  59. package/dist/phrase/server.js +10 -5
  60. package/dist/phrase/value.js +50 -16
  61. package/dist/schema/client.js +11 -6
  62. package/dist/serve/values.js +2 -2
  63. package/dist/util/output.js +11 -4
  64. package/dist/util/request.js +17 -7
  65. package/dist/util/s3.js +10 -2
  66. package/dist/util/schema.js +5 -3
  67. package/dist/util/time.js +5 -0
  68. package/npm-shrinkwrap.json +2 -2
  69. package/package.json +2 -1
package/dist/util/s3.js CHANGED
@@ -7,6 +7,11 @@ import { ArcError } from "./error.js";
7
7
  import { unableToReach, uploadFailed } from "../phrase/index.js";
8
8
  // [declare]
9
9
  const CHECKSUM = "x-amz-checksum-sha256";
10
+ // how long the upload's connection may sit with nothing sent or answered
11
+ // before it's api_unreachable: idle, not the whole upload, which takes as
12
+ // long as the zip's size and the connection make it (LIMITS.md, How long
13
+ // things last).
14
+ export const IDLE = 60_000;
10
15
  // [function]
11
16
  // whether the upload link signs `header`, which must then be sent.
12
17
  function signs(url, header) {
@@ -30,8 +35,8 @@ function requestOpts(url, { sha256, size }) {
30
35
  }
31
36
  // [function]
32
37
  // puts the file to the upload link, and resolves once S3 accepts it. A
33
- // request that gets no response rejects as api_unreachable; a file that can't
34
- // be read rejects with its own error.
38
+ // request that gets no response, or sits idle for IDLE, rejects as
39
+ // api_unreachable; a file that can't be read rejects with its own error.
35
40
  // `https.request` is called through the module, as it is when the request is
36
41
  // made, so the tests' sandbox can replace it (test/support/preload.js).
37
42
  export function upload(url, { path, sha256, size }, onProgress) {
@@ -46,6 +51,9 @@ export function upload(url, { path, sha256, size }, onProgress) {
46
51
  reject(new ArcError(UPLOAD_FAILED, uploadFailed(status), { status }));
47
52
  });
48
53
  let readError = null;
54
+ req.setTimeout(IDLE, () => {
55
+ req.destroy(new DOMException(`No progress in ${IDLE / 1000} seconds.`, "TimeoutError"));
56
+ });
49
57
  req.on("error", (ex) => {
50
58
  reject(readError ??
51
59
  new ArcError(API_UNREACHABLE, unableToReach(), {
@@ -106,7 +106,9 @@ export function toIssue(name, issue) {
106
106
  return {
107
107
  code: issueCodeOf(issue),
108
108
  details,
109
- link: issue.path.length ? messageLink(name, String(issue.path[0])) : null,
109
+ docs_url: issue.path.length
110
+ ? messageLink(name, String(issue.path[0]))
111
+ : null,
110
112
  message,
111
113
  path: `${name}.${issue.path.join(".") || "value"}`,
112
114
  };
@@ -115,7 +117,7 @@ export function toIssue(name, issue) {
115
117
  // an issue as it's printed: the path, the message, then its details and its
116
118
  // link, indented beneath it. `linked` false leaves the link out. `marker`
117
119
  // colors it, standard output's unless it's printed elsewhere.
118
- export function print({ details, link, message, path }, linked = true, marker = chalk) {
120
+ export function print({ details, docs_url: link, message, path }, linked = true, marker = chalk) {
119
121
  const rest = [
120
122
  ...details,
121
123
  ...(linked && link ? [marker.cyan.underline(link)] : []),
@@ -128,7 +130,7 @@ export function print({ details, link, message, path }, linked = true, marker =
128
130
  // validate's list of references.
129
131
  export function dereference(issues) {
130
132
  const references = [
131
- ...new Set(issues.flatMap(({ link }) => (link ? [link] : []))),
133
+ ...new Set(issues.flatMap(({ docs_url: link }) => (link ? [link] : []))),
132
134
  ].map((link) => chalk.cyan.underline(link));
133
135
  return [issues.map((issue) => print(issue, false)), references];
134
136
  }
package/dist/util/time.js CHANGED
@@ -14,3 +14,8 @@ export function m(value) {
14
14
  export function h(value) {
15
15
  return m(value * 60);
16
16
  }
17
+ export function iso(value) {
18
+ return value === null || value === undefined || value === ""
19
+ ? null
20
+ : new Date(value).toISOString();
21
+ }
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "license": "Apache-2.0",
44
44
  "name": "arcadible",
45
- "version": "1.0.48"
45
+ "version": "1.0.50"
46
46
  },
47
47
  "node_modules/@cacheable/memory": {
48
48
  "dependencies": {
@@ -2433,5 +2433,5 @@
2433
2433
  }
2434
2434
  },
2435
2435
  "requires": true,
2436
- "version": "1.0.48"
2436
+ "version": "1.0.50"
2437
2437
  }
package/package.json CHANGED
@@ -63,9 +63,10 @@
63
63
  "scripts": {
64
64
  "build": "tsc && node ../../../src/cloudflare/io-arcadible-runner-dispatch/built.mjs .",
65
65
  "lint": "eslint -c eslint.config.mjs src",
66
+ "outputs": "npm run build && node test/support/outputs.js",
66
67
  "prepack": "rm -rf dist && npm run build",
67
68
  "test": "tsc && npm run lint && node --test \"test/**/*.test.js\" \"test/**/*.test.mjs\""
68
69
  },
69
70
  "type": "module",
70
- "version": "1.0.48"
71
+ "version": "1.0.50"
71
72
  }