@wildo-ai/saas-specifications 1.1.2 → 1.1.3

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 (410) hide show
  1. package/dist/esm/_core/brand/brand-asset.schemas.d.ts +4 -6
  2. package/dist/esm/_core/brand/brand-asset.schemas.d.ts.map +1 -1
  3. package/dist/esm/_core/brand/brand-asset.schemas.js +4 -12
  4. package/dist/esm/_core/brand/brand-asset.schemas.js.map +1 -1
  5. package/dist/esm/_core/brand/brand-generation.schemas.d.ts +5 -3
  6. package/dist/esm/_core/brand/brand-generation.schemas.d.ts.map +1 -1
  7. package/dist/esm/_core/brand/brand-generation.schemas.js +5 -2
  8. package/dist/esm/_core/brand/brand-generation.schemas.js.map +1 -1
  9. package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts +10 -3
  10. package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts.map +1 -1
  11. package/dist/esm/_core/brand/brand-snapshot.schemas.js +10 -2
  12. package/dist/esm/_core/brand/brand-snapshot.schemas.js.map +1 -1
  13. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
  14. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.js +15 -5
  15. package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.js.map +1 -1
  16. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +40 -3
  17. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
  18. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +85 -6
  19. package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
  20. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts.map +1 -1
  21. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js +10 -4
  22. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js.map +1 -1
  23. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts +15 -0
  24. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts.map +1 -1
  25. package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js.map +1 -1
  26. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts +10 -0
  27. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.d.ts.map +1 -1
  28. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js +17 -0
  29. package/dist/esm/_core/compliance-documents/compliance-document-candidate.schemas.js.map +1 -1
  30. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.d.ts +6 -7
  31. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.d.ts.map +1 -1
  32. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.js +6 -13
  33. package/dist/esm/_core/expert-personas/expert-persona-charter.schemas.js.map +1 -1
  34. package/dist/esm/_core/expert-personas/expert-persona-validation.d.ts +0 -11
  35. package/dist/esm/_core/expert-personas/expert-persona-validation.d.ts.map +1 -1
  36. package/dist/esm/_core/expert-personas/expert-persona-validation.js +0 -19
  37. package/dist/esm/_core/expert-personas/expert-persona-validation.js.map +1 -1
  38. package/dist/esm/_core/expert-personas/expert-role-template.schemas.d.ts +1 -2
  39. package/dist/esm/_core/expert-personas/expert-role-template.schemas.d.ts.map +1 -1
  40. package/dist/esm/_core/expert-personas/expert-role-template.schemas.js +1 -2
  41. package/dist/esm/_core/expert-personas/expert-role-template.schemas.js.map +1 -1
  42. package/dist/esm/_core/feature-drafts/feature-specification-drafts-generation.schemas.d.ts.map +1 -1
  43. package/dist/esm/_core/feature-drafts/feature-specification-drafts-generation.schemas.js +17 -4
  44. package/dist/esm/_core/feature-drafts/feature-specification-drafts-generation.schemas.js.map +1 -1
  45. package/dist/esm/_core/index.d.ts +1 -0
  46. package/dist/esm/_core/index.d.ts.map +1 -1
  47. package/dist/esm/_core/index.js +1 -0
  48. package/dist/esm/_core/index.js.map +1 -1
  49. package/dist/esm/_core/market/market-snapshot-generation.schemas.d.ts.map +1 -1
  50. package/dist/esm/_core/market/market-snapshot-generation.schemas.js +5 -40
  51. package/dist/esm/_core/market/market-snapshot-generation.schemas.js.map +1 -1
  52. package/dist/esm/_core/market/market-snapshot-validation.d.ts +15 -0
  53. package/dist/esm/_core/market/market-snapshot-validation.d.ts.map +1 -1
  54. package/dist/esm/_core/market/market-snapshot-validation.js.map +1 -1
  55. package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.d.ts.map +1 -1
  56. package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.js +11 -5
  57. package/dist/esm/_core/placement-plan/placement-plan-generation.schemas.js.map +1 -1
  58. package/dist/esm/_core/placement-plan/placement-plan-validation.d.ts +66 -9
  59. package/dist/esm/_core/placement-plan/placement-plan-validation.d.ts.map +1 -1
  60. package/dist/esm/_core/placement-plan/placement-plan-validation.js +62 -20
  61. package/dist/esm/_core/placement-plan/placement-plan-validation.js.map +1 -1
  62. package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts +4 -1
  63. package/dist/esm/_core/placement-plan/placement-plan.schemas.d.ts.map +1 -1
  64. package/dist/esm/_core/placement-plan/placement-plan.schemas.js +4 -1
  65. package/dist/esm/_core/placement-plan/placement-plan.schemas.js.map +1 -1
  66. package/dist/esm/_core/provider-specification.schemas.d.ts +82 -0
  67. package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -0
  68. package/dist/esm/_core/provider-specification.schemas.js +144 -0
  69. package/dist/esm/_core/provider-specification.schemas.js.map +1 -0
  70. package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.d.ts.map +1 -1
  71. package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.js +13 -8
  72. package/dist/esm/_core/requirements/requirements-snapshot-generation.schemas.js.map +1 -1
  73. package/dist/esm/_core/requirements/requirements-snapshot-validation.d.ts +15 -0
  74. package/dist/esm/_core/requirements/requirements-snapshot-validation.d.ts.map +1 -1
  75. package/dist/esm/_core/requirements/requirements-snapshot-validation.js.map +1 -1
  76. package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.d.ts.map +1 -1
  77. package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.js +7 -2
  78. package/dist/esm/_core/roadmap/roadmap-snapshot-generation.schemas.js.map +1 -1
  79. package/dist/esm/_core/roadmap/roadmap-snapshot-validation.d.ts +15 -0
  80. package/dist/esm/_core/roadmap/roadmap-snapshot-validation.d.ts.map +1 -1
  81. package/dist/esm/_core/roadmap/roadmap-snapshot-validation.js.map +1 -1
  82. package/dist/esm/_core/utils/family-ref-stamping.d.ts +64 -0
  83. package/dist/esm/_core/utils/family-ref-stamping.d.ts.map +1 -0
  84. package/dist/esm/_core/utils/family-ref-stamping.js +73 -0
  85. package/dist/esm/_core/utils/family-ref-stamping.js.map +1 -0
  86. package/dist/esm/_core/vision/vision-snapshot-generation.schemas.d.ts.map +1 -1
  87. package/dist/esm/_core/vision/vision-snapshot-generation.schemas.js +23 -9
  88. package/dist/esm/_core/vision/vision-snapshot-generation.schemas.js.map +1 -1
  89. package/dist/esm/application-creation/application-coding-tasks.application-creation.schemas.d.ts +0 -4
  90. package/dist/esm/application-creation/application-coding-tasks.application-creation.schemas.d.ts.map +1 -1
  91. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts +7 -7
  92. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.d.ts.map +1 -1
  93. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js +6 -7
  94. package/dist/esm/application-creation/application-document-fact-specification.application-creation.schemas.js.map +1 -1
  95. package/dist/esm/application-creation/application-document-release-policy-specification.application-creation.schemas.d.ts +3 -3
  96. package/dist/esm/application-creation/application-document-release-policy-specification.application-creation.schemas.js +3 -3
  97. package/dist/esm/application-creation/application-document-release-policy-specification.application-creation.schemas.js.map +1 -1
  98. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.d.ts +2 -2
  99. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js +2 -2
  100. package/dist/esm/application-creation/application-specification-family-identity.application-creation.schemas.js.map +1 -1
  101. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts +18 -6
  102. package/dist/esm/application-creation/journey.application-creation.schemas.d.ts.map +1 -1
  103. package/dist/esm/application-creation/journey.application-creation.schemas.js +18 -6
  104. package/dist/esm/application-creation/journey.application-creation.schemas.js.map +1 -1
  105. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +8 -23
  106. package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
  107. package/dist/esm/application-creation/playbooks.application-creation.schemas.js +57 -27
  108. package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
  109. package/dist/esm/assurance/application-document-publication.schemas.d.ts +20 -6
  110. package/dist/esm/assurance/application-document-publication.schemas.d.ts.map +1 -1
  111. package/dist/esm/assurance/application-document-publication.schemas.js +26 -10
  112. package/dist/esm/assurance/application-document-publication.schemas.js.map +1 -1
  113. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +72 -49
  114. package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts.map +1 -1
  115. package/dist/esm/assurance/assurance-authority-basis.definitions.js +161 -60
  116. package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
  117. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts +25 -0
  118. package/dist/esm/assurance/assurance-authority-basis.schemas.d.ts.map +1 -1
  119. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts +36 -0
  120. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -0
  121. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +859 -0
  122. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -0
  123. package/dist/esm/assurance/assurance-foundation.schemas.d.ts +43 -0
  124. package/dist/esm/assurance/assurance-foundation.schemas.d.ts.map +1 -1
  125. package/dist/esm/assurance/assurance-foundation.schemas.js +56 -0
  126. package/dist/esm/assurance/assurance-foundation.schemas.js.map +1 -1
  127. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts +14 -7
  128. package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
  129. package/dist/esm/assurance/assurance-objective-catalog.definitions.js +24 -7
  130. package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
  131. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts +8 -1
  132. package/dist/esm/assurance/assurance-program-generation.schemas.d.ts.map +1 -1
  133. package/dist/esm/assurance/assurance-program-generation.schemas.js +10 -2
  134. package/dist/esm/assurance/assurance-program-generation.schemas.js.map +1 -1
  135. package/dist/esm/assurance/assurance-program.schemas.d.ts +447 -11
  136. package/dist/esm/assurance/assurance-program.schemas.d.ts.map +1 -1
  137. package/dist/esm/assurance/assurance-program.schemas.js +293 -5
  138. package/dist/esm/assurance/assurance-program.schemas.js.map +1 -1
  139. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts +35 -0
  140. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -0
  141. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +999 -0
  142. package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -0
  143. package/dist/esm/companion-exports.d.ts +7 -6
  144. package/dist/esm/companion-exports.d.ts.map +1 -1
  145. package/dist/esm/companion-exports.js.map +1 -1
  146. package/dist/esm/engine/_bootstrap.js +3 -1
  147. package/dist/esm/engine/_bootstrap.js.map +1 -1
  148. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.d.ts.map +1 -1
  149. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js +13 -1
  150. package/dist/esm/engine/applications/resources/application-api-keys.resource.specification.js.map +1 -1
  151. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js +1 -1
  152. package/dist/esm/engine/applications/resources/application-metadata.resource.specification.js.map +1 -1
  153. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts +2 -0
  154. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.d.ts.map +1 -1
  155. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js +14 -2
  156. package/dist/esm/engine/applications/resources/application-oauth-clients.resource.specification.js.map +1 -1
  157. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js +9 -9
  158. package/dist/esm/engine/applications/resources/application-versions.resource.specification.js.map +1 -1
  159. package/dist/esm/engine/applications/resources/applications.resource.specification.js +1 -1
  160. package/dist/esm/engine/applications/resources/applications.resource.specification.js.map +1 -1
  161. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js +3 -3
  162. package/dist/esm/engine/auth/resources/consumable-tokens.resource.specification.js.map +1 -1
  163. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js +1 -1
  164. package/dist/esm/engine/auth/resources/oauth-consent-grants.resource.specification.js.map +1 -1
  165. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.d.ts.map +1 -1
  166. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js +13 -1
  167. package/dist/esm/engine/auth/resources/organization-api-keys.resource.specification.js.map +1 -1
  168. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts +2 -0
  169. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.d.ts.map +1 -1
  170. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js +14 -2
  171. package/dist/esm/engine/auth/resources/organization-oauth-clients.resource.specification.js.map +1 -1
  172. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts +32 -0
  173. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.d.ts.map +1 -0
  174. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js +308 -0
  175. package/dist/esm/engine/auth/resources/organization-provider-credentials.resource.specification.js.map +1 -0
  176. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js +4 -4
  177. package/dist/esm/engine/auth/resources/platform-access-grants.resource.specification.js.map +1 -1
  178. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js +2 -2
  179. package/dist/esm/engine/auth/resources/scim-provisioning-config.resource.specification.js.map +1 -1
  180. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js +6 -6
  181. package/dist/esm/engine/auth/resources/scim-tokens.resource.specification.js.map +1 -1
  182. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js +9 -9
  183. package/dist/esm/engine/auth/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
  184. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js +2 -2
  185. package/dist/esm/engine/auth/resources/siem-export-config.resource.specification.js.map +1 -1
  186. package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts +9 -25
  187. package/dist/esm/engine/auth/resources/sso-config.resource.specification.d.ts.map +1 -1
  188. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js +104 -10
  189. package/dist/esm/engine/auth/resources/sso-config.resource.specification.js.map +1 -1
  190. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts +0 -6
  191. package/dist/esm/engine/auth/resources/sso-connections.resource.specification.d.ts.map +1 -1
  192. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts +32 -0
  193. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.d.ts.map +1 -0
  194. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js +297 -0
  195. package/dist/esm/engine/auth/resources/user-provider-credentials.resource.specification.js.map +1 -0
  196. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.d.ts.map +1 -1
  197. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js +4 -3
  198. package/dist/esm/engine/billing/resources/billing-accounts.resource.specification.js.map +1 -1
  199. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js +2 -2
  200. package/dist/esm/engine/billing/resources/credit-pools.resource.specification.js.map +1 -1
  201. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js +3 -3
  202. package/dist/esm/engine/billing/resources/invoice-refs.resource.specification.js.map +1 -1
  203. package/dist/esm/engine/billing/resources/prices.resource.specification.js +7 -7
  204. package/dist/esm/engine/billing/resources/prices.resource.specification.js.map +1 -1
  205. package/dist/esm/engine/billing/resources/products.resource.specification.js +7 -7
  206. package/dist/esm/engine/billing/resources/products.resource.specification.js.map +1 -1
  207. package/dist/esm/engine/billing/resources/promotions.resource.specification.d.ts.map +1 -1
  208. package/dist/esm/engine/billing/resources/promotions.resource.specification.js +14 -12
  209. package/dist/esm/engine/billing/resources/promotions.resource.specification.js.map +1 -1
  210. package/dist/esm/engine/billing/resources/referrals.resource.specification.js +7 -7
  211. package/dist/esm/engine/billing/resources/referrals.resource.specification.js.map +1 -1
  212. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.d.ts.map +1 -1
  213. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js +6 -3
  214. package/dist/esm/engine/billing/resources/subscriptions.resource.specification.js.map +1 -1
  215. package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts +7 -3
  216. package/dist/esm/engine/billing/resources/usage-records.resource.specification.d.ts.map +1 -1
  217. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js +28 -11
  218. package/dist/esm/engine/billing/resources/usage-records.resource.specification.js.map +1 -1
  219. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js +8 -8
  220. package/dist/esm/engine/compliance/resources/audit-logs.resource.specification.js.map +1 -1
  221. package/dist/esm/engine/engine-resource-specifications.registry.d.ts +2 -2
  222. package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
  223. package/dist/esm/engine/engine-resource-specifications.registry.js +6 -2
  224. package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
  225. package/dist/esm/engine/engine-resource-sub-domain.d.ts +20 -0
  226. package/dist/esm/engine/engine-resource-sub-domain.d.ts.map +1 -1
  227. package/dist/esm/engine/engine-resource-sub-domain.js +66 -0
  228. package/dist/esm/engine/engine-resource-sub-domain.js.map +1 -1
  229. package/dist/esm/engine/errors/error-messages.specification.d.ts.map +1 -1
  230. package/dist/esm/engine/errors/error-messages.specification.js +14 -0
  231. package/dist/esm/engine/errors/error-messages.specification.js.map +1 -1
  232. package/dist/esm/engine/features/audit-logs.feature.specification.js +4 -4
  233. package/dist/esm/engine/features/audit-logs.feature.specification.js.map +1 -1
  234. package/dist/esm/engine/features/core-limits.feature.specifications.js +7 -7
  235. package/dist/esm/engine/features/core-limits.feature.specifications.js.map +1 -1
  236. package/dist/esm/engine/features/resources/application-features.resource.specification.js +3 -3
  237. package/dist/esm/engine/features/resources/application-features.resource.specification.js.map +1 -1
  238. package/dist/esm/engine/features/resources/organization-features.resource.specification.js +3 -3
  239. package/dist/esm/engine/features/resources/organization-features.resource.specification.js.map +1 -1
  240. package/dist/esm/engine/features/resources/user-features.resource.specification.js +3 -3
  241. package/dist/esm/engine/features/resources/user-features.resource.specification.js.map +1 -1
  242. package/dist/esm/engine/files/resources/files.resource.specification.js +10 -10
  243. package/dist/esm/engine/files/resources/files.resource.specification.js.map +1 -1
  244. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js +11 -11
  245. package/dist/esm/engine/flows-actors/resources/a2a-push-delivery-log.resource.specification.js.map +1 -1
  246. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js +4 -4
  247. package/dist/esm/engine/flows-actors/resources/a2a-token-budget-state.resource.specification.js.map +1 -1
  248. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js +2 -2
  249. package/dist/esm/engine/flows-actors/resources/flow-actor-executions.resource.specification.js.map +1 -1
  250. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts +5 -0
  251. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.d.ts.map +1 -0
  252. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js +81 -0
  253. package/dist/esm/engine/frontend-components/app/app-layout-connected-accounts-settings.frontend-component.specification.js.map +1 -0
  254. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.d.ts +4 -0
  255. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.d.ts.map +1 -0
  256. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.js +22 -0
  257. package/dist/esm/engine/frontend-components/app/public-layout-file-upload-grant.frontend-component.specification.js.map +1 -0
  258. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.d.ts +0 -4
  259. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.d.ts.map +0 -1
  260. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.js +0 -21
  261. package/dist/esm/engine/frontend-components/billing/billing-plan-change-preview.frontend-component.specification.js.map +0 -1
  262. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.d.ts +0 -4
  263. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.d.ts.map +0 -1
  264. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.js +0 -21
  265. package/dist/esm/engine/frontend-components/billing/billing-promotion-code-input.frontend-component.specification.js.map +0 -1
  266. package/dist/esm/engine/frontend-components/index.d.ts +0 -2
  267. package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
  268. package/dist/esm/engine/frontend-components/index.js +4 -6
  269. package/dist/esm/engine/frontend-components/index.js.map +1 -1
  270. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js +12 -12
  271. package/dist/esm/engine/guidance/resources/guidance-state.resource.specification.js.map +1 -1
  272. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js +9 -9
  273. package/dist/esm/engine/guidance/resources/lifecycle-state.resource.specification.js.map +1 -1
  274. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts +8 -0
  275. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.d.ts.map +1 -1
  276. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js +6 -6
  277. package/dist/esm/engine/guidance/resources/progression-state.resource.specification.js.map +1 -1
  278. package/dist/esm/engine/index.d.ts +1 -0
  279. package/dist/esm/engine/index.d.ts.map +1 -1
  280. package/dist/esm/engine/index.js +1 -0
  281. package/dist/esm/engine/index.js.map +1 -1
  282. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js +17 -17
  283. package/dist/esm/engine/infrastructure/resources/data-seed-runs.resource.specification.js.map +1 -1
  284. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +7 -7
  285. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
  286. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js +8 -8
  287. package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.js.map +1 -1
  288. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts +7 -2
  289. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.d.ts.map +1 -1
  290. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js +10 -5
  291. package/dist/esm/engine/infrastructure/resources/job-payload-storage.resource.specification.js.map +1 -1
  292. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
  293. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +20 -15
  294. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
  295. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.d.ts.map +1 -1
  296. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js +11 -10
  297. package/dist/esm/engine/notifications/resources/notification-badges.resource.specification.js.map +1 -1
  298. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.d.ts.map +1 -1
  299. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js +29 -6
  300. package/dist/esm/engine/notifications/resources/webhook-config.resource.specification.js.map +1 -1
  301. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +9 -9
  302. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
  303. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js +3 -3
  304. package/dist/esm/engine/organizations/resources/organization-notifications.resource.specification.js.map +1 -1
  305. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js +4 -4
  306. package/dist/esm/engine/organizations/resources/organization-preferences.resource.specification.js.map +1 -1
  307. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js +2 -2
  308. package/dist/esm/engine/organizations/resources/organization-profiles.resource.specification.js.map +1 -1
  309. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js +1 -1
  310. package/dist/esm/engine/organizations/resources/organization-unit-members.resource.specification.js.map +1 -1
  311. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +7 -7
  312. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
  313. package/dist/esm/engine/providers/_engine-provider-shared.d.ts +9 -0
  314. package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -0
  315. package/dist/esm/engine/providers/_engine-provider-shared.js +19 -0
  316. package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -0
  317. package/dist/esm/engine/providers/anthropic.provider.specification.d.ts +7 -0
  318. package/dist/esm/engine/providers/anthropic.provider.specification.d.ts.map +1 -0
  319. package/dist/esm/engine/providers/anthropic.provider.specification.js +33 -0
  320. package/dist/esm/engine/providers/anthropic.provider.specification.js.map +1 -0
  321. package/dist/esm/engine/providers/apple.provider.specification.d.ts +7 -0
  322. package/dist/esm/engine/providers/apple.provider.specification.d.ts.map +1 -0
  323. package/dist/esm/engine/providers/apple.provider.specification.js +35 -0
  324. package/dist/esm/engine/providers/apple.provider.specification.js.map +1 -0
  325. package/dist/esm/engine/providers/email-preview.provider.specification.d.ts +7 -0
  326. package/dist/esm/engine/providers/email-preview.provider.specification.d.ts.map +1 -0
  327. package/dist/esm/engine/providers/email-preview.provider.specification.js +31 -0
  328. package/dist/esm/engine/providers/email-preview.provider.specification.js.map +1 -0
  329. package/dist/esm/engine/providers/github.provider.specification.d.ts +7 -0
  330. package/dist/esm/engine/providers/github.provider.specification.d.ts.map +1 -0
  331. package/dist/esm/engine/providers/github.provider.specification.js +30 -0
  332. package/dist/esm/engine/providers/github.provider.specification.js.map +1 -0
  333. package/dist/esm/engine/providers/google.provider.specification.d.ts +7 -0
  334. package/dist/esm/engine/providers/google.provider.specification.d.ts.map +1 -0
  335. package/dist/esm/engine/providers/google.provider.specification.js +34 -0
  336. package/dist/esm/engine/providers/google.provider.specification.js.map +1 -0
  337. package/dist/esm/engine/providers/grok.provider.specification.d.ts +7 -0
  338. package/dist/esm/engine/providers/grok.provider.specification.d.ts.map +1 -0
  339. package/dist/esm/engine/providers/grok.provider.specification.js +30 -0
  340. package/dist/esm/engine/providers/grok.provider.specification.js.map +1 -0
  341. package/dist/esm/engine/providers/index.d.ts +23 -0
  342. package/dist/esm/engine/providers/index.d.ts.map +1 -0
  343. package/dist/esm/engine/providers/index.js +37 -0
  344. package/dist/esm/engine/providers/index.js.map +1 -0
  345. package/dist/esm/engine/providers/microsoft.provider.specification.d.ts +7 -0
  346. package/dist/esm/engine/providers/microsoft.provider.specification.d.ts.map +1 -0
  347. package/dist/esm/engine/providers/microsoft.provider.specification.js +30 -0
  348. package/dist/esm/engine/providers/microsoft.provider.specification.js.map +1 -0
  349. package/dist/esm/engine/providers/mistral.provider.specification.d.ts +7 -0
  350. package/dist/esm/engine/providers/mistral.provider.specification.d.ts.map +1 -0
  351. package/dist/esm/engine/providers/mistral.provider.specification.js +33 -0
  352. package/dist/esm/engine/providers/mistral.provider.specification.js.map +1 -0
  353. package/dist/esm/engine/providers/openai.provider.specification.d.ts +7 -0
  354. package/dist/esm/engine/providers/openai.provider.specification.d.ts.map +1 -0
  355. package/dist/esm/engine/providers/openai.provider.specification.js +43 -0
  356. package/dist/esm/engine/providers/openai.provider.specification.js.map +1 -0
  357. package/dist/esm/engine/providers/opencode.provider.specification.d.ts +7 -0
  358. package/dist/esm/engine/providers/opencode.provider.specification.d.ts.map +1 -0
  359. package/dist/esm/engine/providers/opencode.provider.specification.js +50 -0
  360. package/dist/esm/engine/providers/opencode.provider.specification.js.map +1 -0
  361. package/dist/esm/engine/providers/perplexity.provider.specification.d.ts +7 -0
  362. package/dist/esm/engine/providers/perplexity.provider.specification.d.ts.map +1 -0
  363. package/dist/esm/engine/providers/perplexity.provider.specification.js +30 -0
  364. package/dist/esm/engine/providers/perplexity.provider.specification.js.map +1 -0
  365. package/dist/esm/engine/providers/resend.provider.specification.d.ts +7 -0
  366. package/dist/esm/engine/providers/resend.provider.specification.d.ts.map +1 -0
  367. package/dist/esm/engine/providers/resend.provider.specification.js +33 -0
  368. package/dist/esm/engine/providers/resend.provider.specification.js.map +1 -0
  369. package/dist/esm/engine/providers/stripe.provider.specification.d.ts +7 -0
  370. package/dist/esm/engine/providers/stripe.provider.specification.d.ts.map +1 -0
  371. package/dist/esm/engine/providers/stripe.provider.specification.js +35 -0
  372. package/dist/esm/engine/providers/stripe.provider.specification.js.map +1 -0
  373. package/dist/esm/engine/providers/twilio.provider.specification.d.ts +7 -0
  374. package/dist/esm/engine/providers/twilio.provider.specification.d.ts.map +1 -0
  375. package/dist/esm/engine/providers/twilio.provider.specification.js +33 -0
  376. package/dist/esm/engine/providers/twilio.provider.specification.js.map +1 -0
  377. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js +7 -7
  378. package/dist/esm/engine/users/resources/anonymous-users.resource.specification.js.map +1 -1
  379. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js +9 -9
  380. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.js.map +1 -1
  381. package/dist/esm/engine/users/resources/user-credentials.resource.specification.js +2 -2
  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.js +8 -8
  384. package/dist/esm/engine/users/resources/user-identity-links.resource.specification.js.map +1 -1
  385. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +4 -4
  386. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js +4 -4
  387. package/dist/esm/engine/users/resources/user-preferences.resource.specification.js.map +1 -1
  388. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js +2 -2
  389. package/dist/esm/engine/users/resources/user-profiles.resource.specification.js.map +1 -1
  390. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +4 -4
  391. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
  392. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +13 -11
  393. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
  394. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js +1 -1
  395. package/dist/esm/engine/users/resources/user-self-profiles.resource.specification.js.map +1 -1
  396. package/dist/esm/engine/users/resources/user-self.resource.specification.js +8 -8
  397. package/dist/esm/engine/users/resources/user-self.resource.specification.js.map +1 -1
  398. package/dist/esm/engine/users/resources/users.resource.specification.d.ts.map +1 -1
  399. package/dist/esm/engine/users/resources/users.resource.specification.js +93 -0
  400. package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
  401. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.d.ts.map +1 -1
  402. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js +95 -45
  403. package/dist/esm/technical-documentation/engine-documentation-specification-catalog.companion.js.map +1 -1
  404. package/dist/esm/technical-documentation/technical-documentation-units.schemas.d.ts +37 -1
  405. package/dist/esm/technical-documentation/technical-documentation-units.schemas.d.ts.map +1 -1
  406. package/dist/esm/technical-documentation/technical-documentation-units.schemas.js +36 -0
  407. package/dist/esm/technical-documentation/technical-documentation-units.schemas.js.map +1 -1
  408. package/dist/tsconfig.build.tsbuildinfo +1 -1
  409. package/package.json +8 -8
  410. package/dist/assurance/external-framework-mapping.json +0 -980
@@ -196,7 +196,7 @@ export const organizationProfilesResourceSpecification = resourceSpecificationFr
196
196
  timezone: schemaShape.timezone.stringSpec({ meaning: 'Default IANA timezone used when organization-facing surfaces need a local time context.' }),
197
197
  branding: schemaShape.branding.objectSpec({ meaning: 'Organization-specific logo, favicon, colors, and custom-domain overrides. Omitted values fall back to application branding.' }),
198
198
  socialLinks: schemaShape.socialLinks.objectSpec({ meaning: 'Optional public profile URLs for the organization’s supported social and developer channels.' }),
199
- createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When this profile row was created by the organization lifecycle.' }),
199
+ createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When this profile record was created by the organization lifecycle.' }),
200
200
  updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When any stored profile field was last changed.' }),
201
201
  },
202
202
  operations: {
@@ -267,7 +267,7 @@ export const organizationProfilesResourceSpecification = resourceSpecificationFr
267
267
  purpose: 'Repository-only teardown of the organization profile row when its owning organization is deleted (composition `onParentDelete` cascade).',
268
268
  outcome: 'The eager-seeded singleton profile row is removed together with the organization — the composition part does not outlive its whole.',
269
269
  responseStatuses: [
270
- { code: HttpResponseStatusCode.OK_200, meaning: 'The organization profile row was deleted as part of the owning organization’s deletion cascade.' },
270
+ { code: HttpResponseStatusCode.OK_200, meaning: 'The organization profile record was deleted as part of the owning organization’s deletion cascade.' },
271
271
  ],
272
272
  // REPOSITORY_ONLY variant (ORG_ADMIN) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.
273
273
  idempotent: true,
@@ -1 +1 @@
1
- {"version":3,"file":"organization-profiles.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-profiles.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,IAAI,oCA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T,KAAK,EAAE,oCAAoC;oBAC3C,OAAO,EAAE;wBACP,cAAc,EAAE,4BAA4B,CAAC,cAAc;wBAC3D,GAAG,6CAA6C;qBACjD;oBACD,QAAQ,EAAE,8CAA8C;oBACxD,SAAS,EAAE,sBAAsB,CAAC,MAAM;iBACzC,CAAC;YACF,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,qIAAqI;QACrI,4HAA4H;KAC7H;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,EACD,GAAG,EAAE,CAAC,CAAC;IACL,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,SAAS,EAAE,mEAAmE,EAAE;QACjJ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE,SAAS,EAAE,2DAA2D,EAAE;QAC9I,CAAC,8BAA8B,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,sCAAsC,EAAE;KAC7K;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationProfilesMainResourceUIBehavior as organizationProfilesUIBehaviorSource } 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 OrganizationIndustry,\n OrganizationProfileSchema,\n OrganizationProfile_Operations,\n OrganizationSize,\n ResourcePrimaryScope,\n organizationProfileResourceConfiguration_InitializationFactory as organizationProfilesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof organizationProfilesFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationProfilesResourceUIBehavior = organizationProfilesUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_PROFILE_EXAMPLE = {\n _id: 'organization_profile_01JEXAMPLE',\n organizationId: 'org_01JEXAMPLE',\n displayName: 'Acme Europe',\n domain: 'acme.example',\n phone: '+352 26 00 00 00',\n website: 'https://www.acme.example',\n description: 'European operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.MEDIUM,\n founded: '2018-06-14T00:00:00.000Z',\n address: {\n line1: '12 Boulevard Royal',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n timezone: 'Europe/Luxembourg',\n branding: {\n logo: 'https://cdn.acme.example/brand/logo.svg',\n favicon: 'https://cdn.acme.example/brand/favicon.png',\n primaryColor: '#635BFF',\n secondaryColor: '#0A2540',\n customDomain: 'workspace.acme.example',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-europe',\n github: 'https://github.com/acme-europe',\n },\n createdAt: '2026-01-12T09:00:00.000Z',\n updatedAt: '2026-08-20T16:30:00.000Z',\n _version: 7,\n} as const;\n\nconst ORGANIZATION_PROFILE_CONTEXT_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n organization: { _id: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n} as const;\n\nconst ORGANIZATION_PROFILE_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_PROFILE_EXAMPLE._id,\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n displayName: ORGANIZATION_PROFILE_EXAMPLE.displayName,\n _version: ORGANIZATION_PROFILE_EXAMPLE._version,\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE = {\n displayName: 'Acme Europe & Middle East',\n website: 'https://emea.acme.example',\n description: 'European and Middle East operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.LARGE,\n timezone: 'Europe/Luxembourg',\n address: {\n line1: '12 Boulevard Royal',\n line2: 'Floor 4',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-emea',\n github: 'https://github.com/acme-emea',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n updatedAt: '2026-08-21T08:45:00.000Z',\n _version: 8,\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE = {\n branding: {\n logo: 'https://cdn.acme.example/brand/logo-2026.svg',\n favicon: 'https://cdn.acme.example/brand/favicon-2026.png',\n primaryColor: '#4F46E5',\n secondaryColor: '#111827',\n customDomain: 'portal.acme.example',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n branding: ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE.branding,\n updatedAt: '2026-08-21T09:10:00.000Z',\n _version: 8,\n} as const;\n\nexport const organizationProfilesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationProfilesResourceUIBehavior),\n resourceSpecification(\n organizationProfilesFactory,\n OrganizationProfileSchema,\n ({ schemaShape }) => ({\n purpose: 'Business identity and presentation metadata for one organization: company facts, location, branding, and social links.',\n businessRole: 'Gives authorized members and integrations one consistent organization profile for product surfaces, directories, and connected systems.',\n lifecycleRole: 'The profile is created with its organization, evolves through company and brand changes, and is removed with the owning organization.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationProfileSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationProfileResourceConfiguration_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: 'ORGANIZATION_PROFILES',\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: 'OrganizationProfile_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationProfilesMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of the organization-profile record.',\n whyItMatters: 'Identifies this profile document independently from the organization id used to address the route.',\n }),\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization this public/directory profile describes.',\n whyItMatters: 'Ties branding and company facts to exactly one tenant so directory cards and connector metadata resolve per organization and cannot surface another tenant’s profile.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n displayName: schemaShape.displayName.stringSpec({ meaning: 'Customer-facing name when different from the canonical org `name`.' }),\n domain: schemaShape.domain.stringSpec({ meaning: 'Organization-owned internet domain used as profile and directory metadata; it is not an authentication-domain verification claim.' }),\n phone: schemaShape.phone.stringSpec({ meaning: 'Organization contact telephone number as entered by an authorized profile editor.' }),\n website: schemaShape.website.stringSpec({ meaning: 'Primary marketing or product URL for the tenant.' }),\n description: schemaShape.description.stringSpec({ meaning: 'Short organization description for about panels, directories, and connected systems.' }),\n industry: schemaShape.industry.enumSpec({\n meaning: 'Business sector classification for the tenant, used in directory facets and segmentation.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationIndustry',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationIndustry.TECHNOLOGY]: { meaning: 'Technology / software.' },\n [OrganizationIndustry.FINANCE]: { meaning: 'Finance, banking, or insurance.' },\n [OrganizationIndustry.HEALTHCARE]: { meaning: 'Healthcare and life sciences.' },\n [OrganizationIndustry.EDUCATION]: { meaning: 'Education and academia.' },\n [OrganizationIndustry.RETAIL]: { meaning: 'Retail and commerce.' },\n [OrganizationIndustry.MANUFACTURING]: { meaning: 'Manufacturing and industry.' },\n [OrganizationIndustry.CONSULTING]: { meaning: 'Professional services and consulting.' },\n [OrganizationIndustry.MEDIA]: { meaning: 'Media, entertainment, and publishing.' },\n [OrganizationIndustry.GOVERNMENT]: { meaning: 'Government and public sector.' },\n [OrganizationIndustry.NONPROFIT]: { meaning: 'Nonprofit and NGO.' },\n [OrganizationIndustry.OTHER]: { meaning: 'Any sector not covered by the named categories.' },\n },\n }),\n size: schemaShape.size.enumSpec({\n meaning: 'Employee-count band for the tenant, used for directory facets and plan/segment heuristics.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationSize',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationSize.STARTUP]: { meaning: 'Startup, roughly 1–10 employees.' },\n [OrganizationSize.SMALL]: { meaning: 'Small, roughly 11–50 employees.' },\n [OrganizationSize.MEDIUM]: { meaning: 'Medium, roughly 51–200 employees.' },\n [OrganizationSize.LARGE]: { meaning: 'Large, roughly 201–1000 employees.' },\n [OrganizationSize.ENTERPRISE]: { meaning: 'Enterprise, 1000+ employees.' },\n },\n }),\n founded: schemaShape.founded.dateSpec({ meaning: 'Date associated with the organization’s founding for profile and directory presentation.' }),\n address: schemaShape.address.objectSpec({ meaning: 'Primary organization address, including ISO two-letter country code and postal information.' }),\n timezone: schemaShape.timezone.stringSpec({ meaning: 'Default IANA timezone used when organization-facing surfaces need a local time context.' }),\n branding: schemaShape.branding.objectSpec({ meaning: 'Organization-specific logo, favicon, colors, and custom-domain overrides. Omitted values fall back to application branding.' }),\n socialLinks: schemaShape.socialLinks.objectSpec({ meaning: 'Optional public profile URLs for the organization’s supported social and developer channels.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When this profile row was created by the organization lifecycle.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When any stored profile field was last changed.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read the addressed organization’s complete profile.',\n outcome: 'The caller receives company facts, location, branding, social links, and the current resource version.',\n whenToUse: 'Use this representation when synchronizing a complete organization profile or rendering a full about/settings surface.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile was found and its directory/branding metadata is returned for the addressed organization.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record has been provisioned for the addressed organization in the caller’s scope.' },\n ],\n examples: [{\n title: 'Read the organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n purpose: 'Read the organization profile with its configured relationship context.',\n outcome: 'The complete profile is returned with the related organization identifier when that relationship is available.',\n examples: [{\n title: 'Read the profile with organization context',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_CONTEXT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n purpose: 'Read the compact organization-profile identity.',\n outcome: 'Only the profile id, organization id, display name, and current resource version are returned.',\n examples: [{\n title: 'Read the compact organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n idempotent: true,\n },\n [Op.UPDATE]: {\n purpose: 'Update one or more editable organization-profile fields.',\n outcome: 'The stored profile is changed and the complete updated representation, including its new resource version, is returned.',\n whenToUse: 'Use this operation for company, classification, location, social-link, or combined profile changes. Use the branding operation when the request changes only the brand kit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile fields were patched and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited profile fields fail schema validation (e.g. a malformed `website` URL).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-manager authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to update.' },\n ],\n examples: [{\n title: 'Update organization company and directory details',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the organization profile row when its owning organization is deleted (composition `onParentDelete` cascade).',\n outcome: 'The eager-seeded singleton profile row is removed together with the organization — the composition part does not outlive its whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization profile row was deleted as part of the owning organization’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_ADMIN) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: {\n operationId: OrganizationProfile_Operations.UPDATE_BRANDING,\n purpose: 'Replace the organization-specific logo, favicon, colors, and custom-domain overrides as one brand kit.',\n outcome: 'The brand kit is validated, stored, and returned inside the complete updated profile with its new resource version.',\n whenToUse: 'Use this operation for a branding-only change that should not carry unrelated company-profile fields.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The brand kit (colors, logo, favicon) was applied and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The branding bundle fails validation (e.g. an invalid color token or an unsupported logo/favicon asset reference).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-admin authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to apply branding to.' },\n ],\n examples: [{\n title: 'Replace the organization brand kit',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Each organization owns one profile. The framework creates it with the organization and removes it when the organization is deleted.',\n 'Organization-specific branding fields are overrides; when an override is absent, clients should use the application brand.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n views: {\n [Op.READ]: { purpose: 'Settings read for company/about panels.', whenToUse: 'Org profile in admin and member-visible about pages when exposed.' },\n [Op.UPDATE]: { purpose: 'General field edits in multi-section form.', whenToUse: 'IT and marketing co-own updates through governance roles.' },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: { purpose: 'Branding wizard path separate from long-form text edits.', whenToUse: 'White-label and theme management UX.' },\n },\n }),\n);\n"]}
1
+ {"version":3,"file":"organization-profiles.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-profiles.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,IAAI,oCAAoC,EAAE,MAAM,8BAA8B,CAAC;AAClI,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,oBAAoB,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,gBAAgB,EAChB,oBAAoB,EACpB,8DAA8D,IAAI,2BAA2B,GAC9F,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,8CAA8C,GAC/C,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAO3E,MAAM,sCAAsC,GAAG,oCAAoF,CAAC;AAEpI,MAAM,4BAA4B,GAAG;IACnC,GAAG,EAAE,iCAAiC;IACtC,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,cAAc;IACtB,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,0BAA0B;IACnC,WAAW,EAAE,yDAAyD;IACtE,QAAQ,EAAE,oBAAoB,CAAC,UAAU;IACzC,IAAI,EAAE,gBAAgB,CAAC,MAAM;IAC7B,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE;QACP,KAAK,EAAE,oBAAoB;QAC3B,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,IAAI;QACb,UAAU,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d,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,oHAAoH,EAAE,SAAS,EAAE,mBAAmB,EAAE;gBAC5M,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,mFAAmF,EAAE;gBACzI,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,+EAA+E,EAAE;aACtI;YACD,QAAQ,EAAE,CAAC;oBACT,KAAK,EAAE,oCAAoC;oBAC3C,OAAO,EAAE;wBACP,cAAc,EAAE,4BAA4B,CAAC,cAAc;wBAC3D,GAAG,6CAA6C;qBACjD;oBACD,QAAQ,EAAE,8CAA8C;oBACxD,SAAS,EAAE,sBAAsB,CAAC,MAAM;iBACzC,CAAC;YACF,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,qIAAqI;QACrI,4HAA4H;KAC7H;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,EACD,GAAG,EAAE,CAAC,CAAC;IACL,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE,SAAS,EAAE,mEAAmE,EAAE;QACjJ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE,SAAS,EAAE,2DAA2D,EAAE;QAC9I,CAAC,8BAA8B,CAAC,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,0DAA0D,EAAE,SAAS,EAAE,sCAAsC,EAAE;KAC7K;CACF,CAAC,CACH,CAAC","sourcesContent":["import { organizationProfilesMainResourceUIBehavior as organizationProfilesUIBehaviorSource } 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 OrganizationIndustry,\n OrganizationProfileSchema,\n OrganizationProfile_Operations,\n OrganizationSize,\n ResourcePrimaryScope,\n organizationProfileResourceConfiguration_InitializationFactory as organizationProfilesFactory,\n} from '@wildo-ai/saas-models';\nimport {\n HttpResponseStatusCode,\n resourceFrontendConfiguration,\n resourceSpecification,\n resourceSpecificationFromFrontendConfiguration,\n} from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\ntype Cfg = ReturnType<typeof organizationProfilesFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst organizationProfilesResourceUIBehavior = organizationProfilesUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\nconst ORGANIZATION_PROFILE_EXAMPLE = {\n _id: 'organization_profile_01JEXAMPLE',\n organizationId: 'org_01JEXAMPLE',\n displayName: 'Acme Europe',\n domain: 'acme.example',\n phone: '+352 26 00 00 00',\n website: 'https://www.acme.example',\n description: 'European operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.MEDIUM,\n founded: '2018-06-14T00:00:00.000Z',\n address: {\n line1: '12 Boulevard Royal',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n timezone: 'Europe/Luxembourg',\n branding: {\n logo: 'https://cdn.acme.example/brand/logo.svg',\n favicon: 'https://cdn.acme.example/brand/favicon.png',\n primaryColor: '#635BFF',\n secondaryColor: '#0A2540',\n customDomain: 'workspace.acme.example',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-europe',\n github: 'https://github.com/acme-europe',\n },\n createdAt: '2026-01-12T09:00:00.000Z',\n updatedAt: '2026-08-20T16:30:00.000Z',\n _version: 7,\n} as const;\n\nconst ORGANIZATION_PROFILE_CONTEXT_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n organization: { _id: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n} as const;\n\nconst ORGANIZATION_PROFILE_SUMMARY_EXAMPLE = {\n _id: ORGANIZATION_PROFILE_EXAMPLE._id,\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n displayName: ORGANIZATION_PROFILE_EXAMPLE.displayName,\n _version: ORGANIZATION_PROFILE_EXAMPLE._version,\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE = {\n displayName: 'Acme Europe & Middle East',\n website: 'https://emea.acme.example',\n description: 'European and Middle East operations and customer delivery hub for Acme.',\n industry: OrganizationIndustry.TECHNOLOGY,\n size: OrganizationSize.LARGE,\n timezone: 'Europe/Luxembourg',\n address: {\n line1: '12 Boulevard Royal',\n line2: 'Floor 4',\n city: 'Luxembourg',\n country: 'LU',\n postalCode: 'L-2449',\n },\n socialLinks: {\n linkedin: 'https://www.linkedin.com/company/acme-emea',\n github: 'https://github.com/acme-emea',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n updatedAt: '2026-08-21T08:45:00.000Z',\n _version: 8,\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE = {\n branding: {\n logo: 'https://cdn.acme.example/brand/logo-2026.svg',\n favicon: 'https://cdn.acme.example/brand/favicon-2026.png',\n primaryColor: '#4F46E5',\n secondaryColor: '#111827',\n customDomain: 'portal.acme.example',\n },\n} as const;\n\nconst ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE = {\n ...ORGANIZATION_PROFILE_EXAMPLE,\n branding: ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE.branding,\n updatedAt: '2026-08-21T09:10:00.000Z',\n _version: 8,\n} as const;\n\nexport const organizationProfilesResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(organizationProfilesResourceUIBehavior),\n resourceSpecification(\n organizationProfilesFactory,\n OrganizationProfileSchema,\n ({ schemaShape }) => ({\n purpose: 'Business identity and presentation metadata for one organization: company facts, location, branding, and social links.',\n businessRole: 'Gives authorized members and integrations one consistent organization profile for product surfaces, directories, and connected systems.',\n lifecycleRole: 'The profile is created with its organization, evolves through company and brand changes, and is removed with the owning organization.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationProfileSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationProfileResourceConfiguration_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: 'ORGANIZATION_PROFILES',\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: 'OrganizationProfile_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n frontendConfigurationSources: [\n {\n packageName: '@wildo-ai/presets-components',\n exportName: 'organizationProfilesMainResourceUIBehavior',\n symbolKind: CodeSymbolKind.UI_BEHAVIOR,\n },\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of the organization-profile record.',\n whyItMatters: 'Identifies this profile document independently from the organization id used to address the route.',\n }),\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization this public/directory profile describes.',\n whyItMatters: 'Ties branding and company facts to exactly one tenant so directory cards and connector metadata resolve per organization and cannot surface another tenant’s profile.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n displayName: schemaShape.displayName.stringSpec({ meaning: 'Customer-facing name when different from the canonical org `name`.' }),\n domain: schemaShape.domain.stringSpec({ meaning: 'Organization-owned internet domain used as profile and directory metadata; it is not an authentication-domain verification claim.' }),\n phone: schemaShape.phone.stringSpec({ meaning: 'Organization contact telephone number as entered by an authorized profile editor.' }),\n website: schemaShape.website.stringSpec({ meaning: 'Primary marketing or product URL for the tenant.' }),\n description: schemaShape.description.stringSpec({ meaning: 'Short organization description for about panels, directories, and connected systems.' }),\n industry: schemaShape.industry.enumSpec({\n meaning: 'Business sector classification for the tenant, used in directory facets and segmentation.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationIndustry',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationIndustry.TECHNOLOGY]: { meaning: 'Technology / software.' },\n [OrganizationIndustry.FINANCE]: { meaning: 'Finance, banking, or insurance.' },\n [OrganizationIndustry.HEALTHCARE]: { meaning: 'Healthcare and life sciences.' },\n [OrganizationIndustry.EDUCATION]: { meaning: 'Education and academia.' },\n [OrganizationIndustry.RETAIL]: { meaning: 'Retail and commerce.' },\n [OrganizationIndustry.MANUFACTURING]: { meaning: 'Manufacturing and industry.' },\n [OrganizationIndustry.CONSULTING]: { meaning: 'Professional services and consulting.' },\n [OrganizationIndustry.MEDIA]: { meaning: 'Media, entertainment, and publishing.' },\n [OrganizationIndustry.GOVERNMENT]: { meaning: 'Government and public sector.' },\n [OrganizationIndustry.NONPROFIT]: { meaning: 'Nonprofit and NGO.' },\n [OrganizationIndustry.OTHER]: { meaning: 'Any sector not covered by the named categories.' },\n },\n }),\n size: schemaShape.size.enumSpec({\n meaning: 'Employee-count band for the tenant, used for directory facets and plan/segment heuristics.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationSize',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [OrganizationSize.STARTUP]: { meaning: 'Startup, roughly 1–10 employees.' },\n [OrganizationSize.SMALL]: { meaning: 'Small, roughly 11–50 employees.' },\n [OrganizationSize.MEDIUM]: { meaning: 'Medium, roughly 51–200 employees.' },\n [OrganizationSize.LARGE]: { meaning: 'Large, roughly 201–1000 employees.' },\n [OrganizationSize.ENTERPRISE]: { meaning: 'Enterprise, 1000+ employees.' },\n },\n }),\n founded: schemaShape.founded.dateSpec({ meaning: 'Date associated with the organization’s founding for profile and directory presentation.' }),\n address: schemaShape.address.objectSpec({ meaning: 'Primary organization address, including ISO two-letter country code and postal information.' }),\n timezone: schemaShape.timezone.stringSpec({ meaning: 'Default IANA timezone used when organization-facing surfaces need a local time context.' }),\n branding: schemaShape.branding.objectSpec({ meaning: 'Organization-specific logo, favicon, colors, and custom-domain overrides. Omitted values fall back to application branding.' }),\n socialLinks: schemaShape.socialLinks.objectSpec({ meaning: 'Optional public profile URLs for the organization’s supported social and developer channels.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When this profile record was created by the organization lifecycle.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When any stored profile field was last changed.' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read the addressed organization’s complete profile.',\n outcome: 'The caller receives company facts, location, branding, social links, and the current resource version.',\n whenToUse: 'Use this representation when synchronizing a complete organization profile or rendering a full about/settings surface.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile was found and its directory/branding metadata is returned for the addressed organization.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record has been provisioned for the addressed organization in the caller’s scope.' },\n ],\n examples: [{\n title: 'Read the organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n purpose: 'Read the organization profile with its configured relationship context.',\n outcome: 'The complete profile is returned with the related organization identifier when that relationship is available.',\n examples: [{\n title: 'Read the profile with organization context',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_CONTEXT_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n purpose: 'Read the compact organization-profile identity.',\n outcome: 'Only the profile id, organization id, display name, and current resource version are returned.',\n examples: [{\n title: 'Read the compact organization profile',\n request: { organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId },\n response: ORGANIZATION_PROFILE_SUMMARY_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n idempotent: true,\n },\n [Op.UPDATE]: {\n purpose: 'Update one or more editable organization-profile fields.',\n outcome: 'The stored profile is changed and the complete updated representation, including its new resource version, is returned.',\n whenToUse: 'Use this operation for company, classification, location, social-link, or combined profile changes. Use the branding operation when the request changes only the brand kit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The profile fields were patched and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The edited profile fields fail schema validation (e.g. a malformed `website` URL).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-manager authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to update.' },\n ],\n examples: [{\n title: 'Update organization company and directory details',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_UPDATE_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_UPDATE_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n [Op.DELETE]: {\n purpose: 'Repository-only teardown of the organization profile row when its owning organization is deleted (composition `onParentDelete` cascade).',\n outcome: 'The eager-seeded singleton profile row is removed together with the organization — the composition part does not outlive its whole.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The organization profile record was deleted as part of the owning organization’s deletion cascade.' },\n ],\n // REPOSITORY_ONLY variant (ORG_ADMIN) — invoked by the onParentDelete cascade, not a public HTTP endpoint, so no client-facing 400/403/404 are documented.\n idempotent: true,\n },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: {\n operationId: OrganizationProfile_Operations.UPDATE_BRANDING,\n purpose: 'Replace the organization-specific logo, favicon, colors, and custom-domain overrides as one brand kit.',\n outcome: 'The brand kit is validated, stored, and returned inside the complete updated profile with its new resource version.',\n whenToUse: 'Use this operation for a branding-only change that should not carry unrelated company-profile fields.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The brand kit (colors, logo, favicon) was applied and the updated profile is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The branding bundle fails validation (e.g. an invalid color token or an unsupported logo/favicon asset reference).', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller does not hold the organization-admin authority required by this route.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No profile record exists for the addressed organization to apply branding to.' },\n ],\n examples: [{\n title: 'Replace the organization brand kit',\n request: {\n organizationId: ORGANIZATION_PROFILE_EXAMPLE.organizationId,\n ...ORGANIZATION_PROFILE_BRANDING_REQUEST_EXAMPLE,\n },\n response: ORGANIZATION_PROFILE_BRANDING_RESPONSE_EXAMPLE,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'Each organization owns one profile. The framework creates it with the organization and removes it when the organization is deleted.',\n 'Organization-specific branding fields are overrides; when an override is absent, clients should use the application brand.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n ),\n () => ({\n views: {\n [Op.READ]: { purpose: 'Settings read for company/about panels.', whenToUse: 'Org profile in admin and member-visible about pages when exposed.' },\n [Op.UPDATE]: { purpose: 'General field edits in multi-section form.', whenToUse: 'IT and marketing co-own updates through governance roles.' },\n [OrganizationProfile_Operations.UPDATE_BRANDING]: { purpose: 'Branding wizard path separate from long-form text edits.', whenToUse: 'White-label and theme management UX.' },\n },\n }),\n);\n"]}
@@ -84,7 +84,7 @@ export const organizationUnitMembersResourceSpecification = resourceSpecificatio
84
84
  operations: {
85
85
  [Op.CREATE]: {
86
86
  purpose: 'Assign a member to an organization unit with a role.',
87
- outcome: 'The member holds the given role inside that unit, and an `organization_unit_member_role_changed` audit event records the grant against an empty baseline. The event is an AUTHORIZATION-category record rather than org-chart bookkeeping because the assigned role is live authority: it is emitted into the member’s `initiatorRoles` carrying an `organizationUnitId` discriminator that narrows it to this one unit.',
87
+ outcome: 'The member holds the given role inside that unit, and an `organization_unit_member_role_changed` audit event records the grant against an empty baseline. The event is an AUTHORIZATION-category record rather than org-chart bookkeeping because the assigned role is live authority: it is emitted into the member’s `initiatorRoles` carrying an `organizationUnitId` that narrows it to this one unit.',
88
88
  responseStatuses: [
89
89
  { code: HttpResponseStatusCode.CREATED_201, meaning: 'The assignment was created and is returned.' },
90
90
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"organization-unit-members.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-unit-members.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB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M,CAAC,EAAE;YACX,OAAO,EAAE,yCAAyC;YAClD,OAAO,EAAE,07BAA07B;YACn8B,gBAAgB,EAAE;gBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,cAAc,EAAE,OAAO,EAAE,kDAAkD,EAAE;aAC7G;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,0CAA0C,EAAE;gBAChG,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uEAAuE,EAAE;aAC9H;YACD,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,+NAA+N;QAC/N,kBAAkB,cAAc,CAAC,SAAS,0IAA0I,cAAc,CAAC,SAAS,yBAAyB,cAAc,CAAC,WAAW,OAAO,cAAc,CAAC,UAAU,6BAA6B,cAAc,CAAC,SAAS,eAAe,cAAc,CAAC,UAAU,4EAA4E;QACxc,+YAA+Y;QAC/Y,2NAA2N;QAC3N,qOAAqO;QACrO,uLAAuL;QACvL,kWAAkW;QAClW,uyBAAuyB;KACxyB;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationUnitMembers` — Wildo SaaS engine specification (backend-managed, org-scoped).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/organizations/organization-unit-members.shared.schemas.ts → `OrganizationUnitMemberSchema`\n * - Factory: engine/saas-models/src/organizations/organization-unit-members.shared.resources-config.schemas.ts\n * → `organizationUnitMemberResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none (no engine `resourceUIBehavior` preset; unit assignment is administered through\n * the org-structure admin surface, which consumes this resource's API directly).\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 CORE_ORG_ROLES,\n CoreResourceOperation as Op,\n OrganizationUnitMemberSchema,\n ResourcePrimaryScope,\n organizationUnitMemberResourceConfiguration_InitializationFactory as organizationUnitMembersFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nexport const organizationUnitMembersResourceSpecification = resourceSpecification(\n organizationUnitMembersFactory,\n OrganizationUnitMemberSchema,\n ({ schemaShape }) => ({\n purpose: 'Junction between an organization MEMBERSHIP and an organization UNIT: \"this member holds this role inside this unit of the org chart\".',\n businessRole: 'The per-unit half of a member’s authority, complementing the organization-wide `roles` array on the membership row. Replaced an embedded array on `ORGANIZATION_MEMBERS` so unit assignment became queryable on every persistence adapter, cascade-governed, and unique per (member, unit).',\n lifecycleRole: 'Created when an org admin assigns a member to a unit; the role may be re-graded in place; deleted on revocation, and cascade-deleted with the owning membership or the tenant.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitMemberSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitMemberResourceConfiguration_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: 'ORGANIZATION_UNIT_MEMBERS',\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 // No `customEnum`: the factory is typed `Record<string, never>` for custom operations — this\n // resource exposes the five core verbs and nothing else.\n },\n notes: [\n // DF-1 evidence. Recorded so a later reader can tell a VERIFIED absence from an omission and\n // does not \"helpfully\" add an assignment-notification block the runtime never emits.\n 'Runtime has no `userNotifications` / `m2mNotifications` on any operation — do not add communications.* (DF-1). Unit assignment is evidenced through the audit trail (`organization_unit_member_role_changed` / `organization_unit_member_removed`), not through user-facing messaging.',\n ],\n },\n fields: {\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The tenant this assignment belongs to.',\n whyItMatters: 'Denormalized from the parent membership so tenant scoping and the contextual filter resolve on this row alone — an authorization-adjacent read must never depend on a join to establish which tenant a row belongs to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationUnitId: schemaShape.organizationUnitId.foreignKeySpec({\n meaning: 'The org-chart node this assignment targets.',\n whyItMatters: 'Half of the business key, and the field a future unit-narrowed authorization read would filter on. Immutable: an edit may change what the assignment GRANTS, never what it is ABOUT.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationMemberId: schemaShape.organizationMemberId.foreignKeySpec({\n meaning: 'The organization MEMBERSHIP being assigned — deliberately the membership, not the user.',\n whyItMatters: 'A unit assignment presupposes membership of the owning organization, so the membership row is the semantic parent: it carries the tenant binding, and its deletion is exactly when the assignment stops meaning anything (hence the cascade). Pointing at `userId` instead would model a user as assignable to a unit of an organization they do not belong to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n // `role` carries no field spec: it is `OrgRolesSchema`, a `z.union` of the core org-role enum\n // and an open app-defined string, and the spec decorators live on concrete Zod types\n // (`z.string()`, `z.enum()`, `z.array()`) rather than on a union. The members resource hits the\n // same limit and describes its element through `arraySpec` metadata for the same reason. The\n // field's meaning, its ceiling governance and its immutability are documented in\n // `businessConstraints` below instead of being silently dropped.\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Assign a member to an organization unit with a role.',\n outcome: 'The member holds the given role inside that unit, and an `organization_unit_member_role_changed` audit event records the grant against an empty baseline. The event is an AUTHORIZATION-category record rather than org-chart bookkeeping because the assigned role is live authority: it is emitted into the member’s `initiatorRoles` carrying an `organizationUnitId` discriminator that narrows it to this one unit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The assignment was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation, omits `organizationUnitId`, or names a unit that does not belong to the caller’s organization.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling (a principal cannot grant authority it does not hold).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The member already holds an assignment in that unit — the (membership, unit) pair is the business key.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Assign a member as a manager of one delivery unit',\n request: {\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.READ]: {\n purpose: 'Fetch one unit assignment.',\n outcome: 'The assignment row is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'Read a delivery-unit manager assignment',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'Read a unit assignment with organization context',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n organization: { _id: 'org_acme' },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'Read the compact unit-assignment summary',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List unit assignments, filterable by unit, membership, or role.',\n outcome: 'Who sits where in the org chart — the input to org-structure admin screens.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignments visible in the caller’s organization are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'List delivery-unit role assignments',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'List unit assignments with organization context',\n response: {\n data: [\n {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n organization: { _id: 'org_acme' },\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'List compact unit-assignment summaries',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Re-grade an existing assignment.',\n outcome: 'The member holds a different role inside the same unit, and an `organization_unit_member_role_changed` audit event records both the previous and the new role. Re-stating the role the assignment already carries changes no authority and emits nothing.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n examples: [\n {\n title: 'Re-grade an existing unit assignment',\n request: { role: CORE_ORG_ROLES.ORG_MEMBER },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MEMBER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n [Op.DELETE]: {\n purpose: 'Revoke a member’s assignment to a unit.',\n outcome: 'The assignment row is removed; the member keeps their organization-wide roles. An `organization_unit_member_removed` audit event records the revocation, carrying the role that was removed — the row is hard-deleted, so nothing else in the system can afterwards answer what authority was lost. It is classified as an AUTHORIZATION event rather than org-chart record-keeping because an assignment row exists only to confer a role, so deleting it IS the revocation; the trail would otherwise show unit privileges granted and never removed. Cascade removals — deleting the parent membership, or the whole organization — do not emit this event: those cascades run through the raw repository, below the service tier, and the auditable act there is losing the membership or the tenant. Deleting the UNIT is not one of those paths: it is refused while any assignment remains, so dismantling a unit necessarily goes through this operation and is fully evidenced.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The assignment was removed; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id (or it was already removed).' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n '`role` is the role this member holds WITHIN this unit — a core org role token (`CORE_ORG_ROLES`) or an app-defined custom role string, the same open vocabulary as the organization-wide `roles` array on the membership row.',\n `Every WRITE is ${CORE_ORG_ROLES.ORG_ADMIN}-gated and additionally bounded by the role-ceiling gate: a principal may only grant a role its OWN organization-wide role confers. An ${CORE_ORG_ROLES.ORG_ADMIN} can therefore assign ${CORE_ORG_ROLES.ORG_MANAGER} or ${CORE_ORG_ROLES.ORG_MEMBER} inside a unit, but never ${CORE_ORG_ROLES.ORG_OWNER}. Reads are ${CORE_ORG_ROLES.ORG_MEMBER}-gated — who sits where is ordinary directory information inside a tenant.`,\n 'The ceiling derives from ORGANIZATION-WIDE grants only. That is load-bearing: if it counted unit grants, a member who is admin of one unit could grant themselves that role in every other unit and union up to organization-wide admin. This resource is also permanently barred from unit narrowing for the same reason — a resource that ISSUES authority must not be governed by the authority it issues.',\n 'CREATE validates that the target unit belongs to the caller’s organization. `organizationUnitId` is a caller-supplied FK, so without that check an org admin could bind their own member into another tenant’s org chart.',\n '`role` is the only mutable field; `organizationUnitId` and `organizationMemberId` are immutable. An edit may change what an assignment GRANTS, never what it is ABOUT — which keeps the business key the whole identity of the row.',\n 'The (membership, unit) business key makes \"one role per member per unit\" a persisted invariant. The embedded array this resource replaced admitted duplicates with no defined winner.',\n 'Deleting the owning membership or the organization cascades these rows away, so an assignment cannot outlive the membership that justified it. Deleting a UNIT does NOT cascade: that delete is refused while assignments remain, so an operator decides where the affected people belong rather than having roles silently dropped behind a single-node delete.',\n '`role` IS an authorization axis as of 2026-08-01. Each assignment is emitted into the caller’s `initiatorRoles` as a NARROWED grant carrying its `organizationUnitId`, which every organization-wide consumer partitions out. On a resource that opted into unit narrowing, such a grant admits the member at the operation gate when no organization-wide role of theirs satisfies it, and then confines their reads and writes to that unit — plus its descendants where the unit declares downward inheritance. On every other resource the grant confers nothing at all, which is what stops one unit’s role from becoming tenant-wide authority. Governing these writes BEFORE the wiring landed was deliberate: it meant no above-ceiling role could be pre-planted and then silently become live on the day narrowing shipped.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
1
+ {"version":3,"file":"organization-unit-members.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organization-unit-members.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,M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,CAAC,EAAE;YACX,OAAO,EAAE,yCAAyC;YAClD,OAAO,EAAE,07BAA07B;YACn8B,gBAAgB,EAAE;gBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,cAAc,EAAE,OAAO,EAAE,kDAAkD,EAAE;aAC7G;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,0CAA0C,EAAE;gBAChG,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uEAAuE,EAAE;aAC9H;YACD,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,+NAA+N;QAC/N,kBAAkB,cAAc,CAAC,SAAS,0IAA0I,cAAc,CAAC,SAAS,yBAAyB,cAAc,CAAC,WAAW,OAAO,cAAc,CAAC,UAAU,6BAA6B,cAAc,CAAC,SAAS,eAAe,cAAc,CAAC,UAAU,4EAA4E;QACxc,+YAA+Y;QAC/Y,2NAA2N;QAC3N,qOAAqO;QACrO,uLAAuL;QACvL,kWAAkW;QAClW,uyBAAuyB;KACxyB;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationUnitMembers` — Wildo SaaS engine specification (backend-managed, org-scoped).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/organizations/organization-unit-members.shared.schemas.ts → `OrganizationUnitMemberSchema`\n * - Factory: engine/saas-models/src/organizations/organization-unit-members.shared.resources-config.schemas.ts\n * → `organizationUnitMemberResourceConfiguration_InitializationFactory`\n * - Custom operations: none\n * - UI presets: none (no engine `resourceUIBehavior` preset; unit assignment is administered through\n * the org-structure admin surface, which consumes this resource's API directly).\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 CORE_ORG_ROLES,\n CoreResourceOperation as Op,\n OrganizationUnitMemberSchema,\n ResourcePrimaryScope,\n organizationUnitMemberResourceConfiguration_InitializationFactory as organizationUnitMembersFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nexport const organizationUnitMembersResourceSpecification = resourceSpecification(\n organizationUnitMembersFactory,\n OrganizationUnitMemberSchema,\n ({ schemaShape }) => ({\n purpose: 'Junction between an organization MEMBERSHIP and an organization UNIT: \"this member holds this role inside this unit of the org chart\".',\n businessRole: 'The per-unit half of a member’s authority, complementing the organization-wide `roles` array on the membership row. Replaced an embedded array on `ORGANIZATION_MEMBERS` so unit assignment became queryable on every persistence adapter, cascade-governed, and unique per (member, unit).',\n lifecycleRole: 'Created when an org admin assigns a member to a unit; the role may be re-graded in place; deleted on revocation, and cascade-deleted with the owning membership or the tenant.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.ORGANIZATIONS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'OrganizationUnitMemberSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'organizationUnitMemberResourceConfiguration_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: 'ORGANIZATION_UNIT_MEMBERS',\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 // No `customEnum`: the factory is typed `Record<string, never>` for custom operations — this\n // resource exposes the five core verbs and nothing else.\n },\n notes: [\n // DF-1 evidence. Recorded so a later reader can tell a VERIFIED absence from an omission and\n // does not \"helpfully\" add an assignment-notification block the runtime never emits.\n 'Runtime has no `userNotifications` / `m2mNotifications` on any operation — do not add communications.* (DF-1). Unit assignment is evidenced through the audit trail (`organization_unit_member_role_changed` / `organization_unit_member_removed`), not through user-facing messaging.',\n ],\n },\n fields: {\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The tenant this assignment belongs to.',\n whyItMatters: 'Denormalized from the parent membership so tenant scoping and the contextual filter resolve on this row alone — an authorization-adjacent read must never depend on a join to establish which tenant a row belongs to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationUnitId: schemaShape.organizationUnitId.foreignKeySpec({\n meaning: 'The org-chart node this assignment targets.',\n whyItMatters: 'Half of the business key, and the field a future unit-narrowed authorization read would filter on. Immutable: an edit may change what the assignment GRANTS, never what it is ABOUT.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n organizationMemberId: schemaShape.organizationMemberId.foreignKeySpec({\n meaning: 'The organization MEMBERSHIP being assigned — deliberately the membership, not the user.',\n whyItMatters: 'A unit assignment presupposes membership of the owning organization, so the membership row is the semantic parent: it carries the tenant binding, and its deletion is exactly when the assignment stops meaning anything (hence the cascade). Pointing at `userId` instead would model a user as assignable to a unit of an organization they do not belong to.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n // `role` carries no field spec: it is `OrgRolesSchema`, a `z.union` of the core org-role enum\n // and an open app-defined string, and the spec decorators live on concrete Zod types\n // (`z.string()`, `z.enum()`, `z.array()`) rather than on a union. The members resource hits the\n // same limit and describes its element through `arraySpec` metadata for the same reason. The\n // field's meaning, its ceiling governance and its immutability are documented in\n // `businessConstraints` below instead of being silently dropped.\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Assign a member to an organization unit with a role.',\n outcome: 'The member holds the given role inside that unit, and an `organization_unit_member_role_changed` audit event records the grant against an empty baseline. The event is an AUTHORIZATION-category record rather than org-chart bookkeeping because the assigned role is live authority: it is emitted into the member’s `initiatorRoles` carrying an `organizationUnitId` that narrows it to this one unit.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The assignment was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation, omits `organizationUnitId`, or names a unit that does not belong to the caller’s organization.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling (a principal cannot grant authority it does not hold).' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The member already holds an assignment in that unit — the (membership, unit) pair is the business key.' },\n ],\n idempotent: false,\n examples: [\n {\n title: 'Assign a member as a manager of one delivery unit',\n request: {\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.CREATED_201,\n },\n ],\n },\n [Op.READ]: {\n purpose: 'Fetch one unit assignment.',\n outcome: 'The assignment row is returned.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'Read a delivery-unit manager assignment',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'Read a unit assignment with organization context',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n organization: { _id: 'org_acme' },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'Read the compact unit-assignment summary',\n response: {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List unit assignments, filterable by unit, membership, or role.',\n outcome: 'Who sits where in the org chart — the input to org-structure admin screens.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignments visible in the caller’s organization are returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a member of the organization.' },\n ],\n idempotent: true,\n variants: {\n default: {\n examples: [\n {\n title: 'List delivery-unit role assignments',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n context: {\n examples: [\n {\n title: 'List unit assignments with organization context',\n response: {\n data: [\n {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n createdAt: '2026-06-14T12:00:00.000Z',\n updatedAt: '2026-06-14T12:00:00.000Z',\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n organization: { _id: 'org_acme' },\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n summary: {\n examples: [\n {\n title: 'List compact unit-assignment summaries',\n response: {\n data: [\n {\n _id: 'unit_member_01HX2EXAMPLE',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2EXAMPLE',\n role: CORE_ORG_ROLES.ORG_MANAGER,\n },\n ],\n pagination: { page: 1, limit: 20, total: 1, totalPages: 1 },\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Re-grade an existing assignment.',\n outcome: 'The member holds a different role inside the same unit, and an `organization_unit_member_role_changed` audit event records both the previous and the new role. Re-stating the role the assignment already carries changes no authority and emits nothing.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The assignment was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The payload fails schema validation.', errorCode: 'VALIDATION_FAILED' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin, OR the requested role exceeds the caller’s own organization-wide ceiling.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id in the caller’s organization.' },\n ],\n idempotent: true,\n examples: [\n {\n title: 'Re-grade an existing unit assignment',\n request: { role: CORE_ORG_ROLES.ORG_MEMBER },\n response: {\n _id: 'unit_member_01HX2…',\n organizationId: 'org_acme',\n organizationUnitId: 'unit_product_delivery',\n organizationMemberId: 'member_01HX2…',\n role: CORE_ORG_ROLES.ORG_MEMBER,\n },\n forStatus: HttpResponseStatusCode.OK_200,\n },\n ],\n },\n [Op.DELETE]: {\n purpose: 'Revoke a member’s assignment to a unit.',\n outcome: 'The assignment row is removed; the member keeps their organization-wide roles. An `organization_unit_member_removed` audit event records the revocation, carrying the role that was removed — the row is hard-deleted, so nothing else in the system can afterwards answer what authority was lost. It is classified as an AUTHORIZATION event rather than org-chart record-keeping because an assignment row exists only to confer a role, so deleting it IS the revocation; the trail would otherwise show unit privileges granted and never removed. Cascade removals — deleting the parent membership, or the whole organization — do not emit this event: those cascades run through the raw repository, below the service tier, and the auditable act there is losing the membership or the tenant. Deleting the UNIT is not one of those paths: it is refused while any assignment remains, so dismantling a unit necessarily goes through this operation and is fully evidenced.',\n responseStatuses: [\n { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The assignment was removed; no body is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an organization admin.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No assignment exists for the supplied id (or it was already removed).' },\n ],\n idempotent: true,\n },\n },\n businessConstraints: [\n '`role` is the role this member holds WITHIN this unit — a core org role token (`CORE_ORG_ROLES`) or an app-defined custom role string, the same open vocabulary as the organization-wide `roles` array on the membership row.',\n `Every WRITE is ${CORE_ORG_ROLES.ORG_ADMIN}-gated and additionally bounded by the role-ceiling gate: a principal may only grant a role its OWN organization-wide role confers. An ${CORE_ORG_ROLES.ORG_ADMIN} can therefore assign ${CORE_ORG_ROLES.ORG_MANAGER} or ${CORE_ORG_ROLES.ORG_MEMBER} inside a unit, but never ${CORE_ORG_ROLES.ORG_OWNER}. Reads are ${CORE_ORG_ROLES.ORG_MEMBER}-gated — who sits where is ordinary directory information inside a tenant.`,\n 'The ceiling derives from ORGANIZATION-WIDE grants only. That is load-bearing: if it counted unit grants, a member who is admin of one unit could grant themselves that role in every other unit and union up to organization-wide admin. This resource is also permanently barred from unit narrowing for the same reason — a resource that ISSUES authority must not be governed by the authority it issues.',\n 'CREATE validates that the target unit belongs to the caller’s organization. `organizationUnitId` is a caller-supplied FK, so without that check an org admin could bind their own member into another tenant’s org chart.',\n '`role` is the only mutable field; `organizationUnitId` and `organizationMemberId` are immutable. An edit may change what an assignment GRANTS, never what it is ABOUT — which keeps the business key the whole identity of the row.',\n 'The (membership, unit) business key makes \"one role per member per unit\" a persisted invariant. The embedded array this resource replaced admitted duplicates with no defined winner.',\n 'Deleting the owning membership or the organization cascades these rows away, so an assignment cannot outlive the membership that justified it. Deleting a UNIT does NOT cascade: that delete is refused while assignments remain, so an operator decides where the affected people belong rather than having roles silently dropped behind a single-node delete.',\n '`role` IS an authorization axis as of 2026-08-01. Each assignment is emitted into the caller’s `initiatorRoles` as a NARROWED grant carrying its `organizationUnitId`, which every organization-wide consumer partitions out. On a resource that opted into unit narrowing, such a grant admits the member at the operation gate when no organization-wide role of theirs satisfies it, and then confines their reads and writes to that unit — plus its descendants where the unit declares downward inheritance. On every other resource the grant confers nothing at all, which is what stops one unit’s role from becoming tenant-wide authority. Governing these writes BEFORE the wiring landed was deliberate: it meant no above-ceiling role could be pre-planted and then silently become live on the day narrowing shipped.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
@@ -93,11 +93,11 @@ export const organizationsResourceSpecification = resourceSpecificationFromFront
93
93
  },
94
94
  values: {
95
95
  [OrganizationStatus.ACTIVE]: { meaning: 'Normal operations.' },
96
- [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.' },
96
+ [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 records.' },
97
97
  [OrganizationStatus.TRIAL]: { meaning: 'Time-boxed evaluation.' },
98
98
  [OrganizationStatus.TRIAL_EXPIRED]: { meaning: 'Trial ended without conversion.' },
99
99
  [OrganizationStatus.CANCELLED]: { meaning: 'Customer-initiated or scheduled end. Terminal, and confers NO authority.' },
100
- [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.' },
100
+ [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 record and every child it owns are intact until the purge runs.' },
101
101
  },
102
102
  }),
103
103
  },
@@ -115,8 +115,8 @@ export const organizationsResourceSpecification = resourceSpecificationFromFront
115
115
  idempotent: true,
116
116
  },
117
117
  [Op.LIST]: {
118
- purpose: 'Application-wide organization directory (super-admin; factory-registered).',
119
- outcome: 'Paginated org rows for support and platform operations.',
118
+ purpose: 'Application-wide organization directory, for platform administrators.',
119
+ outcome: 'A paginated directory for support and platform operations.',
120
120
  responseStatuses: [
121
121
  { code: HttpResponseStatusCode.OK_200, meaning: 'A (possibly empty) page of organizations for the platform directory.' },
122
122
  ],
@@ -182,11 +182,11 @@ export const organizationsResourceSpecification = resourceSpecificationFromFront
182
182
  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.',
183
183
  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.',
184
184
  responseStatuses: [
185
- { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The organization row was deleted and its registry-declared cascades ran; no body is returned.' },
185
+ { code: HttpResponseStatusCode.NO_CONTENT_204, meaning: 'The organization record was deleted and its registry-declared cascades ran; no body is returned.' },
186
186
  ],
187
187
  errorScenarios: [
188
188
  { 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.' },
189
- { 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' },
189
+ { 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. Re-authentication accepts a password, an enrolled second factor (a TOTP code or a backup code), or a passkey assertion, so a directory-managed (SCIM) user whose local first factor the framework destroys by design can still clear this gate through an enrolled second factor. A principal holding none of the three cannot.', errorCode: 'STEP_UP_REQUIRED' },
190
190
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id (or it was already purged).' },
191
191
  ],
192
192
  idempotent: true,
@@ -200,7 +200,7 @@ export const organizationsResourceSpecification = resourceSpecificationFromFront
200
200
  ],
201
201
  errorScenarios: [
202
202
  { 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.' },
203
- { 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' },
203
+ { 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. Re-authentication accepts a password, an enrolled second factor (a TOTP code or a backup code), or a passkey assertion, so a directory-managed (SCIM) user whose local first factor the framework destroys by design can still clear this gate through an enrolled second factor. A principal holding none of the three cannot clear it and must route the teardown through the `admin` variant.', errorCode: 'STEP_UP_REQUIRED' },
204
204
  { 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.' },
205
205
  { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No organization exists for the supplied id in the caller’s scope.' },
206
206
  ],
@@ -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,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,MAAM,CAAC,MAAM,kCAAkC,GAAG,8CAA8C,CAC9F,mCAAmC,CACjC,6BAA6B,CAAC,2BAA2B,CAAC,EAC1D,6BAA6B,CAAC,4BAA4B,CAAC,CAC5D,EACD,qBAAqB,CACnB,oBAAoB,EACpB,kBAAkB,EAClB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,qHAAqH;IAC9H,YAAY,EAAE,0HAA0H;IACxI,aAAa,EAAE,2GAA2G;IAC1H,QAAQ,EAAE,aAAa,CAAC,KAAK;IAC7B,SAAS,EAAE,uBAAuB,CAAC,aAAa;IAChD,YAAY,EAAE;QACZ,UAAU,EAAE;YACV,W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ACF;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,sGAAsG;YAC/G,SAAS,EAAE,uDAAuD;SACnE;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,8CAA8C;YACvD,SAAS,EAAE,6DAA6D;SACzE;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP,OAAO,EAAE,sEAAsE;oBAC/E,SAAS,EAAE,4EAA4E;iBACxF;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,mFAAmF;oBAC5F,SAAS,EAAE,sFAAsF;iBAClG;aACF;SACF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP,OAAO,EAAE,wEAAwE;oBACjF,SAAS,EAAE,sDAAsD;iBAClE;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';\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
+ {"version":3,"file":"organizations.resource.specification.js","sourceRoot":"","sources":["../../../../../../src/engine/organizations/resources/organizations.resource.specification.ts"],"names":[],"mappings":"AAA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O,EAAE,8CAA8C;YACvD,SAAS,EAAE,6DAA6D;SACzE;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP,OAAO,EAAE,sEAAsE;oBAC/E,SAAS,EAAE,4EAA4E;iBACxF;gBACD,KAAK,EAAE;oBACL,OAAO,EAAE,mFAAmF;oBAC5F,SAAS,EAAE,sFAAsF;iBAClG;aACF;SACF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP,OAAO,EAAE,wEAAwE;oBACjF,SAAS,EAAE,sDAAsD;iBAClE;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';\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 records.' },\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 record 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, for platform administrators.',\n outcome: 'A paginated directory 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 record 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. Re-authentication accepts a password, an enrolled second factor (a TOTP code or a backup code), or a passkey assertion, so a directory-managed (SCIM) user whose local first factor the framework destroys by design can still clear this gate through an enrolled second factor. A principal holding none of the three cannot.', 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. Re-authentication accepts a password, an enrolled second factor (a TOTP code or a backup code), or a passkey assertion, so a directory-managed (SCIM) user whose local first factor the framework destroys by design can still clear this gate through an enrolled second factor. A principal holding none of the three cannot clear it 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"]}
@@ -0,0 +1,9 @@
1
+ import { type CodeSymbolRef } from '@wildo-ai/zod-decorators';
2
+ import { type SpecificationOwnerRef } from '../../_core';
3
+ /** Owner of every engine-shipped provider specification. */
4
+ export declare const ENGINE_PROVIDER_OWNER_REF: SpecificationOwnerRef;
5
+ /** The npm package the engine's backend provider modules live in. */
6
+ export declare const ENGINE_BACKEND_PROVIDERS_PACKAGE = "@wildo-ai/external-connectors-private";
7
+ /** The `BackendProviderModule` const a backend provider is declared as. */
8
+ export declare function backendProviderModuleSymbol(exportName: string): CodeSymbolRef;
9
+ //# sourceMappingURL=_engine-provider-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_engine-provider-shared.d.ts","sourceRoot":"","sources":["../../../../../src/engine/providers/_engine-provider-shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,qBAAqB,EAA0B,MAAM,6BAA6B,CAAC;AAEjG,4DAA4D;AAC5D,eAAO,MAAM,yBAAyB,EAAE,qBAGvC,CAAC;AAEF,qEAAqE;AACrE,eAAO,MAAM,gCAAgC,0CAA0C,CAAC;AAExF,2EAA2E;AAC3E,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAO7E"}