@aglyn/tenant-data-admin 1.0.0-beta.143

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 (374) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +7 -0
  3. package/jest.integration.config.d.ts +39 -0
  4. package/jest.integration.setup.d.ts +17 -0
  5. package/package.json +51 -0
  6. package/src/index.d.ts +17 -0
  7. package/src/index.js +18 -0
  8. package/src/index.js.map +1 -0
  9. package/src/lib/render-cache.d.ts +184 -0
  10. package/src/lib/render-cache.js +198 -0
  11. package/src/lib/render-cache.js.map +1 -0
  12. package/src/lib/server/account-addresses.d.ts +160 -0
  13. package/src/lib/server/account-addresses.js +311 -0
  14. package/src/lib/server/account-addresses.js.map +1 -0
  15. package/src/lib/server/account-emails.d.ts +219 -0
  16. package/src/lib/server/account-emails.js +640 -0
  17. package/src/lib/server/account-emails.js.map +1 -0
  18. package/src/lib/server/admin-audit.d.ts +180 -0
  19. package/src/lib/server/admin-audit.js +233 -0
  20. package/src/lib/server/admin-audit.js.map +1 -0
  21. package/src/lib/server/analytics-retention.d.ts +63 -0
  22. package/src/lib/server/analytics-retention.js +66 -0
  23. package/src/lib/server/analytics-retention.js.map +1 -0
  24. package/src/lib/server/api-http.d.ts +159 -0
  25. package/src/lib/server/api-http.js +230 -0
  26. package/src/lib/server/api-http.js.map +1 -0
  27. package/src/lib/server/api-keys.d.ts +117 -0
  28. package/src/lib/server/api-keys.js +298 -0
  29. package/src/lib/server/api-keys.js.map +1 -0
  30. package/src/lib/server/auth-handoff.d.ts +165 -0
  31. package/src/lib/server/auth-handoff.js +482 -0
  32. package/src/lib/server/auth-handoff.js.map +1 -0
  33. package/src/lib/server/auth-pools.d.ts +246 -0
  34. package/src/lib/server/auth-pools.js +551 -0
  35. package/src/lib/server/auth-pools.js.map +1 -0
  36. package/src/lib/server/billing-addons.d.ts +171 -0
  37. package/src/lib/server/billing-addons.js +277 -0
  38. package/src/lib/server/billing-addons.js.map +1 -0
  39. package/src/lib/server/campaign-attribution-store.d.ts +55 -0
  40. package/src/lib/server/campaign-attribution-store.js +95 -0
  41. package/src/lib/server/campaign-attribution-store.js.map +1 -0
  42. package/src/lib/server/campaign-conversion-attribution.d.ts +205 -0
  43. package/src/lib/server/campaign-conversion-attribution.js +279 -0
  44. package/src/lib/server/campaign-conversion-attribution.js.map +1 -0
  45. package/src/lib/server/client-error-report.d.ts +301 -0
  46. package/src/lib/server/client-error-report.js +755 -0
  47. package/src/lib/server/client-error-report.js.map +1 -0
  48. package/src/lib/server/connect-account-status.d.ts +74 -0
  49. package/src/lib/server/connect-account-status.js +94 -0
  50. package/src/lib/server/connect-account-status.js.map +1 -0
  51. package/src/lib/server/connect-payout-failure.d.ts +103 -0
  52. package/src/lib/server/connect-payout-failure.js +127 -0
  53. package/src/lib/server/connect-payout-failure.js.map +1 -0
  54. package/src/lib/server/console-api-rate-limit.d.ts +81 -0
  55. package/src/lib/server/console-api-rate-limit.js +111 -0
  56. package/src/lib/server/console-api-rate-limit.js.map +1 -0
  57. package/src/lib/server/console-domains.d.ts +326 -0
  58. package/src/lib/server/console-domains.js +779 -0
  59. package/src/lib/server/console-domains.js.map +1 -0
  60. package/src/lib/server/consume-once.d.ts +91 -0
  61. package/src/lib/server/consume-once.js +96 -0
  62. package/src/lib/server/consume-once.js.map +1 -0
  63. package/src/lib/server/contact-company-link.d.ts +85 -0
  64. package/src/lib/server/contact-company-link.js +105 -0
  65. package/src/lib/server/contact-company-link.js.map +1 -0
  66. package/src/lib/server/contact-email-engagement.d.ts +32 -0
  67. package/src/lib/server/contact-email-engagement.js +145 -0
  68. package/src/lib/server/contact-email-engagement.js.map +1 -0
  69. package/src/lib/server/contact-email-index.d.ts +56 -0
  70. package/src/lib/server/contact-email-index.js +158 -0
  71. package/src/lib/server/contact-email-index.js.map +1 -0
  72. package/src/lib/server/contact-lifecycle-floor.d.ts +89 -0
  73. package/src/lib/server/contact-lifecycle-floor.js +88 -0
  74. package/src/lib/server/contact-lifecycle-floor.js.map +1 -0
  75. package/src/lib/server/contact-merge.d.ts +55 -0
  76. package/src/lib/server/contact-merge.js +279 -0
  77. package/src/lib/server/contact-merge.js.map +1 -0
  78. package/src/lib/server/contact-suppression.d.ts +153 -0
  79. package/src/lib/server/contact-suppression.js +259 -0
  80. package/src/lib/server/contact-suppression.js.map +1 -0
  81. package/src/lib/server/crm-booking-activity.d.ts +86 -0
  82. package/src/lib/server/crm-booking-activity.js +251 -0
  83. package/src/lib/server/crm-booking-activity.js.map +1 -0
  84. package/src/lib/server/crm-email-activity.d.ts +112 -0
  85. package/src/lib/server/crm-email-activity.js +143 -0
  86. package/src/lib/server/crm-email-activity.js.map +1 -0
  87. package/src/lib/server/crm-inbound-email.d.ts +145 -0
  88. package/src/lib/server/crm-inbound-email.js +287 -0
  89. package/src/lib/server/crm-inbound-email.js.map +1 -0
  90. package/src/lib/server/crm-next-activity.d.ts +74 -0
  91. package/src/lib/server/crm-next-activity.js +194 -0
  92. package/src/lib/server/crm-next-activity.js.map +1 -0
  93. package/src/lib/server/crm-records.d.ts +144 -0
  94. package/src/lib/server/crm-records.js +218 -0
  95. package/src/lib/server/crm-records.js.map +1 -0
  96. package/src/lib/server/csp-aggregate.d.ts +62 -0
  97. package/src/lib/server/csp-aggregate.js +276 -0
  98. package/src/lib/server/csp-aggregate.js.map +1 -0
  99. package/src/lib/server/data-storage-gate.d.ts +66 -0
  100. package/src/lib/server/data-storage-gate.js +48 -0
  101. package/src/lib/server/data-storage-gate.js.map +1 -0
  102. package/src/lib/server/dataset-live-pages.d.ts +179 -0
  103. package/src/lib/server/dataset-live-pages.js +421 -0
  104. package/src/lib/server/dataset-live-pages.js.map +1 -0
  105. package/src/lib/server/dns-probe.d.ts +53 -0
  106. package/src/lib/server/dns-probe.js +184 -0
  107. package/src/lib/server/dns-probe.js.map +1 -0
  108. package/src/lib/server/document-id.d.ts +29 -0
  109. package/src/lib/server/document-id.js +100 -0
  110. package/src/lib/server/document-id.js.map +1 -0
  111. package/src/lib/server/domain-provider-vercel.d.ts +33 -0
  112. package/src/lib/server/domain-provider-vercel.js +298 -0
  113. package/src/lib/server/domain-provider-vercel.js.map +1 -0
  114. package/src/lib/server/domain-provider-webhook.d.ts +73 -0
  115. package/src/lib/server/domain-provider-webhook.js +223 -0
  116. package/src/lib/server/domain-provider-webhook.js.map +1 -0
  117. package/src/lib/server/domain-provider-wildcard.d.ts +54 -0
  118. package/src/lib/server/domain-provider-wildcard.js +163 -0
  119. package/src/lib/server/domain-provider-wildcard.js.map +1 -0
  120. package/src/lib/server/domain-provider.d.ts +197 -0
  121. package/src/lib/server/domain-provider.js +221 -0
  122. package/src/lib/server/domain-provider.js.map +1 -0
  123. package/src/lib/server/duplicate-activity.d.ts +54 -0
  124. package/src/lib/server/duplicate-activity.js +67 -0
  125. package/src/lib/server/duplicate-activity.js.map +1 -0
  126. package/src/lib/server/duplicate-resource.d.ts +55 -0
  127. package/src/lib/server/duplicate-resource.js +474 -0
  128. package/src/lib/server/duplicate-resource.js.map +1 -0
  129. package/src/lib/server/dynamic-list-materialize.d.ts +153 -0
  130. package/src/lib/server/dynamic-list-materialize.js +581 -0
  131. package/src/lib/server/dynamic-list-materialize.js.map +1 -0
  132. package/src/lib/server/edit-access-authz.d.ts +56 -0
  133. package/src/lib/server/edit-access-authz.js +107 -0
  134. package/src/lib/server/edit-access-authz.js.map +1 -0
  135. package/src/lib/server/edit-access-token.d.ts +72 -0
  136. package/src/lib/server/edit-access-token.js +116 -0
  137. package/src/lib/server/edit-access-token.js.map +1 -0
  138. package/src/lib/server/edit-hint-token.d.ts +83 -0
  139. package/src/lib/server/edit-hint-token.js +119 -0
  140. package/src/lib/server/edit-hint-token.js.map +1 -0
  141. package/src/lib/server/email-delivery-log.d.ts +509 -0
  142. package/src/lib/server/email-delivery-log.js +1043 -0
  143. package/src/lib/server/email-delivery-log.js.map +1 -0
  144. package/src/lib/server/email-flow-gate.d.ts +80 -0
  145. package/src/lib/server/email-flow-gate.js +153 -0
  146. package/src/lib/server/email-flow-gate.js.map +1 -0
  147. package/src/lib/server/email-marketing-gate.d.ts +333 -0
  148. package/src/lib/server/email-marketing-gate.js +639 -0
  149. package/src/lib/server/email-marketing-gate.js.map +1 -0
  150. package/src/lib/server/email-metering.d.ts +293 -0
  151. package/src/lib/server/email-metering.js +359 -0
  152. package/src/lib/server/email-metering.js.map +1 -0
  153. package/src/lib/server/email-revenue-attribution.d.ts +185 -0
  154. package/src/lib/server/email-revenue-attribution.js +300 -0
  155. package/src/lib/server/email-revenue-attribution.js.map +1 -0
  156. package/src/lib/server/email-send-rate.d.ts +232 -0
  157. package/src/lib/server/email-send-rate.js +417 -0
  158. package/src/lib/server/email-send-rate.js.map +1 -0
  159. package/src/lib/server/email-sender-reputation.d.ts +317 -0
  160. package/src/lib/server/email-sender-reputation.js +464 -0
  161. package/src/lib/server/email-sender-reputation.js.map +1 -0
  162. package/src/lib/server/email-suppression.d.ts +490 -0
  163. package/src/lib/server/email-suppression.js +648 -0
  164. package/src/lib/server/email-suppression.js.map +1 -0
  165. package/src/lib/server/email-topic-confirmation.d.ts +150 -0
  166. package/src/lib/server/email-topic-confirmation.js +272 -0
  167. package/src/lib/server/email-topic-confirmation.js.map +1 -0
  168. package/src/lib/server/email-unsubscribe-link.d.ts +174 -0
  169. package/src/lib/server/email-unsubscribe-link.js +236 -0
  170. package/src/lib/server/email-unsubscribe-link.js.map +1 -0
  171. package/src/lib/server/erase-person.d.ts +116 -0
  172. package/src/lib/server/erase-person.js +272 -0
  173. package/src/lib/server/erase-person.js.map +1 -0
  174. package/src/lib/server/erase.d.ts +458 -0
  175. package/src/lib/server/erase.js +1506 -0
  176. package/src/lib/server/erase.js.map +1 -0
  177. package/src/lib/server/firebase-admin.d.ts +71 -0
  178. package/src/lib/server/firebase-admin.js +343 -0
  179. package/src/lib/server/firebase-admin.js.map +1 -0
  180. package/src/lib/server/form-dataset-binding-token.d.ts +35 -0
  181. package/src/lib/server/form-dataset-binding-token.js +107 -0
  182. package/src/lib/server/form-dataset-binding-token.js.map +1 -0
  183. package/src/lib/server/free-workspace-cap.d.ts +201 -0
  184. package/src/lib/server/free-workspace-cap.js +404 -0
  185. package/src/lib/server/free-workspace-cap.js.map +1 -0
  186. package/src/lib/server/ga4-measurement-protocol.d.ts +256 -0
  187. package/src/lib/server/ga4-measurement-protocol.js +558 -0
  188. package/src/lib/server/ga4-measurement-protocol.js.map +1 -0
  189. package/src/lib/server/host-email-tokens.d.ts +47 -0
  190. package/src/lib/server/host-email-tokens.js +72 -0
  191. package/src/lib/server/host-email-tokens.js.map +1 -0
  192. package/src/lib/server/host-memberships.d.ts +54 -0
  193. package/src/lib/server/host-memberships.js +194 -0
  194. package/src/lib/server/host-memberships.js.map +1 -0
  195. package/src/lib/server/host-sending-domain.d.ts +292 -0
  196. package/src/lib/server/host-sending-domain.js +451 -0
  197. package/src/lib/server/host-sending-domain.js.map +1 -0
  198. package/src/lib/server/host-visitor-records.d.ts +150 -0
  199. package/src/lib/server/host-visitor-records.js +262 -0
  200. package/src/lib/server/host-visitor-records.js.map +1 -0
  201. package/src/lib/server/id-token-refusal.d.ts +28 -0
  202. package/src/lib/server/id-token-refusal.js +111 -0
  203. package/src/lib/server/id-token-refusal.js.map +1 -0
  204. package/src/lib/server/legal-acceptance.d.ts +214 -0
  205. package/src/lib/server/legal-acceptance.js +305 -0
  206. package/src/lib/server/legal-acceptance.js.map +1 -0
  207. package/src/lib/server/list-members.d.ts +211 -0
  208. package/src/lib/server/list-members.js +176 -0
  209. package/src/lib/server/list-members.js.map +1 -0
  210. package/src/lib/server/live-page-usage.d.ts +202 -0
  211. package/src/lib/server/live-page-usage.js +300 -0
  212. package/src/lib/server/live-page-usage.js.map +1 -0
  213. package/src/lib/server/lockdown.d.ts +313 -0
  214. package/src/lib/server/lockdown.js +643 -0
  215. package/src/lib/server/lockdown.js.map +1 -0
  216. package/src/lib/server/media-cdn-rate-limit.d.ts +188 -0
  217. package/src/lib/server/media-cdn-rate-limit.js +204 -0
  218. package/src/lib/server/media-cdn-rate-limit.js.map +1 -0
  219. package/src/lib/server/media-delivery.d.ts +267 -0
  220. package/src/lib/server/media-delivery.js +485 -0
  221. package/src/lib/server/media-delivery.js.map +1 -0
  222. package/src/lib/server/media-download-tokens.d.ts +161 -0
  223. package/src/lib/server/media-download-tokens.js +386 -0
  224. package/src/lib/server/media-download-tokens.js.map +1 -0
  225. package/src/lib/server/media-quarantine.d.ts +127 -0
  226. package/src/lib/server/media-quarantine.js +170 -0
  227. package/src/lib/server/media-quarantine.js.map +1 -0
  228. package/src/lib/server/media-signing.d.ts +126 -0
  229. package/src/lib/server/media-signing.js +159 -0
  230. package/src/lib/server/media-signing.js.map +1 -0
  231. package/src/lib/server/media-storage-path.d.ts +96 -0
  232. package/src/lib/server/media-storage-path.js +111 -0
  233. package/src/lib/server/media-storage-path.js.map +1 -0
  234. package/src/lib/server/media-strong-digest.d.ts +85 -0
  235. package/src/lib/server/media-strong-digest.js +190 -0
  236. package/src/lib/server/media-strong-digest.js.map +1 -0
  237. package/src/lib/server/media-tombstone.d.ts +276 -0
  238. package/src/lib/server/media-tombstone.js +421 -0
  239. package/src/lib/server/media-tombstone.js.map +1 -0
  240. package/src/lib/server/media-variants.d.ts +309 -0
  241. package/src/lib/server/media-variants.js +428 -0
  242. package/src/lib/server/media-variants.js.map +1 -0
  243. package/src/lib/server/member-email-aliases.d.ts +180 -0
  244. package/src/lib/server/member-email-aliases.js +420 -0
  245. package/src/lib/server/member-email-aliases.js.map +1 -0
  246. package/src/lib/server/member-photo.d.ts +88 -0
  247. package/src/lib/server/member-photo.js +185 -0
  248. package/src/lib/server/member-photo.js.map +1 -0
  249. package/src/lib/server/membership-recover-throttle.d.ts +211 -0
  250. package/src/lib/server/membership-recover-throttle.js +231 -0
  251. package/src/lib/server/membership-recover-throttle.js.map +1 -0
  252. package/src/lib/server/notifications.d.ts +55 -0
  253. package/src/lib/server/notifications.js +134 -0
  254. package/src/lib/server/notifications.js.map +1 -0
  255. package/src/lib/server/org-billing.d.ts +97 -0
  256. package/src/lib/server/org-billing.js +236 -0
  257. package/src/lib/server/org-billing.js.map +1 -0
  258. package/src/lib/server/organizations.d.ts +837 -0
  259. package/src/lib/server/organizations.js +1814 -0
  260. package/src/lib/server/organizations.js.map +1 -0
  261. package/src/lib/server/password-reset-throttle.d.ts +84 -0
  262. package/src/lib/server/password-reset-throttle.js +102 -0
  263. package/src/lib/server/password-reset-throttle.js.map +1 -0
  264. package/src/lib/server/personal-data-export.d.ts +241 -0
  265. package/src/lib/server/personal-data-export.js +858 -0
  266. package/src/lib/server/personal-data-export.js.map +1 -0
  267. package/src/lib/server/platform-domain-names.d.ts +62 -0
  268. package/src/lib/server/platform-domain-names.js +197 -0
  269. package/src/lib/server/platform-domain-names.js.map +1 -0
  270. package/src/lib/server/platform-marketing-consent.d.ts +133 -0
  271. package/src/lib/server/platform-marketing-consent.js +209 -0
  272. package/src/lib/server/platform-marketing-consent.js.map +1 -0
  273. package/src/lib/server/rate-limit-store.d.ts +702 -0
  274. package/src/lib/server/rate-limit-store.js +1220 -0
  275. package/src/lib/server/rate-limit-store.js.map +1 -0
  276. package/src/lib/server/realm-plugins.d.ts +67 -0
  277. package/src/lib/server/realm-plugins.js +250 -0
  278. package/src/lib/server/realm-plugins.js.map +1 -0
  279. package/src/lib/server/recaptcha-allowlist.d.ts +90 -0
  280. package/src/lib/server/recaptcha-allowlist.js +409 -0
  281. package/src/lib/server/recaptcha-allowlist.js.map +1 -0
  282. package/src/lib/server/release-flags.d.ts +105 -0
  283. package/src/lib/server/release-flags.js +183 -0
  284. package/src/lib/server/release-flags.js.map +1 -0
  285. package/src/lib/server/replay-erasures.d.ts +126 -0
  286. package/src/lib/server/replay-erasures.js +217 -0
  287. package/src/lib/server/replay-erasures.js.map +1 -0
  288. package/src/lib/server/resolve-people.d.ts +66 -0
  289. package/src/lib/server/resolve-people.js +112 -0
  290. package/src/lib/server/resolve-people.js.map +1 -0
  291. package/src/lib/server/safe-equal.d.ts +45 -0
  292. package/src/lib/server/safe-equal.js +58 -0
  293. package/src/lib/server/safe-equal.js.map +1 -0
  294. package/src/lib/server/sending-domain-debt.d.ts +127 -0
  295. package/src/lib/server/sending-domain-debt.js +268 -0
  296. package/src/lib/server/sending-domain-debt.js.map +1 -0
  297. package/src/lib/server/sending-domain-recheck.d.ts +151 -0
  298. package/src/lib/server/sending-domain-recheck.js +253 -0
  299. package/src/lib/server/sending-domain-recheck.js.map +1 -0
  300. package/src/lib/server/sending-domains.d.ts +364 -0
  301. package/src/lib/server/sending-domains.js +683 -0
  302. package/src/lib/server/sending-domains.js.map +1 -0
  303. package/src/lib/server/serve-media-cdn.d.ts +433 -0
  304. package/src/lib/server/serve-media-cdn.js +1370 -0
  305. package/src/lib/server/serve-media-cdn.js.map +1 -0
  306. package/src/lib/server/serve-plugin-fetch.d.ts +61 -0
  307. package/src/lib/server/serve-plugin-fetch.js +294 -0
  308. package/src/lib/server/serve-plugin-fetch.js.map +1 -0
  309. package/src/lib/server/sms-keywords.d.ts +63 -0
  310. package/src/lib/server/sms-keywords.js +146 -0
  311. package/src/lib/server/sms-keywords.js.map +1 -0
  312. package/src/lib/server/sso-break-glass-owners.d.ts +91 -0
  313. package/src/lib/server/sso-break-glass-owners.js +227 -0
  314. package/src/lib/server/sso-break-glass-owners.js.map +1 -0
  315. package/src/lib/server/sso-domain-policy.d.ts +140 -0
  316. package/src/lib/server/sso-domain-policy.js +239 -0
  317. package/src/lib/server/sso-domain-policy.js.map +1 -0
  318. package/src/lib/server/sso-drift-logic.d.ts +106 -0
  319. package/src/lib/server/sso-drift-logic.js +95 -0
  320. package/src/lib/server/sso-drift-logic.js.map +1 -0
  321. package/src/lib/server/sso-enforcement.d.ts +204 -0
  322. package/src/lib/server/sso-enforcement.js +309 -0
  323. package/src/lib/server/sso-enforcement.js.map +1 -0
  324. package/src/lib/server/sso-provisioning.d.ts +320 -0
  325. package/src/lib/server/sso-provisioning.js +715 -0
  326. package/src/lib/server/sso-provisioning.js.map +1 -0
  327. package/src/lib/server/staff-alert-email.d.ts +41 -0
  328. package/src/lib/server/staff-alert-email.js +63 -0
  329. package/src/lib/server/staff-alert-email.js.map +1 -0
  330. package/src/lib/server/stripe-account-mode.d.ts +156 -0
  331. package/src/lib/server/stripe-account-mode.js +162 -0
  332. package/src/lib/server/stripe-account-mode.js.map +1 -0
  333. package/src/lib/server/tenant-write-lockdown.d.ts +131 -0
  334. package/src/lib/server/tenant-write-lockdown.js +176 -0
  335. package/src/lib/server/tenant-write-lockdown.js.map +1 -0
  336. package/src/lib/server/test-firestore.d.ts +45 -0
  337. package/src/lib/server/test-firestore.js +124 -0
  338. package/src/lib/server/test-firestore.js.map +1 -0
  339. package/src/lib/server/token-revocation.d.ts +140 -0
  340. package/src/lib/server/token-revocation.js +255 -0
  341. package/src/lib/server/token-revocation.js.map +1 -0
  342. package/src/lib/server/update-existing.d.ts +32 -0
  343. package/src/lib/server/update-existing.js +73 -0
  344. package/src/lib/server/update-existing.js.map +1 -0
  345. package/src/lib/server/upload-cors-reconcile.d.ts +118 -0
  346. package/src/lib/server/upload-cors-reconcile.js +234 -0
  347. package/src/lib/server/upload-cors-reconcile.js.map +1 -0
  348. package/src/lib/server/upsert-contact.d.ts +262 -0
  349. package/src/lib/server/upsert-contact.js +546 -0
  350. package/src/lib/server/upsert-contact.js.map +1 -0
  351. package/src/lib/server/usage-invoice.d.ts +203 -0
  352. package/src/lib/server/usage-invoice.js +397 -0
  353. package/src/lib/server/usage-invoice.js.map +1 -0
  354. package/src/lib/server/user-profiles.d.ts +151 -0
  355. package/src/lib/server/user-profiles.js +364 -0
  356. package/src/lib/server/user-profiles.js.map +1 -0
  357. package/src/lib/server/vercel-drain-signature.d.ts +30 -0
  358. package/src/lib/server/vercel-drain-signature.js +61 -0
  359. package/src/lib/server/vercel-drain-signature.js.map +1 -0
  360. package/src/lib/server/vercel-log-drain.d.ts +259 -0
  361. package/src/lib/server/vercel-log-drain.js +479 -0
  362. package/src/lib/server/vercel-log-drain.js.map +1 -0
  363. package/src/lib/server/verify-email-cooldown.d.ts +102 -0
  364. package/src/lib/server/verify-email-cooldown.js +114 -0
  365. package/src/lib/server/verify-email-cooldown.js.map +1 -0
  366. package/src/lib/server/visitor-write-rate-limit.d.ts +87 -0
  367. package/src/lib/server/visitor-write-rate-limit.js +117 -0
  368. package/src/lib/server/visitor-write-rate-limit.js.map +1 -0
  369. package/src/lib/server/workspace-domains.d.ts +156 -0
  370. package/src/lib/server/workspace-domains.js +271 -0
  371. package/src/lib/server/workspace-domains.js.map +1 -0
  372. package/src/tenancy.d.ts +115 -0
  373. package/src/tenancy.js +142 -0
  374. package/src/tenancy.js.map +1 -0
@@ -0,0 +1,309 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * WebP variant generation for a media asset (AGL-175), and the record of
19
+ * whether it worked (AGL-1468).
20
+ *
21
+ * ## Why this is a library function and not two copies of a `try`
22
+ *
23
+ * `/api/media/upload` and `/api/media/replace` each carried the same eleven
24
+ * lines, wrapped in a `catch` whose comment read *"Variants are an
25
+ * optimization — never fail the upload for them."* That judgement is right and
26
+ * it survives here. What did not survive is its consequence: the catch wrote
27
+ * `console.error` and nothing else, so a **total** failure and a **healthy**
28
+ * asset produced byte-identical documents — `variants: []` either way.
29
+ *
30
+ * Measured 2026-08-13 on production: **1 of 180 media documents has a
31
+ * non-empty `variants` array.** The last successful generation was
32
+ * 2026-07-19; every image uploaded since has an empty one. Nothing surfaced
33
+ * that for three weeks, because the only trace was a serverless log line
34
+ * whose retention is about an hour.
35
+ *
36
+ * So the contract of this function is not "generate variants". It is
37
+ * **generate variants and say what happened**, and the two failure classes
38
+ * are kept apart on purpose:
39
+ *
40
+ * - `variants: []` with **no** `error` — nothing was ELIGIBLE. A type in
41
+ * {@link MEDIA_TYPES_WITHOUT_VARIANTS}, a non-image, or a source already
42
+ * narrower than every target width. This is the correct, common,
43
+ * uninteresting outcome and must never look like a fault or the fault signal
44
+ * is worthless.
45
+ * - `variants: []` with an `error` — generation was attempted and did not
46
+ * complete. That string goes onto the media document and bumps a counter,
47
+ * which is what makes "how many assets failed?" a query instead of an
48
+ * archaeology project.
49
+ *
50
+ * A partial run reports both: the widths that landed AND the error, because
51
+ * the widths that landed are real files that the CDN route can serve.
52
+ */
53
+ /** The shape of `sharp`'s default export, narrowed to what is used here. */
54
+ type SharpFactory = (input: Buffer) => {
55
+ resize(options: {
56
+ width: number;
57
+ withoutEnlargement: boolean;
58
+ }): {
59
+ webp(options: {
60
+ quality: number;
61
+ }): {
62
+ toBuffer(): Promise<Buffer>;
63
+ };
64
+ };
65
+ };
66
+ export interface MediaVariantOutcome {
67
+ /** Widths actually written. Safe to store — every entry is a real object. */
68
+ variants: number[];
69
+ /**
70
+ * Present ONLY when generation was attempted and did not complete.
71
+ * `undefined` means nothing went wrong, which includes "nothing to do".
72
+ */
73
+ error?: string;
74
+ }
75
+ /**
76
+ * `image/*` types that produce no variants, for two different reasons.
77
+ *
78
+ * SVG is a vector: there is nothing to downscale, and rasterizing it would be
79
+ * a different asset rather than a variant of this one.
80
+ *
81
+ * ICO carries no `sharp` decoder at all, so attempting it raises an
82
+ * unsupported-format error from `toBuffer` — an ERROR on the media document,
83
+ * which is the signal reserved for generation that was attempted and broke. An
84
+ * icon having no variants is neither attempted nor broken; it is the ordinary
85
+ * outcome, and it has to read as one or the fault counter measures the favicon
86
+ * instead of a fault (AGL-3121).
87
+ *
88
+ * Exported because the backfill script has to skip exactly this set. It kept a
89
+ * second copy of the SVG half, which is how ICO came to be missing from one
90
+ * and not the other.
91
+ */
92
+ export declare const MEDIA_TYPES_WITHOUT_VARIANTS: ReadonlySet<string>;
93
+ /**
94
+ * Which widths this source should produce.
95
+ *
96
+ * Split out and exported because it is the predicate that decides whether an
97
+ * empty result is NORMAL, and both the routes and the health probe have to
98
+ * agree on it. Inlined, the skip rule was a `continue` buried in the loop that
99
+ * a reader had to reconstruct in order to know whether `[]` was a bug.
100
+ *
101
+ * Widths narrower than the source always; for {@link SOURCE_WIDTH_WEBP_TYPES}
102
+ * the rest as well, provided the source is wider than the narrowest width — a
103
+ * source smaller than every candidate is an icon, and it is served as it is.
104
+ */
105
+ export declare function mediaVariantWidthsFor(options: {
106
+ contentType: string;
107
+ /** Source pixel width, when it could be read from the header. */
108
+ sourceWidth?: number | null;
109
+ }): number[];
110
+ /**
111
+ * Resolve `sharp`'s callable through either module shape.
112
+ *
113
+ * `(await import('sharp')).default` is correct under Node ESM and under a
114
+ * bundler that synthesises the CJS namespace. It is `undefined` under one that
115
+ * hands back `module.exports` directly — and `undefined(buffer)` is a
116
+ * `TypeError` raised INSIDE the same `try` that catches a genuine load
117
+ * failure, so from outside the two are the same event: no variants, no
118
+ * message, a 200. This normalises the shape and, when neither shape yields a
119
+ * function, throws something that NAMES the problem instead of a bare
120
+ * `is not a function` from three frames away.
121
+ */
122
+ export declare function loadSharp(): Promise<SharpFactory>;
123
+ /**
124
+ * A short, PUBLISHABLE name for why the encoder is unavailable (AGL-1471).
125
+ *
126
+ * The first thing the probe said on production was `sharp-unavailable`, and
127
+ * that answered less than it looked like it did: it is the fallback for "the
128
+ * error carried no `code`", and BOTH interesting failures land there. `sharp`
129
+ * catches every `require` of its prebuilt binaries and rethrows one composed
130
+ * `Error` with no `code` at all; `loadSharp` throws a plain `Error` too when
131
+ * the module resolves to something that is not callable. One means the native
132
+ * library did not load, the other means the bundler handed back the wrong
133
+ * shape, and they have nothing in common except the remedy being different.
134
+ *
135
+ * Matching on `sharp`'s own help text is the only signal available — the
136
+ * distinction is not in a field, only in the prose. It is matched loosely and
137
+ * it degrades to the old fallback, so a reworded upstream message costs a
138
+ * detail rather than the answer.
139
+ *
140
+ * The MESSAGE still never leaves the process. A native loader failure names
141
+ * every path it tried, the health endpoint is public, and the point of a code
142
+ * is that it is a fixed vocabulary the caller can branch on.
143
+ */
144
+ export declare function classifyLoadFailure(error: unknown): string;
145
+ /**
146
+ * Generate the WebP variants for one asset and report the outcome.
147
+ *
148
+ * `saveVariant` is a callback rather than a `Bucket` so this stays free of a
149
+ * storage dependency and so a spec can assert on the BYTES it produces —
150
+ * which is the only assertion that distinguishes a working variant from the
151
+ * original served back under a `?w=` that selects nothing.
152
+ */
153
+ export declare function generateMediaVariants(options: {
154
+ buffer: Buffer;
155
+ contentType: string;
156
+ sourceWidth?: number | null;
157
+ /** Object path of the ORIGINAL; variants are `${objectPath}__w{n}.webp`. */
158
+ objectPath: string;
159
+ saveVariant: (path: string, webp: Buffer) => Promise<void>;
160
+ }): Promise<MediaVariantOutcome>;
161
+ /**
162
+ * The largest object this will pull back OUT of storage in order to generate.
163
+ *
164
+ * Deliberately equal to `IMAGE_MAX_BYTES`, the console's per-type ceiling for
165
+ * an image (`apps/console/utils/media-upload-limits.ts`), rather than derived
166
+ * from it: this library cannot import that file, and the two numbers answer
167
+ * different questions. That one asks "may this be uploaded at all"; this one
168
+ * asks "may a serverless function afford to fetch it back and decode it". They
169
+ * agree today, which is the point — every image the DAM accepts gets variants.
170
+ * If the upload ceiling is ever raised for a format where 15 MB is small (a
171
+ * camera RAW, a TIFF), the download stops there instead of silently following
172
+ * it into a timeout, and says so.
173
+ */
174
+ export declare const MEDIA_VARIANT_SOURCE_MAX_BYTES: number;
175
+ /**
176
+ * Generate variants for an object whose bytes are in STORAGE, not in hand
177
+ * (AGL-1476).
178
+ *
179
+ * `/api/media/upload` has the buffer — the client base64'd it into the request
180
+ * body. `/api/media/upload-url` never sees it: the browser PUTs straight to GCS
181
+ * with a signed URL, and finalize is handed a path. Since AGL-1465 gave images
182
+ * a signed-path ceiling, every image between 3 MB and 15 MB takes that route,
183
+ * so the assets that most need a 320px WebP became precisely the ones that got
184
+ * none. Measured on production 2026-08-13: a 6,606,921 B PNG landed with
185
+ * `variants` **absent**, and `?w=320` served back all 6,606,921 B of
186
+ * `image/png`; a 2,168,376 B PNG on the base64 route landed with
187
+ * `variants: [320, 640]` and answered `?w=320` in 31,566 B of `image/webp`.
188
+ *
189
+ * So the bytes have to come back. `readSource` is a callback, for the same
190
+ * reason `saveVariant` is one: this stays free of a storage dependency, and a
191
+ * spec can hand it a real PNG and count what comes out.
192
+ *
193
+ * **The read is the last thing that happens, not the first.** Widths are
194
+ * decided from the header dimensions the caller already has, so a source
195
+ * narrower than every target width — and every non-image — costs nothing at
196
+ * all. That ordering is what keeps this from pulling a 200 MB video back out
197
+ * of the bucket to discover it has no variants.
198
+ *
199
+ * The size refusal is reported as an ERROR rather than as an empty success,
200
+ * and the distinction is AGL-1468's: `variants: []` with no error means
201
+ * nothing was ELIGIBLE, and an image the platform accepted and then declined
202
+ * to optimize is not that. It is eligible work that did not happen, so it
203
+ * belongs on the document and in `variantFailures` where it can be counted.
204
+ */
205
+ export declare function generateStoredMediaVariants(options: {
206
+ contentType: string;
207
+ /** The object's REAL size, as storage reports it. */
208
+ sizeBytes: number;
209
+ sourceWidth?: number | null;
210
+ objectPath: string;
211
+ /** Fetches the whole object. Only ever called when there is work to do. */
212
+ readSource: () => Promise<Buffer>;
213
+ saveVariant: (path: string, webp: Buffer) => Promise<void>;
214
+ maxSourceBytes?: number;
215
+ }): Promise<MediaVariantOutcome>;
216
+ /**
217
+ * Can this deployment produce a variant at all?
218
+ *
219
+ * Synthesises a small image in memory, downscales it, and asserts the result
220
+ * is both a WebP and SMALLER than the source. No Storage, no Firestore, no
221
+ * upload — so it can run from a health endpoint on a schedule instead of
222
+ * waiting for a customer to notice their thumbnails are full-size originals.
223
+ *
224
+ * The size comparison is the point. A resize that silently returns its input
225
+ * is exactly the failure this issue is about: `?w=640` answering 200 with the
226
+ * original is indistinguishable from success unless something counts bytes.
227
+ */
228
+ export declare function probeMediaVariantSupport(): Promise<{
229
+ ok: boolean;
230
+ code?: string;
231
+ }>;
232
+ /**
233
+ * The largest poster this will accept from a client (AGL-2742).
234
+ *
235
+ * The browser encodes the still it captured as WebP at quality ~0.72, and a
236
+ * 1920-wide frame of real video lands between 40 KB and 250 KB. 4 MB is
237
+ * therefore ~16x the worst realistic case and is not a quality knob: it is
238
+ * the point past which the bytes stopped being a poster. It has to sit well
239
+ * under the platform's 4.5 MB request-body wall, because the poster rides
240
+ * base64 in the finalize call and a ceiling that admits a body the platform
241
+ * will reject turns a refusal we can explain into a 413 we cannot.
242
+ */
243
+ export declare const MEDIA_POSTER_MAX_BYTES: number;
244
+ /**
245
+ * The widest poster stored. Above this a still is being kept at a resolution
246
+ * no `<video poster>` paints — the element scales it to the player box, and
247
+ * the largest realistic player box is the 1920 the variant widths already
248
+ * top out at.
249
+ */
250
+ export declare const MEDIA_POSTER_MAX_WIDTH = 1920;
251
+ export interface MediaPosterOutcome {
252
+ /** Set only when a poster object was actually written. */
253
+ poster?: {
254
+ width: number;
255
+ height: number;
256
+ variants: number[];
257
+ };
258
+ /**
259
+ * Present ONLY when a poster was offered and could not be produced —
260
+ * the same two-failure-class contract {@link MediaVariantOutcome} keeps.
261
+ * An upload with no poster offered returns an empty object, not an error.
262
+ */
263
+ error?: string;
264
+ }
265
+ /**
266
+ * Turn a client-supplied still into the asset's poster (AGL-2742).
267
+ *
268
+ * ## The re-encode is a security control, not a compression pass
269
+ *
270
+ * These bytes come from a browser, over the wire, and land in the shared
271
+ * media bucket under an org's own prefix, where `serveMediaCdn` will stream
272
+ * them `inline` from the console's origin and from every tenant site's. That
273
+ * is precisely the shape of AGL-1474, where an uploaded `image/svg+xml`
274
+ * turned out to be a scripted document served from `app.aglyn.com`.
275
+ *
276
+ * Nothing here trusts the declared type, the magic bytes, or the extension.
277
+ * The buffer is decoded by `sharp` and **re-encoded** to WebP, so what gets
278
+ * stored is bytes this process produced. A polyglot, an SVG, an HTML file
279
+ * with a PNG header — each either fails to decode (reported, no object
280
+ * written) or becomes a real raster WebP with whatever it was smuggling
281
+ * discarded. That is a stronger guarantee than any sniffing gate, and it is
282
+ * why the poster is allowed to be client-generated at all.
283
+ *
284
+ * ## Why it reuses `generateMediaVariants` rather than looping itself
285
+ *
286
+ * A poster IS an image, and the width set a poster should offer is the width
287
+ * set every other image offers — the srcSet the renderer already knows how
288
+ * to write. Handing the generator `{objectPath}__poster` as its object path
289
+ * makes it emit `{objectPath}__poster__w{n}.webp` with no knowledge that
290
+ * video exists, and inherits its skip rule, its partial-run reporting and
291
+ * its refusal to fail an upload. A private loop here would be a second set
292
+ * of widths to keep in step, which is the defect AGL-175's widths list was
293
+ * moved into `@aglyn/aglyn` to prevent.
294
+ *
295
+ * The dimensions returned are read back from the ENCODED bytes rather than
296
+ * taken from the caller. The browser's report is what sized the capture, and
297
+ * the resize below may have changed it; a document that records what was
298
+ * asked for instead of what was written is how an `aspect-ratio` drifts off
299
+ * by the cap.
300
+ */
301
+ export declare function generateMediaPoster(options: {
302
+ /** Raw bytes as received. Never assumed to be an image of any kind. */
303
+ buffer: Buffer;
304
+ /** Object path of the ORIGINAL video, without the poster suffix. */
305
+ objectPath: string;
306
+ saveVariant: (path: string, bytes: Buffer) => Promise<void>;
307
+ maxWidth?: number;
308
+ }): Promise<MediaPosterOutcome>;
309
+ export {};