@aglyn/tenant-data-admin 1.0.0-beta.221 → 1.0.0-beta.223

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 (121) hide show
  1. package/package.json +7 -7
  2. package/src/lib/server/api-keys.js +3 -3
  3. package/src/lib/server/api-keys.js.map +1 -1
  4. package/src/lib/server/api-v1-resources.d.ts +44 -3
  5. package/src/lib/server/api-v1-resources.js +82 -5
  6. package/src/lib/server/api-v1-resources.js.map +1 -1
  7. package/src/lib/server/collection-live-pages.d.ts +2 -2
  8. package/src/lib/server/collection-live-pages.js +1 -1
  9. package/src/lib/server/collection-live-pages.js.map +1 -1
  10. package/src/lib/server/email-delivery-log.d.ts +17 -73
  11. package/src/lib/server/email-delivery-log.js +44 -222
  12. package/src/lib/server/email-delivery-log.js.map +1 -1
  13. package/src/lib/server/email-flow-gate.js +27 -38
  14. package/src/lib/server/email-flow-gate.js.map +1 -1
  15. package/src/lib/server/erase-person.d.ts +34 -54
  16. package/src/lib/server/erase-person.js +44 -239
  17. package/src/lib/server/erase-person.js.map +1 -1
  18. package/src/lib/server/ga4-measurement-protocol.js +41 -28
  19. package/src/lib/server/ga4-measurement-protocol.js.map +1 -1
  20. package/src/lib/server/host-visitor-records.d.ts +25 -4
  21. package/src/lib/server/host-visitor-records.js +39 -11
  22. package/src/lib/server/host-visitor-records.js.map +1 -1
  23. package/src/lib/server/hosted-page-review.js +52 -36
  24. package/src/lib/server/hosted-page-review.js.map +1 -1
  25. package/src/lib/server/link-reputation-review.d.ts +6 -2
  26. package/src/lib/server/link-reputation-review.js +61 -20
  27. package/src/lib/server/link-reputation-review.js.map +1 -1
  28. package/src/lib/server/live-page-drops.d.ts +67 -0
  29. package/src/lib/server/live-page-drops.js +57 -0
  30. package/src/lib/server/live-page-drops.js.map +1 -0
  31. package/src/lib/server/media-bandwidth-cap.d.ts +78 -0
  32. package/src/lib/server/media-bandwidth-cap.js +180 -0
  33. package/src/lib/server/media-bandwidth-cap.js.map +1 -0
  34. package/src/lib/server/media-cdn-icon.d.ts +77 -0
  35. package/src/lib/server/media-cdn-icon.js +140 -0
  36. package/src/lib/server/media-cdn-icon.js.map +1 -0
  37. package/src/lib/server/media-delivery-regeneration.d.ts +132 -0
  38. package/src/lib/server/media-delivery-regeneration.js +216 -0
  39. package/src/lib/server/media-delivery-regeneration.js.map +1 -0
  40. package/src/lib/server/media-delivery.d.ts +2 -0
  41. package/src/lib/server/media-delivery.js +2 -1
  42. package/src/lib/server/media-delivery.js.map +1 -1
  43. package/src/lib/server/media-serve-count.d.ts +50 -0
  44. package/src/lib/server/media-serve-count.js +62 -0
  45. package/src/lib/server/media-serve-count.js.map +1 -0
  46. package/src/lib/server/media-signing.d.ts +13 -2
  47. package/src/lib/server/media-signing.js +12 -8
  48. package/src/lib/server/media-signing.js.map +1 -1
  49. package/src/lib/server/media-tombstone.js +7 -5
  50. package/src/lib/server/media-tombstone.js.map +1 -1
  51. package/src/lib/server/media-variants.d.ts +151 -20
  52. package/src/lib/server/media-variants.js +204 -27
  53. package/src/lib/server/media-variants.js.map +1 -1
  54. package/src/lib/server/organizations.d.ts +102 -2
  55. package/src/lib/server/organizations.js +388 -58
  56. package/src/lib/server/organizations.js.map +1 -1
  57. package/src/lib/server/outbound-send-review.js +11 -7
  58. package/src/lib/server/outbound-send-review.js.map +1 -1
  59. package/src/lib/server/paged-sweeps.d.ts +51 -0
  60. package/src/lib/server/paged-sweeps.js +79 -0
  61. package/src/lib/server/paged-sweeps.js.map +1 -0
  62. package/src/lib/server/payment-fraud-signal.d.ts +49 -9
  63. package/src/lib/server/payment-fraud-signal.js +192 -48
  64. package/src/lib/server/payment-fraud-signal.js.map +1 -1
  65. package/src/lib/server/platform-marketing-consent.d.ts +0 -49
  66. package/src/lib/server/platform-marketing-consent.js +27 -11
  67. package/src/lib/server/platform-marketing-consent.js.map +1 -1
  68. package/src/lib/server/render-monitor.d.ts +166 -0
  69. package/src/lib/server/render-monitor.js +412 -0
  70. package/src/lib/server/render-monitor.js.map +1 -0
  71. package/src/lib/server/risk-notice.d.ts +7 -0
  72. package/src/lib/server/risk-notice.js +6 -0
  73. package/src/lib/server/risk-notice.js.map +1 -1
  74. package/src/lib/server/serve-media-cdn.d.ts +69 -1
  75. package/src/lib/server/serve-media-cdn.js +424 -70
  76. package/src/lib/server/serve-media-cdn.js.map +1 -1
  77. package/src/lib/server/site-icon-render.d.ts +68 -0
  78. package/src/lib/server/site-icon-render.js +157 -0
  79. package/src/lib/server/site-icon-render.js.map +1 -0
  80. package/src/lib/server/staff-seat.d.ts +50 -0
  81. package/src/lib/server/staff-seat.js +118 -0
  82. package/src/lib/server/staff-seat.js.map +1 -0
  83. package/src/lib/server/transfer-export.d.ts +46 -0
  84. package/src/lib/server/transfer-export.js +221 -0
  85. package/src/lib/server/transfer-export.js.map +1 -0
  86. package/src/lib/server/transfer-jobs.d.ts +385 -0
  87. package/src/lib/server/transfer-jobs.js +2368 -0
  88. package/src/lib/server/transfer-jobs.js.map +1 -0
  89. package/src/lib/server/transfer-packages.d.ts +127 -0
  90. package/src/lib/server/transfer-packages.js +1036 -0
  91. package/src/lib/server/transfer-packages.js.map +1 -0
  92. package/src/lib/server/upgrade-proposal.d.ts +97 -0
  93. package/src/lib/server/upgrade-proposal.js +312 -0
  94. package/src/lib/server/upgrade-proposal.js.map +1 -0
  95. package/src/lib/server/upsert-contact.d.ts +17 -8
  96. package/src/lib/server/upsert-contact.js +82 -16
  97. package/src/lib/server/upsert-contact.js.map +1 -1
  98. package/src/lib/server/web-risk.d.ts +50 -9
  99. package/src/lib/server/web-risk.js +290 -155
  100. package/src/lib/server/web-risk.js.map +1 -1
  101. package/src/tenancy.d.ts +3 -3
  102. package/src/tenancy.js +5 -3
  103. package/src/tenancy.js.map +1 -1
  104. package/src/lib/server/campaign-attribution-store.d.ts +0 -55
  105. package/src/lib/server/campaign-attribution-store.js +0 -95
  106. package/src/lib/server/campaign-attribution-store.js.map +0 -1
  107. package/src/lib/server/campaign-conversion-attribution.d.ts +0 -283
  108. package/src/lib/server/campaign-conversion-attribution.js +0 -450
  109. package/src/lib/server/campaign-conversion-attribution.js.map +0 -1
  110. package/src/lib/server/crm-email-activity.d.ts +0 -118
  111. package/src/lib/server/crm-email-activity.js +0 -148
  112. package/src/lib/server/crm-email-activity.js.map +0 -1
  113. package/src/lib/server/crm-next-activity.d.ts +0 -74
  114. package/src/lib/server/crm-next-activity.js +0 -194
  115. package/src/lib/server/crm-next-activity.js.map +0 -1
  116. package/src/lib/server/dataset-live-pages.d.ts +0 -179
  117. package/src/lib/server/dataset-live-pages.js +0 -421
  118. package/src/lib/server/dataset-live-pages.js.map +0 -1
  119. package/src/lib/server/email-revenue-attribution.d.ts +0 -185
  120. package/src/lib/server/email-revenue-attribution.js +0 -321
  121. package/src/lib/server/email-revenue-attribution.js.map +0 -1
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { type LockdownState, type MediaVideoRendition } from '@aglyn/aglyn/server';
17
+ import { type LockdownState, type MediaCdnVersion, type MediaVideoRendition } from '@aglyn/aglyn/server';
18
18
  import { type MediaCdnScope } from '@aglyn/aglyn/app-utils/media-cdn-scope';
19
19
  import type { NextApiRequest, NextApiResponse } from 'next';
20
20
  /**
@@ -115,6 +115,64 @@ export declare const MEDIA_CDN_STABLE_CACHE_CONTROL = "public, max-age=60, s-max
115
115
  * asset precisely because small ones are the ones that get cached.
116
116
  */
117
117
  export declare const MEDIA_CDN_STABLE_EDGE_BYPASS_CACHE_CONTROL = "private, max-age=60";
118
+ /**
119
+ * The VERSIONED stable URL's policy (AGL-3485): `?v={contentHash}.{encoder}`
120
+ * on the stable path, answered while the token names the asset's current
121
+ * bytes and current variants.
122
+ *
123
+ * The browser keeps it for a year, `immutable`, which is the whole point: the
124
+ * 60-second window above made every repeat view of every published image a
125
+ * conditional request, and Lighthouse reports that policy against each one.
126
+ * It is safe for the reason the content-hashed form never was in a page
127
+ * (AGL-2798): the page names this URL only while the token is current, the
128
+ * composition reads the token off the media document on every render, and a
129
+ * replace or a regeneration therefore moves the page to a new URL instead of
130
+ * leaving it on a pinned copy of the old bytes.
131
+ *
132
+ * The EDGE keeps the stable URL's hour and its revalidation, deliberately not
133
+ * a year: the edge is the copy a takedown or a lockdown has to outrun for
134
+ * every new visitor (`media-takedown-reach.ts`), and an hour is the bound the
135
+ * product states for it. Other visitors still get the edge's copy within that
136
+ * hour, which is what `s-maxage` is for. Images only — every other type keeps
137
+ * the stable policy, for the AGL-1515 reasons above.
138
+ */
139
+ export declare const MEDIA_CDN_VERSIONED_CACHE_CONTROL = "public, max-age=31536000, s-maxage=3600, stale-while-revalidate=86400, immutable";
140
+ /**
141
+ * Whether a versioned request may be answered with
142
+ * {@link MEDIA_CDN_VERSIONED_CACHE_CONTROL} (AGL-3485).
143
+ *
144
+ * Only when everything the token promises is true of what is being served:
145
+ *
146
+ * - the token's content hash is the document's CURRENT one. A stale token is
147
+ * served the current bytes under the stable URL's short policy — a stale
148
+ * page shows the new picture, and nothing pins it;
149
+ * - the representation is the original or a `?w=` variant. A poster or a
150
+ * rendition keeps its own policy;
151
+ * - for a `?w=` request, the variant itself is what is served. A width the
152
+ * asset has no variant for falls back to another representation, and a
153
+ * fallback is not something to keep for a year: the variant may be
154
+ * generated later;
155
+ * - and the asset's delivery copies were made by the encoder generation the
156
+ * token names, which is the one this code runs. The media document records
157
+ * which generation made them (`MEDIA_VARIANT_ENCODER_VERSION_FIELD`, absent
158
+ * meaning the first). A page rendered after the encoder moved on names the
159
+ * new generation before the asset has been regenerated; answering that
160
+ * request with the old encode for a year would hide the regeneration behind
161
+ * the very URL that was minted to reach it. Asked of every request, not
162
+ * only `?w=`, because the encoder makes what the bare URL serves too.
163
+ */
164
+ export declare function mediaCdnVersionIsCurrent(options: {
165
+ token: MediaCdnVersion | null;
166
+ currentHash: string;
167
+ /** A `?w=` was asked for. */
168
+ widthRequested: boolean;
169
+ /** The `?w=` variant itself is what will be served. */
170
+ variantServed: boolean;
171
+ /** A poster or a rendition was selected instead of the image. */
172
+ otherRepresentation: boolean;
173
+ /** The document's {@link MEDIA_VARIANT_ENCODER_VERSION_FIELD}. */
174
+ documentEncoderVersion: unknown;
175
+ }): boolean;
118
176
  /** The immutable content-hashed URL's policy for edge-cacheable (image) types. */
119
177
  export declare const MEDIA_CDN_IMMUTABLE_CACHE_CONTROL = "public, max-age=31536000, immutable";
120
178
  /**
@@ -287,6 +345,16 @@ export declare function mediaCdnServeBlock(scope: MediaCdnScope, asset: {
287
345
  * separate edge entry for identical bytes; two is enough.
288
346
  */
289
347
  export declare function wantsMediaDownload(value: unknown): boolean;
348
+ /**
349
+ * The display copy a media document records (AGL-3486), or null when it has
350
+ * none. Only the type is needed to serve it — the object path is derived — and
351
+ * a record whose type is not an image is treated as no record: the display
352
+ * copy is always an image, and serving its object under another type would be
353
+ * a document field choosing a response's `Content-Type`.
354
+ */
355
+ export declare function mediaCdnDisplayCopy(value: unknown): {
356
+ contentType: string;
357
+ } | null;
290
358
  /**
291
359
  * Whether `?poster=1` was asked for (AGL-2743).
292
360
  *