gcb-host 0.7.1 → 0.8.1

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 (94) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/bin/gcb.js +3 -3
  3. package/lib/audit.d.ts +4 -4
  4. package/lib/audit.d.ts.map +1 -1
  5. package/lib/audit.js +15 -14
  6. package/lib/audit.js.map +1 -1
  7. package/lib/broker.d.ts +12 -13
  8. package/lib/broker.d.ts.map +1 -1
  9. package/lib/broker.js +77 -53
  10. package/lib/broker.js.map +1 -1
  11. package/lib/commands/authorize.d.ts +43 -13
  12. package/lib/commands/authorize.d.ts.map +1 -1
  13. package/lib/commands/authorize.js +146 -53
  14. package/lib/commands/authorize.js.map +1 -1
  15. package/lib/commands/compose.d.ts +8 -10
  16. package/lib/commands/compose.d.ts.map +1 -1
  17. package/lib/commands/compose.js +33 -44
  18. package/lib/commands/compose.js.map +1 -1
  19. package/lib/commands/config.d.ts.map +1 -1
  20. package/lib/commands/config.js +59 -41
  21. package/lib/commands/config.js.map +1 -1
  22. package/lib/commands/deployment.d.ts +11 -11
  23. package/lib/commands/deployment.d.ts.map +1 -1
  24. package/lib/commands/deployment.js +19 -18
  25. package/lib/commands/deployment.js.map +1 -1
  26. package/lib/commands/diagnose.d.ts.map +1 -1
  27. package/lib/commands/diagnose.js +51 -33
  28. package/lib/commands/diagnose.js.map +1 -1
  29. package/lib/commands/doctor.d.ts +5 -5
  30. package/lib/commands/doctor.d.ts.map +1 -1
  31. package/lib/commands/doctor.js +53 -32
  32. package/lib/commands/doctor.js.map +1 -1
  33. package/lib/commands/host.d.ts +7 -7
  34. package/lib/commands/host.d.ts.map +1 -1
  35. package/lib/commands/host.js +144 -93
  36. package/lib/commands/host.js.map +1 -1
  37. package/lib/commands/init.d.ts +33 -33
  38. package/lib/commands/init.d.ts.map +1 -1
  39. package/lib/commands/init.js +93 -75
  40. package/lib/commands/init.js.map +1 -1
  41. package/lib/commands/stage.d.ts +6 -6
  42. package/lib/commands/stage.d.ts.map +1 -1
  43. package/lib/commands/stage.js +21 -15
  44. package/lib/commands/stage.js.map +1 -1
  45. package/lib/config.d.ts +29 -28
  46. package/lib/config.d.ts.map +1 -1
  47. package/lib/config.js +100 -84
  48. package/lib/config.js.map +1 -1
  49. package/lib/daemon.d.ts +9 -9
  50. package/lib/daemon.d.ts.map +1 -1
  51. package/lib/daemon.js +21 -18
  52. package/lib/daemon.js.map +1 -1
  53. package/lib/device-flow.d.ts +23 -22
  54. package/lib/device-flow.d.ts.map +1 -1
  55. package/lib/device-flow.js +33 -28
  56. package/lib/device-flow.js.map +1 -1
  57. package/lib/gh.d.ts +2 -2
  58. package/lib/gh.d.ts.map +1 -1
  59. package/lib/gh.js +74 -46
  60. package/lib/gh.js.map +1 -1
  61. package/lib/http.d.ts.map +1 -1
  62. package/lib/http.js +35 -18
  63. package/lib/http.js.map +1 -1
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/index.js.map +1 -1
  66. package/lib/policy.d.ts +25 -25
  67. package/lib/policy.d.ts.map +1 -1
  68. package/lib/policy.js +57 -36
  69. package/lib/policy.js.map +1 -1
  70. package/lib/providers/github-app.d.ts +12 -12
  71. package/lib/providers/github-app.d.ts.map +1 -1
  72. package/lib/providers/github-app.js +194 -125
  73. package/lib/providers/github-app.js.map +1 -1
  74. package/lib/providers/index.d.ts +8 -9
  75. package/lib/providers/index.d.ts.map +1 -1
  76. package/lib/providers/index.js +5 -5
  77. package/lib/providers/index.js.map +1 -1
  78. package/lib/providers/static.d.ts +3 -3
  79. package/lib/providers/static.d.ts.map +1 -1
  80. package/lib/providers/static.js +14 -12
  81. package/lib/providers/static.js.map +1 -1
  82. package/lib/proxy.d.ts +10 -10
  83. package/lib/proxy.d.ts.map +1 -1
  84. package/lib/proxy.js +18 -16
  85. package/lib/proxy.js.map +1 -1
  86. package/lib/public-repo.d.ts +10 -10
  87. package/lib/public-repo.d.ts.map +1 -1
  88. package/lib/public-repo.js +17 -14
  89. package/lib/public-repo.js.map +1 -1
  90. package/lib/reload.d.ts +4 -4
  91. package/lib/reload.d.ts.map +1 -1
  92. package/lib/reload.js +24 -14
  93. package/lib/reload.js.map +1 -1
  94. package/package.json +10 -10
package/lib/config.d.ts CHANGED
@@ -5,12 +5,12 @@ export declare const DEFAULT_CONFIG_FILE = "broker.config.yml";
5
5
  * Where the configuration lives when nothing says otherwise.
6
6
  *
7
7
  * This convention is what makes the commands usable without repeating paths: run them from the
8
- * deployment directory and `./broker.config.yml` is found, or export `GIT_BROKER_CONFIG` once.
9
- * An explicit `--config` always wins.
8
+ * deployment directory and `./broker.config.yml` is found, or export `GIT_BROKER_CONFIG` once. An
9
+ * explicit `--config` always wins.
10
10
  *
11
- * @param explicit - the `--config` argument, if any.
12
- * @param env - the environment to read.
13
- * @returns an absolute path.
11
+ * @param explicit - The `--config` argument, if any.
12
+ * @param env - The environment to read.
13
+ * @returns An absolute path.
14
14
  */
15
15
  export declare function resolveConfigPath(explicit?: string, env?: NodeJS.ProcessEnv): string;
16
16
  /**
@@ -19,8 +19,8 @@ export declare function resolveConfigPath(explicit?: string, env?: NodeJS.Proces
19
19
  * The key, the configuration and the log directory are siblings, so the file's own location says
20
20
  * where the deployment is.
21
21
  *
22
- * @param configPath - the configuration path.
23
- * @returns the absolute directory.
22
+ * @param configPath - The configuration path.
23
+ * @returns The absolute directory.
24
24
  */
25
25
  export declare function deploymentDir(configPath: string): string;
26
26
  /** The two supported deployments. Which one a configuration suits is decided by its paths. */
@@ -34,18 +34,19 @@ export type DeploymentMode = 'host' | 'sidecar';
34
34
  /**
35
35
  * The file name the authorized person's refresh token is kept under.
36
36
  *
37
- * It sits beside the private key, because the broker reads the key and can find the token without being
38
- * told anything else — one rule, used by the writer, the reader and the mount, so they cannot drift.
37
+ * It sits beside the private key, because the broker reads the key and can find the token without
38
+ * being told anything else — one rule, used by the writer, the reader and the mount, so they cannot
39
+ * drift.
39
40
  */
40
41
  export declare const USER_TOKEN_FILE = "user.refresh";
41
42
  /**
42
43
  * Where the authorized person's refresh token is, given the key it sits beside.
43
44
  *
44
- * posix, not path: these are paths inside the deployment, and the process reading them need not be the
45
- * platform they belong to.
45
+ * Posix, not path: these are paths inside the deployment, and the process reading them need not be
46
+ * the platform they belong to.
46
47
  *
47
- * @param privateKeyPath - the key, as the process that reads it sees the path.
48
- * @returns the refresh token path.
48
+ * @param privateKeyPath - The key, as the process that reads it sees the path.
49
+ * @returns The refresh token path.
49
50
  */
50
51
  export declare function userTokenPath(privateKeyPath: string): string;
51
52
  export declare const SIDECAR: {
@@ -64,8 +65,8 @@ export declare const SIDECAR: {
64
65
  * can find its key. This lives here, not with the CLI, so the daemon can use it to explain a
65
66
  * mismatch instead of reporting a bare ENOENT about a path that only exists in the other layout.
66
67
  *
67
- * @param config - a validated configuration.
68
- * @returns the deployment it suits.
68
+ * @param config - A validated configuration.
69
+ * @returns The deployment it suits.
69
70
  */
70
71
  export declare function inferMode(config: BrokerConfig): DeploymentMode;
71
72
  /**
@@ -74,19 +75,19 @@ export declare function inferMode(config: BrokerConfig): DeploymentMode;
74
75
  * Same reasoning as the key: a path that does not resolve is a deployment mistake, and the process
75
76
  * that runs the broker is the one whose paths count.
76
77
  *
77
- * @param config - the loaded configuration.
78
+ * @param config - The loaded configuration.
78
79
  */
79
80
  export declare function assertUserTokensReadable(config: BrokerConfig): void;
80
81
  /**
81
82
  * Check that each recorded private key is readable, before the caller tries to read it.
82
83
  *
83
- * Both the daemon and `diagnose` need this, because both read the key, and a bare
84
- * `ENOENT ... /etc/git-cred-broker/app.pem` says nothing: that path exists only inside the sidecar,
85
- * so the mistake is where the command was run, not that the key is missing. The layout is
86
- * recoverable from the configuration itself, so name it and give the way out.
84
+ * Both the daemon and `diagnose` need this, because both read the key, and a bare `ENOENT ...
85
+ * /etc/git-cred-broker/app.pem` says nothing: that path exists only inside the sidecar, so the
86
+ * mistake is where the command was run, not that the key is missing. The layout is recoverable from
87
+ * the configuration itself, so name it and give the way out.
87
88
  *
88
- * @param config - the validated configuration.
89
- * @throws {Error} when a key file is missing, with the remedy in the message.
89
+ * @param config - The validated configuration.
90
+ * @throws {Error} When a key file is missing, with the remedy in the message.
90
91
  */
91
92
  export declare function assertKeysReadable(config: BrokerConfig): void;
92
93
  /** Providers this build knows how to construct. */
@@ -94,10 +95,10 @@ export declare const KNOWN_PROVIDERS: readonly ['github-app', 'static'];
94
95
  /**
95
96
  * Validate a parsed configuration object.
96
97
  *
97
- * @param raw - the parsed JSON.
98
- * @param source - where it came from, for error messages.
99
- * @returns the validated configuration with defaults applied.
100
- * @throws {Error} when any field is missing or malformed.
98
+ * @param raw - The parsed JSON.
99
+ * @param source - Where it came from, for error messages.
100
+ * @returns The validated configuration with defaults applied.
101
+ * @throws {Error} When any field is missing or malformed.
101
102
  */
102
103
  export declare function validateConfig(raw: unknown, source?: string): BrokerConfig;
103
104
  /** Read configuration text, with the deployment path named on failure. */
@@ -105,8 +106,8 @@ export declare function readConfigText(path: string): string;
105
106
  /**
106
107
  * Read and validate a configuration file.
107
108
  *
108
- * @param path - path to the YAML config.
109
- * @returns the validated configuration.
109
+ * @param path - Path to the YAML config.
110
+ * @returns The validated configuration.
110
111
  */
111
112
  export declare function loadConfig(path: string): BrokerConfig;
112
113
  /** Parse and validate configuration text already read from `path`. */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAqD,MAAM,UAAU,CAAC;AAEhG,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAEjG;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,8FAA8F;A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AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAErD;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAYvE"}
package/lib/config.js CHANGED
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Broker configuration: loaded from a YAML file that lives on the host, outside every
3
- * mount the agent container can see, and validated eagerly so a broken or over-broad
4
- * configuration stops the daemon at startup instead of silently denying (or silently
5
- * allowing) at push time.
2
+ * Broker configuration: loaded from a YAML file that lives on the host, outside every mount the
3
+ * agent container can see, and validated eagerly so a broken or over-broad configuration stops the
4
+ * daemon at startup instead of silently denying (or silently allowing) at push time.
6
5
  */
7
6
  import { existsSync, readFileSync } from 'node:fs';
8
7
  import path, { posix } from 'node:path';
@@ -14,12 +13,12 @@ export const DEFAULT_CONFIG_FILE = 'broker.config.yml';
14
13
  * Where the configuration lives when nothing says otherwise.
15
14
  *
16
15
  * This convention is what makes the commands usable without repeating paths: run them from the
17
- * deployment directory and `./broker.config.yml` is found, or export `GIT_BROKER_CONFIG` once.
18
- * An explicit `--config` always wins.
16
+ * deployment directory and `./broker.config.yml` is found, or export `GIT_BROKER_CONFIG` once. An
17
+ * explicit `--config` always wins.
19
18
  *
20
- * @param explicit - the `--config` argument, if any.
21
- * @param env - the environment to read.
22
- * @returns an absolute path.
19
+ * @param explicit - The `--config` argument, if any.
20
+ * @param env - The environment to read.
21
+ * @returns An absolute path.
23
22
  */
24
23
  export function resolveConfigPath(explicit, env = process.env) {
25
24
  return path.resolve(explicit || env['GIT_BROKER_CONFIG'] || DEFAULT_CONFIG_FILE);
@@ -30,8 +29,8 @@ export function resolveConfigPath(explicit, env = process.env) {
30
29
  * The key, the configuration and the log directory are siblings, so the file's own location says
31
30
  * where the deployment is.
32
31
  *
33
- * @param configPath - the configuration path.
34
- * @returns the absolute directory.
32
+ * @param configPath - The configuration path.
33
+ * @returns The absolute directory.
35
34
  */
36
35
  export function deploymentDir(configPath) {
37
36
  return path.dirname(path.resolve(configPath));
@@ -45,18 +44,19 @@ export function deploymentDir(configPath) {
45
44
  /**
46
45
  * The file name the authorized person's refresh token is kept under.
47
46
  *
48
- * It sits beside the private key, because the broker reads the key and can find the token without being
49
- * told anything else — one rule, used by the writer, the reader and the mount, so they cannot drift.
47
+ * It sits beside the private key, because the broker reads the key and can find the token without
48
+ * being told anything else — one rule, used by the writer, the reader and the mount, so they cannot
49
+ * drift.
50
50
  */
51
51
  export const USER_TOKEN_FILE = 'user.refresh';
52
52
  /**
53
53
  * Where the authorized person's refresh token is, given the key it sits beside.
54
54
  *
55
- * posix, not path: these are paths inside the deployment, and the process reading them need not be the
56
- * platform they belong to.
55
+ * Posix, not path: these are paths inside the deployment, and the process reading them need not be
56
+ * the platform they belong to.
57
57
  *
58
- * @param privateKeyPath - the key, as the process that reads it sees the path.
59
- * @returns the refresh token path.
58
+ * @param privateKeyPath - The key, as the process that reads it sees the path.
59
+ * @returns The refresh token path.
60
60
  */
61
61
  export function userTokenPath(privateKeyPath) {
62
62
  return posix.join(posix.dirname(privateKeyPath), USER_TOKEN_FILE);
@@ -79,13 +79,15 @@ export const SIDECAR = {
79
79
  * can find its key. This lives here, not with the CLI, so the daemon can use it to explain a
80
80
  * mismatch instead of reporting a bare ENOENT about a path that only exists in the other layout.
81
81
  *
82
- * @param config - a validated configuration.
83
- * @returns the deployment it suits.
82
+ * @param config - A validated configuration.
83
+ * @returns The deployment it suits.
84
84
  */
85
85
  export function inferMode(config) {
86
86
  const block = config.hosts['github.com'];
87
87
  const keyPath = block?.provider === 'github-app' ? block.privateKeyPath : undefined;
88
- return keyPath === SIDECAR.keyPath && config.socketPath === SIDECAR.socketPath ? 'sidecar' : 'host';
88
+ return keyPath === SIDECAR.keyPath && config.socketPath === SIDECAR.socketPath
89
+ ? 'sidecar'
90
+ : 'host';
89
91
  }
90
92
  /**
91
93
  * Refuse to start when a person's token is named but not there.
@@ -93,15 +95,17 @@ export function inferMode(config) {
93
95
  * Same reasoning as the key: a path that does not resolve is a deployment mistake, and the process
94
96
  * that runs the broker is the one whose paths count.
95
97
  *
96
- * @param config - the loaded configuration.
98
+ * @param config - The loaded configuration.
97
99
  */
98
100
  export function assertUserTokensReadable(config) {
99
101
  for (const [host, block] of Object.entries(config.hosts)) {
100
- if (block.provider !== 'github-app')
102
+ if (block.provider !== 'github-app') {
101
103
  continue;
104
+ }
102
105
  for (const [owner, tokenPath] of Object.entries(block.userTokens ?? {})) {
103
- if (existsSync(tokenPath))
106
+ if (existsSync(tokenPath)) {
104
107
  continue;
108
+ }
105
109
  throw new Error(`cannot read the token for ${host}/${owner}: ${tokenPath} does not exist.\n` +
106
110
  ` Create a fine-grained token with pull requests: read and write, contents: read and\n` +
107
111
  ` metadata: read, for the repositories the allowlist names, and put it there — or drop\n` +
@@ -112,21 +116,23 @@ export function assertUserTokensReadable(config) {
112
116
  /**
113
117
  * Check that each recorded private key is readable, before the caller tries to read it.
114
118
  *
115
- * Both the daemon and `diagnose` need this, because both read the key, and a bare
116
- * `ENOENT ... /etc/git-cred-broker/app.pem` says nothing: that path exists only inside the sidecar,
117
- * so the mistake is where the command was run, not that the key is missing. The layout is
118
- * recoverable from the configuration itself, so name it and give the way out.
119
+ * Both the daemon and `diagnose` need this, because both read the key, and a bare `ENOENT ...
120
+ * /etc/git-cred-broker/app.pem` says nothing: that path exists only inside the sidecar, so the
121
+ * mistake is where the command was run, not that the key is missing. The layout is recoverable from
122
+ * the configuration itself, so name it and give the way out.
119
123
  *
120
- * @param config - the validated configuration.
121
- * @throws {Error} when a key file is missing, with the remedy in the message.
124
+ * @param config - The validated configuration.
125
+ * @throws {Error} When a key file is missing, with the remedy in the message.
122
126
  */
123
127
  export function assertKeysReadable(config) {
124
128
  const mode = inferMode(config);
125
129
  for (const [host, block] of Object.entries(config.hosts)) {
126
- if (block.provider !== 'github-app' || block.privateKeyPath === undefined)
130
+ if (block.provider !== 'github-app' || block.privateKeyPath === undefined) {
127
131
  continue;
128
- if (existsSync(block.privateKeyPath))
132
+ }
133
+ if (existsSync(block.privateKeyPath)) {
129
134
  continue;
135
+ }
130
136
  const remedy = mode === 'sidecar'
131
137
  ? `${block.privateKeyPath} exists only inside the sidecar container, so this has to run there —\n` +
132
138
  ' or against a configuration that records host paths instead:\n' +
@@ -142,8 +148,8 @@ export const KNOWN_PROVIDERS = ['github-app', 'static'];
142
148
  /**
143
149
  * Whether a value is a plain object.
144
150
  *
145
- * @param value - the value to test.
146
- * @returns true for a non-null, non-array object.
151
+ * @param value - The value to test.
152
+ * @returns True for a non-null, non-array object.
147
153
  */
148
154
  function isRecord(value) {
149
155
  return typeof value === 'object' && value !== null && !Array.isArray(value);
@@ -151,16 +157,17 @@ function isRecord(value) {
151
157
  /**
152
158
  * Read an optional string field, recording a type error instead of coercing.
153
159
  *
154
- * @param record - the object to read from.
155
- * @param key - the field name.
156
- * @param errors - the error accumulator.
157
- * @param at - the human-readable location, for messages.
158
- * @returns the string, or undefined when absent or invalid.
160
+ * @param record - The object to read from.
161
+ * @param key - The field name.
162
+ * @param errors - The error accumulator.
163
+ * @param at - The human-readable location, for messages.
164
+ * @returns The string, or undefined when absent or invalid.
159
165
  */
160
166
  function stringField(record, key, errors, at) {
161
167
  const value = record[key];
162
- if (value === undefined || value === null)
168
+ if (value === undefined || value === null) {
163
169
  return undefined;
170
+ }
164
171
  if (typeof value !== 'string') {
165
172
  errors.push(`${at}.${key} must be a string`);
166
173
  return undefined;
@@ -170,19 +177,21 @@ function stringField(record, key, errors, at) {
170
177
  /**
171
178
  * Read an optional HTTPS URL field.
172
179
  *
173
- * @param record - the object to read from.
174
- * @param key - the field name.
175
- * @param errors - the error accumulator.
176
- * @param at - the configuration path, for the error message.
177
- * @returns the URL, or undefined when absent or invalid.
180
+ * @param record - The object to read from.
181
+ * @param key - The field name.
182
+ * @param errors - The error accumulator.
183
+ * @param at - The configuration path, for the error message.
184
+ * @returns The URL, or undefined when absent or invalid.
178
185
  */
179
186
  function httpsUrlField(record, key, errors, at) {
180
187
  const value = stringField(record, key, errors, at);
181
- if (value === undefined)
188
+ if (value === undefined) {
182
189
  return undefined;
190
+ }
183
191
  try {
184
- if (new URL(value).protocol === 'https:')
192
+ if (new URL(value).protocol === 'https:') {
185
193
  return value;
194
+ }
186
195
  }
187
196
  catch {
188
197
  // Fall through to the shared error below.
@@ -193,16 +202,17 @@ function httpsUrlField(record, key, errors, at) {
193
202
  /**
194
203
  * Read an optional numeric field.
195
204
  *
196
- * @param record - the object to read from.
197
- * @param key - the field name.
198
- * @param errors - the error accumulator.
199
- * @param at - the human-readable location, for messages.
200
- * @returns the number, or undefined when absent or invalid.
205
+ * @param record - The object to read from.
206
+ * @param key - The field name.
207
+ * @param errors - The error accumulator.
208
+ * @param at - The human-readable location, for messages.
209
+ * @returns The number, or undefined when absent or invalid.
201
210
  */
202
211
  function numberField(record, key, errors, at) {
203
212
  const value = record[key];
204
- if (value === undefined || value === null)
213
+ if (value === undefined || value === null) {
205
214
  return undefined;
215
+ }
206
216
  if (typeof value !== 'number' || !Number.isFinite(value)) {
207
217
  errors.push(`${at}.${key} must be a finite number`);
208
218
  return undefined;
@@ -212,16 +222,17 @@ function numberField(record, key, errors, at) {
212
222
  /**
213
223
  * Read an optional boolean field.
214
224
  *
215
- * @param record - the object to read from.
216
- * @param key - the field name.
217
- * @param errors - the error accumulator.
218
- * @param at - the human-readable location, for messages.
219
- * @returns the boolean, or undefined when absent or invalid.
225
+ * @param record - The object to read from.
226
+ * @param key - The field name.
227
+ * @param errors - The error accumulator.
228
+ * @param at - The human-readable location, for messages.
229
+ * @returns The boolean, or undefined when absent or invalid.
220
230
  */
221
231
  function booleanField(record, key, errors, at) {
222
232
  const value = record[key];
223
- if (value === undefined || value === null)
233
+ if (value === undefined || value === null) {
224
234
  return undefined;
235
+ }
225
236
  if (typeof value !== 'boolean') {
226
237
  errors.push(`${at}.${key} must be a boolean`);
227
238
  return undefined;
@@ -231,18 +242,20 @@ function booleanField(record, key, errors, at) {
231
242
  /**
232
243
  * Read an optional string-or-number field (the app ID may be written either way).
233
244
  *
234
- * @param record - the object to read from.
235
- * @param key - the field name.
236
- * @param errors - the error accumulator.
237
- * @param at - the human-readable location, for messages.
238
- * @returns the value, or undefined when absent or invalid.
245
+ * @param record - The object to read from.
246
+ * @param key - The field name.
247
+ * @param errors - The error accumulator.
248
+ * @param at - The human-readable location, for messages.
249
+ * @returns The value, or undefined when absent or invalid.
239
250
  */
240
251
  function stringOrNumberField(record, key, errors, at) {
241
252
  const value = record[key];
242
- if (value === undefined || value === null)
253
+ if (value === undefined || value === null) {
243
254
  return undefined;
244
- if (typeof value === 'string' || typeof value === 'number')
255
+ }
256
+ if (typeof value === 'string' || typeof value === 'number') {
245
257
  return value;
258
+ }
246
259
  errors.push(`${at}.${key} must be a string or a number`);
247
260
  return undefined;
248
261
  }
@@ -250,31 +263,34 @@ function stringOrNumberField(record, key, errors, at) {
250
263
  * The same map with its keys lower-cased.
251
264
  *
252
265
  * These keys are owners, and owners are case-insensitive on GitHub while every comparison in this
253
- * codebase is made against a lower-cased one. Normalising at the edge is what keeps a configuration that
254
- * looks right from silently doing nothing.
266
+ * codebase is made against a lower-cased one. Normalising at the edge is what keeps a configuration
267
+ * that looks right from silently doing nothing.
255
268
  *
256
- * @param value - the map, as written, or nothing when the field is absent.
257
- * @returns the map with lower-cased keys, or nothing.
269
+ * @param value - The map, as written, or nothing when the field is absent.
270
+ * @returns The map with lower-cased keys, or nothing.
258
271
  */
259
272
  function lowerCasedKeys(value) {
260
- if (value === undefined)
273
+ if (value === undefined) {
261
274
  return undefined;
275
+ }
262
276
  const out = {};
263
- for (const [key, entry] of Object.entries(value))
277
+ for (const [key, entry] of Object.entries(value)) {
264
278
  out[key.toLowerCase()] = entry;
279
+ }
265
280
  return out;
266
281
  }
267
282
  /**
268
283
  * Read an optional map of strings, for REST permission names.
269
284
  *
270
- * @param value - the raw value.
271
- * @param errors - the error accumulator.
272
- * @param at - the human-readable location, for messages.
273
- * @returns the map, or undefined when absent or invalid.
285
+ * @param value - The raw value.
286
+ * @param errors - The error accumulator.
287
+ * @param at - The human-readable location, for messages.
288
+ * @returns The map, or undefined when absent or invalid.
274
289
  */
275
290
  function stringMapField(value, errors, at, field = 'permissions') {
276
- if (value === undefined || value === null)
291
+ if (value === undefined || value === null) {
277
292
  return undefined;
293
+ }
278
294
  if (!isRecord(value)) {
279
295
  errors.push(`${at}.${field} must be an object of names to values`);
280
296
  return undefined;
@@ -292,10 +308,10 @@ function stringMapField(value, errors, at, field = 'permissions') {
292
308
  /**
293
309
  * Validate a parsed configuration object.
294
310
  *
295
- * @param raw - the parsed JSON.
296
- * @param source - where it came from, for error messages.
297
- * @returns the validated configuration with defaults applied.
298
- * @throws {Error} when any field is missing or malformed.
311
+ * @param raw - The parsed JSON.
312
+ * @param source - Where it came from, for error messages.
313
+ * @returns The validated configuration with defaults applied.
314
+ * @throws {Error} When any field is missing or malformed.
299
315
  */
300
316
  export function validateConfig(raw, source = '<config>') {
301
317
  if (!isRecord(raw)) {
@@ -424,14 +440,14 @@ export function readConfigText(path) {
424
440
  return readFileSync(path, 'utf8');
425
441
  }
426
442
  catch (error) {
427
- throw new Error(`cannot read config ${path}: ${error.message}`);
443
+ throw new Error(`cannot read config ${path}: ${error.message}`, { cause: error });
428
444
  }
429
445
  }
430
446
  /**
431
447
  * Read and validate a configuration file.
432
448
  *
433
- * @param path - path to the YAML config.
434
- * @returns the validated configuration.
449
+ * @param path - Path to the YAML config.
450
+ * @returns The validated configuration.
435
451
  */
436
452
  export function loadConfig(path) {
437
453
  return loadConfigText(readConfigText(path), path);
@@ -444,7 +460,7 @@ export function loadConfigText(text, path) {
444
460
  prettyErrors: true,
445
461
  });
446
462
  if (document.errors.length > 0) {
447
- throw new Error(`config ${path} is not valid YAML: ${document.errors.map((error) => error.message).join('; ')}`);
463
+ throw new Error(`config ${path} is not valid YAML: ${document.errors.map(error => error.message).join('; ')}`);
448
464
  }
449
465
  return validateConfig(document.toJS({ maxAliasCount: 0 }), path);
450
466
  }
package/lib/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAiB,EAAE,GAAG,GAAsB,OAAO,CAAC,GAAG;IACvF,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,GAAG,CAAC,mBAAmB,CAAC,IAAI,mBAAmB,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AAChD,CAAC;AAKD;;;;;GAKG;AACH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,cAAsB;IAClD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,eAAe,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,UAAU,EAAE,+CAA+C;IAC3D,OAAO,EAAE,8BAA8B;IACvC,kFAAkF;IAClF,kGAAkG;IAClG,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,8B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C,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;AACnD,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,IAAY;IACvD,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,EAAE;QACnC,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;KACnB,CAAC,CAAA;IACF,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,UAAU,IAAI,uBAAuB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC9F,CAAA;IACH,CAAC;IACD,OAAO,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;AAClE,CAAC"}
package/lib/daemon.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Writable } from 'node:stream';
2
- import type { ProviderDeps } from './providers/index.ts';
3
2
  import type { BrokerConfig, Provider } from 'gcb-core';
3
+ import type { ProviderDeps } from './providers/index.ts';
4
4
  /** The daemon's parsed command line. */
5
5
  export interface DaemonArgs {
6
6
  readonly configPath: string | undefined;
@@ -10,24 +10,24 @@ export interface DaemonArgs {
10
10
  /**
11
11
  * Parse the daemon's command line.
12
12
  *
13
- * @param argv - arguments after the script name.
14
- * @returns the parsed arguments.
13
+ * @param argv - Arguments after the script name.
14
+ * @returns The parsed arguments.
15
15
  */
16
16
  export declare function parseArgs(argv: readonly string[]): DaemonArgs;
17
17
  /**
18
18
  * Build providers for every configured host.
19
19
  *
20
- * @param config - the validated configuration.
21
- * @param deps - injectable dependencies, for tests.
22
- * @returns host -> provider.
20
+ * @param config - The validated configuration.
21
+ * @param deps - Injectable dependencies, for tests.
22
+ * @returns Host -> provider.
23
23
  */
24
24
  export declare function buildProviders(config: BrokerConfig, deps?: ProviderDeps): Map<string, Provider>;
25
25
  /**
26
26
  * Run the daemon.
27
27
  *
28
- * @param argv - arguments after the script name.
29
- * @param io - injectable streams.
30
- * @returns the process exit code, once the daemon has shut down.
28
+ * @param argv - Arguments after the script name.
29
+ * @param io - Injectable streams.
30
+ * @returns The process exit code, once the daemon has shut down.
31
31
  */
32
32
  export declare function runDaemon(argv: readonly string[], io?: {
33
33
  stderr?: Writable;
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.d.ts","sourceRoot":"","sources":["../src/daemon.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAQvD,wCAAwC;AACxC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAmB7D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,YAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAYnG;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,QAAQ,CAAA;CAAO,GAChD,OAAO,CAAC,MAAM,CAAC,CAqGjB"}
1
+ {"version":3,"file":"daem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