@wildo-ai/saas-specifications 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/dist/assurance/external-framework-mapping.json +980 -0
  2. package/dist/esm/_core/brand/brand.family-aspects.d.ts +3 -0
  3. package/dist/esm/_core/brand/brand.family-aspects.d.ts.map +1 -0
  4. package/dist/esm/_core/brand/brand.family-aspects.js +51 -0
  5. package/dist/esm/_core/brand/brand.family-aspects.js.map +1 -0
  6. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts +3 -0
  7. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -0
  8. package/dist/esm/_core/build-plan/build-plan.family-aspects.js +28 -0
  9. package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -0
  10. package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts +3 -0
  11. package/dist/esm/_core/business-model-lite/business-model.family-aspects.d.ts.map +1 -0
  12. package/dist/esm/_core/business-model-lite/business-model.family-aspects.js +21 -0
  13. package/dist/esm/_core/business-model-lite/business-model.family-aspects.js.map +1 -0
  14. package/dist/esm/_core/chart-view-specification.schemas.d.ts +11 -0
  15. package/dist/esm/_core/chart-view-specification.schemas.d.ts.map +1 -1
  16. package/dist/esm/_core/chart-view-specification.schemas.js.map +1 -1
  17. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts +85 -0
  18. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.d.ts.map +1 -1
  19. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js +41 -0
  20. package/dist/esm/_core/compliance-documents/compliance-document-candidate-generation.schemas.js.map +1 -1
  21. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +168 -2
  22. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
  23. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +98 -9
  24. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
  25. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts +12 -0
  26. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.d.ts.map +1 -0
  27. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js +47 -0
  28. package/dist/esm/_core/compliance-documents/compliance-documents.family-aspects.js.map +1 -0
  29. package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.d.ts.map +1 -1
  30. package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js +8 -3
  31. package/dist/esm/_core/compliance-documents/document-fact-specification-generation.schemas.js.map +1 -1
  32. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts +21 -0
  33. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.d.ts.map +1 -0
  34. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js +40 -0
  35. package/dist/esm/_core/compliance-documents/processor-register.family-aspects.js.map +1 -0
  36. package/dist/esm/_core/composite-view-specification.schemas.d.ts +11 -0
  37. package/dist/esm/_core/composite-view-specification.schemas.d.ts.map +1 -1
  38. package/dist/esm/_core/composite-view-specification.schemas.js.map +1 -1
  39. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts +3 -0
  40. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.d.ts.map +1 -0
  41. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js +32 -0
  42. package/dist/esm/_core/domain-plan/domain-plan.family-aspects.js.map +1 -0
  43. package/dist/esm/_core/execution-view-specification.schemas.d.ts +11 -0
  44. package/dist/esm/_core/execution-view-specification.schemas.d.ts.map +1 -1
  45. package/dist/esm/_core/execution-view-specification.schemas.js.map +1 -1
  46. package/dist/esm/_core/family-aspects.registry.d.ts +18 -0
  47. package/dist/esm/_core/family-aspects.registry.d.ts.map +1 -0
  48. package/dist/esm/_core/family-aspects.registry.js +60 -0
  49. package/dist/esm/_core/family-aspects.registry.js.map +1 -0
  50. package/dist/esm/_core/family-aspects.schemas.d.ts +122 -0
  51. package/dist/esm/_core/family-aspects.schemas.d.ts.map +1 -0
  52. package/dist/esm/_core/family-aspects.schemas.js +15 -0
  53. package/dist/esm/_core/family-aspects.schemas.js.map +1 -0
  54. package/dist/esm/_core/feature-drafts/capability-map-output-set-generation.schemas.d.ts +11 -11
  55. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts +3 -0
  56. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.d.ts.map +1 -0
  57. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js +25 -0
  58. package/dist/esm/_core/feature-drafts/feature-drafts.family-aspects.js.map +1 -0
  59. package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts +11 -0
  60. package/dist/esm/_core/flows-actors-view-specification.schemas.d.ts.map +1 -1
  61. package/dist/esm/_core/flows-actors-view-specification.schemas.js.map +1 -1
  62. package/dist/esm/_core/frontend-component-specification.schemas.d.ts.map +1 -1
  63. package/dist/esm/_core/frontend-component-specification.schemas.js +19 -1
  64. package/dist/esm/_core/frontend-component-specification.schemas.js.map +1 -1
  65. package/dist/esm/_core/full-custom-view-specification.schemas.d.ts +11 -0
  66. package/dist/esm/_core/full-custom-view-specification.schemas.d.ts.map +1 -1
  67. package/dist/esm/_core/full-custom-view-specification.schemas.js.map +1 -1
  68. package/dist/esm/_core/guidance-flow-specification.schemas.d.ts +11 -0
  69. package/dist/esm/_core/guidance-flow-specification.schemas.d.ts.map +1 -1
  70. package/dist/esm/_core/guidance-flow-specification.schemas.js +14 -0
  71. package/dist/esm/_core/guidance-flow-specification.schemas.js.map +1 -1
  72. package/dist/esm/_core/index.d.ts +2 -0
  73. package/dist/esm/_core/index.d.ts.map +1 -1
  74. package/dist/esm/_core/index.js +2 -0
  75. package/dist/esm/_core/index.js.map +1 -1
  76. package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts +22 -22
  77. package/dist/esm/_core/market/market.family-aspects.d.ts +9 -0
  78. package/dist/esm/_core/market/market.family-aspects.d.ts.map +1 -0
  79. package/dist/esm/_core/market/market.family-aspects.js +227 -0
  80. package/dist/esm/_core/market/market.family-aspects.js.map +1 -0
  81. package/dist/esm/_core/onboarding-view-specification.schemas.d.ts +11 -0
  82. package/dist/esm/_core/onboarding-view-specification.schemas.d.ts.map +1 -1
  83. package/dist/esm/_core/onboarding-view-specification.schemas.js +14 -0
  84. package/dist/esm/_core/onboarding-view-specification.schemas.js.map +1 -1
  85. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts +3 -0
  86. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.d.ts.map +1 -0
  87. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js +31 -0
  88. package/dist/esm/_core/placement-plan/placement-plan.family-aspects.js.map +1 -0
  89. package/dist/esm/_core/requirements/requirements.family-aspects.d.ts +9 -0
  90. package/dist/esm/_core/requirements/requirements.family-aspects.d.ts.map +1 -0
  91. package/dist/esm/_core/requirements/requirements.family-aspects.js +40 -0
  92. package/dist/esm/_core/requirements/requirements.family-aspects.js.map +1 -0
  93. package/dist/esm/_core/resource-specification.schemas.d.ts +22 -0
  94. package/dist/esm/_core/resource-specification.schemas.d.ts.map +1 -1
  95. package/dist/esm/_core/resource-specification.schemas.js.map +1 -1
  96. package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts +3 -0
  97. package/dist/esm/_core/roadmap/roadmap.family-aspects.d.ts.map +1 -0
  98. package/dist/esm/_core/roadmap/roadmap.family-aspects.js +26 -0
  99. package/dist/esm/_core/roadmap/roadmap.family-aspects.js.map +1 -0
  100. package/dist/esm/_core/vision/vision.family-aspects.d.ts +11 -0
  101. package/dist/esm/_core/vision/vision.family-aspects.d.ts.map +1 -0
  102. package/dist/esm/_core/vision/vision.family-aspects.js +63 -0
  103. package/dist/esm/_core/vision/vision.family-aspects.js.map +1 -0
  104. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +188 -33
  105. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
  106. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +158 -57
  107. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
  108. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts +38 -4
  109. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts.map +1 -1
  110. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js +37 -3
  111. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js.map +1 -1
  112. package/dist/esm/application-creation/document-facts.family-aspects.d.ts +12 -0
  113. package/dist/esm/application-creation/document-facts.family-aspects.d.ts.map +1 -0
  114. package/dist/esm/application-creation/document-facts.family-aspects.js +37 -0
  115. package/dist/esm/application-creation/document-facts.family-aspects.js.map +1 -0
  116. package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts +3 -0
  117. package/dist/esm/application-creation/document-release-policy.family-aspects.d.ts.map +1 -0
  118. package/dist/esm/application-creation/document-release-policy.family-aspects.js +23 -0
  119. package/dist/esm/application-creation/document-release-policy.family-aspects.js.map +1 -0
  120. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +93 -62
  121. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
  122. package/dist/esm/application-creation/playbooks.application-creation.schemas.js +114 -59
  123. package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
  124. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts +2 -0
  125. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts.map +1 -1
  126. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js +2 -0
  127. package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js.map +1 -1
  128. package/dist/esm/application-creation.exports.d.ts +11 -0
  129. package/dist/esm/application-creation.exports.d.ts.map +1 -1
  130. package/dist/esm/application-creation.exports.js +11 -0
  131. package/dist/esm/application-creation.exports.js.map +1 -1
  132. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +976 -2
  133. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
  134. package/dist/esm/assurance/assurance-authority-basis.definitions.js +2026 -61
  135. package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
  136. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +1 -0
  137. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
  138. package/dist/esm/assurance/assurance-document-system.definitions.d.ts.map +1 -1
  139. package/dist/esm/assurance/assurance-document-system.definitions.js +18 -3
  140. package/dist/esm/assurance/assurance-document-system.definitions.js.map +1 -1
  141. package/dist/esm/assurance/assurance-document-system.schemas.d.ts +32 -2
  142. package/dist/esm/assurance/assurance-document-system.schemas.d.ts.map +1 -1
  143. package/dist/esm/assurance/assurance-document-system.schemas.js +32 -2
  144. package/dist/esm/assurance/assurance-document-system.schemas.js.map +1 -1
  145. package/dist/esm/assurance/assurance-external-framework-mapping.d.ts +90 -0
  146. package/dist/esm/assurance/assurance-external-framework-mapping.d.ts.map +1 -0
  147. package/dist/esm/assurance/assurance-external-framework-mapping.js +134 -0
  148. package/dist/esm/assurance/assurance-external-framework-mapping.js.map +1 -0
  149. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts +71 -1
  150. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
  151. package/dist/esm/assurance/assurance-objective-catalog.definitions.js +545 -5
  152. package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
  153. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +141 -0
  154. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -0
  155. package/dist/esm/assurance/assurance-program-generation.schemas.js +377 -0
  156. package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -0
  157. package/dist/esm/assurance/assurance-program.family-aspects.d.ts +13 -0
  158. package/dist/esm/assurance/assurance-program.family-aspects.d.ts.map +1 -0
  159. package/dist/esm/assurance/assurance-program.family-aspects.js +16 -0
  160. package/dist/esm/assurance/assurance-program.family-aspects.js.map +1 -0
  161. package/dist/esm/assurance/assurance-program.schemas.d.ts +30 -6
  162. package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
  163. package/dist/esm/assurance/assurance-program.schemas.js +29 -6
  164. package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
  165. package/dist/esm/assurance/assurance-source-registry.definitions.d.ts +1 -0
  166. package/dist/esm/assurance/assurance-source-registry.definitions.d.ts.map +1 -1
  167. package/dist/esm/assurance/assurance-source-registry.definitions.js +12 -0
  168. package/dist/esm/assurance/assurance-source-registry.definitions.js.map +1 -1
  169. package/dist/esm/assurance/assurance-sources.schemas.d.ts +76 -0
  170. package/dist/esm/assurance/assurance-sources.schemas.d.ts.map +1 -1
  171. package/dist/esm/assurance/assurance-sources.schemas.js +59 -0
  172. package/dist/esm/assurance/assurance-sources.schemas.js.map +1 -1
  173. package/dist/esm/assurance/document-publication.family-aspects.d.ts +29 -0
  174. package/dist/esm/assurance/document-publication.family-aspects.d.ts.map +1 -0
  175. package/dist/esm/assurance/document-publication.family-aspects.js +48 -0
  176. package/dist/esm/assurance/document-publication.family-aspects.js.map +1 -0
  177. package/dist/esm/assurance.exports.d.ts +2 -0
  178. package/dist/esm/assurance.exports.d.ts.map +1 -1
  179. package/dist/esm/assurance.exports.js +2 -0
  180. package/dist/esm/assurance.exports.js.map +1 -1
  181. package/dist/esm/companion-exports.d.ts +19 -2
  182. package/dist/esm/companion-exports.d.ts.map +1 -1
  183. package/dist/esm/companion-exports.js.map +1 -1
  184. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
  185. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +2 -0
  186. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
  187. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.d.ts.map +1 -1
  188. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +3 -1
  189. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
  190. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
  191. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +3 -1
  192. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
  193. package/dist/esm/engine/applications/resources/application-versions.resource.specification.d.ts.map +1 -1
  194. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +3 -1
  195. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
  196. package/dist/esm/engine/applications/resources/applications.resource.specification.d.ts.map +1 -1
  197. package/dist/esm/engine/applications/resources/applications.resource.specification.js +3 -1
  198. package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
  199. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts +36 -0
  200. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.d.ts.map +1 -0
  201. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js +193 -0
  202. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js.map +1 -0
  203. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts +1 -1
  204. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.d.ts.map +1 -1
  205. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +2 -0
  206. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
  207. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
  208. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +2 -0
  209. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
  210. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
  211. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +3 -1
  212. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
  213. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts +1 -1
  214. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.d.ts.map +1 -1
  215. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +2 -0
  216. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
  217. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.d.ts.map +1 -1
  218. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +2 -0
  219. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
  220. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.d.ts.map +1 -1
  221. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +2 -0
  222. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
  223. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
  224. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +2 -0
  225. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
  226. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.d.ts.map +1 -1
  227. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +6 -4
  228. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
  229. package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
  230. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +2 -0
  231. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
  232. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
  233. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js +2 -0
  234. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.js.map +1 -1
  235. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts +2 -2
  236. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
  237. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +2 -0
  238. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
  239. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts +8 -8
  240. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.d.ts.map +1 -1
  241. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +2 -0
  242. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
  243. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts +2 -2
  244. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.d.ts.map +1 -1
  245. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +2 -0
  246. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
  247. package/dist/esm/engine/billing/resources/prices.resource.specification.d.ts.map +1 -1
  248. package/dist/esm/engine/billing/resources/prices.resource.specification.js +3 -1
  249. package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
  250. package/dist/esm/engine/billing/resources/products.resource.specification.d.ts.map +1 -1
  251. package/dist/esm/engine/billing/resources/products.resource.specification.js +3 -1
  252. package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
  253. package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
  254. package/dist/esm/engine/billing/resources/promotions.resource.specification.js +2 -0
  255. package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
  256. package/dist/esm/engine/billing/resources/referrals.resource.specification.d.ts.map +1 -1
  257. package/dist/esm/engine/billing/resources/referrals.resource.specification.js +3 -1
  258. package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
  259. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts +6 -6
  260. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
  261. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +2 -0
  262. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
  263. package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts +6 -6
  264. package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts.map +1 -1
  265. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +2 -0
  266. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
  267. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.d.ts.map +1 -1
  268. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +2 -0
  269. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
  270. package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
  271. package/dist/esm/engine/engine-resource-specifications.registry.js +5 -0
  272. package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
  273. package/dist/esm/engine/engine-resource-sub-domain.d.ts +63 -0
  274. package/dist/esm/engine/engine-resource-sub-domain.d.ts.map +1 -0
  275. package/dist/esm/engine/engine-resource-sub-domain.js +87 -0
  276. package/dist/esm/engine/engine-resource-sub-domain.js.map +1 -0
  277. package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
  278. package/dist/esm/engine/errors/error-messages.specification.js +30 -1
  279. package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
  280. package/dist/esm/engine/features/resources/application-features.resource.specification.d.ts.map +1 -1
  281. package/dist/esm/engine/features/resources/application-features.resource.specification.js +2 -0
  282. package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
  283. package/dist/esm/engine/features/resources/organization-features.resource.specification.d.ts.map +1 -1
  284. package/dist/esm/engine/features/resources/organization-features.resource.specification.js +2 -0
  285. package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
  286. package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts +1 -1
  287. package/dist/esm/engine/features/resources/user-features.resource.specification.d.ts.map +1 -1
  288. package/dist/esm/engine/features/resources/user-features.resource.specification.js +2 -0
  289. package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
  290. package/dist/esm/engine/files/resources/files.resource.specification.d.ts.map +1 -1
  291. package/dist/esm/engine/files/resources/files.resource.specification.js +2 -0
  292. package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
  293. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts +3 -3
  294. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.d.ts.map +1 -1
  295. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +12 -0
  296. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
  297. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts +3 -3
  298. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.d.ts.map +1 -1
  299. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +2 -0
  300. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
  301. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts +3 -3
  302. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.d.ts.map +1 -1
  303. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +2 -0
  304. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
  305. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts +3 -3
  306. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.d.ts.map +1 -1
  307. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -1
  308. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
  309. package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.d.ts.map +1 -1
  310. package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js +8 -3
  311. package/dist/esm/engine/frontend-components/app/public-layout-main-container.frontend-component.specification.js.map +1 -1
  312. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts +1 -1
  313. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.d.ts.map +1 -1
  314. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +3 -0
  315. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
  316. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts +1 -1
  317. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.d.ts.map +1 -1
  318. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +3 -0
  319. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
  320. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts +1 -1
  321. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
  322. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +3 -0
  323. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
  324. package/dist/esm/engine/index.d.ts +1 -0
  325. package/dist/esm/engine/index.d.ts.map +1 -1
  326. package/dist/esm/engine/index.js +1 -0
  327. package/dist/esm/engine/index.js.map +1 -1
  328. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.d.ts.map +1 -1
  329. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +2 -0
  330. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
  331. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.d.ts.map +1 -1
  332. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -0
  333. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
  334. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
  335. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +2 -0
  336. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
  337. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts.map +1 -1
  338. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +2 -0
  339. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
  340. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
  341. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +2 -0
  342. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
  343. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts +1 -1
  344. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
  345. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +3 -0
  346. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
  347. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
  348. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +2 -0
  349. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
  350. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts +1 -1
  351. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
  352. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +2 -0
  353. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
  354. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.d.ts.map +1 -1
  355. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +2 -0
  356. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
  357. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.d.ts.map +1 -1
  358. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +2 -0
  359. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
  360. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.d.ts.map +1 -1
  361. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +2 -0
  362. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
  363. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.d.ts.map +1 -1
  364. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +2 -0
  365. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
  366. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.d.ts.map +1 -1
  367. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +2 -0
  368. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
  369. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
  370. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +2 -0
  371. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
  372. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.d.ts.map +1 -1
  373. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +2 -0
  374. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
  375. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +1 -1
  376. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts.map +1 -1
  377. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +2 -0
  378. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
  379. package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts +1 -1
  380. package/dist/esm/engine/users/resources/user-credentials.resource.specification.d.ts.map +1 -1
  381. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -0
  382. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js.map +1 -1
  383. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts +1 -1
  384. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.d.ts.map +1 -1
  385. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js +2 -0
  386. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
  387. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -1
  388. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
  389. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +2 -0
  390. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
  391. package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts +1 -1
  392. package/dist/esm/engine/users/resources/user-profiles.resource.specification.d.ts.map +1 -1
  393. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +2 -0
  394. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
  395. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -1
  396. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
  397. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +2 -0
  398. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
  399. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts +1 -1
  400. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.d.ts.map +1 -1
  401. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +2 -0
  402. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
  403. package/dist/esm/engine/users/resources/user-self.resource.specification.d.ts.map +1 -1
  404. package/dist/esm/engine/users/resources/user-self.resource.specification.js +3 -1
  405. package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
  406. package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
  407. package/dist/esm/engine/users/resources/users.resource.specification.js +2 -0
  408. package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
  409. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts +5 -0
  410. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
  411. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +385 -9
  412. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
  413. package/dist/esm/technical-documentation/technical-documentation-units.schemas.js +1 -1
  414. package/dist/esm/technical-documentation/technical-documentation-units.schemas.js.map +1 -1
  415. package/dist/tsconfig.build.tsbuildinfo +1 -0
  416. package/package.json +8 -8
  417. package/dist/esm/.builder.pid +0 -9
  418. package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts +0 -0
  419. package/dist/esm/_core/business-coverage/coverage-findings-validation.d.ts.map +0 -0
  420. package/dist/esm/_core/business-coverage/coverage-findings-validation.js.map +0 -0
  421. package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts +0 -0
  422. package/dist/esm/_core/business-coverage/coverage-findings.schemas.d.ts.map +0 -0
  423. package/dist/esm/_core/business-coverage/coverage-findings.schemas.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organizations.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uCAAuC,IAAI,kCAAkC,EAC7E,sCAAsC,IAAI,iCAAiC,GAC5E,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,oBAA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ClE;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,0DAA0D;oBACnE,SAAS,EAAE,8CAA8C;iBAC1D;aACF;SACF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,QAAQ,EAAE;gBACR,KAAK,EAAE;oBACL,OAAO,EAAE,yFAAyF;oBAClG,SAAS,EAAE,8FAA8F;iBAC1G;aACF;SACF;QACD,CAAC,iCAAiC,CAAC,QAAQ,CAAC,EAAE;YAC5C,OAAO,EAAE,yDAAyD;YAClE,SAAS,EAAE,uEAAuE;SACnF;QACD,CAAC,iCAAiC,CAAC,OAAO,CAAC,EAAE;YAC3C,OAAO,EAAE,iFAAiF;YAC1F,SAAS,EAAE,qDAAqD;SACjE;KACF;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n organizationsAdminOrgResourceUIBehavior as organizationsAdminUIBehaviorSource,\n organizationsMainOrgResourceUIBehavior as organizationsMainUIBehaviorSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationSchema,\n OrganizationStatus,\n Organization_Lifecycle_Operations,\n ResourcePrimaryScope,\n organizationResourceConfiguration_InitializationFactory as organizationsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\n\ntype OrgsConfig = ReturnType<typeof organizationsFactory>;\ntype OrgsCustom = NonNullable<OrgsConfig['customOperation']>;\ntype OrgsCore = OrgsConfig['coreOperations'][number];\ntype OrgsSchema = OrgsConfig['mainSchema'];\n\nconst organizationsMainUIBehavior = organizationsMainUIBehaviorSource as ResourceUIBehaviorConfig<\n OrgsCustom,\n OrgsCore,\n OrgsSchema\n>;\nconst organizationsAdminUIBehavior = organizationsAdminUIBehaviorSource as ResourceUIBehaviorConfig<\n OrgsCustom,\n OrgsCore,\n OrgsSchema\n>;\n\n/**\n * Merged `ORGANIZATIONS` UI: org self-service CRUD in main presets, super-admin\n * directory + lifecycle in admin (`organizations.resource-presets.tsx`).\n */\nexport const organizationsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(\n resourceFrontendConfiguration(organizationsMainUIBehavior),\n resourceFrontendConfiguration(organizationsAdminUIBehavior),\n ),\n resourceSpecification(\n organizationsFactory,\n OrganizationSchema,\n ({ schemaShape }) => ({\n purpose: 'Tenant (organization) record for a customer context inside the application — name, slug, type, and lifecycle state.',\n businessRole: 'The anchor for org-scoped data: members, units, entitlements, billing, and security configuration all hang off this key.',\n lifecycleRole: 'Progresses from trial through active use, suspension, and eventual cancellation or deletion under policy.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATIONS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'Organization_Lifecycle_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationsMainOrgResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationsAdminOrgResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n name: schemaShape.name.stringSpec({\n meaning: 'Human label for the organization in UI and support.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n type: schemaShape.type.stringSpec({\n meaning: 'Creation-time organization policy identity selecting role, membership-grant, and authentication behavior; transitions require a dedicated dependent-policy migration.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n slug: schemaShape.slug.stringSpec({\n meaning: 'URL-safe identifier, stable for routing and APIs. Unique across the application, and creation-time identity — it cannot be edited afterwards, which is why a collision is refused at CREATE rather than reconciled later.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n ownerFloorSerializationToken: schemaShape.ownerFloorSerializationToken.numberSpec({\n meaning: 'Concurrency token for the organization-owner floor. Carries NO business meaning and is never read for one — it exists so that two concurrent owner-reducing operations write the same document and the storage engine aborts the loser. Without it the floor is open to write skew: two callers each remove a DIFFERENT owner, each observes the other still present, and both commit, leaving a tenant nobody can administer. Backend-only and hidden; a lost update on the value itself is harmless.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Subscription and access posture for the tenant.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationStatus.ACTIVE]: { meaning: 'Normal operations.' },\n [OrganizationStatus.SUSPENDED]: { meaning: 'Blocked by policy or billing until reinstated. Confers NO authority: a membership in a suspended tenant stops granting its roles, resolved per request rather than by rewriting membership rows.' },\n [OrganizationStatus.TRIAL]: { meaning: 'Time-boxed evaluation.' },\n [OrganizationStatus.TRIAL_EXPIRED]: { meaning: 'Trial ended without conversion.' },\n [OrganizationStatus.CANCELLED]: { meaning: 'Customer-initiated or scheduled end. Terminal, and confers NO authority.' },\n [OrganizationStatus.DELETED]: { meaning: 'MARKED for deletion and inside its retention window — present, restorable, and conferring NO authority. Written by `request_deletion`, cleared by `restore`, and consumed by the `organization-purge` batch once `purgeScheduledAt` elapses. NOT a synonym for removed: the row and every child it owns are intact until the purge runs.' },\n },\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Load org context for members (default) or any org as super-admin (`admin` variant in factory).',\n outcome: 'Clients render the tenant record and link related org-scoped resources.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization was found and its tenant record (name, slug, type, status) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id, or the caller cannot resolve it within their tenant scope.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A member attempts to read an organization other than their own, or the `admin` cross-tenant read variant is used without the platform/super-admin role.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Application-wide organization directory (super-admin; factory-registered).',\n outcome: 'Paginated org rows for support and platform operations.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of organizations for the platform directory.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin entitlement required to enumerate every tenant in the application.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Filter/sort org directory for operators.',\n outcome: 'Matching organizations for search surfaces.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of organizations matching the name/slug/status query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin entitlement required to search across tenants.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Registration-owned tenant bootstrap (route-less internal variant), direct end-user creation (default HTTP variant), or super-admin creation (`admin` HTTP variant). Organization types governed by a registration creation policy are accepted only on the internal path.',\n outcome: 'A new `ORGANIZATIONS` row and downstream provisioning hooks run.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new organization was provisioned and is returned with its server-assigned id and starting lifecycle status.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The organization payload fails schema validation (e.g. missing `name` or a malformed `slug`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not permitted to create a tenant: self-serve bootstrap is disabled for this application, or the `admin` create variant is invoked without the super-admin role.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another organization already uses the requested URL-safe `slug` (or the name where the application enforces name uniqueness).', errorCode: 'ORGANIZATION_SLUG_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Bootstrap a new organization',\n request: {\n name: 'Acme Corp',\n slug: 'acme-corp',\n },\n response: {\n _id: 'org_01HX2…',\n name: 'Acme Corp',\n slug: 'acme-corp',\n status: OrganizationStatus.TRIAL,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Org admin patch (default) or super-admin patch (`admin` variant) excluding immutable slug and organization type.',\n outcome: 'Field updates that propagate to org-scoped UIs and integrations.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization was patched and the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation, or a caller attempts to mutate immutable `slug` / `type` identity through generic UPDATE.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an org admin of this tenant nor a platform super-admin using the `admin` edit variant.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'PURGE — irreversible destruction of a tenant at the end of its retention window. No longer the tenant-facing delete: an org admin uses `request_deletion`, which marks the tenant instead.',\n outcome: 'The tenant row is hard-deleted and every enabled `onParentDelete` cascade in the resource registry runs, including organization members. Cascade edges resolve their own per-edge strategy, so children declared `IMPERSONALIZE_AND_RETAIN` are scrubbed and kept rather than removed. Deliberately retained edges (billing accounts and subscriptions, audit logs, job executions) survive the tenant by design. Emits `ORGANIZATION_DELETED`, the evidence of what was destroyed.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The organization row was deleted and its registry-declared cascades ran; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform super-admin role, OR holds it but is not a member of the target organization. Unlike `restore`, `activate` and `requestDeletion: admin`, this variant deliberately does NOT declare `admitsCrossTenantPlatformAdministration` (decided 2026-08-05): it is irreversible, whole-tenant, cascading, and skips the retention window on purpose, so crossing it would turn a compromised platform credential from a per-tenant threat into an any-tenant one. The sanctioned operator takedown path is `requestDeletion: admin` (mark + notify + window, undoable by `restore`). Opening this one would require shipping a mandatory justification, a separable high-severity audit event, and a two-person rule alongside it. Only the `admin` variant is reachable over HTTP; the default variant is a route-less INTERNAL_CALL owned by the `organization-purge` batch, so no client can skip the retention window.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The `admin` variant declares `requiresStepUpAuthentication`, and the request carried no valid single-use re-authentication token. Obtain one from the re-authentication route and retry with it. A principal with no re-authenticable credential — notably a directory-managed (SCIM) user, whose local first factor the framework destroys by design — cannot currently clear this gate.', errorCode: 'STEP_UP_REQUIRED' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id (or it was already purged).' },\n ],\n idempotent: true,\n },\n [Organization_Lifecycle_Operations.REQUEST_DELETION]: {\n operationId: Organization_Lifecycle_Operations.REQUEST_DELETION,\n purpose: 'Mark the tenant for deletion — the tenant-facing delete. Replaces the former org-admin `DELETE` door.',\n outcome: 'The tenant becomes authorization-dead immediately and stays data-alive until the retention window elapses. NOW: `status` flips to `DELETED`, `deletionRequestedAt` and `purgeScheduledAt` are stamped, every affected user’s global `userTypes` are reconciled and their tokens invalidated, and members are notified. LATER: the `organization-purge` batch destroys the tenant once `purgeScheduledAt` has passed. No rows are removed here — membership rows in particular are preserved precisely so `restore` can re-derive organization-scoped authority from them.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned to `DELETED` with its purge deadline stamped; the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role (default variant) or the platform super-admin role (`admin` variant) that gates this destructive transition. Only the `admin` variant declares `admitsCrossTenantPlatformAdministration`: an operator marks a tenant they are not a member of, which is the takedown path for a legal order or abuse report. It is the REVERSIBLE destructive door — mark, notify, window — crossed together with RESTORE deliberately, since a marking door without its release would be a one-way door calling itself a window.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'Both variants declare `requiresStepUpAuthentication`, and the request carried no valid single-use re-authentication token. Obtain one from the re-authentication route and retry with it. A principal with no re-authenticable credential — notably a directory-managed (SCIM) user, whose local first factor the framework destroys by design — cannot clear this gate and must route the teardown through the `admin` variant.', errorCode: 'STEP_UP_REQUIRED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'REQUEST_DELETION is unavailable for the organization’s current status — it is enabled only from `ACTIVE`, `TRIAL`, `TRIAL_EXPIRED` or `SUSPENDED`. From `DELETED` (already marked) or the terminal `CANCELLED` the operation is disabled, so a double-mark cannot silently re-arm the retention window. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled). On the default variant the `SUSPENDED` arm is additionally unreachable, because a suspended tenant confers no authority to its own admins.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: false,\n },\n [Organization_Lifecycle_Operations.RESTORE]: {\n operationId: Organization_Lifecycle_Operations.RESTORE,\n purpose: 'Cancel a pending tenant deletion inside its retention window (platform super-admin).',\n outcome: 'The tenant returns to `ACTIVE`, its deletion marks are cleared, and each affected user’s global `userTypes` are re-granted. Organization-scoped authority needs no restoration step: it is recomputed per request from the tenant status, over membership rows the mark deliberately left untouched.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned back to `ACTIVE` with its deletion marks cleared; the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform super-admin role. There is deliberately NO org-scoped variant: a `DELETED` tenant confers no authority, so its own admin could never satisfy one — recovery is a provider-side action, as it is in comparable systems. The variant declares `admitsCrossTenantPlatformAdministration`, so a platform super-administrator reaches it WITHOUT being a member of the marked tenant. That crossing is what makes the retention window a real safety net: until 2026-08-05 the operator was refused by the tenant-boundary check too, so a marked tenant could be restored by NOBODY and was always collected by the purge batch.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'RESTORE is unavailable unless the organization is currently `DELETED`. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id — the retention window has elapsed and the tenant was purged, or the id is unknown. There is no separate “too late to restore” state: if the row is present it is restorable.' },\n ],\n idempotent: false,\n },\n [Organization_Lifecycle_Operations.ACTIVATE]: {\n operationId: Organization_Lifecycle_Operations.ACTIVATE,\n purpose: 'Return a halted or expired organization to normal operation (super-admin). Also the trial-conversion path.',\n outcome: 'The tenant transitions to `ACTIVE` and immediately confers its members’ organization roles again — authority is recomputed per request from the tenant status over membership rows suspension never touched. Membership-derived GLOBAL `userTypes` withdrawn while the tenant was halted are re-granted from configuration (additive and idempotent, so a member who never lost one is untouched). Emits `ORGANIZATION_ACTIVATED` carrying the status it came FROM, so lifting a suspension stays distinguishable from converting a lapsed trial. Notifications fan out to org leadership.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned to `ACTIVE` and the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin role that gates organization lifecycle transitions. The variant declares `admitsCrossTenantPlatformAdministration`, so that role is sufficient on its own — membership of the target tenant is NOT additionally required, and could not be relied upon: ACTIVATE runs only from `SUSPENDED` or `TRIAL_EXPIRED`, and a `SUSPENDED` tenant confers no authority to its own members.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'ACTIVATE is unavailable for the organization’s current status — it is enabled only from `SUSPENDED` or `TRIAL_EXPIRED`. From `ACTIVE` (a no-op) or the terminal `CANCELLED`/`DELETED` states the operation is disabled. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Organization_Lifecycle_Operations.SUSPEND]: {\n operationId: Organization_Lifecycle_Operations.SUSPEND,\n purpose: 'Halt an organization for abuse, billing, or compliance (super-admin).',\n outcome: 'The tenant transitions to `SUSPENDED` and STOPS CONFERRING AUTHORITY: every member loses their organization roles at once, resolved per request rather than by editing membership rows, so the change is complete the moment it commits and is fully reversed by `ACTIVATE`. Members are emailed unless `notifyMembers` is false — a deliberately quiet hold is supported and is recorded in the audit event. Membership-derived GLOBAL `userTypes` are also reconciled: a membership in a non-authority-conferring tenant no longer justifies such a grant, so suspending an organization withdraws what it was vouching for platform-wide, and users who actually lose a grant have their tokens invalidated. `activate` restores them. Emits `ORGANIZATION_SUSPENDED` with the reason, the prior status, and how many users lost a global grant.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned to `SUSPENDED` and the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin role that gates organization lifecycle transitions.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'SUSPEND is unavailable for the organization’s current status — it is enabled only from `ACTIVE` or `TRIAL`. From `SUSPENDED` (a no-op) or the terminal `CANCELLED`/`DELETED` states the operation is disabled. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Registry self-anchor is `ORGANIZATIONS` for the ORGANIZATIONS primary scope; align `resourcePrimaryScope` with the factory.',\n 'Organization `type` is creation-time policy identity. Changing it requires a dedicated migration that reconciles existing member roles, membership-derived user types, and organization-specific authentication policy; generic UPDATE strips it.',\n 'Organization types with a registration creation policy cannot be created through either HTTP CREATE variant. Registration and registration-onboarding own the distinct route-less INTERNAL_CALL CREATE path, so direct CRUD cannot impersonate that authority.',\n // DELETE deliberately has NO dependents guard. An earlier revision of this spec documented a\n // 409 `ORGANIZATION_HAS_DEPENDENTS` naming active members, organization units and live\n // subscriptions as blockers; it was removed (2026-07-29) because each named dependent\n // contradicts the tenant-teardown contract rather than supporting it. Kept as a constraint so\n // the refusal is not re-derived as a \"missing\" guard.\n 'Deleting an organization is never refused for having dependents. Organization units are cascade-deleted with the tenant (every unit carries the tenant id, so the whole tree goes in one pass). Billing accounts and subscriptions are retained on purpose by the billing-retention decision, which explicitly accepts the resulting dangling tenant reference so the financial audit trail outlives the tenant. And blocking on active members would be self-defeating: the default DELETE variant is performed BY an org admin, who is himself an active member, so such a guard could never pass.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n layout: {\n purpose: 'Name/slug-first layout for org settings and the super-admin org directory card.',\n displayPurpose: 'Read-only and edit chrome share the two-section `overview` + `lifecycle` model from the merged presets.',\n sections: {\n overview: {\n purpose: 'Primary identity block: `name`, `slug`, `status`, and `type` for the tenant.',\n whenToUse: 'Default summary for org home, admin directory, and edit forms.',\n textSlots: {\n title: { purpose: 'Label the identity overview card.' },\n description: { purpose: 'Explain that these fields define the canonical customer record in Wildo.' },\n },\n },\n lifecycle: {\n purpose: 'Timestamped evidence for creation and for a pending teardown (`deletionRequestedAt`, `purgeScheduledAt`).',\n whenToUse: 'Audit, support, and compliance reviews when lifecycle questions arise.',\n textSlots: {\n title: { purpose: 'Label the lifecycle/audit strip.' },\n description: { purpose: 'Clarify that destructive actions may still leave audit trails outside this row.' },\n },\n },\n },\n },\n views: {\n [Op.READ]: {\n variants: {\n default: {\n purpose: 'Member-facing read of the current organization in standard app context.',\n whenToUse: 'Org home and any surface scoped to the active tenant.',\n },\n admin: {\n purpose: 'Super-admin read of any customer organization (factory `admin` variant).',\n whenToUse: 'Platform and support org detail drawers.',\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Platform listing of all organizations (merged admin preset only; main bundle does not surface LIST).',\n whenToUse: 'Directory and org-picker rows for app administrators.',\n },\n [Op.SEARCH]: {\n purpose: 'Filterable org search in app-admin consoles.',\n whenToUse: 'Lookup by name, slug, or status when managing many tenants.',\n },\n [Op.CREATE]: {\n variants: {\n default: {\n purpose: 'Self-serve or guided creation of a new org by an authenticated user.',\n whenToUse: 'Onboarding where users can stand up a tenant without platform admin tools.',\n },\n admin: {\n purpose: 'Back-office or migration flows where a super-admin creates an org for a customer.',\n whenToUse: 'Manual provisioning, imports, and partner enablement — addressable in merged preset.',\n },\n },\n },\n [Op.UPDATE]: {\n variants: {\n default: {\n purpose: 'Org administrators edit mutable fields (not slug) in product settings.',\n whenToUse: 'Renaming, status transitions permitted to org roles.',\n },\n admin: {\n purpose: 'Super-admin correction or elevated edits across tenants.',\n whenToUse: 'Support, compliance, and data-fix workflows.',\n },\n },\n },\n [Op.DELETE]: {\n variants: {\n admin: {\n purpose: 'Platform-driven immediate tenant purge that bypasses the retention window (high trust).',\n whenToUse: 'Exceptional abuse, legal-order, or emergency takedowns that cannot wait for scheduled purge.',\n },\n },\n },\n [Organization_Lifecycle_Operations.ACTIVATE]: {\n purpose: 'Restore operations after a suspension in app-admin UIs.',\n whenToUse: 'Reinstatement from billing recovery or false-positive security holds.',\n },\n [Organization_Lifecycle_Operations.SUSPEND]: {\n purpose: 'Emergency or policy hold that blocks org access while retaining data for audit.',\n whenToUse: 'Non-payment, ToS, or law-enforcement–driven pauses.',\n },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"organizations.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organizations.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uCAAuC,IAAI,kCAAkC,EAC7E,sCAAsC,IAAI,iCAAiC,GAC5E,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,iCAAiC,EACjC,oBAAoB,EACpB,uDAAuD,IAAI,oBAAoB,GAChF,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACnC,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAO3E,MAAM,2BAA2B,GAAG,iCAInC,CAAC;AACF,MAAM,4BAA4B,GAAG,kCAIpC,CAAC;AAEF;;;GAGG;AACH,MA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F;SACF;QACD,CAAC,iCAAiC,CAAC,QAAQ,CAAC,EAAE;YAC5C,OAAO,EAAE,yDAAyD;YAClE,SAAS,EAAE,uEAAuE;SACnF;QACD,CAAC,iCAAiC,CAAC,OAAO,CAAC,EAAE;YAC3C,OAAO,EAAE,iFAAiF;YAC1F,SAAS,EAAE,qDAAqD;SACjE;KACF;CACF,CAAC,CACH,CAAC","sourcesContent":["import {\n organizationsAdminOrgResourceUIBehavior as organizationsAdminUIBehaviorSource,\n organizationsMainOrgResourceUIBehavior as organizationsMainUIBehaviorSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationSchema,\n OrganizationStatus,\n Organization_Lifecycle_Operations,\n ResourcePrimaryScope,\n organizationResourceConfiguration_InitializationFactory as organizationsFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype OrgsConfig = ReturnType<typeof organizationsFactory>;\ntype OrgsCustom = NonNullable<OrgsConfig['customOperation']>;\ntype OrgsCore = OrgsConfig['coreOperations'][number];\ntype OrgsSchema = OrgsConfig['mainSchema'];\n\nconst organizationsMainUIBehavior = organizationsMainUIBehaviorSource as ResourceUIBehaviorConfig<\n OrgsCustom,\n OrgsCore,\n OrgsSchema\n>;\nconst organizationsAdminUIBehavior = organizationsAdminUIBehaviorSource as ResourceUIBehaviorConfig<\n OrgsCustom,\n OrgsCore,\n OrgsSchema\n>;\n\n/**\n * Merged `ORGANIZATIONS` UI: org self-service CRUD in main presets, super-admin\n * directory + lifecycle in admin (`organizations.resource-presets.tsx`).\n */\nexport const organizationsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(\n resourceFrontendConfiguration(organizationsMainUIBehavior),\n resourceFrontendConfiguration(organizationsAdminUIBehavior),\n ),\n resourceSpecification(\n organizationsFactory,\n OrganizationSchema,\n ({ schemaShape }) => ({\n purpose: 'Tenant (organization) record for a customer context inside the application — name, slug, type, and lifecycle state.',\n businessRole: 'The anchor for org-scoped data: members, units, entitlements, billing, and security configuration all hang off this key.',\n lifecycleRole: 'Progresses from trial through active use, suspension, and eventual cancellation or deletion under policy.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ORGANIZATIONS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'Organization_Lifecycle_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationsMainOrgResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationsAdminOrgResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n name: schemaShape.name.stringSpec({\n meaning: 'Human label for the organization in UI and support.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n type: schemaShape.type.stringSpec({\n meaning: 'Creation-time organization policy identity selecting role, membership-grant, and authentication behavior; transitions require a dedicated dependent-policy migration.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n slug: schemaShape.slug.stringSpec({\n meaning: 'URL-safe identifier, stable for routing and APIs. Unique across the application, and creation-time identity — it cannot be edited afterwards, which is why a collision is refused at CREATE rather than reconciled later.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n ownerFloorSerializationToken: schemaShape.ownerFloorSerializationToken.numberSpec({\n meaning: 'Concurrency token for the organization-owner floor. Carries NO business meaning and is never read for one — it exists so that two concurrent owner-reducing operations write the same document and the storage engine aborts the loser. Without it the floor is open to write skew: two callers each remove a DIFFERENT owner, each observes the other still present, and both commit, leaving a tenant nobody can administer. Backend-only and hidden; a lost update on the value itself is harmless.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Subscription and access posture for the tenant.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationStatus.ACTIVE]: { meaning: 'Normal operations.' },\n [OrganizationStatus.SUSPENDED]: { meaning: 'Blocked by policy or billing until reinstated. Confers NO authority: a membership in a suspended tenant stops granting its roles, resolved per request rather than by rewriting membership rows.' },\n [OrganizationStatus.TRIAL]: { meaning: 'Time-boxed evaluation.' },\n [OrganizationStatus.TRIAL_EXPIRED]: { meaning: 'Trial ended without conversion.' },\n [OrganizationStatus.CANCELLED]: { meaning: 'Customer-initiated or scheduled end. Terminal, and confers NO authority.' },\n [OrganizationStatus.DELETED]: { meaning: 'MARKED for deletion and inside its retention window — present, restorable, and conferring NO authority. Written by `request_deletion`, cleared by `restore`, and consumed by the `organization-purge` batch once `purgeScheduledAt` elapses. NOT a synonym for removed: the row and every child it owns are intact until the purge runs.' },\n },\n }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Load org context for members (default) or any org as super-admin (`admin` variant in factory).',\n outcome: 'Clients render the tenant record and link related org-scoped resources.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization was found and its tenant record (name, slug, type, status) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id, or the caller cannot resolve it within their tenant scope.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'A member attempts to read an organization other than their own, or the `admin` cross-tenant read variant is used without the platform/super-admin role.' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Application-wide organization directory (super-admin; factory-registered).',\n outcome: 'Paginated org rows for support and platform operations.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of organizations for the platform directory.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin entitlement required to enumerate every tenant in the application.' },\n ],\n idempotent: true,\n },\n [Op.SEARCH]: {\n purpose: 'Filter/sort org directory for operators.',\n outcome: 'Matching organizations for search surfaces.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of organizations matching the name/slug/status query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin entitlement required to search across tenants.' },\n ],\n idempotent: true,\n },\n [Op.CREATE]: {\n purpose: 'Registration-owned tenant bootstrap (route-less internal variant), direct end-user creation (default HTTP variant), or super-admin creation (`admin` HTTP variant). Organization types governed by a registration creation policy are accepted only on the internal path.',\n outcome: 'A new `ORGANIZATIONS` row and downstream provisioning hooks run.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new organization was provisioned and is returned with its server-assigned id and starting lifecycle status.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The organization payload fails schema validation (e.g. missing `name` or a malformed `slug`).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not permitted to create a tenant: self-serve bootstrap is disabled for this application, or the `admin` create variant is invoked without the super-admin role.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Another organization already uses the requested URL-safe `slug` (or the name where the application enforces name uniqueness).', errorCode: 'ORGANIZATION_SLUG_EXISTS' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Bootstrap a new organization',\n request: {\n name: 'Acme Corp',\n slug: 'acme-corp',\n },\n response: {\n _id: 'org_01HX2…',\n name: 'Acme Corp',\n slug: 'acme-corp',\n status: OrganizationStatus.TRIAL,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.UPDATE]: {\n purpose: 'Org admin patch (default) or super-admin patch (`admin` variant) excluding immutable slug and organization type.',\n outcome: 'Field updates that propagate to org-scoped UIs and integrations.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization was patched and the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited fields fail schema validation, or a caller attempts to mutate immutable `slug` / `type` identity through generic UPDATE.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is neither an org admin of this tenant nor a platform super-admin using the `admin` edit variant.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'PURGE — irreversible destruction of a tenant at the end of its retention window. No longer the tenant-facing delete: an org admin uses `request_deletion`, which marks the tenant instead.',\n outcome: 'The tenant row is hard-deleted and every enabled `onParentDelete` cascade in the resource registry runs, including organization members. Cascade edges resolve their own per-edge strategy, so children declared `IMPERSONALIZE_AND_RETAIN` are scrubbed and kept rather than removed. Deliberately retained edges (billing accounts and subscriptions, audit logs, job executions) survive the tenant by design. Emits `ORGANIZATION_DELETED`, the evidence of what was destroyed.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The organization row was deleted and its registry-declared cascades ran; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform super-admin role, OR holds it but is not a member of the target organization. Unlike `restore`, `activate` and `requestDeletion: admin`, this variant deliberately does NOT declare `admitsCrossTenantPlatformAdministration` (decided 2026-08-05): it is irreversible, whole-tenant, cascading, and skips the retention window on purpose, so crossing it would turn a compromised platform credential from a per-tenant threat into an any-tenant one. The sanctioned operator takedown path is `requestDeletion: admin` (mark + notify + window, undoable by `restore`). Opening this one would require shipping a mandatory justification, a separable high-severity audit event, and a two-person rule alongside it. Only the `admin` variant is reachable over HTTP; the default variant is a route-less INTERNAL_CALL owned by the `organization-purge` batch, so no client can skip the retention window.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The `admin` variant declares `requiresStepUpAuthentication`, and the request carried no valid single-use re-authentication token. Obtain one from the re-authentication route and retry with it. A principal with no re-authenticable credential — notably a directory-managed (SCIM) user, whose local first factor the framework destroys by design — cannot currently clear this gate.', errorCode: 'STEP_UP_REQUIRED' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id (or it was already purged).' },\n ],\n idempotent: true,\n },\n [Organization_Lifecycle_Operations.REQUEST_DELETION]: {\n operationId: Organization_Lifecycle_Operations.REQUEST_DELETION,\n purpose: 'Mark the tenant for deletion — the tenant-facing delete. Replaces the former org-admin `DELETE` door.',\n outcome: 'The tenant becomes authorization-dead immediately and stays data-alive until the retention window elapses. NOW: `status` flips to `DELETED`, `deletionRequestedAt` and `purgeScheduledAt` are stamped, every affected user’s global `userTypes` are reconciled and their tokens invalidated, and members are notified. LATER: the `organization-purge` batch destroys the tenant once `purgeScheduledAt` has passed. No rows are removed here — membership rows in particular are preserved precisely so `restore` can re-derive organization-scoped authority from them.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned to `DELETED` with its purge deadline stamped; the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the org-admin role (default variant) or the platform super-admin role (`admin` variant) that gates this destructive transition. Only the `admin` variant declares `admitsCrossTenantPlatformAdministration`: an operator marks a tenant they are not a member of, which is the takedown path for a legal order or abuse report. It is the REVERSIBLE destructive door — mark, notify, window — crossed together with RESTORE deliberately, since a marking door without its release would be a one-way door calling itself a window.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'Both variants declare `requiresStepUpAuthentication`, and the request carried no valid single-use re-authentication token. Obtain one from the re-authentication route and retry with it. A principal with no re-authenticable credential — notably a directory-managed (SCIM) user, whose local first factor the framework destroys by design — cannot clear this gate and must route the teardown through the `admin` variant.', errorCode: 'STEP_UP_REQUIRED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'REQUEST_DELETION is unavailable for the organization’s current status — it is enabled only from `ACTIVE`, `TRIAL`, `TRIAL_EXPIRED` or `SUSPENDED`. From `DELETED` (already marked) or the terminal `CANCELLED` the operation is disabled, so a double-mark cannot silently re-arm the retention window. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled). On the default variant the `SUSPENDED` arm is additionally unreachable, because a suspended tenant confers no authority to its own admins.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: false,\n },\n [Organization_Lifecycle_Operations.RESTORE]: {\n operationId: Organization_Lifecycle_Operations.RESTORE,\n purpose: 'Cancel a pending tenant deletion inside its retention window (platform super-admin).',\n outcome: 'The tenant returns to `ACTIVE`, its deletion marks are cleared, and each affected user’s global `userTypes` are re-granted. Organization-scoped authority needs no restoration step: it is recomputed per request from the tenant status, over membership rows the mark deliberately left untouched.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned back to `ACTIVE` with its deletion marks cleared; the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform super-admin role. There is deliberately NO org-scoped variant: a `DELETED` tenant confers no authority, so its own admin could never satisfy one — recovery is a provider-side action, as it is in comparable systems. The variant declares `admitsCrossTenantPlatformAdministration`, so a platform super-administrator reaches it WITHOUT being a member of the marked tenant. That crossing is what makes the retention window a real safety net: until 2026-08-05 the operator was refused by the tenant-boundary check too, so a marked tenant could be restored by NOBODY and was always collected by the purge batch.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'RESTORE is unavailable unless the organization is currently `DELETED`. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id — the retention window has elapsed and the tenant was purged, or the id is unknown. There is no separate “too late to restore” state: if the row is present it is restorable.' },\n ],\n idempotent: false,\n },\n [Organization_Lifecycle_Operations.ACTIVATE]: {\n operationId: Organization_Lifecycle_Operations.ACTIVATE,\n purpose: 'Return a halted or expired organization to normal operation (super-admin). Also the trial-conversion path.',\n outcome: 'The tenant transitions to `ACTIVE` and immediately confers its members’ organization roles again — authority is recomputed per request from the tenant status over membership rows suspension never touched. Membership-derived GLOBAL `userTypes` withdrawn while the tenant was halted are re-granted from configuration (additive and idempotent, so a member who never lost one is untouched). Emits `ORGANIZATION_ACTIVATED` carrying the status it came FROM, so lifting a suspension stays distinguishable from converting a lapsed trial. Notifications fan out to org leadership.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned to `ACTIVE` and the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin role that gates organization lifecycle transitions. The variant declares `admitsCrossTenantPlatformAdministration`, so that role is sufficient on its own — membership of the target tenant is NOT additionally required, and could not be relied upon: ACTIVATE runs only from `SUSPENDED` or `TRIAL_EXPIRED`, and a `SUSPENDED` tenant confers no authority to its own members.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'ACTIVATE is unavailable for the organization’s current status — it is enabled only from `SUSPENDED` or `TRIAL_EXPIRED`. From `ACTIVE` (a no-op) or the terminal `CANCELLED`/`DELETED` states the operation is disabled. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n [Organization_Lifecycle_Operations.SUSPEND]: {\n operationId: Organization_Lifecycle_Operations.SUSPEND,\n purpose: 'Halt an organization for abuse, billing, or compliance (super-admin).',\n outcome: 'The tenant transitions to `SUSPENDED` and STOPS CONFERRING AUTHORITY: every member loses their organization roles at once, resolved per request rather than by editing membership rows, so the change is complete the moment it commits and is fully reversed by `ACTIVATE`. Members are emailed unless `notifyMembers` is false — a deliberately quiet hold is supported and is recorded in the audit event. Membership-derived GLOBAL `userTypes` are also reconciled: a membership in a non-authority-conferring tenant no longer justifies such a grant, so suspending an organization withdraws what it was vouching for platform-wide, and users who actually lose a grant have their tokens invalidated. `activate` restores them. Emits `ORGANIZATION_SUSPENDED` with the reason, the prior status, and how many users lost a global grant.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization transitioned to `SUSPENDED` and the updated tenant record is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the platform/super-admin role that gates organization lifecycle transitions.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'SUSPEND is unavailable for the organization’s current status — it is enabled only from `ACTIVE` or `TRIAL`. From `SUSPENDED` (a no-op) or the terminal `CANCELLED`/`DELETED` states the operation is disabled. Enforced as conditional availability (`enabledCondition`) on both the frontend (the action is disabled) and the backend (rejected as operation-disabled).' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Registry self-anchor is `ORGANIZATIONS` for the ORGANIZATIONS primary scope; align `resourcePrimaryScope` with the factory.',\n 'Organization `type` is creation-time policy identity. Changing it requires a dedicated migration that reconciles existing member roles, membership-derived user types, and organization-specific authentication policy; generic UPDATE strips it.',\n 'Organization types with a registration creation policy cannot be created through either HTTP CREATE variant. Registration and registration-onboarding own the distinct route-less INTERNAL_CALL CREATE path, so direct CRUD cannot impersonate that authority.',\n // DELETE deliberately has NO dependents guard. An earlier revision of this spec documented a\n // 409 `ORGANIZATION_HAS_DEPENDENTS` naming active members, organization units and live\n // subscriptions as blockers; it was removed (2026-07-29) because each named dependent\n // contradicts the tenant-teardown contract rather than supporting it. Kept as a constraint so\n // the refusal is not re-derived as a \"missing\" guard.\n 'Deleting an organization is never refused for having dependents. Organization units are cascade-deleted with the tenant (every unit carries the tenant id, so the whole tree goes in one pass). Billing accounts and subscriptions are retained on purpose by the billing-retention decision, which explicitly accepts the resulting dangling tenant reference so the financial audit trail outlives the tenant. And blocking on active members would be self-defeating: the default DELETE variant is performed BY an org admin, who is himself an active member, so such a guard could never pass.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n layout: {\n purpose: 'Name/slug-first layout for org settings and the super-admin org directory card.',\n displayPurpose: 'Read-only and edit chrome share the two-section `overview` + `lifecycle` model from the merged presets.',\n sections: {\n overview: {\n purpose: 'Primary identity block: `name`, `slug`, `status`, and `type` for the tenant.',\n whenToUse: 'Default summary for org home, admin directory, and edit forms.',\n textSlots: {\n title: { purpose: 'Label the identity overview card.' },\n description: { purpose: 'Explain that these fields define the canonical customer record in Wildo.' },\n },\n },\n lifecycle: {\n purpose: 'Timestamped evidence for creation and for a pending teardown (`deletionRequestedAt`, `purgeScheduledAt`).',\n whenToUse: 'Audit, support, and compliance reviews when lifecycle questions arise.',\n textSlots: {\n title: { purpose: 'Label the lifecycle/audit strip.' },\n description: { purpose: 'Clarify that destructive actions may still leave audit trails outside this row.' },\n },\n },\n },\n },\n views: {\n [Op.READ]: {\n variants: {\n default: {\n purpose: 'Member-facing read of the current organization in standard app context.',\n whenToUse: 'Org home and any surface scoped to the active tenant.',\n },\n admin: {\n purpose: 'Super-admin read of any customer organization (factory `admin` variant).',\n whenToUse: 'Platform and support org detail drawers.',\n },\n },\n },\n [Op.LIST]: {\n purpose: 'Platform listing of all organizations (merged admin preset only; main bundle does not surface LIST).',\n whenToUse: 'Directory and org-picker rows for app administrators.',\n },\n [Op.SEARCH]: {\n purpose: 'Filterable org search in app-admin consoles.',\n whenToUse: 'Lookup by name, slug, or status when managing many tenants.',\n },\n [Op.CREATE]: {\n variants: {\n default: {\n purpose: 'Self-serve or guided creation of a new org by an authenticated user.',\n whenToUse: 'Onboarding where users can stand up a tenant without platform admin tools.',\n },\n admin: {\n purpose: 'Back-office or migration flows where a super-admin creates an org for a customer.',\n whenToUse: 'Manual provisioning, imports, and partner enablement — addressable in merged preset.',\n },\n },\n },\n [Op.UPDATE]: {\n variants: {\n default: {\n purpose: 'Org administrators edit mutable fields (not slug) in product settings.',\n whenToUse: 'Renaming, status transitions permitted to org roles.',\n },\n admin: {\n purpose: 'Super-admin correction or elevated edits across tenants.',\n whenToUse: 'Support, compliance, and data-fix workflows.',\n },\n },\n },\n [Op.DELETE]: {\n variants: {\n admin: {\n purpose: 'Platform-driven immediate tenant purge that bypasses the retention window (high trust).',\n whenToUse: 'Exceptional abuse, legal-order, or emergency takedowns that cannot wait for scheduled purge.',\n },\n },\n },\n [Organization_Lifecycle_Operations.ACTIVATE]: {\n purpose: 'Restore operations after a suspension in app-admin UIs.',\n whenToUse: 'Reinstatement from billing recovery or false-positive security holds.',\n },\n [Organization_Lifecycle_Operations.SUSPEND]: {\n purpose: 'Emergency or policy hold that blocks org access while retaining data for audit.',\n whenToUse: 'Non-payment, ToS, or law-enforcement–driven pauses.',\n },\n },\n }),\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"anonymous-users.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/anonymous-users.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,EAEL,gCAAgC,EAEhC,qBAAqB,IAAI,EAAE,EAE5B,MAAM,uBAAuB,CAAC;AAyB/B,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;iCA4P/C,CAAC"}
1
+ {"version":3,"file":"anonymous-users.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/anonymous-users.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,EAEL,gCAAgC,EAEhC,qBAAqB,IAAI,EAAE,EAE5B,MAAM,uBAAuB,CAAC;AA0B/B,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;iCA6P/C,CAAC"}
@@ -13,6 +13,7 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
13
13
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
14
14
  import { AnonymousUserSchema, AnonymousUserTranspositionStatus, anonymousUsersResourceConfiguration_InitializationFactory as anonymousUsersFactory, CoreResourceOperation as Op, ResourcePrimaryScope, } from '@wildo-ai/saas-models';
15
15
  import { HttpResponseStatusCode, mergeResourceFrontendConfigurations, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
16
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
16
17
  const anonymousUsersMainResourceUIBehavior = anonymousUsersMainResourceUIBehaviorSource;
17
18
  const anonymousUsersAdminResourceUIBehavior = anonymousUsersAdminResourceUIBehaviorSource;
18
19
  export const anonymousUsersResourceSpecification = resourceSpecificationFromFrontendConfiguration(mergeResourceFrontendConfigurations(resourceFrontendConfiguration(anonymousUsersMainResourceUIBehavior), resourceFrontendConfiguration(anonymousUsersAdminResourceUIBehavior)), resourceSpecification(anonymousUsersFactory, AnonymousUserSchema, ({ schemaShape }) => ({
@@ -20,6 +21,7 @@ export const anonymousUsersResourceSpecification = resourceSpecificationFromFron
20
21
  businessRole: 'The anonymous side of the identity graph — every visitor gets a row before sign-up, tied to rate limits, inbound leads, and UTM context.',
21
22
  lifecycleRole: 'Created at session start, updated as privacy or transposition state changes, retained for audit unless compliance demands erasure.',
22
23
  audience: LabelAudience.ADMIN,
24
+ subDomain: EngineResourceSubDomain.USERS,
23
25
  codeHandling: {
24
26
  mainSchema: {
25
27
  packageName: '@wildo-ai/saas-models',
@@ -1 +1 @@
1
- {"version":3,"file":"anonymous-users.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/anonymous-users.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,qCAAqC,IAAI,2CAA2C,EACpF,oCAAoC,IAAI,0CAA0C,GACnF,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAChC,yDAAyD,IAAI,qBAAqB,EAClF,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBA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,uDAAuD;gBAChE,SAAS,EAAE,wDAAwD;gBACnE,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,OAAO,EAAE,qCAAqC,EAAE;oBACzD,WAAW,EAAE,EAAE,OAAO,EAAE,4GAA4G,EAAE;iBACvI;aACF;YACD,OAAO,EAAE;gBACP,OAAO,EAAE,uFAAuF;gBAChG,SAAS,EAAE,yDAAyD;gBACpE,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,OAAO,EAAE,iDAAiD,EAAE;oBACrE,WAAW,EAAE,EAAE,OAAO,EAAE,8DAA8D,EAAE;iBACzF;aACF;SACF;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,oEAAoE;YAC7E,SAAS,EAAE,sFAAsF;SAClG;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,sEAAsE;YAC/E,SAAS,EAAE,kEAAkE;SAC9E;KACF;CACF,CAAC,CACH,CAAC","sourcesContent":["/**\n * Resource: `anonymous_users` — Wildo SaaS engine specification (mixed).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/users/anonymous-users.shared.schema.ts → `AnonymousUserSchema`\n * - Factory: engine/saas-models/src/users/anonymous-users.shared.resources-config.schemas.ts\n * - Custom operations: none (core CRUD only)\n * - Presets: `anonymousUsersMainResourceUIBehavior` + `anonymousUsersAdminResourceUIBehavior` from\n * `engine/presets-components/src/config/resources/identity.resource-presets.tsx`\n */\n\nimport {\n anonymousUsersAdminResourceUIBehavior as anonymousUsersAdminResourceUIBehaviorSource,\n anonymousUsersMainResourceUIBehavior as anonymousUsersMainResourceUIBehaviorSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n AnonymousUserSchema,\n AnonymousUserTranspositionStatus,\n anonymousUsersResourceConfiguration_InitializationFactory as anonymousUsersFactory,\n CoreResourceOperation as Op,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\n\ntype AnonymousUsersConfig = ReturnType<typeof anonymousUsersFactory>;\ntype AnonymousUsersCoreOp = AnonymousUsersConfig['coreOperations'][number];\ntype AnonymousUsersSchema = AnonymousUsersConfig['mainSchema'];\n\nconst anonymousUsersMainResourceUIBehavior = anonymousUsersMainResourceUIBehaviorSource as ResourceUIBehaviorConfig<\n undefined,\n AnonymousUsersCoreOp,\n AnonymousUsersSchema\n>;\n\nconst anonymousUsersAdminResourceUIBehavior = anonymousUsersAdminResourceUIBehaviorSource as ResourceUIBehaviorConfig<\n undefined,\n AnonymousUsersCoreOp,\n AnonymousUsersSchema\n>;\n\nexport const anonymousUsersResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(\n resourceFrontendConfiguration(anonymousUsersMainResourceUIBehavior),\n resourceFrontendConfiguration(anonymousUsersAdminResourceUIBehavior),\n ),\n resourceSpecification(\n anonymousUsersFactory,\n AnonymousUserSchema,\n ({ schemaShape }) => ({\n purpose: 'Anchor pre-authentication marketing sessions: privacy posture, first-touch metadata, and transposition into a real user.',\n businessRole: 'The anonymous side of the identity graph — every visitor gets a row before sign-up, tied to rate limits, inbound leads, and UTM context.',\n lifecycleRole: 'Created at session start, updated as privacy or transposition state changes, retained for audit unless compliance demands erasure.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AnonymousUserSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'anonymousUsersResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ANONYMOUS_USERS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'anonymousUsersMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'anonymousUsersAdminResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n notes: [\n 'No `userNotifications[]` on any operation — the runtime has no comms fan-out; do not add communications.* blocks (DF-1).',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Server-minted MongoDB storage id (ObjectId). Internal only — the anonymous user’s relational identity is `uuidRef`, not this. Child FKs and the session JWT never carry `_id`.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n uuidRef: schemaShape.uuidRef.stringSpec({\n meaning: 'Client-generated session UUID — the anonymous user’s relational identity. The `anonymousUserId` FK on child resources, the session JWT, and the `/anonymous-users/{uuidRef}/…` nested routes all key off this, never `_id`.',\n whyItMatters: 'Carries the same anonymous identity across origins (marketing site → app, which have separate localStorage) and across page reload / 24h JWT expiry; being an unguessable random UUID it can be safely presented at init to re-adopt an existing session.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n privacy: schemaShape.privacy.objectSpec({\n meaning: 'Per-session marketing and processing consent for anonymous browsing.',\n whyItMatters: 'Demonstrates the visitor agreed to the anonymous data policy before personalization or lead capture.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n userAgent: schemaShape.userAgent.stringSpec({\n meaning: 'Optional browser or client fingerprint string captured for fraud and support triage.',\n }),\n\n ipHash: schemaShape.ipHash.stringSpec({\n meaning: 'One-way hash of the client IP for rate limiting without storing raw PII in hot paths.',\n semanticRole: 'code',\n }),\n\n marketingMetadata: schemaShape.marketingMetadata.objectSpec({\n meaning: 'First-touch UTM, campaign, and path attribution — backend-only, joined server-side to leads.',\n whyItMatters: 'Powers “how did you hear about us” without duplicating the payload on `InboundContact` rows.',\n }),\n\n convertedToUserId: schemaShape.convertedToUserId.stringSpec({\n meaning: 'Wildo `users` id once the same anonymous session completes signup or login transposition.',\n semanticRole: 'identifier',\n }),\n\n transpositionStatus: schemaShape.transpositionStatus.enumSpec({\n meaning: 'Whether the anonymous row has been fully linked to a user account, partially, or is still pending.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AnonymousUserTranspositionStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [AnonymousUserTranspositionStatus.PENDING]: { meaning: 'Session exists but no successful ownership transfer yet.' },\n [AnonymousUserTranspositionStatus.PARTIAL]: { meaning: 'Some linkage (e.g. lead row) without a full user account.' },\n [AnonymousUserTranspositionStatus.COMPLETE]: { meaning: 'The visitor became an authenticated `users` row and FKs are coherent.' },\n },\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the anonymous anchor row was first created (session start).',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Internal provisioning of a new anonymous anchor when a session is minted.',\n outcome: 'The platform can attach rate limits, lead rows, and marketing metadata to a stable id.',\n whenToUse: 'Repository or system services — not a public unauthenticated CRUD in production.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new anonymous anchor row is minted with a stable id that rate limits, leads, and marketing metadata can attach to.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The provisioning payload (privacy posture, forensic fields) fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Mint an anonymous session anchor',\n request: {\n uuidRef: '550e8400-e29b-41d4-a716-446655440000',\n privacy: { dataProcessingConsent: 'basic' },\n userAgent: 'Mozilla/5.0 (…)',\n },\n response: {\n _id: '507f1f77bcf86cd799439011',\n uuidRef: '550e8400-e29b-41d4-a716-446655440000',\n transpositionStatus: AnonymousUserTranspositionStatus.PENDING,\n createdAt: '2026-06-15T10:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.READ]: {\n purpose: 'Super-admin inspection of an anonymous anchor row by its `_id`.',\n outcome: 'Operators can verify transposition, privacy, and forensic fields during investigations.',\n whenToUse: 'Super-admin investigation only. NOT an anonymous self-read: the session reaches its owned data via the nested `/anonymous-users/{uuidRef}/…` routes and validates via the JWT; a direct read resolves by `_id`, which is a server ObjectId, not the session `uuidRef`.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The anonymous anchor row was found and its transposition/privacy/forensic fields are returned (marketing metadata stays backend-only).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No anonymous anchor exists for the supplied `_id` (the session expired, was purged, or never existed).' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Administrative directory of recent anonymous visitors for support and anti-abuse review.',\n outcome: 'Operators can page session anchors in recency order within admin consoles.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of recent anonymous session anchors in recency order.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a super-admin; the global anonymous-visitor directory is never exposed to org-level operators (see businessConstraints).' },\n ],\n idempotent: true,\n },\n [Op.UPDATE]: {\n purpose: 'Internal mutation of transposition, privacy, or metadata during session upgrades.',\n outcome: 'The record reflects the latest ownership and compliance state after backend flows.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The anonymous row’s transposition/privacy/metadata was updated and the latest state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The mutated fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No anonymous anchor exists for the supplied id.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A transposition mutation conflicts with existing ownership — e.g. `convertedToUserId` is already set to a different user, so re-binding the session to another identity is rejected.' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Remove an anonymous row under compliance or when sessions are purged after retention policy.',\n outcome: 'The visitor anchor no longer exists — downstream FKs (e.g. leads) must already be nullified or re-bound.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The anonymous anchor was deleted under retention/compliance; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the super-admin / compliance role required to purge an anonymous anchor.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No anonymous anchor exists for the supplied id (or it was already purged).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Dependent rows (e.g. `InboundContact` leads) still reference this anchor and must be nullified or re-bound before the anchor can be removed.' },\n ],\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Marketing metadata is backend-only at rest — it never ships to the generic READ DTO; companion prompts must not assume client-visible UTM without checking runtime serialization.',\n 'LIST is super-admin only in the main runtime variants — do not expose unfiltered global anonymous lists to org-level operators.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ANONYMOUS },\n ),\n () => ({\n layout: {\n purpose: 'Group anonymous-visitor inspection into session health, compliance, and forensic slices.',\n displayPurpose: 'Let admins review state without exposing more PII than the preset sections already surface.',\n summaryPurpose: 'Show transposition and creation time in compact list rows.',\n sections: {\n overview: {\n purpose: 'Surface transposition and lifecycle timestamps for triage at a glance.',\n whenToUse: 'First panel when opening an anonymous visitor detail.',\n textSlots: {\n title: { purpose: 'Label the “session overview” card.' },\n description: { purpose: 'Explain that this block shows conversion progress and when the row was created.' },\n },\n },\n privacy: {\n purpose: 'Show consent captured for the anonymous relationship.',\n whenToUse: 'When validating GDPR/marketing opt-in for the session.',\n textSlots: {\n title: { purpose: 'Label the privacy and consent area.' },\n description: { purpose: 'Clarify that this is the anonymous visitor’s policy posture, not the post-signup `users` privacy document.' },\n },\n },\n context: {\n purpose: 'Optional forensic context (user agent, IP hash) for support and abuse investigations.',\n whenToUse: 'When correlating a session with WAF or rate-limit logs.',\n textSlots: {\n title: { purpose: 'Label the forensic / technical context section.' },\n description: { purpose: 'State that these fields may be redacted in some deployments.' },\n },\n },\n },\n },\n views: {\n [Op.READ]: {\n purpose: 'Read-only anonymous session inspection in the super-admin context.',\n whenToUse: 'When a platform operator inspects a specific anonymous anchor during investigations.',\n },\n [Op.LIST]: {\n purpose: 'Admin-only list of anonymous session anchors for operational review.',\n whenToUse: 'When a platform operator triages sign-up funnel issues or fraud.',\n },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"anonymous-users.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/anonymous-users.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,qCAAqC,IAAI,2CAA2C,EACpF,oCAAoC,IAAI,0CAA0C,GACnF,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,E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;gBACR,OAAO,EAAE,wEAAwE;gBACjF,SAAS,EAAE,uDAAuD;gBAClE,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,OAAO,EAAE,oCAAoC,EAAE;oBACxD,WAAW,EAAE,EAAE,OAAO,EAAE,iFAAiF,EAAE;iBAC5G;aACF;YACD,OAAO,EAAE;gBACP,OAAO,EAAE,uDAAuD;gBAChE,SAAS,EAAE,wDAAwD;gBACnE,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,OAAO,EAAE,qCAAqC,EAAE;oBACzD,WAAW,EAAE,EAAE,OAAO,EAAE,4GAA4G,EAAE;iBACvI;aACF;YACD,OAAO,EAAE;gBACP,OAAO,EAAE,uFAAuF;gBAChG,SAAS,EAAE,yDAAyD;gBACpE,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,OAAO,EAAE,iDAAiD,EAAE;oBACrE,WAAW,EAAE,EAAE,OAAO,EAAE,8DAA8D,EAAE;iBACzF;aACF;SACF;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,oEAAoE;YAC7E,SAAS,EAAE,sFAAsF;SAClG;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,sEAAsE;YAC/E,SAAS,EAAE,kEAAkE;SAC9E;KACF;CACF,CAAC,CACH,CAAC","sourcesContent":["/**\n * Resource: `anonymous_users` — Wildo SaaS engine specification (mixed).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/users/anonymous-users.shared.schema.ts → `AnonymousUserSchema`\n * - Factory: engine/saas-models/src/users/anonymous-users.shared.resources-config.schemas.ts\n * - Custom operations: none (core CRUD only)\n * - Presets: `anonymousUsersMainResourceUIBehavior` + `anonymousUsersAdminResourceUIBehavior` from\n * `engine/presets-components/src/config/resources/identity.resource-presets.tsx`\n */\n\nimport {\n anonymousUsersAdminResourceUIBehavior as anonymousUsersAdminResourceUIBehaviorSource,\n anonymousUsersMainResourceUIBehavior as anonymousUsersMainResourceUIBehaviorSource,\n} from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n AnonymousUserSchema,\n AnonymousUserTranspositionStatus,\n anonymousUsersResourceConfiguration_InitializationFactory as anonymousUsersFactory,\n CoreResourceOperation as Op,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n mergeResourceFrontendConfigurations,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype AnonymousUsersConfig = ReturnType<typeof anonymousUsersFactory>;\ntype AnonymousUsersCoreOp = AnonymousUsersConfig['coreOperations'][number];\ntype AnonymousUsersSchema = AnonymousUsersConfig['mainSchema'];\n\nconst anonymousUsersMainResourceUIBehavior = anonymousUsersMainResourceUIBehaviorSource as ResourceUIBehaviorConfig<\n undefined,\n AnonymousUsersCoreOp,\n AnonymousUsersSchema\n>;\n\nconst anonymousUsersAdminResourceUIBehavior = anonymousUsersAdminResourceUIBehaviorSource as ResourceUIBehaviorConfig<\n undefined,\n AnonymousUsersCoreOp,\n AnonymousUsersSchema\n>;\n\nexport const anonymousUsersResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n mergeResourceFrontendConfigurations(\n resourceFrontendConfiguration(anonymousUsersMainResourceUIBehavior),\n resourceFrontendConfiguration(anonymousUsersAdminResourceUIBehavior),\n ),\n resourceSpecification(\n anonymousUsersFactory,\n AnonymousUserSchema,\n ({ schemaShape }) => ({\n purpose: 'Anchor pre-authentication marketing sessions: privacy posture, first-touch metadata, and transposition into a real user.',\n businessRole: 'The anonymous side of the identity graph — every visitor gets a row before sign-up, tied to rate limits, inbound leads, and UTM context.',\n lifecycleRole: 'Created at session start, updated as privacy or transposition state changes, retained for audit unless compliance demands erasure.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.USERS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AnonymousUserSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'anonymousUsersResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'ANONYMOUS_USERS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'anonymousUsersMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'anonymousUsersAdminResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n notes: [\n 'No `userNotifications[]` on any operation — the runtime has no comms fan-out; do not add communications.* blocks (DF-1).',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Server-minted MongoDB storage id (ObjectId). Internal only — the anonymous user’s relational identity is `uuidRef`, not this. Child FKs and the session JWT never carry `_id`.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n uuidRef: schemaShape.uuidRef.stringSpec({\n meaning: 'Client-generated session UUID — the anonymous user’s relational identity. The `anonymousUserId` FK on child resources, the session JWT, and the `/anonymous-users/{uuidRef}/…` nested routes all key off this, never `_id`.',\n whyItMatters: 'Carries the same anonymous identity across origins (marketing site → app, which have separate localStorage) and across page reload / 24h JWT expiry; being an unguessable random UUID it can be safely presented at init to re-adopt an existing session.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n privacy: schemaShape.privacy.objectSpec({\n meaning: 'Per-session marketing and processing consent for anonymous browsing.',\n whyItMatters: 'Demonstrates the visitor agreed to the anonymous data policy before personalization or lead capture.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n userAgent: schemaShape.userAgent.stringSpec({\n meaning: 'Optional browser or client fingerprint string captured for fraud and support triage.',\n }),\n\n ipHash: schemaShape.ipHash.stringSpec({\n meaning: 'One-way hash of the client IP for rate limiting without storing raw PII in hot paths.',\n semanticRole: 'code',\n }),\n\n marketingMetadata: schemaShape.marketingMetadata.objectSpec({\n meaning: 'First-touch UTM, campaign, and path attribution — backend-only, joined server-side to leads.',\n whyItMatters: 'Powers “how did you hear about us” without duplicating the payload on `InboundContact` rows.',\n }),\n\n convertedToUserId: schemaShape.convertedToUserId.stringSpec({\n meaning: 'Wildo `users` id once the same anonymous session completes signup or login transposition.',\n semanticRole: 'identifier',\n }),\n\n transpositionStatus: schemaShape.transpositionStatus.enumSpec({\n meaning: 'Whether the anonymous row has been fully linked to a user account, partially, or is still pending.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'AnonymousUserTranspositionStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [AnonymousUserTranspositionStatus.PENDING]: { meaning: 'Session exists but no successful ownership transfer yet.' },\n [AnonymousUserTranspositionStatus.PARTIAL]: { meaning: 'Some linkage (e.g. lead row) without a full user account.' },\n [AnonymousUserTranspositionStatus.COMPLETE]: { meaning: 'The visitor became an authenticated `users` row and FKs are coherent.' },\n },\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the anonymous anchor row was first created (session start).',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Internal provisioning of a new anonymous anchor when a session is minted.',\n outcome: 'The platform can attach rate limits, lead rows, and marketing metadata to a stable id.',\n whenToUse: 'Repository or system services — not a public unauthenticated CRUD in production.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'A new anonymous anchor row is minted with a stable id that rate limits, leads, and marketing metadata can attach to.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The provisioning payload (privacy posture, forensic fields) fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Mint an anonymous session anchor',\n request: {\n uuidRef: '550e8400-e29b-41d4-a716-446655440000',\n privacy: { dataProcessingConsent: 'basic' },\n userAgent: 'Mozilla/5.0 (…)',\n },\n response: {\n _id: '507f1f77bcf86cd799439011',\n uuidRef: '550e8400-e29b-41d4-a716-446655440000',\n transpositionStatus: AnonymousUserTranspositionStatus.PENDING,\n createdAt: '2026-06-15T10:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.READ]: {\n purpose: 'Super-admin inspection of an anonymous anchor row by its `_id`.',\n outcome: 'Operators can verify transposition, privacy, and forensic fields during investigations.',\n whenToUse: 'Super-admin investigation only. NOT an anonymous self-read: the session reaches its owned data via the nested `/anonymous-users/{uuidRef}/…` routes and validates via the JWT; a direct read resolves by `_id`, which is a server ObjectId, not the session `uuidRef`.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The anonymous anchor row was found and its transposition/privacy/forensic fields are returned (marketing metadata stays backend-only).' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No anonymous anchor exists for the supplied `_id` (the session expired, was purged, or never existed).' },\n ],\n idempotent: true,\n },\n [Op.LIST]: {\n purpose: 'Administrative directory of recent anonymous visitors for support and anti-abuse review.',\n outcome: 'Operators can page session anchors in recency order within admin consoles.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of recent anonymous session anchors in recency order.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a super-admin; the global anonymous-visitor directory is never exposed to org-level operators (see businessConstraints).' },\n ],\n idempotent: true,\n },\n [Op.UPDATE]: {\n purpose: 'Internal mutation of transposition, privacy, or metadata during session upgrades.',\n outcome: 'The record reflects the latest ownership and compliance state after backend flows.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The anonymous row’s transposition/privacy/metadata was updated and the latest state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The mutated fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No anonymous anchor exists for the supplied id.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'A transposition mutation conflicts with existing ownership — e.g. `convertedToUserId` is already set to a different user, so re-binding the session to another identity is rejected.' },\n ],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Remove an anonymous row under compliance or when sessions are purged after retention policy.',\n outcome: 'The visitor anchor no longer exists — downstream FKs (e.g. leads) must already be nullified or re-bound.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The anonymous anchor was deleted under retention/compliance; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the super-admin / compliance role required to purge an anonymous anchor.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No anonymous anchor exists for the supplied id (or it was already purged).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'Dependent rows (e.g. `InboundContact` leads) still reference this anchor and must be nullified or re-bound before the anchor can be removed.' },\n ],\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Marketing metadata is backend-only at rest — it never ships to the generic READ DTO; companion prompts must not assume client-visible UTM without checking runtime serialization.',\n 'LIST is super-admin only in the main runtime variants — do not expose unfiltered global anonymous lists to org-level operators.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ANONYMOUS },\n ),\n () => ({\n layout: {\n purpose: 'Group anonymous-visitor inspection into session health, compliance, and forensic slices.',\n displayPurpose: 'Let admins review state without exposing more PII than the preset sections already surface.',\n summaryPurpose: 'Show transposition and creation time in compact list rows.',\n sections: {\n overview: {\n purpose: 'Surface transposition and lifecycle timestamps for triage at a glance.',\n whenToUse: 'First panel when opening an anonymous visitor detail.',\n textSlots: {\n title: { purpose: 'Label the “session overview” card.' },\n description: { purpose: 'Explain that this block shows conversion progress and when the row was created.' },\n },\n },\n privacy: {\n purpose: 'Show consent captured for the anonymous relationship.',\n whenToUse: 'When validating GDPR/marketing opt-in for the session.',\n textSlots: {\n title: { purpose: 'Label the privacy and consent area.' },\n description: { purpose: 'Clarify that this is the anonymous visitor’s policy posture, not the post-signup `users` privacy document.' },\n },\n },\n context: {\n purpose: 'Optional forensic context (user agent, IP hash) for support and abuse investigations.',\n whenToUse: 'When correlating a session with WAF or rate-limit logs.',\n textSlots: {\n title: { purpose: 'Label the forensic / technical context section.' },\n description: { purpose: 'State that these fields may be redacted in some deployments.' },\n },\n },\n },\n },\n views: {\n [Op.READ]: {\n purpose: 'Read-only anonymous session inspection in the super-admin context.',\n whenToUse: 'When a platform operator inspects a specific anonymous anchor during investigations.',\n },\n [Op.LIST]: {\n purpose: 'Admin-only list of anonymous session anchors for operational review.',\n whenToUse: 'When a platform operator triages sign-up funnel issues or fraud.',\n },\n },\n }),\n);\n"]}
@@ -9,7 +9,7 @@
9
9
  * - UI presets: none (read surfaces live in a marketing / admin app; no `resourceUIBehavior` in presets-components for this type).
10
10
  */
11
11
  import { CoreResourceOperation as Op, InboundContactEmailUserMatch } from '@wildo-ai/saas-models';
12
- export declare const inboundContactsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.DELETE | Op.CREATE | Op.LIST | Op.SEARCH, import("zod").ZodObject<{
12
+ export declare const inboundContactsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.UPDATE_MANY | Op.DELETE | Op.CREATE | Op.LIST | Op.SEARCH, import("zod").ZodObject<{
13
13
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
14
14
  email: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodEmail>>;
15
15
  firstName: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodString>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"inbound-contacts.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/inbound-contacts.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,4BAA4B,EAI7B,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;iCAoPhD,CAAC"}
1
+ {"version":3,"file":"inbound-contacts.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/inbound-contacts.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,4BAA4B,EAI7B,MAAM,uBAAuB,CAAC;AAI/B,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;iCAqPhD,CAAC"}
@@ -12,11 +12,13 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
12
12
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
13
13
  import { CoreResourceOperation as Op, InboundContactEmailUserMatch, InboundContactSchema, inboundContactsResourceConfiguration_InitializationFactory, ResourcePrimaryScope, } from '@wildo-ai/saas-models';
14
14
  import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
15
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
15
16
  export const inboundContactsResourceSpecification = resourceSpecification(inboundContactsResourceConfiguration_InitializationFactory, InboundContactSchema, ({ schemaShape }) => ({
16
17
  purpose: 'Capture public marketing leads (contact forms) as first-class records tied to an anonymous session and later transposed to a user account when the visitor signs up.',
17
18
  businessRole: 'The APPLICATION-scoped lead log that powers marketing follow-up, CRM sync, and privacy consent tracking without mixing attribution into the row itself.',
18
19
  lifecycleRole: 'Created anonymously, optionally linked to a `users` id after conversion, and rarely deleted except by compliance or super-admin cleanup.',
19
20
  audience: LabelAudience.ADMIN,
21
+ subDomain: EngineResourceSubDomain.USERS,
20
22
  codeHandling: {
21
23
  mainSchema: {
22
24
  packageName: '@wildo-ai/saas-models',
@@ -1 +1 @@
1
- {"version":3,"file":"inbound-contacts.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/inbound-contacts.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,4BAA4B,EAC5B,oBAAoB,EACpB,0DAA0D,EAC1D,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAE5F,MAAM,CA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AsB,CAAC,cAAc,EAAE,OAAO,EAAE,2DAA2D,EAAE;aACtH;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,kFAAkF,EAAE;gBACxI,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+EAA+E,EAAE;aACtI;YACD,UAAU,EAAE,IAAI;SACjB;KACF;IAED,mBAAmB,EAAE;QACnB,4JAA4J;QAC5J,iNAAiN;KAClN;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["/**\n * Resource: `inboundContacts` — Wildo SaaS engine specification (backend-only).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/users/inbound-contacts.shared.schemas.ts → `InboundContactSchema`\n * - Factory: engine/saas-models/src/users/inbound-contacts.shared.resources-config.schemas.ts\n * → `inboundContactsResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none (read surfaces live in a marketing / admin app; no `resourceUIBehavior` in presets-components for this type).\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n InboundContactEmailUserMatch,\n InboundContactSchema,\n inboundContactsResourceConfiguration_InitializationFactory,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\n\nexport const inboundContactsResourceSpecification = resourceSpecification(\n inboundContactsResourceConfiguration_InitializationFactory,\n InboundContactSchema,\n ({ schemaShape }) => ({\n purpose: 'Capture public marketing leads (contact forms) as first-class records tied to an anonymous session and later transposed to a user account when the visitor signs up.',\n businessRole: 'The APPLICATION-scoped lead log that powers marketing follow-up, CRM sync, and privacy consent tracking without mixing attribution into the row itself.',\n lifecycleRole: 'Created anonymously, optionally linked to a `users` id after conversion, and rarely deleted except by compliance or super-admin cleanup.',\n audience: LabelAudience.ADMIN,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'InboundContactSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'inboundContactsResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'INBOUND_CONTACTS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Attribution (UTM, landing path) intentionally lives on `AnonymousUser` — this row only stores lead identity and privacy consent.',\n 'CREATE declares no `userNotifications`: the `INBOUND_CONTACT` target has no email-by-target implementation in the dispatcher (it is wired only for the WEBSOCKET channel), so this spec asserts no email delivery on create.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Primary id for a single inbound lead row.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n email: schemaShape.email.stringSpec({\n meaning: 'Email address the visitor submitted (validated at the schema layer as an email).',\n whyItMatters: 'Primary business contact channel and dedup candidate for the marketing org.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n\n firstName: schemaShape.firstName.stringSpec({\n meaning: 'Optional given name for personalization in follow-up comms.',\n }),\n\n lastName: schemaShape.lastName.stringSpec({\n meaning: 'Optional family name for CRM exports and personalized outreach.',\n }),\n\n phone: schemaShape.phone.stringSpec({\n meaning: 'Optional phone capture when the public form includes it — policy-dependent.',\n semanticRole: 'identifier',\n }),\n\n anonymousUserId: schemaShape.anonymousUserId.foreignKeySpec({\n meaning: 'Foreign key to the `AnonymousUser` (pre-auth session) that submitted this lead, carrying first-touch marketing attribution (UTM, referrer, landing path) on the session side.',\n whyItMatters:\n 'Join key to the `AnonymousUser` record for campaign attribution — that context stays on the session row, not duplicated on the lead. Nullable and cleared to `null` by the transposition hook once the visitor converts and `userId` is set; `excludeFromCreate` in the Zod layer, so the controller injects it from the execution context, never the client.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n userId: schemaShape.userId.foreignKeySpec({\n meaning: 'Foreign key to the authenticated Wildo `users` row after the same anonymous visitor converts — auto-set by anonymous-session transposition. `null` for leads that never converted; distinct from the manually-linked `relatedUserId`.',\n whyItMatters: 'Records the resolved authenticated identity for a converted lead, populated by `AnonymousSessionBackendService` transposition rather than on the initial anonymous CREATE — the durable link from lead capture to a real user account.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n relatedUserId: schemaShape.relatedUserId.stringSpec({\n meaning: 'Manually associated existing customer when sales/support links a lead to another profile.',\n whyItMatters: 'Not the auto-transpose path — it encodes a human CRM decision and may differ from `userId`. `excludeFromCreate` in the Zod layer: set ONLY post-create by a sales/support admin via a privileged update, never on the public anonymous CREATE — otherwise an unauthenticated visitor could forge a lead’s association to an arbitrary user.',\n semanticRole: 'identifier',\n }),\n\n emailUserMatch: schemaShape.emailUserMatch.enumSpec({\n meaning: 'Capture-time triage signal: did the lead email already belong to an existing user, and was that user active? A hint for sales dedup/prioritisation — NOT an ownership link (never sets userId).',\n whyItMatters: 'Backend-only (`isBackendOnly`) precisely so it is never returned to the anonymous submitter — exposing it would make lead capture an account-enumeration oracle. Only admin/analytics (internal DTO) surfaces read it.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'InboundContactEmailUserMatch',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [InboundContactEmailUserMatch.NONE]: { meaning: 'No existing user carried this email at capture time.' },\n [InboundContactEmailUserMatch.ACTIVE_USER]: { meaning: 'Email matched an existing user whose lifecycle status is ACTIVE.' },\n [InboundContactEmailUserMatch.INACTIVE_USER]: { meaning: 'Email matched an existing but non-active user (inactive / suspended / pending / deleted).' },\n },\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'Creation timestamp for dedup windows and list ordering. Persisted as a `Date` (`z.date()`); serialized ISO-8601 on the wire.',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'Last mutation time for the lead row (transposition, support edits, etc.).',\n temporalRole: 'modified',\n }),\n\n privacy: schemaShape.privacy.objectSpec({\n meaning: 'Per-row consent to data processing and legal approvals required for the marketing use-case in the host jurisdiction.',\n whyItMatters: 'Demonstrates the visitor accepted marketing and processing terms, distinct from the platform-wide `users` privacy record.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Create a new inbound lead from the public site while an anonymous session is active.',\n outcome: 'A lead row is persisted and marketing can follow up from the admin console.',\n whenToUse: 'Call from the rate-limited anonymous public endpoint after validating captcha/anti-spam as required by the host app.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The lead was captured and persisted with a server-assigned id; marketing follow-up can proceed.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The submitted email is malformed/missing, or the public form payload otherwise fails schema validation or anti-spam pre-checks.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.TOO_MANY_REQUESTS_429, when: 'The anonymous session or source IP exceeded the per-window submission cap declared on the CREATE variant; the public form must back off and retry later.' },\n ],\n idempotent: false,\n rateLimitNote: 'Public, unauthenticated lead capture is rate-limited per anonymous session / source IP (cap declared on the CREATE variant in saas-models) to absorb form-spam and scripted abuse.',\n examples: [\n {\n title: 'Capture a public contact-form lead',\n request: {\n email: 'jordan@example.com',\n firstName: 'Jordan',\n lastName: 'Lee',\n privacy: { dataProcessingConsent: 'marketing' },\n },\n response: {\n _id: 'inboundcontact_01HX2…',\n email: 'jordan@example.com',\n firstName: 'Jordan',\n lastName: 'Lee',\n anonymousUserId: 'anon_01HX2…',\n createdAt: '2026-06-15T10:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n\n [Op.READ]: {\n purpose: 'Read one lead row in the admin marketing console.',\n outcome: 'Editors can inspect the submitted profile, state flags, and privacy consents for follow-up calls.',\n whenToUse: 'Use when a marketing operator opens a lead detail from search results.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The lead row was found and its DTO (profile, state flags, privacy consents) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the marketing-editor / admin role; lead detail is an operator console surface, not a public read.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No inbound-contact row exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n\n [Op.LIST]: {\n purpose: 'Paginate the lead inbox with default recency sort.',\n outcome: 'Operators can triage a queue of new inbound contacts within the application.',\n whenToUse: 'Use in dashboard views bound to the marketing editor role surface.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of inbound-contact rows in recency order.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the marketing-editor / admin role required to browse the lead inbox.' },\n ],\n idempotent: true,\n },\n\n [Op.SEARCH]: {\n purpose: 'Filter leads by free-text, email, or time windows depending on the runtime searchable fields.',\n outcome: 'Operators can narrow the population for campaigns or support investigations without exporting raw data.',\n whenToUse: 'Use when a human already knows a fragment of a lead’s identity and needs a targeted match set.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of inbound-contact rows matching the search/filter query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the marketing-editor / admin role required to query the lead population.' },\n ],\n idempotent: true,\n },\n\n [Op.UPDATE]: {\n purpose: 'Internal-only transposition and manual fixes — `INTERNAL_CALL` (not a public “edit my lead” API).',\n outcome: 'The row’s `userId` / `anonymousUserId` transition or operator corrections are persisted for audit.',\n whenToUse: 'Use in `AnonymousSessionBackendService` when ownership transposes, or in maintenance scripts under super-admin control.',\n notes: [\n 'The runtime does not surface a public marketing “edit my submission” experience — keep updates rare and system-driven.',\n ],\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The lead row was patched (transposition FK move or operator correction) and the updated row is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a trusted internal service / super-admin; this op is `INTERNAL_CALL`, never a public edit path.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No inbound-contact row exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n\n [Op.DELETE]: {\n purpose: 'Permanently remove a lead when a super-admin or compliance workflow demands erasure.',\n outcome: 'The marketing database no longer holds the PII for that id.',\n whenToUse: 'Use only for GDPR/DSR workflows or when duplicative junk rows must be purged with audit approval.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The lead row was permanently erased; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the super-admin / compliance role required to erase a lead row.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No inbound-contact row exists for the supplied id (or it was already erased).' },\n ],\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Rate limiting on CREATE is declared on the resource variant in saas-models — respect those limits in any new controller path that triggers this operation.',\n 'Because scope is `APPLICATION`, org membership alone does not partition leads — the application must add app-specific filters (campaign id, org id on host object, etc.) if multi-tenant marketing is required.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
1
+ {"version":3,"file":"inbound-contacts.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/inbound-contacts.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,4BAA4B,EAC5B,oBAAoB,EACpB,0DAA0D,EAC1D,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,CAAC,MAAM,oCAAoC,GAAG,qBAAqB,CACvE,0DAA0D,EAC1D,oBAAoB,EACpB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,sKAAsK;IAC/K,YAAY,EAAE,yJAAyJ;IACvK,aAAa,EAAE,0IAA0I;IACzJ,QAAQ,EAAE,aAAa,CAAC,KAAK;IAC7B,SAAS,EAAE,uBAAuB,CAAC,KAAK;IACxC,YAAY,EAAE;QACZ,UAAU,EAAE;YACV,WAAW,EAAE,uBAAuB;YACpC,UAAU,EAAE,sBAAsB;YAClC,UAAU,EAAE,cAAc,CAAC,MAAM;YACjC,eA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C,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["/**\n * Resource: `inboundContacts` — Wildo SaaS engine specification (backend-only).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/users/inbound-contacts.shared.schemas.ts → `InboundContactSchema`\n * - Factory: engine/saas-models/src/users/inbound-contacts.shared.resources-config.schemas.ts\n * → `inboundContactsResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none (read surfaces live in a marketing / admin app; no `resourceUIBehavior` in presets-components for this type).\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n InboundContactEmailUserMatch,\n InboundContactSchema,\n inboundContactsResourceConfiguration_InitializationFactory,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nexport const inboundContactsResourceSpecification = resourceSpecification(\n inboundContactsResourceConfiguration_InitializationFactory,\n InboundContactSchema,\n ({ schemaShape }) => ({\n purpose: 'Capture public marketing leads (contact forms) as first-class records tied to an anonymous session and later transposed to a user account when the visitor signs up.',\n businessRole: 'The APPLICATION-scoped lead log that powers marketing follow-up, CRM sync, and privacy consent tracking without mixing attribution into the row itself.',\n lifecycleRole: 'Created anonymously, optionally linked to a `users` id after conversion, and rarely deleted except by compliance or super-admin cleanup.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.USERS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'InboundContactSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'inboundContactsResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'INBOUND_CONTACTS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Attribution (UTM, landing path) intentionally lives on `AnonymousUser` — this row only stores lead identity and privacy consent.',\n 'CREATE declares no `userNotifications`: the `INBOUND_CONTACT` target has no email-by-target implementation in the dispatcher (it is wired only for the WEBSOCKET channel), so this spec asserts no email delivery on create.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Primary id for a single inbound lead row.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n email: schemaShape.email.stringSpec({\n meaning: 'Email address the visitor submitted (validated at the schema layer as an email).',\n whyItMatters: 'Primary business contact channel and dedup candidate for the marketing org.',\n importance: FieldSemanticImportance.PRIMARY,\n semanticRole: 'identifier',\n }),\n\n firstName: schemaShape.firstName.stringSpec({\n meaning: 'Optional given name for personalization in follow-up comms.',\n }),\n\n lastName: schemaShape.lastName.stringSpec({\n meaning: 'Optional family name for CRM exports and personalized outreach.',\n }),\n\n phone: schemaShape.phone.stringSpec({\n meaning: 'Optional phone capture when the public form includes it — policy-dependent.',\n semanticRole: 'identifier',\n }),\n\n anonymousUserId: schemaShape.anonymousUserId.foreignKeySpec({\n meaning: 'Foreign key to the `AnonymousUser` (pre-auth session) that submitted this lead, carrying first-touch marketing attribution (UTM, referrer, landing path) on the session side.',\n whyItMatters:\n 'Join key to the `AnonymousUser` record for campaign attribution — that context stays on the session row, not duplicated on the lead. Nullable and cleared to `null` by the transposition hook once the visitor converts and `userId` is set; `excludeFromCreate` in the Zod layer, so the controller injects it from the execution context, never the client.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n userId: schemaShape.userId.foreignKeySpec({\n meaning: 'Foreign key to the authenticated Wildo `users` row after the same anonymous visitor converts — auto-set by anonymous-session transposition. `null` for leads that never converted; distinct from the manually-linked `relatedUserId`.',\n whyItMatters: 'Records the resolved authenticated identity for a converted lead, populated by `AnonymousSessionBackendService` transposition rather than on the initial anonymous CREATE — the durable link from lead capture to a real user account.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n relatedUserId: schemaShape.relatedUserId.stringSpec({\n meaning: 'Manually associated existing customer when sales/support links a lead to another profile.',\n whyItMatters: 'Not the auto-transpose path — it encodes a human CRM decision and may differ from `userId`. `excludeFromCreate` in the Zod layer: set ONLY post-create by a sales/support admin via a privileged update, never on the public anonymous CREATE — otherwise an unauthenticated visitor could forge a lead’s association to an arbitrary user.',\n semanticRole: 'identifier',\n }),\n\n emailUserMatch: schemaShape.emailUserMatch.enumSpec({\n meaning: 'Capture-time triage signal: did the lead email already belong to an existing user, and was that user active? A hint for sales dedup/prioritisation — NOT an ownership link (never sets userId).',\n whyItMatters: 'Backend-only (`isBackendOnly`) precisely so it is never returned to the anonymous submitter — exposing it would make lead capture an account-enumeration oracle. Only admin/analytics (internal DTO) surfaces read it.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'InboundContactEmailUserMatch',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [InboundContactEmailUserMatch.NONE]: { meaning: 'No existing user carried this email at capture time.' },\n [InboundContactEmailUserMatch.ACTIVE_USER]: { meaning: 'Email matched an existing user whose lifecycle status is ACTIVE.' },\n [InboundContactEmailUserMatch.INACTIVE_USER]: { meaning: 'Email matched an existing but non-active user (inactive / suspended / pending / deleted).' },\n },\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'Creation timestamp for dedup windows and list ordering. Persisted as a `Date` (`z.date()`); serialized ISO-8601 on the wire.',\n temporalRole: 'creation',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'Last mutation time for the lead row (transposition, support edits, etc.).',\n temporalRole: 'modified',\n }),\n\n privacy: schemaShape.privacy.objectSpec({\n meaning: 'Per-row consent to data processing and legal approvals required for the marketing use-case in the host jurisdiction.',\n whyItMatters: 'Demonstrates the visitor accepted marketing and processing terms, distinct from the platform-wide `users` privacy record.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Create a new inbound lead from the public site while an anonymous session is active.',\n outcome: 'A lead row is persisted and marketing can follow up from the admin console.',\n whenToUse: 'Call from the rate-limited anonymous public endpoint after validating captcha/anti-spam as required by the host app.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The lead was captured and persisted with a server-assigned id; marketing follow-up can proceed.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The submitted email is malformed/missing, or the public form payload otherwise fails schema validation or anti-spam pre-checks.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.TOO_MANY_REQUESTS_429, when: 'The anonymous session or source IP exceeded the per-window submission cap declared on the CREATE variant; the public form must back off and retry later.' },\n ],\n idempotent: false,\n rateLimitNote: 'Public, unauthenticated lead capture is rate-limited per anonymous session / source IP (cap declared on the CREATE variant in saas-models) to absorb form-spam and scripted abuse.',\n examples: [\n {\n title: 'Capture a public contact-form lead',\n request: {\n email: 'jordan@example.com',\n firstName: 'Jordan',\n lastName: 'Lee',\n privacy: { dataProcessingConsent: 'marketing' },\n },\n response: {\n _id: 'inboundcontact_01HX2…',\n email: 'jordan@example.com',\n firstName: 'Jordan',\n lastName: 'Lee',\n anonymousUserId: 'anon_01HX2…',\n createdAt: '2026-06-15T10:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n\n [Op.READ]: {\n purpose: 'Read one lead row in the admin marketing console.',\n outcome: 'Editors can inspect the submitted profile, state flags, and privacy consents for follow-up calls.',\n whenToUse: 'Use when a marketing operator opens a lead detail from search results.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The lead row was found and its DTO (profile, state flags, privacy consents) is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the marketing-editor / admin role; lead detail is an operator console surface, not a public read.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No inbound-contact row exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n\n [Op.LIST]: {\n purpose: 'Paginate the lead inbox with default recency sort.',\n outcome: 'Operators can triage a queue of new inbound contacts within the application.',\n whenToUse: 'Use in dashboard views bound to the marketing editor role surface.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of inbound-contact rows in recency order.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the marketing-editor / admin role required to browse the lead inbox.' },\n ],\n idempotent: true,\n },\n\n [Op.SEARCH]: {\n purpose: 'Filter leads by free-text, email, or time windows depending on the runtime searchable fields.',\n outcome: 'Operators can narrow the population for campaigns or support investigations without exporting raw data.',\n whenToUse: 'Use when a human already knows a fragment of a lead’s identity and needs a targeted match set.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of inbound-contact rows matching the search/filter query.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the marketing-editor / admin role required to query the lead population.' },\n ],\n idempotent: true,\n },\n\n [Op.UPDATE]: {\n purpose: 'Internal-only transposition and manual fixes — `INTERNAL_CALL` (not a public “edit my lead” API).',\n outcome: 'The row’s `userId` / `anonymousUserId` transition or operator corrections are persisted for audit.',\n whenToUse: 'Use in `AnonymousSessionBackendService` when ownership transposes, or in maintenance scripts under super-admin control.',\n notes: [\n 'The runtime does not surface a public marketing “edit my submission” experience — keep updates rare and system-driven.',\n ],\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The lead row was patched (transposition FK move or operator correction) and the updated row is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patched fields fail schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a trusted internal service / super-admin; this op is `INTERNAL_CALL`, never a public edit path.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No inbound-contact row exists for the supplied id in the application scope.' },\n ],\n idempotent: true,\n },\n\n [Op.DELETE]: {\n purpose: 'Permanently remove a lead when a super-admin or compliance workflow demands erasure.',\n outcome: 'The marketing database no longer holds the PII for that id.',\n whenToUse: 'Use only for GDPR/DSR workflows or when duplicative junk rows must be purged with audit approval.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The lead row was permanently erased; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks the super-admin / compliance role required to erase a lead row.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No inbound-contact row exists for the supplied id (or it was already erased).' },\n ],\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Rate limiting on CREATE is declared on the resource variant in saas-models — respect those limits in any new controller path that triggers this operation.',\n 'Because scope is `APPLICATION`, org membership alone does not partition leads — the application must add app-specific filters (campaign id, org id on host object, etc.) if multi-tenant marketing is required.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
@@ -9,7 +9,7 @@
9
9
  * - UI presets: none
10
10
  */
11
11
  import { CoreResourceOperation as Op, MfaEnrollmentState } from '@wildo-ai/saas-models';
12
- export declare const userCredentialsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.DELETE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
12
+ export declare const userCredentialsResourceSpecification: import("../../../_core").ResourceSpecificationConfig<undefined, Op.READ | Op.UPDATE | Op.UPDATE_MANY | Op.DELETE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
13
13
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>;
14
14
  userId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodString>>>>;
15
15
  passwordHash: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"user-credentials.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/user-credentials.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAmQhD,CAAC"}
1
+ {"version":3,"file":"user-credentials.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/users/resources/user-credentials.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAI/B,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAoQhD,CAAC"}
@@ -12,11 +12,13 @@ import { LabelAudience } from '@wildo-ai/presets-components-models';
12
12
  import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
13
13
  import { CoreResourceOperation as Op, MfaEnrollmentState, ResourcePrimaryScope, UserCredentialsSchema, userCredentialsResourceConfiguration_InitializationFactory, } from '@wildo-ai/saas-models';
14
14
  import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
15
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
15
16
  export const userCredentialsResourceSpecification = resourceSpecification(userCredentialsResourceConfiguration_InitializationFactory, UserCredentialsSchema, ({ schemaShape }) => ({
16
17
  purpose: 'Store each user’s primary authentication material (password, MFA, and passkey credentials) as a system-owned secrets record.',
17
18
  businessRole: 'The authoritative per-user auth-secrets table backing login, re-auth, lockout, and MFA policy enforcement for that identity.',
18
19
  lifecycleRole: 'Rotates with every password or MFA change, new passkey registration, and progressive lockout counter updates as security events occur.',
19
20
  audience: LabelAudience.END_USER,
21
+ subDomain: EngineResourceSubDomain.USERS,
20
22
  codeHandling: {
21
23
  mainSchema: {
22
24
  packageName: '@wildo-ai/saas-models',