@hot-updater/server 1.2.0-rc.50 → 1.2.0-rc.51

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.
@@ -320,6 +320,30 @@ const createAdminRouteHandlers = () => ({
320
320
  return row === null ? notFound() : json({ data: row });
321
321
  }),
322
322
  rebuildReleaseCatalog: onCore(async (core, _request, params) => json({ data: await core.rebuildReleaseCatalog(scopeKeyOf(params)) })),
323
+ /**
324
+ * The release a label names, or `null`: never 404, which tells a client
325
+ * the server has no such route.
326
+ */
327
+ getReleaseByLabel: onCore(async (core, request) => {
328
+ const url = new URL(request.url);
329
+ const channel = url.searchParams.get("channel");
330
+ const platform = platformOf(url);
331
+ const label = Number(url.searchParams.get("label"));
332
+ if (channel === null || channel.length === 0 || platform === void 0 || !Number.isSafeInteger(label) || label < 1) throw new HandlerBadRequestError("A release label lookup takes channel, platform, and a label of 1 or more.");
333
+ return json({ data: await core.getReleaseByLabel({
334
+ channel,
335
+ platform,
336
+ label
337
+ }) });
338
+ }),
339
+ fillReleaseLabels: onCore(async (core, request) => {
340
+ const body = await request.json().catch(() => ({}));
341
+ const input = body !== null && typeof body === "object" ? body : {};
342
+ return json({ data: await core.fillReleaseLabels({
343
+ dryRun: input.dryRun === true,
344
+ catalogs: input.catalogs !== false
345
+ }) });
346
+ }),
323
347
  updateBundle: onCore(async (core, request, params) => {
324
348
  const bundleId = requireRouteParam(params, "id");
325
349
  const update = bundleUpdateOf(await request.json(), bundleId);
@@ -547,6 +571,16 @@ const ADMIN_ROUTES = [
547
571
  path: "/release-scopes",
548
572
  handler: "listReleaseScopeKeys"
549
573
  },
574
+ {
575
+ method: "GET",
576
+ path: "/release-labels",
577
+ handler: "getReleaseByLabel"
578
+ },
579
+ {
580
+ method: "POST",
581
+ path: "/release-labels/fill",
582
+ handler: "fillReleaseLabels"
583
+ },
550
584
  {
551
585
  method: "POST",
552
586
  path: "/release-catalogs/:scopeKey/rebuild",
package/dist/package.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "1.2.0-rc.50";
2
+ var version = "1.2.0-rc.51";
3
3
  //#endregion
4
4
  Object.defineProperty(exports, "version", {
5
5
  enumerable: true,
package/dist/package.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "1.2.0-rc.50";
2
+ var version = "1.2.0-rc.51";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/server",
3
- "version": "1.2.0-rc.50",
3
+ "version": "1.2.0-rc.51",
4
4
  "type": "module",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "sideEffects": false,
@@ -50,11 +50,11 @@
50
50
  "dependencies": {
51
51
  "rou3": "0.7.9",
52
52
  "verkit": "0.4.0",
53
- "@hot-updater/plugin-core": "1.2.0-rc.50",
54
- "@hot-updater/plugin-api-keys": "1.2.0-rc.50",
55
- "@hot-updater/plugin-remote-config": "1.2.0-rc.50",
56
- "@hot-updater/plugin-insights": "1.2.0-rc.50",
57
- "@hot-updater/protocol": "1.2.0-rc.50"
53
+ "@hot-updater/protocol": "1.2.0-rc.51",
54
+ "@hot-updater/plugin-api-keys": "1.2.0-rc.51",
55
+ "@hot-updater/plugin-insights": "1.2.0-rc.51",
56
+ "@hot-updater/plugin-remote-config": "1.2.0-rc.51",
57
+ "@hot-updater/plugin-core": "1.2.0-rc.51"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "@prisma/client": "*",