@bluestep-systems/b6p-core 1.4.0 → 1.6.0

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.
@@ -1,4 +1,4 @@
1
- import type { GatewayMarketplaceCreateRequest, GatewayMarketplaceCreateResult, GatewayMarketplaceRepo } from "../types";
1
+ import type { GatewayMarketplaceCreateRequest, GatewayMarketplaceCreateResult, GatewayMarketplaceRepo, GatewayMarketplaceRepoMetadata, GatewayMarketplaceTombstone } from "../types";
2
2
  import type { GatewayClient } from "./GatewayClient";
3
3
  import type { GatewayGit } from "./GatewayGit";
4
4
  /**
@@ -67,7 +67,7 @@ export interface GatewayMarketplacePullResult {
67
67
  }
68
68
  /**
69
69
  * Marketplace repositories on web-global's gateway: browse them, pull a plain working clone, and
70
- * create a new (empty) repo. Core has no push of its own (a repo is pushed with plain `git`), and a
70
+ * manage their lifecycle (create, edit, archive, rename, delete, purge). Core has no push of its own (a repo is pushed with plain `git`), and a
71
71
  * pull never reads or changes any script's sources or pins.
72
72
  * @lastreviewed null
73
73
  */
@@ -84,12 +84,139 @@ export declare class GatewayMarketplace {
84
84
  */
85
85
  list(): Promise<GatewayMarketplaceRepo[]>;
86
86
  /**
87
- * One marketplace repo by name.
88
- * @throws {Err.GatewayNotFoundError} no repo has that name (or it is not visible to this user)
89
- * @throws {Err.GatewayUnexpectedResponseError} the entry for that name is malformed
87
+ * One marketplace repo by name (`GET /api/v1/registry/repos/{name}`, scope `registry:read`). Unlike
88
+ * {@link list}, it finds an empty repo too (one just created and not yet pushed to), and it carries the
89
+ * repo's `website`, `topics` and `archived`. A name the gateway could never hold (not a marketplace repo name,
90
+ * or one the forge reserves) is not found, with nothing sent.
91
+ * @throws {Err.GatewayNotFoundError} no repo has exactly that name (a renamed repo's old name is not found
92
+ * either)
93
+ * @throws {Err.GatewayUnexpectedResponseError} the answer is malformed, or is for another repo
94
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
90
95
  * @lastreviewed null
91
96
  */
92
97
  get(name: string): Promise<GatewayMarketplaceRepo>;
98
+ /**
99
+ * Change a marketplace repo's metadata (`PATCH /api/v1/registry/repos/{name}`, scope `registry:push`, a fleet
100
+ * super). Only the members given change; one left out (or `undefined`) stays as it is. The members are checked as
101
+ * `create` checks them, and a change that names none (or any member but `description`, `website` and `topics`)
102
+ * fails here with nothing sent, as the gateway refuses it as `400`.
103
+ * @returns the repo as the forge now holds it
104
+ * @throws {Err.GatewayInvalidArgumentError} the name or a member is one the gateway would refuse; nothing sent
105
+ * @throws {Err.GatewayNotFoundError} `404`: no repo has exactly that name
106
+ * @throws {Err.GatewayRepoArchivedError} `409 repo-archived`: unarchive it first
107
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
108
+ * @throws {Err.GatewayInvalidRequestError} `400`
109
+ * @throws {Err.GatewayTooLargeError} `413`
110
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
111
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
112
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
113
+ * @throws {Err.GatewayUnexpectedResponseError} the answer is not the repo asked for
114
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
115
+ * @lastreviewed null
116
+ */
117
+ edit(name: string, metadata: GatewayMarketplaceRepoMetadata): Promise<GatewayMarketplaceRepo>;
118
+ /**
119
+ * Archive a marketplace repo (`POST /api/v1/registry/repos/{name}/archive`, scope `registry:push`, a fleet
120
+ * super): it can still be fetched, deleted and unarchived, but not pushed to, edited or renamed. Archiving an
121
+ * archived repo changes nothing and is not an error. npm packages are unaffected.
122
+ * @returns the repo, `archived` true
123
+ * @throws {Err.GatewayInvalidArgumentError} the name is not a marketplace repo name; nothing sent
124
+ * @throws {Err.GatewayNotFoundError} `404`
125
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
126
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
127
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
128
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
129
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
130
+ * @lastreviewed null
131
+ */
132
+ archive(name: string): Promise<GatewayMarketplaceRepo>;
133
+ /**
134
+ * Unarchive a marketplace repo (`POST /api/v1/registry/repos/{name}/unarchive`), so it can be pushed to,
135
+ * edited and renamed again. Unarchiving a repo that is not archived changes nothing and is not an error.
136
+ * Same errors as {@link archive}.
137
+ * @returns the repo, `archived` false
138
+ * @lastreviewed null
139
+ */
140
+ unarchive(name: string): Promise<GatewayMarketplaceRepo>;
141
+ /**
142
+ * Rename a marketplace repo (`POST /api/v1/registry/repos/{name}/rename`, scope `registry:push`, a fleet
143
+ * super). Its metadata, tags and branch protection move with it, the gateway answers a git client on the old
144
+ * URL with a `301` to the new one, and npm packages are unaffected. The new name is checked as `create` checks a
145
+ * name (reserved names included) and must differ from the old one; both fail here with nothing sent.
146
+ *
147
+ * A consumer with a clone of the repo should point its remote at the returned repo's `gitUrl`.
148
+ * @returns the repo at its new name
149
+ * @throws {Err.GatewayInvalidArgumentError} either name is one the gateway would refuse, or they are the same
150
+ * @throws {Err.GatewayNotFoundError} `404`: no repo has exactly the old name
151
+ * @throws {Err.GatewayRepoArchivedError} `409 repo-archived`: unarchive it first
152
+ * @throws {Err.GatewayRepoExistsError} `409 repo-exists`: a repo already holds the new name (any case)
153
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
154
+ * @throws {Err.GatewayInvalidRequestError} `400`: the forge does not accept the new name
155
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
156
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
157
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
158
+ * @throws {Err.GatewayUnexpectedResponseError} the answer is not the repo at the new name
159
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
160
+ * @lastreviewed null
161
+ */
162
+ rename(name: string, newName: string): Promise<GatewayMarketplaceRepo>;
163
+ /**
164
+ * Delete a marketplace repo (`DELETE /api/v1/registry/repos/{name}`, scope `registry:push`, a fleet super):
165
+ * the gateway renames it to its tombstone and archives it. Nothing is destroyed (history, tags and npm packages
166
+ * stay), the name is free for `create` again, and a git client on the old URL gets `404`. A purge of the
167
+ * tombstone is what destroys it.
168
+ * @returns the tombstone's name (`_deleted-<id>-<name>`), which {@link purge} takes
169
+ * @throws {Err.GatewayInvalidArgumentError} the name is not a marketplace repo name; nothing sent
170
+ * @throws {Err.GatewayNotFoundError} `404`
171
+ * @throws {Err.GatewayRepoExistsError} `409 repo-exists`: a repo already holds the tombstone's name
172
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
173
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
174
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
175
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
176
+ * @throws {Err.GatewayUnexpectedResponseError} the answer names no tombstone of this repo
177
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
178
+ * @lastreviewed null
179
+ */
180
+ delete(name: string): Promise<string>;
181
+ /**
182
+ * The deleted marketplace repos still awaiting a purge (`GET /api/v1/registry/tombstones`, scope
183
+ * `registry:push`, a fleet super), sorted by tombstone name as the gateway sends them. An entry of the wrong
184
+ * shape is left out. There is no restore.
185
+ * @throws {Err.GatewayUnexpectedResponseError} the body is not a tombstone list at all
186
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
187
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
188
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
189
+ * @lastreviewed null
190
+ */
191
+ tombstones(): Promise<GatewayMarketplaceTombstone[]>;
192
+ /**
193
+ * Purge a tombstone for good (`DELETE /api/v1/registry/tombstones/{tombstone}`): the gateway deletes the
194
+ * archived repo from the forge, history and tags with it. There is no undo and no waiting period, and the purge
195
+ * is audited. npm packages are unaffected. The caller must be a fleet super holding `registry:push` AND the
196
+ * history-manager grant.
197
+ *
198
+ * `tombstone` is the name {@link delete} returned or {@link tombstones} lists (`_deleted-<id>-<name>`), not a
199
+ * marketplace repo name: it is checked against the tombstone rule, not the repo name rule.
200
+ * @throws {Err.GatewayInvalidArgumentError} not a tombstone name; nothing sent
201
+ * @throws {Err.GatewayNotFoundError} `404`: no such tombstone
202
+ * @throws {Err.GatewayNotArchivedError} `409 not-archived`: the tombstone is not archived
203
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
204
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
205
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super or lacks the
206
+ * history-manager grant (the message says both are needed)
207
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
208
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
209
+ * @lastreviewed null
210
+ */
211
+ purge(tombstone: string): Promise<void>;
212
+ private setArchived;
213
+ private requireName;
214
+ private repoPath;
215
+ /**
216
+ * The repo an answer carries, which must be the one the request was about.
217
+ * @lastreviewed null
218
+ */
219
+ private repoAnswer;
93
220
  /**
94
221
  * Create a marketplace repo (`POST /api/v1/registry/repos`, scope `registry:push`, a fleet super): the gateway
95
222
  * makes it private and empty with default branch `main`, sets the metadata given and protects `main`.
@@ -114,6 +241,11 @@ export declare class GatewayMarketplace {
114
241
  * @lastreviewed null
115
242
  */
116
243
  create(request: GatewayMarketplaceCreateRequest): Promise<GatewayMarketplaceCreateResult>;
244
+ /**
245
+ * A repo by name from the listing: what {@link pull} clones. An empty repo is not listed, and so is not pulled.
246
+ * @lastreviewed null
247
+ */
248
+ private listed;
117
249
  private entries;
118
250
  /**
119
251
  * Make `options.dir` (default: `<cwd>/<name>`, relative paths resolved against `options.cwd`) a
@@ -123,7 +255,7 @@ export declare class GatewayMarketplace {
123
255
  * tracks it; a clone on a tag is `up-to-date` only while the gateway's tag still points at the
124
256
  * checked-out commit. Nothing is merged, rebased or overwritten, and nothing is pushed.
125
257
  *
126
- * @param name the repo's name from {@link list}
258
+ * @param name the repo's name from {@link list}: an empty repo is not listed, so it is not pulled
127
259
  * @throws {Err.GatewayNotFoundError} no such repo
128
260
  * @throws {Err.GatewayConfigError} the folder is relative and `cwd` is missing or not absolute
129
261
  * @throws {Err.GatewayUnexpectedResponseError} the name cannot be a folder name (with no `dir`)
@@ -105,7 +105,19 @@ function parseRepoEntry(value, subject, status) {
105
105
  if (typeof gitUrl !== "string" || gitUrl === "") {
106
106
  throw bad("no gitUrl");
107
107
  }
108
- return { name, description, defaultBranch, tags, gitUrl };
108
+ // The repo lifecycle's members. A gateway from before it sends none: they default. One that is sent in
109
+ // the wrong shape is a malformed entry.
110
+ const { website = "", topics = [], archived = false } = value;
111
+ if (typeof website !== "string" || INVISIBLE.test(website)) {
112
+ throw bad("no usable website");
113
+ }
114
+ if (!Array.isArray(topics) || !topics.every((t) => typeof t === "string" && !INVISIBLE.test(t))) {
115
+ throw bad("topics that are not a list of plain strings");
116
+ }
117
+ if (typeof archived !== "boolean") {
118
+ throw bad("an archived flag that is not true or false");
119
+ }
120
+ return { name, description, defaultBranch, tags, gitUrl, website, topics, archived };
109
121
  }
110
122
  /**
111
123
  * A marketplace repo name as the gateway accepts it (contract 6.x, `POST /api/v1/registry/repos`).
@@ -124,11 +136,36 @@ function forgeReserves(name) {
124
136
  const lower = name.toLowerCase();
125
137
  return RESERVED_NAMES.has(lower) || RESERVED_SUFFIXES.some((suffix) => lower.endsWith(suffix));
126
138
  }
139
+ /**
140
+ * Whether `name` is a marketplace repo name the gateway accepts in a path or body: the name rule, no `..`, and
141
+ * none the forge reserves.
142
+ * @lastreviewed null
143
+ */
144
+ function isRepoName(name) {
145
+ return typeof name === "string" && REPO_NAME.test(name) && !name.includes("..") && !forgeReserves(name);
146
+ }
147
+ const NAME_RULE = 'must be lowercase letters, digits, ".", "_" or "-", start and end with a letter or digit, be at most 100 characters, not contain "..", and not be one the forge reserves (`.`, `..`, `-`, or ending `.git`, `.wiki`, `.rss` or `.atom`)';
148
+ /**
149
+ * A tombstone's name as the gateway parses it: `_deleted-<forge repo id>-<name>`, at most 100 characters, no `..`.
150
+ * It begins with `_`, so it is never a marketplace name and {@link isRepoName} does not apply to it.
151
+ * @lastreviewed null
152
+ */
153
+ const TOMBSTONE = /^_deleted-([1-9][0-9]{0,18})-([a-z0-9._-]+)$/;
154
+ function isTombstoneName(name) {
155
+ return typeof name === "string" && name.length <= 100 && !name.includes("..") && TOMBSTONE.test(name);
156
+ }
127
157
  const TOPIC = /^[a-z0-9][-.a-z0-9]*$/;
128
158
  const MAX_DESCRIPTION = 2048;
129
159
  const MAX_WEBSITE = 1024;
130
160
  const MAX_TOPICS = 25;
131
161
  const MAX_TOPIC_LENGTH = 35;
162
+ /**
163
+ * A caller's name for a message: only when it is plain printable text, else a placeholder.
164
+ * @lastreviewed null
165
+ */
166
+ function shown(name) {
167
+ return typeof name === "string" && name.length <= 100 && /^[\x21-\x7e]+$/.test(name) ? name : "that";
168
+ }
132
169
  function invalid(field, why) {
133
170
  return new Err_1.Err.GatewayInvalidArgumentError(`The marketplace repo ${field} ${why}; nothing was sent.`);
134
171
  }
@@ -193,6 +230,27 @@ function metadataBody(metadata) {
193
230
  }
194
231
  return body;
195
232
  }
233
+ const METADATA_MEMBERS = new Set(["description", "website", "topics"]);
234
+ /**
235
+ * One tombstone entry of `GET /api/v1/registry/tombstones`; `undefined` when it is not well formed.
236
+ * @lastreviewed null
237
+ */
238
+ function parseTombstone(value) {
239
+ if (!isRecord(value)) {
240
+ return undefined;
241
+ }
242
+ const { tombstone, deletedName, id, archived } = value;
243
+ if (!isTombstoneName(tombstone) ||
244
+ typeof deletedName !== "string" ||
245
+ INVISIBLE.test(deletedName) ||
246
+ typeof id !== "number" ||
247
+ !Number.isInteger(id) ||
248
+ id <= 0 ||
249
+ typeof archived !== "boolean") {
250
+ return undefined;
251
+ }
252
+ return { tombstone, deletedName, id, archived };
253
+ }
196
254
  /**
197
255
  * `refs/heads/x` and `refs/tags/x` are accepted and mean `x`, so the same options work on a second
198
256
  * pull (the clone's own branch is the short name).
@@ -220,7 +278,7 @@ function sameUrl(a, b) {
220
278
  }
221
279
  /**
222
280
  * Marketplace repositories on web-global's gateway: browse them, pull a plain working clone, and
223
- * create a new (empty) repo. Core has no push of its own (a repo is pushed with plain `git`), and a
281
+ * manage their lifecycle (create, edit, archive, rename, delete, purge). Core has no push of its own (a repo is pushed with plain `git`), and a
224
282
  * pull never reads or changes any script's sources or pins.
225
283
  * @lastreviewed null
226
284
  */
@@ -242,22 +300,234 @@ class GatewayMarketplace {
242
300
  return (await this.entries()).repos;
243
301
  }
244
302
  /**
245
- * One marketplace repo by name.
246
- * @throws {Err.GatewayNotFoundError} no repo has that name (or it is not visible to this user)
247
- * @throws {Err.GatewayUnexpectedResponseError} the entry for that name is malformed
303
+ * One marketplace repo by name (`GET /api/v1/registry/repos/{name}`, scope `registry:read`). Unlike
304
+ * {@link list}, it finds an empty repo too (one just created and not yet pushed to), and it carries the
305
+ * repo's `website`, `topics` and `archived`. A name the gateway could never hold (not a marketplace repo name,
306
+ * or one the forge reserves) is not found, with nothing sent.
307
+ * @throws {Err.GatewayNotFoundError} no repo has exactly that name (a renamed repo's old name is not found
308
+ * either)
309
+ * @throws {Err.GatewayUnexpectedResponseError} the answer is malformed, or is for another repo
310
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
248
311
  * @lastreviewed null
249
312
  */
250
313
  async get(name) {
251
- const { repos, malformed } = await this.entries();
252
- const found = repos.find((repo) => repo.name === name);
253
- if (found) {
254
- return found;
314
+ if (!isRepoName(name)) {
315
+ throw new Err_1.Err.GatewayNotFoundError(`No marketplace repo is named ${shown(name)}.`, "not-found");
255
316
  }
256
- const broken = malformed.get(name);
257
- if (broken) {
258
- throw broken;
317
+ const path = this.repoPath(name);
318
+ const answer = await this.client.requestDetailed(Http_1.Http.Methods.GET, path);
319
+ return this.repoAnswer(Http_1.Http.Methods.GET, path, answer, name);
320
+ }
321
+ /**
322
+ * Change a marketplace repo's metadata (`PATCH /api/v1/registry/repos/{name}`, scope `registry:push`, a fleet
323
+ * super). Only the members given change; one left out (or `undefined`) stays as it is. The members are checked as
324
+ * `create` checks them, and a change that names none (or any member but `description`, `website` and `topics`)
325
+ * fails here with nothing sent, as the gateway refuses it as `400`.
326
+ * @returns the repo as the forge now holds it
327
+ * @throws {Err.GatewayInvalidArgumentError} the name or a member is one the gateway would refuse; nothing sent
328
+ * @throws {Err.GatewayNotFoundError} `404`: no repo has exactly that name
329
+ * @throws {Err.GatewayRepoArchivedError} `409 repo-archived`: unarchive it first
330
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
331
+ * @throws {Err.GatewayInvalidRequestError} `400`
332
+ * @throws {Err.GatewayTooLargeError} `413`
333
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
334
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
335
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
336
+ * @throws {Err.GatewayUnexpectedResponseError} the answer is not the repo asked for
337
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
338
+ * @lastreviewed null
339
+ */
340
+ async edit(name, metadata) {
341
+ this.requireName("name", name);
342
+ if (typeof metadata !== "object" || metadata === null || Array.isArray(metadata)) {
343
+ throw invalid("change", "must be an object of the members to change");
344
+ }
345
+ for (const [member, value] of Object.entries(metadata)) {
346
+ if (value !== undefined && !METADATA_MEMBERS.has(member)) {
347
+ throw invalid("change", `may not name "${member}": only description, website and topics can be edited`);
348
+ }
259
349
  }
260
- throw new Err_1.Err.GatewayNotFoundError(`No marketplace repo is named ${name}.`, "not-found");
350
+ const body = metadataBody(metadata);
351
+ if (Object.keys(body).length === 0) {
352
+ throw invalid("change", "names no member to change (give description, website or topics)");
353
+ }
354
+ const path = this.repoPath(name);
355
+ const answer = await this.client.requestDetailed(Http_1.Http.Methods.PATCH, path, { body });
356
+ return this.repoAnswer(Http_1.Http.Methods.PATCH, path, answer, name);
357
+ }
358
+ /**
359
+ * Archive a marketplace repo (`POST /api/v1/registry/repos/{name}/archive`, scope `registry:push`, a fleet
360
+ * super): it can still be fetched, deleted and unarchived, but not pushed to, edited or renamed. Archiving an
361
+ * archived repo changes nothing and is not an error. npm packages are unaffected.
362
+ * @returns the repo, `archived` true
363
+ * @throws {Err.GatewayInvalidArgumentError} the name is not a marketplace repo name; nothing sent
364
+ * @throws {Err.GatewayNotFoundError} `404`
365
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
366
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
367
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
368
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
369
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
370
+ * @lastreviewed null
371
+ */
372
+ async archive(name) {
373
+ return this.setArchived(name, "archive");
374
+ }
375
+ /**
376
+ * Unarchive a marketplace repo (`POST /api/v1/registry/repos/{name}/unarchive`), so it can be pushed to,
377
+ * edited and renamed again. Unarchiving a repo that is not archived changes nothing and is not an error.
378
+ * Same errors as {@link archive}.
379
+ * @returns the repo, `archived` false
380
+ * @lastreviewed null
381
+ */
382
+ async unarchive(name) {
383
+ return this.setArchived(name, "unarchive");
384
+ }
385
+ /**
386
+ * Rename a marketplace repo (`POST /api/v1/registry/repos/{name}/rename`, scope `registry:push`, a fleet
387
+ * super). Its metadata, tags and branch protection move with it, the gateway answers a git client on the old
388
+ * URL with a `301` to the new one, and npm packages are unaffected. The new name is checked as `create` checks a
389
+ * name (reserved names included) and must differ from the old one; both fail here with nothing sent.
390
+ *
391
+ * A consumer with a clone of the repo should point its remote at the returned repo's `gitUrl`.
392
+ * @returns the repo at its new name
393
+ * @throws {Err.GatewayInvalidArgumentError} either name is one the gateway would refuse, or they are the same
394
+ * @throws {Err.GatewayNotFoundError} `404`: no repo has exactly the old name
395
+ * @throws {Err.GatewayRepoArchivedError} `409 repo-archived`: unarchive it first
396
+ * @throws {Err.GatewayRepoExistsError} `409 repo-exists`: a repo already holds the new name (any case)
397
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
398
+ * @throws {Err.GatewayInvalidRequestError} `400`: the forge does not accept the new name
399
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
400
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
401
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
402
+ * @throws {Err.GatewayUnexpectedResponseError} the answer is not the repo at the new name
403
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
404
+ * @lastreviewed null
405
+ */
406
+ async rename(name, newName) {
407
+ this.requireName("name", name);
408
+ this.requireName("new name", newName);
409
+ if (name === newName) {
410
+ throw invalid("new name", "is the repo's own name; nothing was sent");
411
+ }
412
+ const path = `${this.repoPath(name)}/rename`;
413
+ const answer = await this.client.requestDetailed(Http_1.Http.Methods.POST, path, { body: { name: newName } });
414
+ return this.repoAnswer(Http_1.Http.Methods.POST, path, answer, newName);
415
+ }
416
+ /**
417
+ * Delete a marketplace repo (`DELETE /api/v1/registry/repos/{name}`, scope `registry:push`, a fleet super):
418
+ * the gateway renames it to its tombstone and archives it. Nothing is destroyed (history, tags and npm packages
419
+ * stay), the name is free for `create` again, and a git client on the old URL gets `404`. A purge of the
420
+ * tombstone is what destroys it.
421
+ * @returns the tombstone's name (`_deleted-<id>-<name>`), which {@link purge} takes
422
+ * @throws {Err.GatewayInvalidArgumentError} the name is not a marketplace repo name; nothing sent
423
+ * @throws {Err.GatewayNotFoundError} `404`
424
+ * @throws {Err.GatewayRepoExistsError} `409 repo-exists`: a repo already holds the tombstone's name
425
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
426
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
427
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
428
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
429
+ * @throws {Err.GatewayUnexpectedResponseError} the answer names no tombstone of this repo
430
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
431
+ * @lastreviewed null
432
+ */
433
+ async delete(name) {
434
+ this.requireName("name", name);
435
+ const path = this.repoPath(name);
436
+ const answer = await this.client.requestDetailed(Http_1.Http.Methods.DELETE, path);
437
+ const wrong = (what) => new Err_1.Err.GatewayUnexpectedResponseError(`DELETE ${path}: the answer ${what}.`, answer.status, null);
438
+ if (!isRecord(answer.body)) {
439
+ throw wrong("has the wrong shape");
440
+ }
441
+ if (answer.body.name !== name) {
442
+ throw wrong("is for another repo than the one asked for");
443
+ }
444
+ const { tombstone } = answer.body;
445
+ if (!isTombstoneName(tombstone)) {
446
+ throw wrong("names no tombstone");
447
+ }
448
+ return tombstone;
449
+ }
450
+ /**
451
+ * The deleted marketplace repos still awaiting a purge (`GET /api/v1/registry/tombstones`, scope
452
+ * `registry:push`, a fleet super), sorted by tombstone name as the gateway sends them. An entry of the wrong
453
+ * shape is left out. There is no restore.
454
+ * @throws {Err.GatewayUnexpectedResponseError} the body is not a tombstone list at all
455
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
456
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super
457
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
458
+ * @lastreviewed null
459
+ */
460
+ async tombstones() {
461
+ const body = await this.client.getJson(Gateway_1.Gateway.Paths.REGISTRY_TOMBSTONES);
462
+ if (!isRecord(body) || !Array.isArray(body.tombstones)) {
463
+ throw new Err_1.Err.GatewayUnexpectedResponseError("The tombstone list is not the expected shape.", 200, null);
464
+ }
465
+ const found = [];
466
+ for (const entry of body.tombstones) {
467
+ const parsed = parseTombstone(entry);
468
+ if (parsed !== undefined) {
469
+ found.push(parsed);
470
+ }
471
+ }
472
+ return found;
473
+ }
474
+ /**
475
+ * Purge a tombstone for good (`DELETE /api/v1/registry/tombstones/{tombstone}`): the gateway deletes the
476
+ * archived repo from the forge, history and tags with it. There is no undo and no waiting period, and the purge
477
+ * is audited. npm packages are unaffected. The caller must be a fleet super holding `registry:push` AND the
478
+ * history-manager grant.
479
+ *
480
+ * `tombstone` is the name {@link delete} returned or {@link tombstones} lists (`_deleted-<id>-<name>`), not a
481
+ * marketplace repo name: it is checked against the tombstone rule, not the repo name rule.
482
+ * @throws {Err.GatewayInvalidArgumentError} not a tombstone name; nothing sent
483
+ * @throws {Err.GatewayNotFoundError} `404`: no such tombstone
484
+ * @throws {Err.GatewayNotArchivedError} `409 not-archived`: the tombstone is not archived
485
+ * @throws {Err.GatewayRewriteInProgressError} `409 rewrite-in-progress`: retry shortly
486
+ * @throws {Err.GatewayScopeError} the token lacks `registry:push`
487
+ * @throws {Err.GatewayNotPermittedError} `403 not-permitted`: the owner is not a fleet super or lacks the
488
+ * history-manager grant (the message says both are needed)
489
+ * @throws {Err.GatewayForgeUnavailableError} `502 forge-unavailable`
490
+ * @throws {Err.GatewayError} a subclass for any other gateway failure
491
+ * @lastreviewed null
492
+ */
493
+ async purge(tombstone) {
494
+ if (!isTombstoneName(tombstone)) {
495
+ throw invalid("tombstone", "must be a tombstone name, `_deleted-<id>-<name>` (as `delete` returns it)");
496
+ }
497
+ try {
498
+ await this.client.requestDetailed(Http_1.Http.Methods.DELETE, `${Gateway_1.Gateway.Paths.REGISTRY_TOMBSTONES}/${encodeURIComponent(tombstone)}`);
499
+ }
500
+ catch (error) {
501
+ if (error instanceof Err_1.Err.GatewayNotPermittedError && error.code === "not-permitted") {
502
+ throw new Err_1.Err.GatewayNotPermittedError(`${error.message} A purge needs a fleet super holding registry:push and the history-manager grant.`, error.code, error.reason, error.presentingExpiresAt, error.scope);
503
+ }
504
+ throw error;
505
+ }
506
+ }
507
+ async setArchived(name, action) {
508
+ this.requireName("name", name);
509
+ const path = `${this.repoPath(name)}/${action}`;
510
+ const answer = await this.client.requestDetailed(Http_1.Http.Methods.POST, path);
511
+ return this.repoAnswer(Http_1.Http.Methods.POST, path, answer, name);
512
+ }
513
+ requireName(field, name) {
514
+ if (!isRepoName(name)) {
515
+ throw invalid(field, NAME_RULE);
516
+ }
517
+ }
518
+ repoPath(name) {
519
+ return `${Gateway_1.Gateway.Paths.REGISTRY_REPOS}/${encodeURIComponent(name)}`;
520
+ }
521
+ /**
522
+ * The repo an answer carries, which must be the one the request was about.
523
+ * @lastreviewed null
524
+ */
525
+ repoAnswer(method, path, answer, expected) {
526
+ const repo = parseRepoEntry(answer.body, `The answer to ${method} ${path}`, answer.status);
527
+ if (repo.name !== expected) {
528
+ throw new Err_1.Err.GatewayUnexpectedResponseError(`The answer to ${method} ${path} is for a repo with another name than the one asked for.`, answer.status, null);
529
+ }
530
+ return repo;
261
531
  }
262
532
  /**
263
533
  * Create a marketplace repo (`POST /api/v1/registry/repos`, scope `registry:push`, a fleet super): the gateway
@@ -298,6 +568,22 @@ class GatewayMarketplace {
298
568
  }
299
569
  return { repo, created: answer.status === 201 };
300
570
  }
571
+ /**
572
+ * A repo by name from the listing: what {@link pull} clones. An empty repo is not listed, and so is not pulled.
573
+ * @lastreviewed null
574
+ */
575
+ async listed(name) {
576
+ const { repos, malformed } = await this.entries();
577
+ const found = repos.find((repo) => repo.name === name);
578
+ if (found) {
579
+ return found;
580
+ }
581
+ const broken = malformed.get(name);
582
+ if (broken) {
583
+ throw broken;
584
+ }
585
+ throw new Err_1.Err.GatewayNotFoundError(`No marketplace repo is named ${shown(name)}.`, "not-found");
586
+ }
301
587
  async entries() {
302
588
  const body = await this.client.getJson(Gateway_1.Gateway.Paths.REGISTRY_REPOS);
303
589
  if (!isRecord(body) || !Array.isArray(body.repos)) {
@@ -329,7 +615,7 @@ class GatewayMarketplace {
329
615
  * tracks it; a clone on a tag is `up-to-date` only while the gateway's tag still points at the
330
616
  * checked-out commit. Nothing is merged, rebased or overwritten, and nothing is pushed.
331
617
  *
332
- * @param name the repo's name from {@link list}
618
+ * @param name the repo's name from {@link list}: an empty repo is not listed, so it is not pulled
333
619
  * @throws {Err.GatewayNotFoundError} no such repo
334
620
  * @throws {Err.GatewayConfigError} the folder is relative and `cwd` is missing or not absolute
335
621
  * @throws {Err.GatewayUnexpectedResponseError} the name cannot be a folder name (with no `dir`)
@@ -341,7 +627,7 @@ class GatewayMarketplace {
341
627
  * @lastreviewed null
342
628
  */
343
629
  async pull(name, options) {
344
- const repo = await this.get(name);
630
+ const repo = await this.listed(name);
345
631
  if (options.dir === undefined && !isPlainSegment(repo.name)) {
346
632
  throw new Err_1.Err.GatewayUnexpectedResponseError(`The marketplace repo name "${repo.name}" cannot be used as a folder name.`, 200, null);
347
633
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GatewayMarketplace.js","sourceRoot":"","sources":["../../src/gateway/GatewayMarketplace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,oCAAgB;AAClC,MAAY,IAAI,sCAAkB;AAClC,kDAA+C;AAC/C,gCAA6B;AAC7B,4CAAyC;AA6EzC,SAAS,QAAQ,CAAC,KAA4B;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,8DAA8D,CAAC;AAEjF;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAC,OAAe;IACrC,OAAO,CACL,OAAO,KAAK,EAAE;QACd,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QACxB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7B,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;QACxB,OAA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