@aglyn/aglyn 1.0.0-beta.221 → 1.0.0-beta.222

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 (346) hide show
  1. package/package.json +15 -11
  2. package/src/lib/app-utils/agent-openapi.js +1 -1
  3. package/src/lib/app-utils/agent-openapi.js.map +1 -1
  4. package/src/lib/app-utils/analytics-events.d.ts +3 -2
  5. package/src/lib/app-utils/analytics-events.js +3 -2
  6. package/src/lib/app-utils/analytics-events.js.map +1 -1
  7. package/src/lib/app-utils/api-plugins.d.ts +30 -0
  8. package/src/lib/app-utils/api-plugins.js +24 -1
  9. package/src/lib/app-utils/api-plugins.js.map +1 -1
  10. package/src/lib/app-utils/author-html.d.ts +1 -1
  11. package/src/lib/app-utils/author-html.js.map +1 -1
  12. package/src/lib/app-utils/bandwidth-cap.d.ts +12 -1
  13. package/src/lib/app-utils/bandwidth-cap.js +17 -1
  14. package/src/lib/app-utils/bandwidth-cap.js.map +1 -1
  15. package/src/lib/app-utils/compose-reusable-components.d.ts +19 -0
  16. package/src/lib/app-utils/compose-reusable-components.js +116 -26
  17. package/src/lib/app-utils/compose-reusable-components.js.map +1 -1
  18. package/src/lib/app-utils/console-routes.d.ts +4 -0
  19. package/src/lib/app-utils/console-routes.js +3 -0
  20. package/src/lib/app-utils/console-routes.js.map +1 -1
  21. package/src/lib/app-utils/contacts.d.ts +71 -0
  22. package/src/lib/app-utils/contacts.js +55 -0
  23. package/src/lib/app-utils/contacts.js.map +1 -1
  24. package/src/lib/app-utils/contexts.d.ts +1 -0
  25. package/src/lib/app-utils/contexts.js +1 -0
  26. package/src/lib/app-utils/contexts.js.map +1 -1
  27. package/src/lib/app-utils/crm-email-templates.js +21 -4
  28. package/src/lib/app-utils/crm-email-templates.js.map +1 -1
  29. package/src/lib/app-utils/crm-kinds.d.ts +2 -0
  30. package/src/lib/app-utils/crm-kinds.js +1 -0
  31. package/src/lib/app-utils/crm-kinds.js.map +1 -1
  32. package/src/lib/app-utils/crm.d.ts +1199 -67
  33. package/src/lib/app-utils/crm.js +1951 -310
  34. package/src/lib/app-utils/crm.js.map +1 -1
  35. package/src/lib/app-utils/csv-import.d.ts +10 -38
  36. package/src/lib/app-utils/csv-import.js +17 -42
  37. package/src/lib/app-utils/csv-import.js.map +1 -1
  38. package/src/lib/app-utils/csv.d.ts +32 -11
  39. package/src/lib/app-utils/csv.js +43 -5
  40. package/src/lib/app-utils/csv.js.map +1 -1
  41. package/src/lib/app-utils/default-site.d.ts +116 -0
  42. package/src/lib/app-utils/default-site.js +1024 -0
  43. package/src/lib/app-utils/default-site.js.map +1 -0
  44. package/src/lib/app-utils/docs-help.generated.d.ts +22 -22
  45. package/src/lib/app-utils/docs-help.generated.js +44 -10
  46. package/src/lib/app-utils/docs-help.generated.js.map +1 -1
  47. package/src/lib/app-utils/docs-index.generated.js +738 -150
  48. package/src/lib/app-utils/docs-index.generated.js.map +1 -1
  49. package/src/lib/app-utils/draft-placeholders.d.ts +76 -0
  50. package/src/lib/app-utils/draft-placeholders.js +115 -0
  51. package/src/lib/app-utils/draft-placeholders.js.map +1 -0
  52. package/src/lib/app-utils/entity-picker-context.d.ts +19 -15
  53. package/src/lib/app-utils/entity-picker-context.js +4 -4
  54. package/src/lib/app-utils/entity-picker-context.js.map +1 -1
  55. package/src/lib/app-utils/expand-repeatables.d.ts +66 -10
  56. package/src/lib/app-utils/expand-repeatables.js +88 -14
  57. package/src/lib/app-utils/expand-repeatables.js.map +1 -1
  58. package/src/lib/app-utils/forms.d.ts +33 -22
  59. package/src/lib/app-utils/forms.js +47 -28
  60. package/src/lib/app-utils/forms.js.map +1 -1
  61. package/src/lib/app-utils/full-use-cost.d.ts +277 -0
  62. package/src/lib/app-utils/full-use-cost.js +421 -0
  63. package/src/lib/app-utils/full-use-cost.js.map +1 -0
  64. package/src/lib/app-utils/health-report.js +11 -0
  65. package/src/lib/app-utils/health-report.js.map +1 -1
  66. package/src/lib/app-utils/llms-txt.d.ts +20 -0
  67. package/src/lib/app-utils/llms-txt.js +7 -1
  68. package/src/lib/app-utils/llms-txt.js.map +1 -1
  69. package/src/lib/app-utils/media-asset-facts.d.ts +16 -1
  70. package/src/lib/app-utils/media-asset-facts.js +40 -13
  71. package/src/lib/app-utils/media-asset-facts.js.map +1 -1
  72. package/src/lib/app-utils/media-bandwidth.d.ts +52 -0
  73. package/src/lib/app-utils/media-bandwidth.js +94 -0
  74. package/src/lib/app-utils/media-bandwidth.js.map +1 -0
  75. package/src/lib/app-utils/media-ref.d.ts +241 -33
  76. package/src/lib/app-utils/media-ref.js +324 -43
  77. package/src/lib/app-utils/media-ref.js.map +1 -1
  78. package/src/lib/app-utils/media-src.d.ts +8 -8
  79. package/src/lib/app-utils/media-src.js +27 -11
  80. package/src/lib/app-utils/media-src.js.map +1 -1
  81. package/src/lib/app-utils/media-takedown-reach.d.ts +4 -1
  82. package/src/lib/app-utils/media-takedown-reach.js +6 -3
  83. package/src/lib/app-utils/media-takedown-reach.js.map +1 -1
  84. package/src/lib/app-utils/notifications.d.ts +1 -1
  85. package/src/lib/app-utils/notifications.js +2 -0
  86. package/src/lib/app-utils/notifications.js.map +1 -1
  87. package/src/lib/app-utils/organizations.d.ts +51 -2
  88. package/src/lib/app-utils/organizations.js +56 -3
  89. package/src/lib/app-utils/organizations.js.map +1 -1
  90. package/src/lib/app-utils/page-record-sources.d.ts +87 -0
  91. package/src/lib/app-utils/page-record-sources.js +53 -0
  92. package/src/lib/app-utils/page-record-sources.js.map +1 -0
  93. package/src/lib/app-utils/paid-media-source.d.ts +3 -7
  94. package/src/lib/app-utils/paid-media-source.js +5 -19
  95. package/src/lib/app-utils/paid-media-source.js.map +1 -1
  96. package/src/lib/app-utils/person-erasure.d.ts +5 -2
  97. package/src/lib/app-utils/person-erasure.js.map +1 -1
  98. package/src/lib/app-utils/picklists.d.ts +187 -0
  99. package/src/lib/app-utils/picklists.js +320 -0
  100. package/src/lib/app-utils/picklists.js.map +1 -0
  101. package/src/lib/app-utils/plan-entitlements.d.ts +220 -50
  102. package/src/lib/app-utils/plan-entitlements.js +309 -115
  103. package/src/lib/app-utils/plan-entitlements.js.map +1 -1
  104. package/src/lib/app-utils/realm-host-surface.generated.js +2 -0
  105. package/src/lib/app-utils/realm-host-surface.generated.js.map +1 -1
  106. package/src/lib/app-utils/release-flags.d.ts +1 -1
  107. package/src/lib/app-utils/release-flags.js +11 -0
  108. package/src/lib/app-utils/release-flags.js.map +1 -1
  109. package/src/lib/app-utils/rendered-widths.d.ts +121 -0
  110. package/src/lib/app-utils/rendered-widths.js +211 -0
  111. package/src/lib/app-utils/rendered-widths.js.map +1 -0
  112. package/src/lib/app-utils/repeat-sources.d.ts +2 -1
  113. package/src/lib/app-utils/repeat-sources.js.map +1 -1
  114. package/src/lib/app-utils/screen-route.d.ts +154 -36
  115. package/src/lib/app-utils/screen-route.js +185 -40
  116. package/src/lib/app-utils/screen-route.js.map +1 -1
  117. package/src/lib/app-utils/seo-audit.d.ts +11 -1
  118. package/src/lib/app-utils/seo-audit.js +33 -13
  119. package/src/lib/app-utils/seo-audit.js.map +1 -1
  120. package/src/lib/app-utils/seo-keywords.d.ts +11 -0
  121. package/src/lib/app-utils/seo-keywords.js +19 -5
  122. package/src/lib/app-utils/seo-keywords.js.map +1 -1
  123. package/src/lib/app-utils/seo-page-facts.d.ts +47 -4
  124. package/src/lib/app-utils/seo-page-facts.js +136 -31
  125. package/src/lib/app-utils/seo-page-facts.js.map +1 -1
  126. package/src/lib/app-utils/seo-site-scan.d.ts +42 -4
  127. package/src/lib/app-utils/seo-site-scan.js +113 -12
  128. package/src/lib/app-utils/seo-site-scan.js.map +1 -1
  129. package/src/lib/app-utils/server.d.ts +5 -4
  130. package/src/lib/app-utils/server.js +14 -5
  131. package/src/lib/app-utils/server.js.map +1 -1
  132. package/src/lib/app-utils/site-icon-set.d.ts +195 -0
  133. package/src/lib/app-utils/site-icon-set.js +351 -0
  134. package/src/lib/app-utils/site-icon-set.js.map +1 -0
  135. package/src/lib/app-utils/site-interactions.d.ts +101 -4
  136. package/src/lib/app-utils/site-interactions.js +120 -4
  137. package/src/lib/app-utils/site-interactions.js.map +1 -1
  138. package/src/lib/app-utils/starter-template-nodes.d.ts +7 -0
  139. package/src/lib/app-utils/starter-template-nodes.js +3 -0
  140. package/src/lib/app-utils/starter-template-nodes.js.map +1 -1
  141. package/src/lib/app-utils/starter-templates.d.ts +5 -19
  142. package/src/lib/app-utils/starter-templates.js +5 -49
  143. package/src/lib/app-utils/starter-templates.js.map +1 -1
  144. package/src/lib/app-utils/transfer-launcher-context.d.ts +136 -0
  145. package/src/lib/app-utils/transfer-launcher-context.js +23 -0
  146. package/src/lib/app-utils/transfer-launcher-context.js.map +1 -0
  147. package/src/lib/app-utils/transfer-resume-import.d.ts +39 -0
  148. package/src/lib/app-utils/transfer-resume-import.js +128 -0
  149. package/src/lib/app-utils/transfer-resume-import.js.map +1 -0
  150. package/src/lib/app-utils/upgrade-proposal.d.ts +66 -0
  151. package/src/lib/app-utils/upgrade-proposal.js +95 -0
  152. package/src/lib/app-utils/upgrade-proposal.js.map +1 -0
  153. package/src/lib/app-utils/utc-month.d.ts +33 -0
  154. package/src/lib/app-utils/utc-month.js +35 -0
  155. package/src/lib/app-utils/utc-month.js.map +1 -0
  156. package/src/lib/app-utils/visitor-record-ceiling.d.ts +4 -4
  157. package/src/lib/app-utils/visitor-record-ceiling.js +4 -4
  158. package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -1
  159. package/src/lib/app-utils/wire-nodes.d.ts +39 -19
  160. package/src/lib/app-utils/wire-nodes.js +120 -34
  161. package/src/lib/app-utils/wire-nodes.js.map +1 -1
  162. package/src/lib/data-transfer/access.d.ts +74 -0
  163. package/src/lib/data-transfer/access.js +93 -0
  164. package/src/lib/data-transfer/access.js.map +1 -0
  165. package/src/lib/data-transfer/derive.d.ts +246 -0
  166. package/src/lib/data-transfer/derive.js +1007 -0
  167. package/src/lib/data-transfer/derive.js.map +1 -0
  168. package/src/lib/data-transfer/export-file.d.ts +46 -0
  169. package/src/lib/data-transfer/export-file.js +146 -0
  170. package/src/lib/data-transfer/export-file.js.map +1 -0
  171. package/src/lib/data-transfer/field-catalog.d.ts +134 -0
  172. package/src/lib/data-transfer/field-catalog.js +278 -0
  173. package/src/lib/data-transfer/field-catalog.js.map +1 -0
  174. package/src/lib/data-transfer/header-match.d.ts +129 -0
  175. package/src/lib/data-transfer/header-match.js +367 -0
  176. package/src/lib/data-transfer/header-match.js.map +1 -0
  177. package/src/lib/data-transfer/index.d.ts +34 -0
  178. package/src/lib/data-transfer/index.js +40 -0
  179. package/src/lib/data-transfer/index.js.map +1 -0
  180. package/src/lib/data-transfer/job.d.ts +190 -0
  181. package/src/lib/data-transfer/job.js +229 -0
  182. package/src/lib/data-transfer/job.js.map +1 -0
  183. package/src/lib/data-transfer/lookup.d.ts +45 -0
  184. package/src/lib/data-transfer/lookup.js +71 -0
  185. package/src/lib/data-transfer/lookup.js.map +1 -0
  186. package/src/lib/data-transfer/match.d.ts +99 -0
  187. package/src/lib/data-transfer/match.js +244 -0
  188. package/src/lib/data-transfer/match.js.map +1 -0
  189. package/src/lib/data-transfer/package-plan.d.ts +205 -0
  190. package/src/lib/data-transfer/package-plan.js +475 -0
  191. package/src/lib/data-transfer/package-plan.js.map +1 -0
  192. package/src/lib/data-transfer/package.d.ts +181 -0
  193. package/src/lib/data-transfer/package.js +426 -0
  194. package/src/lib/data-transfer/package.js.map +1 -0
  195. package/src/lib/data-transfer/picklist-map.d.ts +139 -0
  196. package/src/lib/data-transfer/picklist-map.js +271 -0
  197. package/src/lib/data-transfer/picklist-map.js.map +1 -0
  198. package/src/lib/data-transfer/plan.d.ts +176 -0
  199. package/src/lib/data-transfer/plan.js +451 -0
  200. package/src/lib/data-transfer/plan.js.map +1 -0
  201. package/src/lib/data-transfer/policy.d.ts +170 -0
  202. package/src/lib/data-transfer/policy.js +378 -0
  203. package/src/lib/data-transfer/policy.js.map +1 -0
  204. package/src/lib/data-transfer/resource.d.ts +211 -0
  205. package/src/lib/data-transfer/resource.js +241 -0
  206. package/src/lib/data-transfer/resource.js.map +1 -0
  207. package/src/lib/data-transfer/review.d.ts +70 -0
  208. package/src/lib/data-transfer/review.js +233 -0
  209. package/src/lib/data-transfer/review.js.map +1 -0
  210. package/src/lib/data-transfer/similarity.d.ts +40 -0
  211. package/src/lib/data-transfer/similarity.js +106 -0
  212. package/src/lib/data-transfer/similarity.js.map +1 -0
  213. package/src/lib/data-transfer/site-package.d.ts +365 -0
  214. package/src/lib/data-transfer/site-package.js +1077 -0
  215. package/src/lib/data-transfer/site-package.js.map +1 -0
  216. package/src/lib/data-transfer/source.d.ts +74 -0
  217. package/src/lib/data-transfer/source.js +293 -0
  218. package/src/lib/data-transfer/source.js.map +1 -0
  219. package/src/lib/data-transfer/transfer-api.d.ts +898 -0
  220. package/src/lib/data-transfer/transfer-api.js +107 -0
  221. package/src/lib/data-transfer/transfer-api.js.map +1 -0
  222. package/src/lib/foundation/definitions/org-billing.types.d.ts +31 -0
  223. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -1
  224. package/src/lib/foundation/definitions/organization.types.d.ts +42 -1
  225. package/src/lib/foundation/definitions/organization.types.js.map +1 -1
  226. package/src/lib/foundation/definitions/platform.types.d.ts +6 -4
  227. package/src/lib/foundation/definitions/platform.types.js.map +1 -1
  228. package/src/lib/foundation/index.d.ts +1 -1
  229. package/src/lib/foundation/index.js.map +1 -1
  230. package/src/lib/plugin-manager/feature-plugins.d.ts +91 -2
  231. package/src/lib/plugin-manager/feature-plugins.js +48 -3
  232. package/src/lib/plugin-manager/feature-plugins.js.map +1 -1
  233. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +50 -0
  234. package/src/lib/plugin-manager/first-party-plugins.generated.js +1129 -28
  235. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -1
  236. package/src/lib/plugin-manager/index.d.ts +0 -1
  237. package/src/lib/plugin-manager/index.js +0 -1
  238. package/src/lib/plugin-manager/index.js.map +1 -1
  239. package/src/lib/plugin-manager/interaction-recipes.d.ts +142 -0
  240. package/src/lib/plugin-manager/interaction-recipes.js +104 -0
  241. package/src/lib/plugin-manager/interaction-recipes.js.map +1 -0
  242. package/src/lib/plugin-manager/interaction-step-checks.d.ts +66 -0
  243. package/src/lib/plugin-manager/interaction-step-checks.js +86 -0
  244. package/src/lib/plugin-manager/interaction-step-checks.js.map +1 -0
  245. package/src/lib/plugin-manager/plugin-artifact-types.d.ts +235 -0
  246. package/src/lib/plugin-manager/plugin-artifact-types.js +99 -0
  247. package/src/lib/plugin-manager/plugin-artifact-types.js.map +1 -0
  248. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +8 -0
  249. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -1
  250. package/src/lib/plugin-manager/plugin-conversion-credit.d.ts +216 -0
  251. package/src/lib/plugin-manager/plugin-conversion-credit.js +91 -0
  252. package/src/lib/plugin-manager/plugin-conversion-credit.js.map +1 -0
  253. package/src/lib/plugin-manager/plugin-entity-pickers.d.ts +83 -0
  254. package/src/lib/plugin-manager/plugin-entity-pickers.js +87 -0
  255. package/src/lib/plugin-manager/plugin-entity-pickers.js.map +1 -0
  256. package/src/lib/plugin-manager/plugin-host-resources.d.ts +6 -0
  257. package/src/lib/plugin-manager/plugin-host-resources.js +6 -1
  258. package/src/lib/plugin-manager/plugin-host-resources.js.map +1 -1
  259. package/src/lib/plugin-manager/plugin-intake-gates.d.ts +75 -0
  260. package/src/lib/plugin-manager/plugin-intake-gates.js +49 -0
  261. package/src/lib/plugin-manager/plugin-intake-gates.js.map +1 -0
  262. package/src/lib/plugin-manager/plugin-jobs.d.ts +5 -5
  263. package/src/lib/plugin-manager/plugin-jobs.js +7 -7
  264. package/src/lib/plugin-manager/plugin-jobs.js.map +1 -1
  265. package/src/lib/plugin-manager/plugin-live-paths.d.ts +70 -0
  266. package/src/lib/plugin-manager/plugin-live-paths.js +66 -0
  267. package/src/lib/plugin-manager/plugin-live-paths.js.map +1 -0
  268. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +3 -2
  269. package/src/lib/plugin-manager/plugin-org-erasure.js +30 -5
  270. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -1
  271. package/src/lib/plugin-manager/plugin-person-erasure.d.ts +68 -9
  272. package/src/lib/plugin-manager/plugin-person-erasure.js +196 -51
  273. package/src/lib/plugin-manager/plugin-person-erasure.js.map +1 -1
  274. package/src/lib/plugin-manager/plugin-person-records.d.ts +275 -0
  275. package/src/lib/plugin-manager/plugin-person-records.js +107 -0
  276. package/src/lib/plugin-manager/plugin-person-records.js.map +1 -0
  277. package/src/lib/plugin-manager/plugin-record-counts.d.ts +76 -0
  278. package/src/lib/plugin-manager/plugin-record-counts.js +49 -0
  279. package/src/lib/plugin-manager/plugin-record-counts.js.map +1 -0
  280. package/src/lib/plugin-manager/plugin-record-email-state.d.ts +26 -0
  281. package/src/lib/plugin-manager/plugin-record-email-state.js +16 -0
  282. package/src/lib/plugin-manager/plugin-record-email-state.js.map +1 -1
  283. package/src/lib/plugin-manager/plugin-record-index.d.ts +10 -0
  284. package/src/lib/plugin-manager/plugin-record-index.js.map +1 -1
  285. package/src/lib/plugin-manager/plugin-record-lists.d.ts +86 -6
  286. package/src/lib/plugin-manager/plugin-record-lists.js +42 -5
  287. package/src/lib/plugin-manager/plugin-record-lists.js.map +1 -1
  288. package/src/lib/plugin-manager/plugin-record-origin.d.ts +79 -0
  289. package/src/lib/plugin-manager/plugin-record-origin.js +46 -0
  290. package/src/lib/plugin-manager/plugin-record-origin.js.map +1 -0
  291. package/src/lib/plugin-manager/plugin-record-pages.d.ts +37 -0
  292. package/src/lib/plugin-manager/plugin-record-pages.js +52 -0
  293. package/src/lib/plugin-manager/plugin-record-pages.js.map +1 -0
  294. package/src/lib/plugin-manager/plugin-record-timeline.d.ts +60 -0
  295. package/src/lib/plugin-manager/plugin-record-timeline.js +16 -0
  296. package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -1
  297. package/src/lib/plugin-manager/plugin-resource-drafts.d.ts +5 -5
  298. package/src/lib/plugin-manager/plugin-resource-drafts.js.map +1 -1
  299. package/src/lib/plugin-manager/plugin-revocations.d.ts +64 -0
  300. package/src/lib/plugin-manager/plugin-revocations.js +47 -0
  301. package/src/lib/plugin-manager/plugin-revocations.js.map +1 -0
  302. package/src/lib/plugin-manager/plugin-send-tallies.d.ts +69 -0
  303. package/src/lib/plugin-manager/plugin-send-tallies.js +45 -0
  304. package/src/lib/plugin-manager/plugin-send-tallies.js.map +1 -0
  305. package/src/lib/plugin-manager/plugin-site-bundle.d.ts +40 -0
  306. package/src/lib/plugin-manager/plugin-site-bundle.js +4 -0
  307. package/src/lib/plugin-manager/plugin-site-bundle.js.map +1 -1
  308. package/src/lib/plugin-manager/plugin-site-export.d.ts +57 -1
  309. package/src/lib/plugin-manager/plugin-site-export.js +23 -10
  310. package/src/lib/plugin-manager/plugin-site-export.js.map +1 -1
  311. package/src/lib/plugin-manager/plugin-sitemap-readers.d.ts +146 -0
  312. package/src/lib/plugin-manager/plugin-sitemap-readers.js +110 -0
  313. package/src/lib/plugin-manager/plugin-sitemap-readers.js.map +1 -0
  314. package/src/lib/plugin-manager/plugin-transfer-resources.d.ts +714 -0
  315. package/src/lib/plugin-manager/plugin-transfer-resources.js +443 -0
  316. package/src/lib/plugin-manager/plugin-transfer-resources.js.map +1 -0
  317. package/src/lib/plugin-manager/plugin-usage-axes.d.ts +54 -5
  318. package/src/lib/plugin-manager/plugin-usage-axes.js +11 -3
  319. package/src/lib/plugin-manager/plugin-usage-axes.js.map +1 -1
  320. package/src/lib/plugin-manager/plugin-user-erasure.js +9 -1
  321. package/src/lib/plugin-manager/plugin-user-erasure.js.map +1 -1
  322. package/src/lib/plugin-manager/plugin-visitor-doors.d.ts +104 -0
  323. package/src/lib/plugin-manager/plugin-visitor-doors.js +108 -0
  324. package/src/lib/plugin-manager/plugin-visitor-doors.js.map +1 -0
  325. package/src/lib/plugin-manager/realm-host-aglyn.generated.js +2 -0
  326. package/src/lib/plugin-manager/realm-host-aglyn.generated.js.map +1 -1
  327. package/src/lib/plugin-manager/repeat-rows.d.ts +5 -6
  328. package/src/lib/plugin-manager/repeat-rows.js.map +1 -1
  329. package/src/lib/app-utils/actions.d.ts +0 -310
  330. package/src/lib/app-utils/actions.js +0 -506
  331. package/src/lib/app-utils/actions.js.map +0 -1
  332. package/src/lib/app-utils/automation-placeholders.d.ts +0 -72
  333. package/src/lib/app-utils/automation-placeholders.js +0 -207
  334. package/src/lib/app-utils/automation-placeholders.js.map +0 -1
  335. package/src/lib/app-utils/dataset-models.d.ts +0 -339
  336. package/src/lib/app-utils/dataset-models.js +0 -722
  337. package/src/lib/app-utils/dataset-models.js.map +0 -1
  338. package/src/lib/app-utils/datasets.d.ts +0 -171
  339. package/src/lib/app-utils/datasets.js +0 -227
  340. package/src/lib/app-utils/datasets.js.map +0 -1
  341. package/src/lib/app-utils/form-abuse-ceiling.d.ts +0 -146
  342. package/src/lib/app-utils/form-abuse-ceiling.js +0 -158
  343. package/src/lib/app-utils/form-abuse-ceiling.js.map +0 -1
  344. package/src/lib/plugin-manager/order-fulfilment.d.ts +0 -142
  345. package/src/lib/plugin-manager/order-fulfilment.js +0 -104
  346. package/src/lib/plugin-manager/order-fulfilment.js.map +0 -1
@@ -0,0 +1,176 @@
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
+ import type { FieldDerivation, FieldProblem } from './derive';
18
+ import type { RowMatchOutcome } from './match';
19
+ import type { FieldPolicyOutcome, TransferFieldMode, TransferPolicy, TransferPolicySource, TransferValuesComparator } from './policy';
20
+ import type { TransferField } from './resource';
21
+ /** What a row will do. */
22
+ export type TransferRowVerdict = 'create' | 'update' | 'unchanged' | 'skip' | 'fail';
23
+ export declare const TRANSFER_ROW_VERDICTS: readonly TransferRowVerdict[];
24
+ /** Why a row is skipped or fails. */
25
+ export type TransferRowReason = 'matchedSkipped' | 'newSkipped' | 'skippedByChoice' | 'ambiguousSkipped' | 'ambiguousUnresolved' | 'duplicateInFile' | 'missingRequired' | 'refusedValue' | 'matchedRecordMissing' | 'planLimit' | 'resourceRule';
26
+ /** A class of thing the person is warned about. */
27
+ export type TransferWarningClass = 'derivation' | 'ambiguousDate' | 'unmatchedPicklist' | 'newPicklistValue' | 'unresolvedLookup' | 'ambiguousMatch' | 'duplicateInFile' | 'lockedRule' | 'droppedCell' | 'overwriteNonBlank' | 'clearValue' | 'planLimit'
28
+ /**
29
+ * What the owning plugin's own checks found in the file — a column, an
30
+ * address, a count — named in each sample's `detail`. Raised by a
31
+ * resource's `plan`, never by the core.
32
+ */
33
+ | 'screening'
34
+ /**
35
+ * The owning plugin's finding about one row — a rule no field policy can
36
+ * say — folded in by `withTransferResourceFindings`; it may refuse the row.
37
+ */
38
+ | 'resourceRule';
39
+ export declare const TRANSFER_WARNING_CLASSES: readonly TransferWarningClass[];
40
+ /**
41
+ * The classes that always need an acknowledgement. `derivation` needs one
42
+ * only when it holds a flagged guess; every other class is a change to data
43
+ * or a row held back, and the person says they have seen it.
44
+ */
45
+ export declare const ACKNOWLEDGED_WARNING_CLASSES: readonly TransferWarningClass[];
46
+ /**
47
+ * Something an earlier step of the wizard decided about a row: a picklist
48
+ * value that was added, left blank or refuses the row; a lookup that did
49
+ * not resolve. `refuse` fails the row.
50
+ */
51
+ export interface TransferRowNote {
52
+ class: Extract<TransferWarningClass, 'unmatchedPicklist' | 'newPicklistValue' | 'unresolvedLookup'>;
53
+ fieldId: string;
54
+ value: string;
55
+ refuse?: boolean;
56
+ detail?: string;
57
+ }
58
+ /** One row as the plan takes it. */
59
+ export interface TransferPlanRow {
60
+ /** Its index in the file. */
61
+ index: number;
62
+ /** Field id → value; `null` for a mapped blank cell; absent for unmapped. */
63
+ values: Readonly<Record<string, unknown>>;
64
+ derivations?: readonly FieldDerivation[];
65
+ problems?: readonly FieldProblem[];
66
+ notes?: readonly TransferRowNote[];
67
+ }
68
+ /** One field a row changes. */
69
+ export interface TransferFieldChange {
70
+ fieldId: string;
71
+ before: unknown;
72
+ after: unknown;
73
+ mode: TransferFieldMode;
74
+ source: TransferPolicySource;
75
+ rule: FieldPolicyOutcome['rule'];
76
+ }
77
+ /** One row's verdict. */
78
+ export interface PlannedTransferRow {
79
+ index: number;
80
+ verdict: TransferRowVerdict;
81
+ /** The record updated (or `null` for a create). */
82
+ recordId: string | null;
83
+ reason?: TransferRowReason;
84
+ /** Required fields a create lacked. */
85
+ missing?: string[];
86
+ /** Fields that change, before → after; on a create, `before` is `null`. */
87
+ diff: TransferFieldChange[];
88
+ /** Values the file had that this row will not write because of a locked rule. */
89
+ heldBack: string[];
90
+ warnings: TransferWarningClass[];
91
+ match: RowMatchOutcome;
92
+ }
93
+ /** One example of a warning. */
94
+ export interface TransferWarningSample {
95
+ /** The row's index in the file; {@link TRANSFER_FILE_SAMPLE_ROW} for something about the whole file. */
96
+ row: number;
97
+ fieldId?: string;
98
+ value?: string;
99
+ detail?: string;
100
+ }
101
+ /** The `row` of a warning sample about the whole file rather than one row (a column's name). */
102
+ export declare const TRANSFER_FILE_SAMPLE_ROW = -1;
103
+ /** One class of warning, counted. */
104
+ export interface TransferWarning {
105
+ class: TransferWarningClass;
106
+ /** Occurrences (a row can raise a class for several fields). */
107
+ count: number;
108
+ /** Distinct rows that raised it. */
109
+ rows: number;
110
+ fieldIds: string[];
111
+ samples: TransferWarningSample[];
112
+ requiresAcknowledgement: boolean;
113
+ }
114
+ export type TransferPlanSummary = Record<TransferRowVerdict, number> & {
115
+ total: number;
116
+ };
117
+ export interface TransferPlan {
118
+ rows: PlannedTransferRow[];
119
+ summary: TransferPlanSummary;
120
+ warnings: TransferWarning[];
121
+ /** The classes that must be acknowledged before the plan may be applied. */
122
+ acknowledgementsRequired: TransferWarningClass[];
123
+ }
124
+ /** Bounds the plan enforces as it goes, from the organization's plan. */
125
+ export interface TransferPlanLimits {
126
+ /** The most records this import may create. */
127
+ maxCreates?: number;
128
+ /** The most records this import may write (creates and updates). */
129
+ maxWrites?: number;
130
+ }
131
+ export interface BuildTransferPlanInput {
132
+ fields: readonly TransferField[];
133
+ rows: readonly TransferPlanRow[];
134
+ /** One per row, in the same order. */
135
+ matches: readonly RowMatchOutcome[];
136
+ /** Record id → its current values by field id. */
137
+ existing: ReadonlyMap<string, Readonly<Record<string, unknown>>>;
138
+ policy: TransferPolicy;
139
+ limits?: TransferPlanLimits;
140
+ /** Samples kept per warning class; default 5. */
141
+ sampleSize?: number;
142
+ /**
143
+ * The resource's answer to whether a field's value changes (AGL-3548):
144
+ * a value it folds on write (`Published`, `published`) is not a change.
145
+ */
146
+ valuesEqual?: TransferValuesComparator;
147
+ }
148
+ /** The plan for a file (see the block header). */
149
+ export declare function buildTransferPlan(input: BuildTransferPlanInput): TransferPlan;
150
+ /** The classes still to acknowledge before the plan may be applied. */
151
+ export declare function missingAcknowledgements(plan: Pick<TransferPlan, 'acknowledgementsRequired'>, acknowledged: Iterable<TransferWarningClass>): TransferWarningClass[];
152
+ /** Whether the plan may be applied: something to write and every required acknowledgement given. */
153
+ export declare function canApplyTransferPlan(plan: Pick<TransferPlan, 'acknowledgementsRequired' | 'summary'>, acknowledged: Iterable<TransferWarningClass>): boolean;
154
+ /** The rows that will write, in file order — what the job engine applies. */
155
+ export declare function plannedWrites(plan: Pick<TransferPlan, 'rows'>): PlannedTransferRow[];
156
+ /**
157
+ * One thing the owning plugin found about a planned row that no field policy
158
+ * can say — a redirect that loops, an off-site destination, a rule its own
159
+ * write path refuses — raised from the resource's `plan` hook.
160
+ */
161
+ export interface TransferResourceFinding {
162
+ row: number;
163
+ /** What the person should know, in a sentence. */
164
+ detail: string;
165
+ fieldId?: string;
166
+ value?: string;
167
+ /** Refuse the row (it fails as `resourceRule`) rather than only warn about it. */
168
+ refuse?: boolean;
169
+ }
170
+ /**
171
+ * The plan with the plugin's findings folded in: each finding is a
172
+ * `resourceRule` warning on its row (acknowledged before Apply, like every
173
+ * class but a plain derivation), and a `refuse` finding fails a row that
174
+ * would have written. The summary and the acknowledgements follow.
175
+ */
176
+ export declare function withTransferResourceFindings(plan: TransferPlan, findings: readonly TransferResourceFinding[], sampleSize?: number): TransferPlan;
@@ -0,0 +1,451 @@
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
+ * THE PLAN — what an import WILL do, row by row, before it does anything.
18
+ *
19
+ * Given the rows (mapped and derived), each row's match outcome, the
20
+ * records those matched, and the policy, the plan says for every row:
21
+ * create, update, unchanged, skip or fail — with the field-by-field diff
22
+ * (before → after, and which policy decided it) and the warnings it
23
+ * raised. Nothing is written; the dry run IS this function run on the
24
+ * server over every row.
25
+ *
26
+ * ## Warnings are typed and must be acknowledged
27
+ *
28
+ * Every class of thing that could surprise a person — a guessed date
29
+ * order, a picklist value nobody chose for, a non-blank value about to be
30
+ * overwritten, a value about to be cleared — is a warning class with a
31
+ * count and samples. The classes in {@link ACKNOWLEDGED_WARNING_CLASSES}
32
+ * (and a derivation class holding a flagged guess) must each be
33
+ * acknowledged before Apply is enabled; {@link missingAcknowledgements}
34
+ * says which are outstanding.
35
+ *=========================================*/ import { _ as _extends } from "@swc/helpers/_/_extends";
36
+ import { appendTransferList, applyFieldPolicy, compareTransferValues, isBlankTransferValue, resolveFieldPolicy, resolveRecordPolicy, transferValuesEqual } from "./policy.js";
37
+ import { isTransferFieldWritable } from "./resource.js";
38
+ export const TRANSFER_ROW_VERDICTS = [
39
+ 'create',
40
+ 'update',
41
+ 'unchanged',
42
+ 'skip',
43
+ 'fail'
44
+ ];
45
+ export const TRANSFER_WARNING_CLASSES = [
46
+ 'derivation',
47
+ 'ambiguousDate',
48
+ 'unmatchedPicklist',
49
+ 'newPicklistValue',
50
+ 'unresolvedLookup',
51
+ 'ambiguousMatch',
52
+ 'duplicateInFile',
53
+ 'lockedRule',
54
+ 'droppedCell',
55
+ 'overwriteNonBlank',
56
+ 'clearValue',
57
+ 'planLimit',
58
+ 'screening',
59
+ 'resourceRule'
60
+ ];
61
+ /**
62
+ * The classes that always need an acknowledgement. `derivation` needs one
63
+ * only when it holds a flagged guess; every other class is a change to data
64
+ * or a row held back, and the person says they have seen it.
65
+ */ export const ACKNOWLEDGED_WARNING_CLASSES = TRANSFER_WARNING_CLASSES.filter((entry)=>entry !== 'derivation');
66
+ /** The `row` of a warning sample about the whole file rather than one row (a column's name). */ export const TRANSFER_FILE_SAMPLE_ROW = -1;
67
+ let WarningTally = class WarningTally {
68
+ add(entry, sample, flagged = true) {
69
+ var _this_byClass_get, _tally;
70
+ const tally = (_this_byClass_get = this.byClass.get(entry)) != null ? _this_byClass_get : {
71
+ count: 0,
72
+ rows: new Set(),
73
+ fields: new Set(),
74
+ samples: [],
75
+ flagged: false
76
+ };
77
+ tally.count += 1;
78
+ tally.rows.add(sample.row);
79
+ if (sample.fieldId) tally.fields.add(sample.fieldId);
80
+ if (tally.samples.length < this.sampleSize) tally.samples.push(sample);
81
+ (_tally = tally).flagged || (_tally.flagged = flagged);
82
+ this.byClass.set(entry, tally);
83
+ }
84
+ list() {
85
+ return TRANSFER_WARNING_CLASSES.filter((entry)=>this.byClass.has(entry)).map((entry)=>{
86
+ const tally = this.byClass.get(entry);
87
+ return {
88
+ class: entry,
89
+ count: tally.count,
90
+ rows: tally.rows.size,
91
+ fieldIds: [
92
+ ...tally.fields
93
+ ],
94
+ samples: tally.samples,
95
+ requiresAcknowledgement: ACKNOWLEDGED_WARNING_CLASSES.includes(entry) || tally.flagged
96
+ };
97
+ });
98
+ }
99
+ constructor(sampleSize){
100
+ this.sampleSize = sampleSize;
101
+ this.byClass = new Map();
102
+ }
103
+ };
104
+ /** Whether a field's new value carries what the file said (every item, for a list). */ function reflects(after, incoming) {
105
+ if (Array.isArray(incoming)) return transferValuesEqual(appendTransferList(after, incoming), after);
106
+ return transferValuesEqual(after, incoming);
107
+ }
108
+ function display(value) {
109
+ if (value === null || value === undefined) return '';
110
+ return typeof value === 'string' ? value : JSON.stringify(value);
111
+ }
112
+ /** The plan for a file (see the block header). */ export function buildTransferPlan(input) {
113
+ var _input_sampleSize, _input_limits;
114
+ const byId = new Map(input.fields.map((field)=>[
115
+ field.id,
116
+ field
117
+ ]));
118
+ const tally = new WarningTally((_input_sampleSize = input.sampleSize) != null ? _input_sampleSize : 5);
119
+ const limits = (_input_limits = input.limits) != null ? _input_limits : {};
120
+ let creates = 0;
121
+ let writes = 0;
122
+ const rows = input.rows.map((row, position)=>{
123
+ var _input_matches_position, _row_derivations, _row_problems, _row_notes;
124
+ const match = (_input_matches_position = input.matches[position]) != null ? _input_matches_position : {
125
+ kind: 'new'
126
+ };
127
+ const warnings = new Set();
128
+ const warn = (entry, sample, flagged = true)=>{
129
+ warnings.add(entry);
130
+ tally.add(entry, _extends({
131
+ row: row.index
132
+ }, sample), flagged);
133
+ };
134
+ const finish = (verdict, recordId, extra = {})=>_extends({
135
+ index: row.index,
136
+ verdict,
137
+ recordId,
138
+ diff: [],
139
+ heldBack: []
140
+ }, extra, {
141
+ warnings: [
142
+ ...warnings
143
+ ],
144
+ match
145
+ });
146
+ for (const entry of (_row_derivations = row.derivations) != null ? _row_derivations : []){
147
+ warn(entry.kind === 'ambiguousDate' ? 'ambiguousDate' : 'derivation', {
148
+ fieldId: entry.fieldId,
149
+ value: entry.from,
150
+ detail: `${entry.note} → ${entry.to}`
151
+ }, entry.flagged);
152
+ }
153
+ for (const problem of (_row_problems = row.problems) != null ? _row_problems : []){
154
+ warn('droppedCell', {
155
+ fieldId: problem.fieldId,
156
+ value: problem.raw,
157
+ detail: problem.message
158
+ });
159
+ }
160
+ let refused = false;
161
+ for (const note of (_row_notes = row.notes) != null ? _row_notes : []){
162
+ warn(note.class, _extends({
163
+ fieldId: note.fieldId,
164
+ value: note.value
165
+ }, note.detail ? {
166
+ detail: note.detail
167
+ } : {}));
168
+ if (note.refuse) refused = true;
169
+ }
170
+ if (refused) return finish('fail', null, {
171
+ reason: 'refusedValue'
172
+ });
173
+ const record = resolveRecordPolicy(input.policy, row.index);
174
+ let target;
175
+ if (record.action === 'skip') {
176
+ target = {
177
+ kind: 'skip',
178
+ reason: 'skippedByChoice'
179
+ };
180
+ } else if (record.action === 'create') {
181
+ target = {
182
+ kind: 'create'
183
+ };
184
+ } else if (record.recordId) {
185
+ target = {
186
+ kind: 'update',
187
+ recordId: record.recordId
188
+ };
189
+ } else if (match.kind === 'duplicateInFile') {
190
+ warn('duplicateInFile', {
191
+ value: match.via.value,
192
+ fieldId: match.via.fieldId,
193
+ detail: `Same as row ${match.firstRow + 1}`
194
+ });
195
+ target = {
196
+ kind: 'skip',
197
+ reason: 'duplicateInFile'
198
+ };
199
+ } else if (match.kind === 'ambiguous') {
200
+ warn('ambiguousMatch', {
201
+ fieldId: match.via.fieldId,
202
+ value: match.via.value,
203
+ detail: `${match.recordIds.length} records match`
204
+ });
205
+ target = {
206
+ kind: 'skip',
207
+ reason: record.onAmbiguous === 'skip' ? 'ambiguousSkipped' : 'ambiguousUnresolved'
208
+ };
209
+ } else if (match.kind === 'matched') {
210
+ var _match_alsoMatched;
211
+ if ((_match_alsoMatched = match.alsoMatched) == null ? void 0 : _match_alsoMatched.length) {
212
+ warn('ambiguousMatch', {
213
+ fieldId: match.via.fieldId,
214
+ value: match.via.value,
215
+ detail: `Another key points at ${match.alsoMatched.length} other record(s)`
216
+ });
217
+ }
218
+ if (record.onMatch === 'skip') target = {
219
+ kind: 'skip',
220
+ reason: 'matchedSkipped'
221
+ };
222
+ else if (record.onMatch === 'duplicate') target = {
223
+ kind: 'create'
224
+ };
225
+ else target = {
226
+ kind: 'update',
227
+ recordId: match.recordId
228
+ };
229
+ } else {
230
+ target = record.onNew === 'skip' ? {
231
+ kind: 'skip',
232
+ reason: 'newSkipped'
233
+ } : {
234
+ kind: 'create'
235
+ };
236
+ }
237
+ if (target.kind === 'skip') return finish('skip', null, {
238
+ reason: target.reason
239
+ });
240
+ const before = target.kind === 'update' ? input.existing.get(target.recordId) : {};
241
+ if (!before) return finish('fail', target.kind === 'update' ? target.recordId : null, {
242
+ reason: 'matchedRecordMissing'
243
+ });
244
+ const diff = [];
245
+ const heldBack = [];
246
+ for (const [fieldId, incoming] of Object.entries(row.values)){
247
+ const field = byId.get(fieldId);
248
+ if (!field || !isTransferFieldWritable(field)) continue;
249
+ const resolved = resolveFieldPolicy(input.policy, row.index, field);
250
+ const current = target.kind === 'update' ? before[fieldId] : null;
251
+ const equal = (a, b)=>compareTransferValues(field, a, b, input.valuesEqual);
252
+ // A new record has nothing to keep, fill around or append to: the
253
+ // file's value is written unless a locked rule refuses it.
254
+ const outcome = target.kind === 'create' ? applyFieldPolicy({
255
+ mode: 'overwrite',
256
+ blank: 'leave',
257
+ refuseValues: resolved.refuseValues
258
+ }, null, incoming, equal) : applyFieldPolicy(resolved, current, incoming, equal);
259
+ if (resolved.locked && (resolved.refuseValues || resolved.source === 'locked') && !isBlankTransferValue(incoming) && !reflects(outcome.after, incoming)) {
260
+ heldBack.push(fieldId);
261
+ warn('lockedRule', {
262
+ fieldId,
263
+ value: display(incoming),
264
+ detail: resolved.locked.reason
265
+ });
266
+ }
267
+ if (!outcome.changed) continue;
268
+ if (target.kind === 'update') {
269
+ if (outcome.rule === 'cleared') warn('clearValue', {
270
+ fieldId,
271
+ value: display(current)
272
+ });
273
+ else if (!isBlankTransferValue(current) && outcome.rule !== 'appended') {
274
+ warn('overwriteNonBlank', {
275
+ fieldId,
276
+ value: display(current),
277
+ detail: `→ ${display(outcome.after)}`
278
+ });
279
+ }
280
+ }
281
+ diff.push({
282
+ fieldId,
283
+ before: target.kind === 'update' ? current != null ? current : null : null,
284
+ after: outcome.after,
285
+ mode: target.kind === 'create' ? 'overwrite' : resolved.mode,
286
+ source: resolved.source,
287
+ rule: outcome.rule
288
+ });
289
+ }
290
+ if (target.kind === 'create') {
291
+ const missing = input.fields.filter((field)=>{
292
+ var _diff_find;
293
+ return field.required && isBlankTransferValue((_diff_find = diff.find((change)=>change.fieldId === field.id)) == null ? void 0 : _diff_find.after);
294
+ }).map((field)=>field.id);
295
+ if (missing.length) return finish('fail', null, {
296
+ reason: 'missingRequired',
297
+ missing,
298
+ heldBack
299
+ });
300
+ if (limits.maxCreates !== undefined && creates >= limits.maxCreates || limits.maxWrites !== undefined && writes >= limits.maxWrites) {
301
+ warn('planLimit', {
302
+ detail: 'Past what the plan allows'
303
+ });
304
+ return finish('fail', null, {
305
+ reason: 'planLimit',
306
+ heldBack
307
+ });
308
+ }
309
+ creates += 1;
310
+ writes += 1;
311
+ return finish('create', null, {
312
+ diff,
313
+ heldBack
314
+ });
315
+ }
316
+ if (!diff.length) return finish('unchanged', target.recordId, {
317
+ heldBack
318
+ });
319
+ if (limits.maxWrites !== undefined && writes >= limits.maxWrites) {
320
+ warn('planLimit', {
321
+ detail: 'Past what the plan allows'
322
+ });
323
+ return finish('fail', target.recordId, {
324
+ reason: 'planLimit',
325
+ heldBack
326
+ });
327
+ }
328
+ writes += 1;
329
+ return finish('update', target.recordId, {
330
+ diff,
331
+ heldBack
332
+ });
333
+ });
334
+ const summary = {
335
+ create: 0,
336
+ update: 0,
337
+ unchanged: 0,
338
+ skip: 0,
339
+ fail: 0,
340
+ total: rows.length
341
+ };
342
+ for (const row of rows)summary[row.verdict] += 1;
343
+ const warnings = tally.list();
344
+ return {
345
+ rows,
346
+ summary,
347
+ warnings,
348
+ acknowledgementsRequired: warnings.filter((entry)=>entry.requiresAcknowledgement).map((entry)=>entry.class)
349
+ };
350
+ }
351
+ /** The classes still to acknowledge before the plan may be applied. */ export function missingAcknowledgements(plan, acknowledged) {
352
+ const seen = new Set(acknowledged);
353
+ return plan.acknowledgementsRequired.filter((entry)=>!seen.has(entry));
354
+ }
355
+ /** Whether the plan may be applied: something to write and every required acknowledgement given. */ export function canApplyTransferPlan(plan, acknowledged) {
356
+ return plan.summary.create + plan.summary.update > 0 && missingAcknowledgements(plan, acknowledged).length === 0;
357
+ }
358
+ /** The rows that will write, in file order — what the job engine applies. */ export function plannedWrites(plan) {
359
+ return plan.rows.filter((row)=>row.verdict === 'create' || row.verdict === 'update');
360
+ }
361
+ /**
362
+ * The plan with the plugin's findings folded in: each finding is a
363
+ * `resourceRule` warning on its row (acknowledged before Apply, like every
364
+ * class but a plain derivation), and a `refuse` finding fails a row that
365
+ * would have written. The summary and the acknowledgements follow.
366
+ */ export function withTransferResourceFindings(plan, findings, sampleSize = 5) {
367
+ var _ref, _ref1, _ref2, _ref3;
368
+ if (!findings.length) return plan;
369
+ const byIndex = new Map(plan.rows.map((row)=>[
370
+ row.index,
371
+ row
372
+ ]));
373
+ const touched = new Map();
374
+ const rowsRaised = new Set();
375
+ const fieldIds = new Set();
376
+ const samples = [];
377
+ let count = 0;
378
+ for (const finding of findings){
379
+ var _touched_get;
380
+ const original = byIndex.get(finding.row);
381
+ if (!original) continue;
382
+ const row = (_touched_get = touched.get(finding.row)) != null ? _touched_get : _extends({}, original, {
383
+ warnings: [
384
+ ...original.warnings
385
+ ]
386
+ });
387
+ if (!row.warnings.includes('resourceRule')) row.warnings.push('resourceRule');
388
+ if (finding.refuse && row.verdict !== 'skip' && row.verdict !== 'fail') {
389
+ row.verdict = 'fail';
390
+ row.reason = 'resourceRule';
391
+ row.diff = [];
392
+ }
393
+ touched.set(finding.row, row);
394
+ count += 1;
395
+ rowsRaised.add(finding.row);
396
+ if (finding.fieldId) fieldIds.add(finding.fieldId);
397
+ if (samples.length < sampleSize) {
398
+ samples.push(_extends({
399
+ row: finding.row
400
+ }, finding.fieldId ? {
401
+ fieldId: finding.fieldId
402
+ } : {}, finding.value !== undefined ? {
403
+ value: finding.value
404
+ } : {}, {
405
+ detail: finding.detail
406
+ }));
407
+ }
408
+ }
409
+ if (!count) return plan;
410
+ const rows = plan.rows.map((row)=>{
411
+ var _touched_get;
412
+ return (_touched_get = touched.get(row.index)) != null ? _touched_get : row;
413
+ });
414
+ const summary = {
415
+ create: 0,
416
+ update: 0,
417
+ unchanged: 0,
418
+ skip: 0,
419
+ fail: 0,
420
+ total: rows.length
421
+ };
422
+ for (const row of rows)summary[row.verdict] += 1;
423
+ const prior = plan.warnings.find((entry)=>entry.class === 'resourceRule');
424
+ const raised = {
425
+ class: 'resourceRule',
426
+ count: ((_ref = prior == null ? void 0 : prior.count) != null ? _ref : 0) + count,
427
+ rows: ((_ref1 = prior == null ? void 0 : prior.rows) != null ? _ref1 : 0) + rowsRaised.size,
428
+ fieldIds: [
429
+ ...new Set([
430
+ ...(_ref2 = prior == null ? void 0 : prior.fieldIds) != null ? _ref2 : [],
431
+ ...fieldIds
432
+ ])
433
+ ],
434
+ samples: [
435
+ ...(_ref3 = prior == null ? void 0 : prior.samples) != null ? _ref3 : [],
436
+ ...samples
437
+ ].slice(0, sampleSize),
438
+ requiresAcknowledgement: true
439
+ };
440
+ const warnings = TRANSFER_WARNING_CLASSES.flatMap((entry)=>entry === 'resourceRule' ? [
441
+ raised
442
+ ] : plan.warnings.filter((warning)=>warning.class === entry));
443
+ return {
444
+ rows,
445
+ summary,
446
+ warnings,
447
+ acknowledgementsRequired: warnings.filter((entry)=>entry.requiresAcknowledgement).map((entry)=>entry.class)
448
+ };
449
+ }
450
+
451
+ //# sourceMappingURL=plan.js.map