@hot-updater/console 1.0.0-rc.0 → 1.0.0-rc.2

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 (203) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/HashValueDisplay-CB0Eskit.js +1 -0
  3. package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +1 -0
  4. package/.output/public/assets/api-keys-BzKocqRy.js +1 -0
  5. package/.output/public/assets/api-keys-api-BHcODB7q.js +1 -0
  6. package/.output/public/assets/card-Dhr_eFYj.js +1 -0
  7. package/.output/public/assets/{chart-no-axes-combined-FaYMGmQS.js → chart-no-axes-combined-Dy4WJv2U.js} +1 -1
  8. package/.output/public/assets/composite-Bp98A0Ld.js +1 -0
  9. package/.output/public/assets/createServerFn-CA8fs7QD.js +3 -0
  10. package/.output/public/assets/dialog-CUTrcPlB.js +1 -0
  11. package/.output/public/assets/{dist-DspNKfMj.js → dist-C_NydL0e.js} +1 -1
  12. package/.output/public/assets/index-DdAz-CXv.js +10 -0
  13. package/.output/public/assets/input-group-cSOG4wh_.js +1 -0
  14. package/.output/public/assets/insights-C0PBSZ-n.js +1 -0
  15. package/.output/public/assets/installations-CE33wgbY.js +2 -0
  16. package/.output/public/assets/installations-CStZja8x.js +1 -0
  17. package/.output/public/assets/lazyRouteComponent-Ccp3bwBY.js +1 -0
  18. package/.output/public/assets/link-CI8idAUi.js +1 -0
  19. package/.output/public/assets/loader-circle-BoxLrsOu.js +1 -0
  20. package/.output/public/assets/refresh-cw-Bqc72UZG.js +1 -0
  21. package/.output/public/assets/{routes-DcQnVajO.js → routes-DGVXdzpw.js} +2 -2
  22. package/.output/public/assets/routes-DTlwOr8I.js +1 -0
  23. package/.output/public/assets/{shield-check-DE_hVuHu.js → shield-check-uK3MHWJZ.js} +1 -1
  24. package/.output/public/assets/signing-CMf4aqDO.js +1 -0
  25. package/.output/public/assets/styles-BCvbtKsm.css +2 -0
  26. package/.output/public/assets/table-2vcV89QB.js +1 -0
  27. package/.output/public/assets/useCompositeListItem-CHLITE_4.js +1 -0
  28. package/.output/public/assets/x-DCd0j8c6.js +1 -0
  29. package/.output/server/{__23tanstack-start-server-fn-resolver-DBP9TQ7K.mjs → __23tanstack-start-server-fn-resolver-B7ioJhtE.mjs} +44 -52
  30. package/.output/server/_libs/@base-ui/react+[...].mjs +1906 -4040
  31. package/.output/server/_libs/@tanstack/react-router+[...].mjs +52 -4
  32. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +2 -2
  33. package/.output/server/_libs/lucide-react.mjs +36 -3
  34. package/.output/server/_libs/next-themes.mjs +2 -2
  35. package/.output/server/_libs/sonner.mjs +2 -2
  36. package/.output/server/_libs/tanstack__react-query.mjs +2 -2
  37. package/.output/server/_libs/verkit.mjs +20 -15
  38. package/.output/server/_runtime.mjs +1 -10
  39. package/.output/server/_ssr/HashValueDisplay-DwpGLfrl.mjs +55 -0
  40. package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +484 -0
  41. package/.output/server/_ssr/{api-keys-BnM_o2nS.mjs → api-keys-CZeTPQys.mjs} +11 -13
  42. package/.output/server/_ssr/{api-keys-api-CIywsSF5.mjs → api-keys-api-BUPQVSpk.mjs} +2 -2
  43. package/.output/server/_ssr/{api-keys-rpc-BSp1wkIV.mjs → api-keys-rpc-Cs7tS5_j.mjs} +5 -5
  44. package/.output/server/_ssr/{api-rpc-cG5wd_tO.mjs → api-rpc-tAupfGQm.mjs} +73 -142
  45. package/.output/server/_ssr/{auth-rpc-BrJ6obHJ.mjs → auth-rpc-DUaeOWKK.mjs} +4 -4
  46. package/.output/server/_ssr/{auth.server-DwKoZoQM.mjs → auth.server-DW71WzsD.mjs} +2 -5
  47. package/.output/server/_ssr/{bundle-signing-rpc-COoQhW8E.mjs → bundle-signing-rpc-BhnBw0-d.mjs} +2 -2
  48. package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +12 -0
  49. package/.output/server/_ssr/{alert-Dim3MGY5.mjs → card-BRiPmi0C.mjs} +61 -39
  50. package/.output/server/_ssr/{config.server-DEiLhKmy.mjs → config.server-afDuAwaG.mjs} +15 -8
  51. package/.output/server/_ssr/{createSsrRpc-9P0S0lJ3.mjs → createSsrRpc-DjWNJ0uc.mjs} +6 -6
  52. package/.output/server/_ssr/databaseJsonValue-d6I3nAS4.mjs +45 -0
  53. package/.output/server/_ssr/{databaseRows-CwbNwYSl.mjs → databaseRows-5bCRTxm-.mjs} +4 -44
  54. package/.output/server/_ssr/{deleteBundle-Cu_XOMt0.mjs → deleteBundle-BTGwBgzx.mjs} +2 -2
  55. package/.output/server/_ssr/{dialog-CQuRMNZ4.mjs → dialog-DS-nw-pA.mjs} +2 -2
  56. package/.output/server/_ssr/{dist-BVSLTpoP.mjs → dist-CyzPaI5v.mjs} +2 -2
  57. package/.output/server/_ssr/{getBundleChildren-BcRMFoDF.mjs → getBundleChildren-C0vh4ZvE.mjs} +2 -2
  58. package/.output/server/_ssr/input-group-BpsnmvZw.mjs +70 -0
  59. package/.output/server/_ssr/insights-BdS364Xu.mjs +460 -0
  60. package/.output/server/_ssr/insights-rpc-38DujK0G.mjs +57 -0
  61. package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +303 -0
  62. package/.output/server/_ssr/installations-CtA59MQG.mjs +29 -0
  63. package/.output/server/_ssr/installations-DiVKEF5T.mjs +627 -0
  64. package/.output/server/_ssr/{router-C-KUBfOi.mjs → router-B9wG_9f8.mjs} +37 -46
  65. package/.output/server/_ssr/{routes-Z7TwC6nC.mjs → routes-CKrrS2q2.mjs} +3 -3
  66. package/.output/server/_ssr/{routes-BM4ht9jb.mjs → routes-D7Yh_jfj.mjs} +402 -390
  67. package/.output/server/_ssr/runtime.server-DacU1TBV.mjs +438 -0
  68. package/.output/server/_ssr/{server-BjzmvXnO.mjs → server-D_C2rMzf.mjs} +5 -5
  69. package/.output/server/_ssr/{signing-k8GxyBDF.mjs → signing-Dz1WkZOf.mjs} +16 -85
  70. package/.output/server/_ssr/ssr.mjs +1 -1
  71. package/.output/server/_ssr/{field-DRIXKjZG.mjs → table-CnZmon_Z.mjs} +51 -5
  72. package/.output/server/_ssr/{uuidv7-BbJ-9D_I.mjs → uuidv7-D0QFkPL_.mjs} +3 -3
  73. package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +97 -0
  74. package/.output/server/index.mjs +168 -203
  75. package/lib/index.d.mts +4 -4
  76. package/lib/vite-internal.mjs +1 -1
  77. package/lib/vite.d.mts +0 -1
  78. package/package.json +8 -8
  79. package/src/components/AppSidebar.tsx +12 -16
  80. package/src/components/ConsoleAccessPage.tsx +1 -1
  81. package/src/components/HashValueDisplay.tsx +11 -2
  82. package/src/components/features/api-keys/ApiKeysPage.tsx +1 -1
  83. package/src/components/features/bundles/BundleChildrenPanel.tsx +7 -6
  84. package/src/components/features/bundles/BundleMetadata.tsx +1 -20
  85. package/src/components/features/channels/ChannelManagementDialog.tsx +1 -1
  86. package/src/components/features/insights/EventDetails.tsx +151 -0
  87. package/src/components/features/insights/EventHistoryCard.tsx +245 -0
  88. package/src/components/features/insights/EventHistoryList.tsx +63 -0
  89. package/src/components/features/insights/InsightsBundleReports.tsx +51 -0
  90. package/src/components/features/insights/InsightsControls.tsx +121 -0
  91. package/src/components/features/{analytics/AnalyticsErrorAlert.tsx → insights/InsightsErrorAlert.tsx} +6 -6
  92. package/src/components/features/insights/InsightsOverview.tsx +203 -0
  93. package/src/components/features/insights/InsightsPageHeader.tsx +48 -0
  94. package/src/components/features/insights/InsightsPagination.tsx +52 -0
  95. package/src/components/features/insights/InstallationHistoryCard.tsx +250 -0
  96. package/src/components/features/insights/InstallationMatchesCard.tsx +178 -0
  97. package/src/components/features/insights/InstallationPageHeader.tsx +90 -0
  98. package/src/components/features/releases/ReleaseEditorSheet.tsx +24 -24
  99. package/src/components/features/signing/BundleSigningPage.tsx +18 -126
  100. package/src/components/ui/badge.tsx +2 -0
  101. package/src/components/ui/combobox.tsx +1 -0
  102. package/src/components/ui/skeleton.tsx +4 -1
  103. package/src/components/ui/tooltip.tsx +1 -1
  104. package/src/index.ts +7 -3
  105. package/src/lib/api-rpc.ts +19 -90
  106. package/src/lib/api.ts +0 -99
  107. package/src/lib/insights-api.ts +100 -0
  108. package/src/lib/insights-rpc.ts +88 -0
  109. package/src/lib/insights-view.ts +15 -0
  110. package/src/lib/public-bundle-error.ts +19 -0
  111. package/src/lib/server/bundle-signing.server.ts +5 -82
  112. package/src/lib/server/console-runtime.server.ts +0 -9
  113. package/src/lib/server/releaseReachability.ts +1 -4
  114. package/src/lib/server/runtime.server.ts +6 -142
  115. package/src/routeTree.gen.ts +21 -21
  116. package/src/router.tsx +3 -0
  117. package/src/routes/-installations-search.ts +25 -12
  118. package/src/routes/__root.tsx +6 -16
  119. package/src/routes/api-keys.tsx +1 -1
  120. package/src/routes/index.tsx +21 -81
  121. package/src/routes/insights.tsx +84 -0
  122. package/src/routes/installations.tsx +294 -142
  123. package/src/styles.css +6 -0
  124. package/.output/public/assets/AnalyticsCapabilityContext-BCke57-7.js +0 -1
  125. package/.output/public/assets/BundleActivityChart-CnsBe_1J.js +0 -42
  126. package/.output/public/assets/BundleIdDisplay-Dky75zLU.js +0 -1
  127. package/.output/public/assets/alert-C-1KvDW8.js +0 -1
  128. package/.output/public/assets/analytics-Bqz0c-BT.js +0 -1
  129. package/.output/public/assets/analytics-api-CJdrTLLO.js +0 -1
  130. package/.output/public/assets/api-B_Rh-uzC.js +0 -1
  131. package/.output/public/assets/api-keys-BurCFhzH.js +0 -1
  132. package/.output/public/assets/api-keys-api-BEDJdQg3.js +0 -1
  133. package/.output/public/assets/badge-Bf0fZ-Gx.js +0 -1
  134. package/.output/public/assets/createServerFn-gM2-LFBy.js +0 -3
  135. package/.output/public/assets/dialog-BS60BRr2.js +0 -1
  136. package/.output/public/assets/download-O-yNBc9H.js +0 -1
  137. package/.output/public/assets/field-Buq148-A.js +0 -1
  138. package/.output/public/assets/index-kFhd2S78.js +0 -10
  139. package/.output/public/assets/installations-BrQ-od41.js +0 -2
  140. package/.output/public/assets/installations-CGlZ3ROz.js +0 -1
  141. package/.output/public/assets/lazyRouteComponent-rPzgA7S-.js +0 -1
  142. package/.output/public/assets/loader-circle-DCYF-wJl.js +0 -1
  143. package/.output/public/assets/refresh-cw-n8XYbPPj.js +0 -1
  144. package/.output/public/assets/routes-CrdokJ80.js +0 -1
  145. package/.output/public/assets/search-DLhbWw3W.js +0 -1
  146. package/.output/public/assets/signing-HRexfjsH.js +0 -1
  147. package/.output/public/assets/styles-eB4EtvFS.css +0 -2
  148. package/.output/public/assets/table-D8CLieHX.js +0 -1
  149. package/.output/public/assets/textarea-YJLTVAoq.js +0 -1
  150. package/.output/public/assets/useMutation-JsGVjQMY.js +0 -1
  151. package/.output/public/assets/useOpenInteractionType-4cRD5xO0.js +0 -1
  152. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +0 -1554
  153. package/.output/server/_libs/d3-array.mjs +0 -231
  154. package/.output/server/_libs/d3-color.mjs +0 -330
  155. package/.output/server/_libs/d3-format.mjs +0 -252
  156. package/.output/server/_libs/d3-interpolate.mjs +0 -207
  157. package/.output/server/_libs/d3-path.mjs +0 -77
  158. package/.output/server/_libs/d3-scale+[...].mjs +0 -1907
  159. package/.output/server/_libs/d3-shape.mjs +0 -818
  160. package/.output/server/_libs/decimal.js-light.mjs +0 -884
  161. package/.output/server/_libs/es-toolkit.mjs +0 -1134
  162. package/.output/server/_libs/eventemitter3.mjs +0 -236
  163. package/.output/server/_libs/immer.mjs +0 -532
  164. package/.output/server/_libs/react-redux+[...].mjs +0 -205
  165. package/.output/server/_libs/recharts+[...].mjs +0 -14117
  166. package/.output/server/_ssr/AnalyticsCapabilityContext-ui4DX8GO.mjs +0 -15
  167. package/.output/server/_ssr/BundleActivityChart-BiB9ZORH.mjs +0 -288
  168. package/.output/server/_ssr/BundleIdDisplay-Czk6iR6p.mjs +0 -13
  169. package/.output/server/_ssr/analytics-DtMTn8fn.mjs +0 -858
  170. package/.output/server/_ssr/analytics-api-Cg1M5v_H.mjs +0 -71
  171. package/.output/server/_ssr/analytics-input-fRRRn0uA.mjs +0 -96
  172. package/.output/server/_ssr/analytics-rpc-DY5uXvHT.mjs +0 -155
  173. package/.output/server/_ssr/api-BTSv1tZb.mjs +0 -282
  174. package/.output/server/_ssr/badge-DCxbEeof.mjs +0 -26
  175. package/.output/server/_ssr/bundle-signing.server-D5u8KkMp.mjs +0 -51
  176. package/.output/server/_ssr/installations-B-azgAvX.mjs +0 -19
  177. package/.output/server/_ssr/installations-Ctvzp2JH.mjs +0 -535
  178. package/.output/server/_ssr/runtime.server-awTLiiXW.mjs +0 -527
  179. package/.output/server/_ssr/table-v1yCvYo7.mjs +0 -53
  180. package/.output/server/_ssr/textarea-DYHnskhb.mjs +0 -14
  181. package/.output/server/_tanstack-start-manifest_v-CH4StzJu.mjs +0 -108
  182. package/src/components/features/analytics/ActivityChart.tsx +0 -150
  183. package/src/components/features/analytics/AnalyticsCapabilityContext.tsx +0 -24
  184. package/src/components/features/analytics/AnalyticsControls.tsx +0 -115
  185. package/src/components/features/analytics/AnalyticsOverview.tsx +0 -208
  186. package/src/components/features/analytics/BundleDistribution.tsx +0 -133
  187. package/src/components/features/analytics/BundleSelector.tsx +0 -114
  188. package/src/components/features/analytics/InstallationHistoryCard.tsx +0 -248
  189. package/src/components/features/analytics/InstallationMatchesCard.tsx +0 -132
  190. package/src/components/features/analytics/InstallationPageHeader.tsx +0 -138
  191. package/src/components/features/analytics/InstallationPagination.tsx +0 -48
  192. package/src/components/features/analytics/InstallationSearch.tsx +0 -230
  193. package/src/components/features/analytics/UpdateOutcomes.tsx +0 -147
  194. package/src/components/features/bundles/BundleActivityChart.tsx +0 -193
  195. package/src/components/features/bundles/BundleAnalyticsSummary.tsx +0 -123
  196. package/src/lib/analytics-api.ts +0 -145
  197. package/src/lib/analytics-error.ts +0 -19
  198. package/src/lib/analytics-input.ts +0 -187
  199. package/src/lib/analytics-overview.ts +0 -170
  200. package/src/lib/analytics-rpc.ts +0 -218
  201. package/src/lib/server/releaseActivity.ts +0 -27
  202. package/src/routes/analytics.tsx +0 -139
  203. /package/.output/public/assets/{preload-helper-TKOBYGYD.js → preload-helper-CQ36nxok.js} +0 -0
@@ -0,0 +1,438 @@
1
+ import { x as isUUIDv7 } from "./dist-CyzPaI5v.mjs";
2
+ import { t as createUUIDv7 } from "./uuidv7-D0QFkPL_.mjs";
3
+ import { i as toInsightsInstallationRow, n as isInsightsMovementEvent, t as compareInsightsText } from "./insightsContract-fjJDBeEE.mjs";
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/runtime.server-DacU1TBV.js
5
+ var InsightsBadRequestError = class extends Error {
6
+ name = "InsightsBadRequestError";
7
+ };
8
+ var MAX_EVENT_STRING_LENGTH = 1024;
9
+ var MAX_IDENTITY_LENGTH$1 = 255;
10
+ var eventKeys = /* @__PURE__ */ new Set([
11
+ "type",
12
+ "installId",
13
+ "toBundleId",
14
+ "userId",
15
+ "username",
16
+ "platform",
17
+ "appVersion",
18
+ "channel",
19
+ "cohort",
20
+ "fingerprintHash",
21
+ "fromBundleId",
22
+ "fromReleaseId",
23
+ "toReleaseId",
24
+ "updateStrategy",
25
+ "sdkVersion"
26
+ ]);
27
+ function isRecord$1(value) {
28
+ return typeof value === "object" && value !== null && !Array.isArray(value);
29
+ }
30
+ function requireStringField(payload, key) {
31
+ const value = payload[key];
32
+ if (typeof value !== "string" || value.length === 0 || value.length > MAX_EVENT_STRING_LENGTH || new TextDecoder("utf-8", { ignoreBOM: true }).decode(new TextEncoder().encode(value)) !== value) throw new InsightsBadRequestError(`Invalid event field: ${key}`);
33
+ return value;
34
+ }
35
+ function requireNullableStringField(payload, key) {
36
+ if (payload[key] === null) return null;
37
+ return requireStringField(payload, key);
38
+ }
39
+ function requireIdentityField(payload, key) {
40
+ const value = requireStringField(payload, key);
41
+ if (value.length > MAX_IDENTITY_LENGTH$1) throw new InsightsBadRequestError(`Invalid event field: ${key}`);
42
+ return value;
43
+ }
44
+ function requireEvent(payload) {
45
+ if (!isRecord$1(payload) || Object.keys(payload).some((key) => !eventKeys.has(key))) throw new InsightsBadRequestError("Invalid event payload");
46
+ const platform = requireStringField(payload, "platform");
47
+ if (platform !== "ios" && platform !== "android") throw new InsightsBadRequestError("Invalid event field: platform");
48
+ const base = {
49
+ installId: requireIdentityField(payload, "installId"),
50
+ toBundleId: requireStringField(payload, "toBundleId"),
51
+ ...payload.userId === void 0 ? {} : { userId: requireIdentityField(payload, "userId") },
52
+ ...payload.username === void 0 ? {} : { username: requireStringField(payload, "username") },
53
+ platform,
54
+ appVersion: requireStringField(payload, "appVersion"),
55
+ channel: requireStringField(payload, "channel"),
56
+ cohort: requireStringField(payload, "cohort"),
57
+ fingerprintHash: requireNullableStringField(payload, "fingerprintHash"),
58
+ sdkVersion: payload.sdkVersion === void 0 ? null : requireNullableStringField(payload, "sdkVersion"),
59
+ fromReleaseId: requireNullableStringField(payload, "fromReleaseId"),
60
+ toReleaseId: requireNullableStringField(payload, "toReleaseId")
61
+ };
62
+ const type = requireStringField(payload, "type");
63
+ switch (type) {
64
+ case "UPDATE_APPLIED":
65
+ case "RECOVERED":
66
+ case "RELEASE_ADOPTED": {
67
+ const updateStrategy = requireStringField(payload, "updateStrategy");
68
+ if (updateStrategy !== "fingerprint" && updateStrategy !== "appVersion") throw new InsightsBadRequestError("Invalid event field: updateStrategy");
69
+ return {
70
+ ...base,
71
+ type,
72
+ fromBundleId: requireStringField(payload, "fromBundleId"),
73
+ updateStrategy
74
+ };
75
+ }
76
+ case "UNCHANGED":
77
+ if (payload.fromBundleId !== null || payload.updateStrategy !== null) throw new InsightsBadRequestError("Invalid unchanged event shape");
78
+ return {
79
+ ...base,
80
+ type,
81
+ fromBundleId: null,
82
+ updateStrategy: null
83
+ };
84
+ default: throw new InsightsBadRequestError("Invalid event field: type");
85
+ }
86
+ }
87
+ function createBundleEventRow(input) {
88
+ input = requireEvent(input);
89
+ const base = {
90
+ app_version: input.appVersion,
91
+ channel: input.channel,
92
+ cohort: input.cohort,
93
+ fingerprint_hash: input.fingerprintHash,
94
+ from_release_id: input.fromReleaseId,
95
+ id: createUUIDv7(),
96
+ install_id: input.installId,
97
+ platform: input.platform,
98
+ received_at_ms: Date.now(),
99
+ sdk_version: input.sdkVersion ?? null,
100
+ to_bundle_id: input.toBundleId,
101
+ to_release_id: input.toReleaseId,
102
+ user_id: input.userId ?? null,
103
+ username: input.username ?? null
104
+ };
105
+ switch (input.type) {
106
+ case "UPDATE_APPLIED":
107
+ case "RECOVERED":
108
+ case "RELEASE_ADOPTED": return {
109
+ ...base,
110
+ from_bundle_id: input.fromBundleId,
111
+ type: input.type,
112
+ update_strategy: input.updateStrategy
113
+ };
114
+ case "UNCHANGED": return {
115
+ ...base,
116
+ from_bundle_id: null,
117
+ type: input.type,
118
+ update_strategy: null
119
+ };
120
+ }
121
+ }
122
+ var DEFAULT_PAGE_LIMIT = 50;
123
+ var MAX_PAGE_LIMIT = 100;
124
+ var MAX_EVENT_ID_LENGTH = 1024;
125
+ var MAX_IDENTITY_LENGTH = 255;
126
+ var MAX_CURSOR_LENGTH = 8192;
127
+ var WINDOW_MS = {
128
+ "24h": 864e5,
129
+ "7d": 6048e5,
130
+ "30d": 2592e6
131
+ };
132
+ var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
133
+ var requireString = (value, label, maximumLength) => {
134
+ if (typeof value !== "string" || value.length === 0 || value.length > maximumLength || new TextDecoder("utf-8", { ignoreBOM: true }).decode(new TextEncoder().encode(value)) !== value) throw new InsightsBadRequestError(`Invalid ${label}.`);
135
+ return value;
136
+ };
137
+ var requireTimestamp = (value, label) => {
138
+ if (!Number.isSafeInteger(value) || Number(value) < 0) throw new InsightsBadRequestError(`Invalid ${label}.`);
139
+ return Number(value);
140
+ };
141
+ var readLimit = (value) => {
142
+ const limit = value ?? DEFAULT_PAGE_LIMIT;
143
+ if (!Number.isSafeInteger(limit) || limit < 1 || limit > MAX_PAGE_LIMIT) throw new InsightsBadRequestError("Invalid page limit.");
144
+ return limit;
145
+ };
146
+ var encodeBase64Url = (value) => {
147
+ const bytes = new TextEncoder().encode(value);
148
+ let binary = "";
149
+ for (const byte of bytes) binary += String.fromCharCode(byte);
150
+ return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/u, "");
151
+ };
152
+ var decodeBase64Url = (value) => {
153
+ if (value.length === 0 || value.length > MAX_CURSOR_LENGTH) throw new InsightsBadRequestError("Invalid Insights cursor.");
154
+ try {
155
+ const base64 = value.replaceAll("-", "+").replaceAll("_", "/");
156
+ const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
157
+ const binary = atob(padded);
158
+ const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
159
+ return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
160
+ } catch {
161
+ throw new InsightsBadRequestError("Invalid Insights cursor.");
162
+ }
163
+ };
164
+ var encodeCursor = (value) => encodeBase64Url(JSON.stringify(value));
165
+ var decodeCursor = (value) => {
166
+ try {
167
+ return JSON.parse(decodeBase64Url(value));
168
+ } catch (error) {
169
+ if (error instanceof InsightsBadRequestError) throw error;
170
+ throw new InsightsBadRequestError("Invalid Insights cursor.");
171
+ }
172
+ };
173
+ var readScope = (input) => {
174
+ if (input.platform !== "ios" && input.platform !== "android") throw new InsightsBadRequestError("Invalid Insights platform.");
175
+ return {
176
+ platform: input.platform,
177
+ channel: requireString(input.channel, "channel", MAX_EVENT_ID_LENGTH)
178
+ };
179
+ };
180
+ var bundleFilter = (input) => {
181
+ const scope = readScope(input);
182
+ const bundleId = requireString(input.bundleId, "bundle ID", MAX_EVENT_ID_LENGTH);
183
+ switch (input.outcome) {
184
+ case "applied": return {
185
+ ...scope,
186
+ type: "UPDATE_APPLIED",
187
+ toBundleId: bundleId
188
+ };
189
+ case "recovered": return {
190
+ ...scope,
191
+ type: "RECOVERED",
192
+ fromBundleId: bundleId
193
+ };
194
+ case "adopted": return {
195
+ ...scope,
196
+ type: "RELEASE_ADOPTED",
197
+ toBundleId: bundleId
198
+ };
199
+ default: throw new InsightsBadRequestError("Invalid Insights outcome.");
200
+ }
201
+ };
202
+ var sameFilter = (left, right) => {
203
+ if (!isRecord(left) || left.kind !== right.kind) return false;
204
+ switch (right.kind) {
205
+ case "all": return true;
206
+ case "installationMovement": return left.installId === right.installId;
207
+ case "bundle": return left.platform === right.platform && left.channel === right.channel && left.type === right.type && (right.type === "RECOVERED" ? left.fromBundleId === right.fromBundleId : left.toBundleId === right.toBundleId);
208
+ }
209
+ };
210
+ var readEventCursor = (value, filter) => {
211
+ const cursor = decodeCursor(value);
212
+ if (!isRecord(cursor) || cursor.version !== 2 || cursor.kind !== "events" || !isRecord(cursor.filter) || !isRecord(cursor.after)) throw new InsightsBadRequestError("Invalid Insights cursor.");
213
+ if (!sameFilter(cursor.filter, filter)) throw new InsightsBadRequestError("Insights cursor does not match the requested events.");
214
+ if (typeof cursor.after.id !== "string" || !isUUIDv7(cursor.after.id)) throw new InsightsBadRequestError("Invalid Insights event cursor ID.");
215
+ return {
216
+ after: {
217
+ id: cursor.after.id,
218
+ receivedAtMs: requireTimestamp(cursor.after.receivedAtMs, "event cursor")
219
+ },
220
+ beforeReceivedAtMs: requireTimestamp(cursor.beforeReceivedAtMs, "event cutoff"),
221
+ kind: "events",
222
+ sinceMs: requireTimestamp(cursor.sinceMs, "event start"),
223
+ filter,
224
+ version: 2
225
+ };
226
+ };
227
+ var readUserInstallationCursor = (value, userId) => {
228
+ const cursor = decodeCursor(value);
229
+ if (!isRecord(cursor) || cursor.version !== 1 || cursor.kind !== "user-installations" || cursor.userId !== userId) throw new InsightsBadRequestError("Insights cursor does not match the requested user ID.");
230
+ return {
231
+ afterInstallId: requireString(cursor.afterInstallId, "installation cursor", MAX_IDENTITY_LENGTH),
232
+ kind: "user-installations",
233
+ userId,
234
+ version: 1
235
+ };
236
+ };
237
+ var compareEventNewest = (left, right) => right.received_at_ms - left.received_at_ms || compareInsightsText(right.id, left.id);
238
+ var isAfterEventCursor = (row, after) => row.received_at_ms < after.receivedAtMs || row.received_at_ms === after.receivedAtMs && compareInsightsText(row.id, after.id) < 0;
239
+ var assertEventRows = (rows, input) => {
240
+ if (rows.length > input.limit) throw new Error("Insights database returned too many event rows.");
241
+ for (let index = 0; index < rows.length; index += 1) {
242
+ const row = rows[index];
243
+ const previous = rows[index - 1];
244
+ if (!row || typeof row.id !== "string" || !isUUIDv7(row.id) || !Number.isSafeInteger(row.received_at_ms) || row.received_at_ms >= input.beforeReceivedAtMs || row.received_at_ms < input.sinceMs || previous !== void 0 && compareEventNewest(previous, row) >= 0 || input.after !== void 0 && !isAfterEventCursor(row, input.after) || input.filter.kind === "installationMovement" && (row.install_id !== input.filter.installId || !isInsightsMovementEvent(row)) || input.filter.kind === "bundle" && (row.platform !== input.filter.platform || row.channel !== input.filter.channel || row.type !== input.filter.type || (input.filter.type === "RECOVERED" ? row.from_bundle_id !== input.filter.fromBundleId : row.to_bundle_id !== input.filter.toBundleId))) throw new Error("Insights database returned invalid event rows.");
245
+ }
246
+ };
247
+ var toEventHistoryRow = (row) => ({
248
+ appVersion: row.app_version,
249
+ channel: row.channel,
250
+ cohort: row.cohort,
251
+ fromBundleId: row.from_bundle_id,
252
+ id: row.id,
253
+ installId: row.install_id,
254
+ platform: row.platform,
255
+ receivedAtMs: row.received_at_ms,
256
+ toBundleId: row.to_bundle_id,
257
+ type: row.type,
258
+ userId: row.user_id,
259
+ username: row.username
260
+ });
261
+ var toInstallationRow = (row) => ({
262
+ appVersion: row.app_version,
263
+ channel: row.channel,
264
+ cohort: row.cohort,
265
+ installId: row.install_id,
266
+ lastKnownBundleId: row.to_bundle_id,
267
+ latestStatus: row.type,
268
+ platform: row.platform,
269
+ receivedAtMs: row.received_at_ms,
270
+ userId: row.user_id,
271
+ username: row.username
272
+ });
273
+ var pageEventRows = async (model, input, filter, map) => {
274
+ const limit = readLimit(input.limit);
275
+ const cursor = input.cursor === void 0 ? void 0 : readEventCursor(input.cursor, filter);
276
+ const beforeReceivedAtMs = cursor?.beforeReceivedAtMs ?? (input.beforeReceivedAtMs === void 0 ? Date.now() : requireTimestamp(input.beforeReceivedAtMs, "event cutoff"));
277
+ if (cursor !== void 0 && input.beforeReceivedAtMs !== void 0 && input.beforeReceivedAtMs !== beforeReceivedAtMs) throw new InsightsBadRequestError("Insights cursor does not match the requested event cutoff.");
278
+ const sinceMs = cursor?.sinceMs ?? (input.sinceMs === void 0 ? 0 : requireTimestamp(input.sinceMs, "event start"));
279
+ if (sinceMs > beforeReceivedAtMs || input.sinceMs !== void 0 && input.sinceMs !== sinceMs || cursor !== void 0 && (cursor.after.receivedAtMs < sinceMs || cursor.after.receivedAtMs >= beforeReceivedAtMs)) throw new InsightsBadRequestError("Insights cursor or range does not match the requested event start.");
280
+ const databaseInput = {
281
+ filter,
282
+ sinceMs,
283
+ beforeReceivedAtMs,
284
+ ...cursor === void 0 ? {} : { after: cursor.after },
285
+ limit: limit + 1
286
+ };
287
+ const rows = await model.listEvents(databaseInput);
288
+ assertEventRows(rows, databaseInput);
289
+ const pageRows = rows.slice(0, limit);
290
+ const last = pageRows.at(-1);
291
+ return {
292
+ beforeReceivedAtMs,
293
+ data: pageRows.map(map),
294
+ nextCursor: rows.length > limit && last ? encodeCursor({
295
+ after: {
296
+ id: last.id,
297
+ receivedAtMs: last.received_at_ms
298
+ },
299
+ beforeReceivedAtMs,
300
+ kind: "events",
301
+ filter,
302
+ sinceMs,
303
+ version: 2
304
+ }) : null
305
+ };
306
+ };
307
+ var assertInstallationRows = (rows, input) => {
308
+ if (rows.length > input.limit) throw new Error("Insights database returned too many installation rows.");
309
+ for (let index = 0; index < rows.length; index += 1) {
310
+ const row = rows[index];
311
+ const previous = rows[index - 1];
312
+ if (!row || row.user_id !== input.userId || input.afterInstallId !== void 0 && compareInsightsText(row.install_id, input.afterInstallId) <= 0 || previous !== void 0 && compareInsightsText(previous.install_id, row.install_id) >= 0) throw new Error("Insights database returned invalid installation rows.");
313
+ }
314
+ };
315
+ var createInsightsProvider = (model) => Object.freeze({
316
+ async appendBundleEvent(input) {
317
+ const event = createBundleEventRow(input);
318
+ await model.record({
319
+ event,
320
+ installation: toInsightsInstallationRow(event)
321
+ });
322
+ },
323
+ listEvents(input) {
324
+ return pageEventRows(model, input, input.bundle === void 0 ? { kind: "all" } : {
325
+ kind: "bundle",
326
+ ...bundleFilter(input.bundle)
327
+ }, toEventHistoryRow);
328
+ },
329
+ async listInstallationEvents(input) {
330
+ if ("bundle" in input && input.bundle !== void 0) throw new InsightsBadRequestError("Installation movement queries cannot include a bundle filter.");
331
+ return pageEventRows(model, input, {
332
+ kind: "installationMovement",
333
+ installId: requireString(input.installId, "install ID", MAX_IDENTITY_LENGTH)
334
+ }, (row) => toEventHistoryRow(row));
335
+ },
336
+ async getInstallation({ installId }) {
337
+ const normalizedInstallId = requireString(installId, "install ID", MAX_IDENTITY_LENGTH);
338
+ const rows = await model.findInstallations({ installId: normalizedInstallId });
339
+ const row = rows[0] ?? null;
340
+ if (rows.length > 1 || row !== null && row.install_id !== normalizedInstallId) throw new Error("Insights database returned an invalid installation.");
341
+ return row === null ? null : toInstallationRow(row);
342
+ },
343
+ async pageInstallationsByCurrentUserId(input) {
344
+ const userId = requireString(input.userId, "user ID", MAX_IDENTITY_LENGTH);
345
+ const limit = readLimit(input.limit);
346
+ const cursor = input.cursor === void 0 ? void 0 : readUserInstallationCursor(input.cursor, userId);
347
+ const databaseInput = {
348
+ userId,
349
+ ...cursor === void 0 ? {} : { afterInstallId: cursor.afterInstallId },
350
+ limit: limit + 1
351
+ };
352
+ const rows = await model.findInstallations(databaseInput);
353
+ assertInstallationRows(rows, databaseInput);
354
+ const pageRows = rows.slice(0, limit);
355
+ const last = pageRows.at(-1);
356
+ return {
357
+ data: pageRows.map(toInstallationRow),
358
+ nextCursor: rows.length > limit && last ? encodeCursor({
359
+ afterInstallId: last.install_id,
360
+ kind: "user-installations",
361
+ userId,
362
+ version: 1
363
+ }) : null
364
+ };
365
+ },
366
+ async getReportingOverview(input) {
367
+ const scope = readScope(input);
368
+ const { window } = input;
369
+ if (!Object.hasOwn(WINDOW_MS, window)) throw new InsightsBadRequestError("Invalid reporting installation window.");
370
+ const beforeReceivedAtMs = Date.now();
371
+ const sinceMs = Math.max(0, beforeReceivedAtMs - WINDOW_MS[window]);
372
+ const measure = async (count) => {
373
+ const value = await count;
374
+ if (!Number.isSafeInteger(value) || value < 0) throw new Error("Insights database returned an invalid count.");
375
+ return {
376
+ count: value,
377
+ measuredAtMs: Date.now()
378
+ };
379
+ };
380
+ const bundleId = input.bundleId === void 0 ? void 0 : requireString(input.bundleId, "bundle ID", MAX_EVENT_ID_LENGTH);
381
+ const reporting = measure(model.countInstallations({
382
+ ...scope,
383
+ sinceMs
384
+ }));
385
+ if (bundleId === void 0) return {
386
+ ...scope,
387
+ window,
388
+ sinceMs,
389
+ beforeReceivedAtMs,
390
+ reportingInstallations: await reporting
391
+ };
392
+ const countOutcome = (outcome) => measure(model.countEvents({
393
+ filter: bundleFilter({
394
+ ...scope,
395
+ bundleId,
396
+ outcome
397
+ }),
398
+ sinceMs,
399
+ beforeReceivedAtMs
400
+ }));
401
+ const [reportingInstallations, bundleInstallations, appliedReports, recoveredReports, adoptedReports] = await Promise.all([
402
+ reporting,
403
+ measure(model.countInstallations({
404
+ ...scope,
405
+ sinceMs,
406
+ bundleId
407
+ })),
408
+ countOutcome("applied"),
409
+ countOutcome("recovered"),
410
+ countOutcome("adopted")
411
+ ]);
412
+ return {
413
+ ...scope,
414
+ window,
415
+ sinceMs,
416
+ beforeReceivedAtMs,
417
+ reportingInstallations,
418
+ bundle: {
419
+ bundleId,
420
+ reportingInstallations: bundleInstallations,
421
+ appliedReports,
422
+ recoveredReports,
423
+ adoptedReports
424
+ }
425
+ };
426
+ }
427
+ });
428
+ function createRuntimeHotUpdater(config) {
429
+ return createInsightsProvider(config.database.models.insights);
430
+ }
431
+ function createApiKeyStore(config) {
432
+ const models = Reflect.get(config.database, "models");
433
+ const apiKeys = typeof models === "object" && models !== null ? Reflect.get(models, "apiKeys") : void 0;
434
+ if (typeof apiKeys !== "object" || apiKeys === null || typeof Reflect.get(apiKeys, "create") !== "function" || typeof Reflect.get(apiKeys, "findByHash") !== "function" || typeof Reflect.get(apiKeys, "list") !== "function" || typeof Reflect.get(apiKeys, "revoke") !== "function") return null;
435
+ return apiKeys;
436
+ }
437
+ //#endregion
438
+ export { createApiKeyStore, createRuntimeHotUpdater };
@@ -1,8 +1,8 @@
1
1
  import "../_runtime.mjs";
2
- import { at as require_react, it as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
2
  import { a as X_TSS_RAW_RESPONSE, d as getStartOptions, f as isRedirect, g as safeObjectMerge, h as runWithStartContext, i as TSS_SERVER_FUNCTION, l as flattenMiddlewares, m as mergeHeaders, n as TSS_CONTENT_TYPE_FRAMED_VERSIONED, o as X_TSS_SERIALIZED, p as isResolvedRedirect, r as TSS_FORMDATA_CONTEXT, s as createNullProtoObject, t as FrameType, u as getStartContext } from "./createServerFn-B2hcXoPM.mjs";
4
- import { t as getServerFnById } from "../__23tanstack-start-server-fn-resolver-DBP9TQ7K.mjs";
5
- import { n as defineHandlerCallback, r as renderRouterToString, s as RouterProvider, t as renderRouterToStream } from "../_libs/@tanstack/react-router+[...].mjs";
3
+ import { t as getServerFnById } from "../__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs";
4
+ import { J as require_react, q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
5
+ import { c as RouterProvider, n as defineHandlerCallback, r as renderRouterToString, t as renderRouterToStream } from "../_libs/@tanstack/react-router+[...].mjs";
6
6
  import { PassThrough, Readable } from "node:stream";
7
7
  import { AsyncLocalStorage } from "node:async_hooks";
8
8
  import { ReadableStream as ReadableStream$1 } from "node:stream/web";
@@ -4901,7 +4901,7 @@ var defaultSerovalPlugins = [
4901
4901
  * the dev styles URL for route-scoped CSS collection.
4902
4902
  */
4903
4903
  async function getStartManifest(matchedRoutes) {
4904
- const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-CH4StzJu.mjs");
4904
+ const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-2MjTyxil.mjs");
4905
4905
  const startManifest = tsrStartManifest();
4906
4906
  let routes = startManifest.routes;
4907
4907
  routes[rootRouteId];
@@ -7041,7 +7041,7 @@ var getBaseManifest = getProdBaseManifest;
7041
7041
  var createEarlyHintsForRequest = createEarlyHintsCollector;
7042
7042
  async function loadEntries() {
7043
7043
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
7044
- import("./router-C-KUBfOi.mjs"),
7044
+ import("./router-B9wG_9f8.mjs"),
7045
7045
  import("./start-DpViQGnt.mjs"),
7046
7046
  import("./empty-plugin-adapters-B5QvGpEl.mjs")
7047
7047
  ]);
@@ -1,13 +1,10 @@
1
- import { it as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
1
  import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
3
- import { E as Clipboard, O as CircleCheck, T as Download, c as ShieldCheck, d as RefreshCw, n as TriangleAlert, x as Info } from "../_libs/lucide-react.mjs";
4
- import { _ as Skeleton, g as SidebarTrigger, t as Button$1, w as createSsrRpc } from "./createSsrRpc-9P0S0lJ3.mjs";
2
+ import { q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
+ import { S as Info, c as ShieldCheck, d as RefreshCw, k as CircleCheck, n as TriangleAlert } from "../_libs/lucide-react.mjs";
4
+ import { _ as Skeleton, g as SidebarTrigger, t as Button$1, w as createSsrRpc } from "./createSsrRpc-DjWNJ0uc.mjs";
5
5
  import { n as useQuery } from "../_libs/tanstack__react-query.mjs";
6
- import { t as Textarea } from "./textarea-DYHnskhb.mjs";
7
- import { a as Card, i as AlertTitle, l as CardHeader, n as AlertAction, o as CardContent, r as AlertDescription, s as CardDescription, t as Alert, u as CardTitle } from "./alert-Dim3MGY5.mjs";
8
- import { t as Badge } from "./badge-DCxbEeof.mjs";
9
- import { n as toast } from "../_libs/sonner.mjs";
10
- //#region node_modules/.nitro/vite/services/ssr/assets/signing-k8GxyBDF.js
6
+ import { a as Badge, c as CardDescription, d as CardTitle, i as AlertTitle, n as AlertAction, o as Card, r as AlertDescription, s as CardContent, t as Alert, u as CardHeader } from "./card-BRiPmi0C.mjs";
7
+ //#region node_modules/.nitro/vite/services/ssr/assets/signing-Dz1WkZOf.js
11
8
  var import_jsx_runtime = require_jsx_runtime();
12
9
  var getBundleSigningInspectionRpc = createServerFn({ method: "GET" }).handler(createSsrRpc("662034966679a6d29db2b55e7ba665e26e6c9a58a5529f33aa857a2049616233"));
13
10
  var bundleSigningQueryKey = ["bundle-signing"];
@@ -17,7 +14,6 @@ var getBundleSigningInspectionQueryOptions = () => ({
17
14
  staleTime: 3e4
18
15
  });
19
16
  var useBundleSigningInspectionQuery = () => useQuery(getBundleSigningInspectionQueryOptions());
20
- var PUBLIC_KEY_FILENAME = "hot-updater-public-key.pem";
21
17
  function InspectionLoading() {
22
18
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
23
19
  "aria-label": "Loading bundle signing",
@@ -46,23 +42,22 @@ function InspectionError({ refetch }) {
46
42
  }
47
43
  function SigningStatusCard({ inspection }) {
48
44
  const enabled = inspection.status === "enabled";
49
- const misconfigured = inspection.status === "misconfigured";
50
45
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardHeader, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
51
46
  className: "flex flex-wrap items-center justify-between gap-2",
52
47
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, {
53
48
  className: "text-sm font-medium",
54
49
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Signing status" })
55
50
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
56
- variant: misconfigured ? "destructive" : enabled ? "default" : "outline",
57
- children: enabled ? "Enabled" : misconfigured ? "Misconfigured" : "Disabled"
51
+ variant: enabled ? "default" : "outline",
52
+ children: enabled ? "Enabled" : "Disabled"
58
53
  })]
59
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardDescription, { children: enabled ? "The Console found the public key configured for bundle verification." : misconfigured ? "Signing is enabled, but the public key cannot be inspected safely." : "Bundle signing is disabled in the current Hot Updater configuration." })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardContent, {
54
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardDescription, { children: enabled ? "Bundle signing is enabled in the current Hot Updater configuration." : "Bundle signing is disabled in the current Hot Updater configuration." })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardContent, {
60
55
  className: "flex flex-col gap-5",
61
56
  children: inspection.status === "disabled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, { children: [
62
57
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Info, { "aria-hidden": "true" }),
63
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: "Configure signing outside the Console" }),
64
59
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Use your signing provider or the Hot Updater CLI to configure a key. The Console never creates or stores private keys." })
65
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
60
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
66
61
  className: "grid gap-4 sm:grid-cols-2",
67
62
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
68
63
  className: "flex min-w-0 flex-col gap-1",
@@ -73,7 +68,7 @@ function SigningStatusCard({ inspection }) {
73
68
  className: "truncate text-sm font-medium",
74
69
  children: inspection.provider
75
70
  })]
76
- }), inspection.status === "enabled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
71
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
77
72
  className: "flex min-w-0 flex-col gap-1",
78
73
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
79
74
  className: "text-xs text-muted-foreground",
@@ -82,68 +77,8 @@ function SigningStatusCard({ inspection }) {
82
77
  className: "text-sm font-medium",
83
78
  children: inspection.algorithm
84
79
  })]
85
- }) : null]
86
- }), inspection.status === "enabled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
87
- className: "flex min-w-0 flex-col gap-1 border-t pt-4",
88
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
89
- className: "text-xs text-muted-foreground",
90
- children: "SPKI SHA-256 fingerprint"
91
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
92
- className: "break-all font-mono text-xs",
93
- children: inspection.fingerprint
94
80
  })]
95
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
96
- variant: "destructive",
97
- children: [
98
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
99
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: "Public key unavailable" }),
100
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: inspection.message })
101
- ]
102
- })] })
103
- })] });
104
- }
105
- function PublicKeyCard({ publicKey }) {
106
- const copyPublicKey = async () => {
107
- try {
108
- await navigator.clipboard.writeText(publicKey);
109
- toast.success("Public key copied");
110
- } catch {
111
- toast.error("Unable to copy public key");
112
- }
113
- };
114
- const downloadPublicKey = () => {
115
- const url = URL.createObjectURL(new Blob([`${publicKey}\n`], { type: "application/x-pem-file" }));
116
- const link = document.createElement("a");
117
- link.download = PUBLIC_KEY_FILENAME;
118
- link.href = url;
119
- link.click();
120
- URL.revokeObjectURL(url);
121
- };
122
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardHeader, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, {
123
- className: "text-sm font-medium",
124
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Public key" })
125
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardDescription, { children: "This public key may be embedded in native app configuration. Private key material is never available in the Console." })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardContent, {
126
- className: "flex flex-col gap-3",
127
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Textarea, {
128
- "aria-label": "Bundle signing public key",
129
- className: "min-h-56 resize-none font-mono text-xs",
130
- readOnly: true,
131
- spellCheck: false,
132
- value: publicKey
133
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
134
- className: "flex flex-wrap gap-2",
135
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
136
- onClick: () => void copyPublicKey(),
137
- size: "sm",
138
- variant: "outline",
139
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Clipboard, { "data-icon": "inline-start" }), "Copy"]
140
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
141
- onClick: downloadPublicKey,
142
- size: "sm",
143
- variant: "outline",
144
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Download, { "data-icon": "inline-start" }), "Download"]
145
- })]
146
- })]
81
+ })
147
82
  })] });
148
83
  }
149
84
  function BundleSigningPage() {
@@ -152,15 +87,11 @@ function BundleSigningPage() {
152
87
  if (inspection.isError || !inspection.data) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InspectionError, { refetch: () => void inspection.refetch() });
153
88
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
154
89
  className: "flex flex-col gap-6",
155
- children: [
156
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SigningStatusCard, { inspection: inspection.data }),
157
- inspection.data.status === "enabled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PublicKeyCard, { publicKey: inspection.data.publicKey }) : null,
158
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, { children: [
159
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CircleCheck, { "aria-hidden": "true" }),
160
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: "Read-only inspection" }),
161
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Configure or rotate signing keys through the provider or Hot Updater CLI. The Console only reads a checked-in public key file." })
162
- ] })
163
- ]
90
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SigningStatusCard, { inspection: inspection.data }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, { children: [
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CircleCheck, { "aria-hidden": "true" }),
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: "Read-only inspection" }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Configure or rotate signing keys through the provider or Hot Updater CLI. The Console never accesses signing credentials." })
94
+ ] })]
164
95
  });
165
96
  }
166
97
  function BundleSigningRoute() {
@@ -1,4 +1,4 @@
1
- import { i as defaultStreamHandler, n as createStartHandler } from "./server-BjzmvXnO.mjs";
1
+ import { i as defaultStreamHandler, n as createStartHandler } from "./server-D_C2rMzf.mjs";
2
2
  //#region node_modules/.nitro/vite/services/ssr/index.js
3
3
  var fetch = createStartHandler(defaultStreamHandler);
4
4
  function createServerEntry(entry) {