@wildo-ai/saas-models 1.1.4 → 1.1.5

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 (1032) hide show
  1. package/dist/esm/__tests__/setup.d.ts.map +1 -1
  2. package/dist/esm/_inspect.d.ts.map +1 -1
  3. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts +1 -1
  4. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts.map +1 -1
  5. package/dist/esm/applications/application-subject.shared.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts +1 -1
  7. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
  8. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js +2 -2
  9. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  10. package/dist/esm/applications/applications-context.schemas.d.ts +236 -18
  11. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  12. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts +1 -0
  13. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  14. package/dist/esm/applications/applications.shared.resources-config.schemas.js +1 -1
  15. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  16. package/dist/esm/applications/applications.shared.schemas.d.ts +3 -2
  17. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  18. package/dist/esm/applications/applications.shared.schemas.js +40 -5
  19. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  20. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +1 -2
  21. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  22. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +1 -2
  23. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  24. package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
  25. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  26. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +87 -5
  28. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  29. package/dist/esm/billing/billing-enums.shared.schemas.js +91 -5
  30. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  31. package/dist/esm/billing/billing-types.shared.schemas.d.ts +24 -4
  32. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  33. package/dist/esm/billing/billing-types.shared.schemas.js +24 -8
  34. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  35. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  36. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  37. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
  38. package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
  39. package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
  40. package/dist/esm/billing/price.shared.resources-config.schemas.js +32 -2
  41. package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
  42. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  43. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  44. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  45. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +1 -1
  46. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  47. package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  49. package/dist/esm/billing/product.shared.resources-config.schemas.js +32 -2
  50. package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
  51. package/dist/esm/billing/product.shared.schemas.d.ts +1 -0
  52. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  53. package/dist/esm/billing/product.shared.schemas.js +3 -0
  54. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  55. package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/promotions.shared.resources-config.schemas.js +33 -3
  57. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  58. package/dist/esm/billing/promotions.shared.schemas.d.ts.map +1 -1
  59. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  60. package/dist/esm/billing/referral.shared.resources-config.schemas.js +22 -2
  61. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  62. package/dist/esm/billing/referral.shared.schemas.d.ts +1 -0
  63. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  64. package/dist/esm/billing/referral.shared.schemas.js +3 -0
  65. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  66. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +23 -1
  67. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  68. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +48 -2
  69. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  70. package/dist/esm/billing/subscription.shared.schemas.d.ts +1 -0
  71. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  72. package/dist/esm/billing/subscription.shared.schemas.js +3 -0
  73. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  74. package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts +49 -0
  75. package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -0
  76. package/dist/esm/billing/usage-flush-evidence.shared.schemas.js +48 -0
  77. package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -0
  78. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
  79. package/dist/esm/billing/usage-record.shared.schemas.d.ts +1 -0
  80. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  81. package/dist/esm/billing/usage-record.shared.schemas.js +3 -0
  82. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  83. package/dist/esm/charts/aggregation-query.shared.schemas.d.ts.map +1 -1
  84. package/dist/esm/charts/chart-definition-builder.shared.d.ts.map +1 -1
  85. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +7 -1
  86. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  87. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  88. package/dist/esm/companion/shared-library-companion.shared.definitions.d.ts.map +1 -1
  89. package/dist/esm/companion-exports.d.ts.map +1 -1
  90. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +14 -3
  91. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  92. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +21 -7
  93. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  94. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts +450 -0
  95. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -0
  96. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js +723 -0
  97. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -0
  98. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
  99. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +2 -2
  100. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  101. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +8 -0
  102. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  103. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +15 -0
  104. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  105. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +610 -16
  106. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  107. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +769 -38
  108. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  109. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  110. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +29 -0
  111. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  112. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts +463 -0
  113. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -0
  114. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js +526 -0
  115. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -0
  116. package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts +539 -15
  117. package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
  118. package/dist/esm/compliance/documents/governed-documents.shared.schemas.js +402 -14
  119. package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
  120. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts +18 -0
  121. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -0
  122. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js +89 -0
  123. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -0
  124. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts +47 -0
  125. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -0
  126. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js +73 -0
  127. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -0
  128. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts +21 -0
  129. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  130. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js +39 -1
  131. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  132. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts +33 -0
  133. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -0
  134. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js +30 -0
  135. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -0
  136. package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts +6 -5
  137. package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
  138. package/dist/esm/compliance/privacy/client-storage.shared.schemas.js +15 -5
  139. package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
  140. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts +127 -0
  141. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -0
  142. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js +94 -0
  143. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -0
  144. package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts +125 -0
  145. package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -0
  146. package/dist/esm/compliance/privacy/consent-purposes.shared.js +136 -0
  147. package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -0
  148. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts.map +1 -1
  149. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts +91 -0
  150. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -0
  151. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +123 -0
  152. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -0
  153. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
  154. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  155. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
  156. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
  157. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +68 -25
  158. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  159. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +74 -22
  160. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  161. package/dist/esm/compliance/privacy/personal-data-category.shared.schemas.d.ts.map +1 -1
  162. package/dist/esm/compliance/privacy/personal-data-declaration.shared.utils.d.ts.map +1 -1
  163. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts +9 -17
  164. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  165. package/dist/esm/compliance/privacy/privacy.shared.schemas.js +74 -31
  166. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  167. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
  168. package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
  169. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
  170. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts +47 -0
  171. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -0
  172. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js +98 -0
  173. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -0
  174. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts +368 -35
  175. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  176. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js +403 -17
  177. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  178. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
  179. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  180. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  181. package/dist/esm/compliance/review-cadence.shared.schemas.d.ts +56 -0
  182. package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -0
  183. package/dist/esm/compliance/review-cadence.shared.schemas.js +71 -0
  184. package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -0
  185. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts +161 -0
  186. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -0
  187. package/dist/esm/compliance/risk-posture.shared.schemas.js +166 -0
  188. package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -0
  189. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts +4 -3
  190. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  191. package/dist/esm/config/analytics-value-moments.shared.schemas.js +4 -3
  192. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  193. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +222 -9
  194. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  195. package/dist/esm/config/app-configuration-shared.shared.schemas.js +232 -9
  196. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  197. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts +75 -3
  198. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  199. package/dist/esm/config/auth-config-resolution.shared.utils.js +93 -4
  200. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  201. package/dist/esm/config/brand-assets.shared.schemas.d.ts +5 -4
  202. package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
  203. package/dist/esm/config/brand-assets.shared.schemas.js +14 -4
  204. package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
  205. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +463 -19
  206. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  207. package/dist/esm/config/entity-identity-config.shared.schemas.js +535 -28
  208. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  209. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +24 -24
  210. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts.map +1 -1
  211. package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
  212. package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
  213. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +21 -17
  214. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  215. package/dist/esm/config/frontend/navigation.shared.schemas.js +58 -40
  216. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  217. package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts +90 -133
  218. package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
  219. package/dist/esm/config/frontend/onboarding.shared.schemas.js +148 -100
  220. package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
  221. package/dist/esm/config/registration-acquisition-policy.shared.utils.d.ts.map +1 -1
  222. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  223. package/dist/esm/crdt/crdt-merge.shared.utils.d.ts.map +1 -1
  224. package/dist/esm/data-seeding/data-seeding-config.shared.schemas.d.ts.map +1 -1
  225. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +140 -43
  226. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  227. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +141 -42
  228. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  229. package/dist/esm/errors/errors.shared.definitions.d.ts.map +1 -1
  230. package/dist/esm/errors/errors.shared.definitions.js +1 -1
  231. package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
  232. package/dist/esm/errors/errors.shared.schemas.d.ts +29 -40
  233. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  234. package/dist/esm/errors/errors.shared.schemas.js +37 -54
  235. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  236. package/dist/esm/errors/errors.shared.utils.d.ts +24 -0
  237. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  238. package/dist/esm/errors/errors.shared.utils.js +39 -0
  239. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  240. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts +27 -0
  241. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -0
  242. package/dist/esm/errors/thrown-value-description.shared.utils.js +67 -0
  243. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -0
  244. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +48 -73
  245. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  246. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js +103 -9
  247. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  248. package/dist/esm/external-data.exports.d.ts +1 -0
  249. package/dist/esm/external-data.exports.d.ts.map +1 -1
  250. package/dist/esm/external-data.exports.js +1 -0
  251. package/dist/esm/external-data.exports.js.map +1 -1
  252. package/dist/esm/external-providers/compose-provider-registry.shared.d.ts.map +1 -1
  253. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +11 -12
  254. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  255. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +11 -12
  256. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  257. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts +5 -3
  258. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  259. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +5 -3
  260. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  261. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts +77 -0
  262. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -0
  263. package/dist/esm/external-providers/engine-capability-surface.shared.js +173 -0
  264. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -0
  265. package/dist/esm/external-providers/external-providers.shared.schemas.d.ts +2 -0
  266. package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
  267. package/dist/esm/external-providers/external-providers.shared.schemas.js +21 -0
  268. package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
  269. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +129 -9
  270. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  271. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +114 -0
  272. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  273. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +148 -0
  274. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  275. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
  276. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
  277. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +54 -3
  278. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  279. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +58 -1
  280. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  281. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts +12 -3
  282. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
  283. package/dist/esm/external-providers/frontend-provider-public-config.shared.js +14 -5
  284. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
  285. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts +30 -0
  286. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -0
  287. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js +32 -0
  288. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -0
  289. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts +86 -0
  290. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -0
  291. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js +85 -0
  292. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -0
  293. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +14 -13
  294. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  295. package/dist/esm/external-providers/provider-capability.shared.schemas.js +10 -10
  296. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  297. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  298. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  299. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
  300. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
  301. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +7 -5
  302. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  303. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +7 -5
  304. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  305. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +8 -5
  306. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  307. package/dist/esm/external-providers/provider-metadata.shared.schemas.js +5 -2
  308. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  309. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  310. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  311. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -1
  312. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -1
  313. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
  314. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts +2 -0
  315. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  316. package/dist/esm/features/application-features.shared.resources-config.schemas.js +30 -3
  317. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  318. package/dist/esm/features/connected-feature.example.d.ts +64 -0
  319. package/dist/esm/features/connected-feature.example.d.ts.map +1 -0
  320. package/dist/esm/features/connected-feature.example.js +86 -0
  321. package/dist/esm/features/connected-feature.example.js.map +1 -0
  322. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  323. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  324. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  325. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  326. package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
  327. package/dist/esm/features/feature-registry.shared.d.ts.map +1 -1
  328. package/dist/esm/features/feature-resolution.shared.schemas.d.ts.map +1 -1
  329. package/dist/esm/features/scope-features.shared.schemas.d.ts +53 -0
  330. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  331. package/dist/esm/features/scope-features.shared.schemas.js +37 -0
  332. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  333. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
  334. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
  335. package/dist/esm/features/user-features.shared.resources-config.schemas.js +34 -52
  336. package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
  337. package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -1
  338. package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -1
  339. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -1
  340. package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -1
  341. package/dist/esm/files/files.shared.resources-config.schemas.d.ts +3 -3
  342. package/dist/esm/files/files.shared.resources-config.schemas.d.ts.map +1 -1
  343. package/dist/esm/files/files.shared.resources-config.schemas.js +3 -3
  344. package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
  345. package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
  346. package/dist/esm/files/files.shared.schemas.js.map +1 -1
  347. package/dist/esm/files/files.shared.utils.d.ts.map +1 -1
  348. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  349. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
  350. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
  351. package/dist/esm/flows-actors/a2a-token-budget-state.shared.schemas.d.ts.map +1 -1
  352. package/dist/esm/flows-actors/actors.shared.schemas.d.ts +152 -129
  353. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  354. package/dist/esm/flows-actors/actors.shared.schemas.js +99 -2
  355. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  356. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts +6 -0
  357. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  358. package/dist/esm/flows-actors/agents.shared.schemas.d.ts +3 -3
  359. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  360. package/dist/esm/flows-actors/agents.shared.schemas.js +11 -5
  361. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  362. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +13 -0
  363. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  364. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  365. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts +45 -0
  366. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -0
  367. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js +51 -0
  368. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -0
  369. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
  370. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +31 -0
  371. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  372. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +61 -3
  373. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  374. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
  375. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts +2 -2
  376. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
  377. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +16 -8
  378. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  379. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +23 -11
  380. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  381. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts +0 -189
  382. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  383. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js +14 -50
  384. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  385. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts +0 -3
  386. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  387. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js +0 -1
  388. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  389. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
  390. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  391. package/dist/esm/flows-actors/flows-actors.system.shared.definitions.d.ts.map +1 -1
  392. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts +1 -67
  393. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  394. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js +1 -2
  395. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  396. package/dist/esm/flows-actors/flows.shared.schemas.d.ts +0 -1
  397. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  398. package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
  399. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts +121 -0
  400. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -0
  401. package/dist/esm/flows-actors/human-decision.shared.schemas.js +252 -0
  402. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -0
  403. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
  404. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js +4 -2
  405. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
  406. package/dist/esm/flows-actors/prompt-ir.shared.schemas.d.ts.map +1 -1
  407. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts +24 -0
  408. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -0
  409. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js +80 -0
  410. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -0
  411. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts +123 -0
  412. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -0
  413. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js +181 -0
  414. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -0
  415. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts +58 -81
  416. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  417. package/dist/esm/flows-actors/tasks.actors.shared.schemas.js +75 -38
  418. package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
  419. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts +106 -1
  420. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
  421. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +117 -0
  422. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
  423. package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts +106 -24
  424. package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
  425. package/dist/esm/guidance/guidance-flow.shared.schemas.js +152 -14
  426. package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
  427. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
  428. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  429. package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
  430. package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
  431. package/dist/esm/guidance/lifecycle-config.shared.schemas.d.ts.map +1 -1
  432. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
  433. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts +0 -6
  434. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
  435. package/dist/esm/guidance/lifecycle-state.shared.schemas.js +0 -19
  436. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  437. package/dist/esm/guidance/milestone-builders.shared.d.ts +4 -2
  438. package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
  439. package/dist/esm/guidance/milestone-builders.shared.js +4 -2
  440. package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
  441. package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts +66 -4
  442. package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
  443. package/dist/esm/guidance/milestone-definition.shared.schemas.js +50 -0
  444. package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
  445. package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts +71 -0
  446. package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -0
  447. package/dist/esm/guidance/progression-presentation.shared.schemas.js +72 -0
  448. package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -0
  449. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +2 -0
  450. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  451. package/dist/esm/guidance/progression-state.shared.schemas.d.ts +4 -0
  452. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  453. package/dist/esm/guidance/progression-state.shared.schemas.js +5 -0
  454. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  455. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
  456. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js +2 -1
  457. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  458. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +181 -412
  459. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  460. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +249 -199
  461. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  462. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts +107 -0
  463. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -0
  464. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js +108 -0
  465. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -0
  466. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts +38 -0
  467. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -0
  468. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js +42 -0
  469. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -0
  470. package/dist/esm/i18n/labelling.dto.shared.schemas.d.ts.map +1 -1
  471. package/dist/esm/index.d.ts +41 -4
  472. package/dist/esm/index.d.ts.map +1 -1
  473. package/dist/esm/index.js +71 -16
  474. package/dist/esm/index.js.map +1 -1
  475. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -0
  476. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -0
  477. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -0
  478. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -0
  479. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts +130 -0
  480. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -0
  481. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js +104 -0
  482. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -0
  483. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -0
  484. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -0
  485. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/decisions.meta-workflows.shared.schemas.d.ts +64 -0
  486. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -0
  487. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/decisions.meta-workflows.shared.schemas.js +47 -0
  488. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -0
  489. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +544 -0
  490. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -0
  491. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +638 -0
  492. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -0
  493. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/portable-primitives.meta-workflows.shared.schemas.d.ts +15 -8
  494. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -0
  495. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/portable-primitives.meta-workflows.shared.schemas.js +15 -8
  496. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -0
  497. package/dist/esm/meta-workflows.exports.d.ts +21 -25
  498. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  499. package/dist/esm/meta-workflows.exports.js +21 -25
  500. package/dist/esm/meta-workflows.exports.js.map +1 -1
  501. package/dist/esm/monitoring/monitoring.shared.schemas.d.ts.map +1 -1
  502. package/dist/esm/notifications/email/email-context.shared.schemas.d.ts.map +1 -1
  503. package/dist/esm/notifications/email/email-submission.shared.enums.d.ts +16 -0
  504. package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -0
  505. package/dist/esm/notifications/email/email-submission.shared.enums.js +17 -0
  506. package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -0
  507. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +36 -0
  508. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  509. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js +50 -3
  510. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  511. package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
  512. package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
  513. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -1
  514. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  515. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js +4 -1
  516. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  517. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts +2 -1
  518. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
  519. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js +3 -2
  520. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
  521. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  522. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +44 -3
  523. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  524. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  525. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  526. package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
  527. package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
  528. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  529. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  530. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
  531. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
  532. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +12 -33
  533. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
  534. package/dist/esm/notifications/notifications.shared.schemas.d.ts +19 -8
  535. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  536. package/dist/esm/notifications/notifications.shared.schemas.js +19 -8
  537. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  538. package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts +145 -0
  539. package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -0
  540. package/dist/esm/organizations/application-owner-organization.shared.schemas.js +146 -0
  541. package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -0
  542. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts +2 -0
  543. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
  544. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +26 -3
  545. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  546. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +1 -1
  547. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  548. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +18 -14
  549. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  550. package/dist/esm/organizations/organization-members.shared.schemas.d.ts +1 -1
  551. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  552. package/dist/esm/organizations/organization-members.shared.schemas.js +9 -1
  553. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  554. package/dist/esm/organizations/organization-notifications.shared.resources-config.schemas.d.ts.map +1 -1
  555. package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
  556. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  557. package/dist/esm/organizations/organization-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  558. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts +2 -1
  559. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  560. package/dist/esm/organizations/organization-preferences.shared.schemas.js +3 -0
  561. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  562. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
  563. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +3 -1
  564. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  565. package/dist/esm/organizations/organization-profile.shared.schemas.js +4 -2
  566. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  567. package/dist/esm/organizations/organization-unit-inheritance.shared.d.ts.map +1 -1
  568. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.d.ts.map +1 -1
  569. package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
  570. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
  571. package/dist/esm/organizations/organization-unit-narrowing.example.d.ts.map +1 -1
  572. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts +29 -2
  573. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  574. package/dist/esm/organizations/organization-unit-narrowing.shared.js +27 -0
  575. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  576. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts +2 -0
  577. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  578. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js +3 -0
  579. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  580. package/dist/esm/organizations/organization-units.shared.schemas.d.ts +17 -5
  581. package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
  582. package/dist/esm/organizations/organization-units.shared.schemas.js +65 -5
  583. package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
  584. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts +51 -7
  585. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  586. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +151 -7
  587. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  588. package/dist/esm/organizations/organizations.shared.schemas.d.ts +18 -83
  589. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  590. package/dist/esm/organizations/organizations.shared.schemas.js +37 -19
  591. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  592. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  593. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  594. package/dist/esm/provider-registration-runtime.exports.d.ts +1 -0
  595. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  596. package/dist/esm/provider-registration-runtime.exports.js +1 -0
  597. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  598. package/dist/esm/public-runtime/index.d.ts +39 -10
  599. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  600. package/dist/esm/public-runtime/index.js +39 -10
  601. package/dist/esm/public-runtime/index.js.map +1 -1
  602. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts +7 -8
  603. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  604. package/dist/esm/queue/jobs.shared.resources-config.schemas.js +30 -6
  605. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  606. package/dist/esm/queue/jobs.shared.schemas.d.ts +388 -2
  607. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  608. package/dist/esm/queue/jobs.shared.schemas.js +315 -11
  609. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  610. package/dist/esm/queue/jobs.shared.utils.d.ts +6 -4
  611. package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
  612. package/dist/esm/queue/jobs.shared.utils.js +5 -4
  613. package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
  614. package/dist/esm/queue/queues.shared.schemas.d.ts +20 -8
  615. package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
  616. package/dist/esm/queue/queues.shared.schemas.js +23 -18
  617. package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
  618. package/dist/esm/queue/queues.shared.utils.d.ts +4 -2
  619. package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
  620. package/dist/esm/queue/queues.shared.utils.js +4 -2
  621. package/dist/esm/queue/queues.shared.utils.js.map +1 -1
  622. package/dist/esm/rag/rag-retrieval-health.shared.d.ts +27 -0
  623. package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -0
  624. package/dist/esm/rag/rag-retrieval-health.shared.js +29 -0
  625. package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -0
  626. package/dist/esm/requests/header-keys.shared.d.ts +6 -0
  627. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  628. package/dist/esm/requests/header-keys.shared.js +7 -0
  629. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  630. package/dist/esm/requests/idempotency-key.shared.d.ts +76 -0
  631. package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -0
  632. package/dist/esm/requests/idempotency-key.shared.js +112 -0
  633. package/dist/esm/requests/idempotency-key.shared.js.map +1 -0
  634. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  635. package/dist/esm/requests/manual-controllers-routes-documentation.js +218 -17
  636. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  637. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +87 -0
  638. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  639. package/dist/esm/requests/manual-controllers-routes-urls.js +102 -0
  640. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  641. package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
  642. package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
  643. package/dist/esm/requests/websocket.shared.schemas.d.ts +200 -24
  644. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  645. package/dist/esm/requests/websocket.shared.schemas.js +219 -5
  646. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  647. package/dist/esm/resources/child-operations.shared.schemas.d.ts +56 -5
  648. package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
  649. package/dist/esm/resources/child-operations.shared.schemas.js +97 -5
  650. package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
  651. package/dist/esm/resources/context-policy.shared.schemas.d.ts +20 -0
  652. package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
  653. package/dist/esm/resources/context-policy.shared.schemas.js +3 -0
  654. package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
  655. package/dist/esm/resources/relationship-display.shared.schemas.d.ts.map +1 -1
  656. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  657. package/dist/esm/resources/resources-config.shared.factory.js +498 -29
  658. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  659. package/dist/esm/resources/resources-config.shared.schemas.d.ts +623 -45
  660. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  661. package/dist/esm/resources/resources-config.shared.schemas.js +315 -22
  662. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  663. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  664. package/dist/esm/resources/resources-registry.shared.core.definitions.js +377 -69
  665. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  666. package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
  667. package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
  668. package/dist/esm/resources/resources-serialization.shared.schemas.d.ts.map +1 -1
  669. package/dist/esm/resources/resources.shared.core.definitions.d.ts +19 -0
  670. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  671. package/dist/esm/resources/resources.shared.core.definitions.js +28 -0
  672. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  673. package/dist/esm/resources/resources.shared.schemas.d.ts +256 -10
  674. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  675. package/dist/esm/resources/resources.shared.schemas.js +209 -9
  676. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  677. package/dist/esm/resources/resources.shared.utils.d.ts +3 -2
  678. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  679. package/dist/esm/resources/resources.shared.utils.js +38 -6
  680. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  681. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
  682. package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts +44 -12
  683. package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
  684. package/dist/esm/resources/utils/composition-cascade-deletability.validation.js +46 -23
  685. package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
  686. package/dist/esm/resources/utils/composition-seedability.validation.d.ts.map +1 -1
  687. package/dist/esm/resources/utils/context-addressed-composition-singleton.shared.utils.d.ts.map +1 -1
  688. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts +61 -0
  689. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -0
  690. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js +79 -0
  691. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -0
  692. package/dist/esm/resources/utils/duplicate-relationship-registration.validation.d.ts.map +1 -1
  693. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -1
  694. package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -1
  695. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts +60 -0
  696. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -0
  697. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js +80 -0
  698. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -0
  699. package/dist/esm/resources/utils/persistence-adapter-discrimination.shared.utils.d.ts.map +1 -1
  700. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts +21 -0
  701. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -0
  702. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js +159 -0
  703. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -0
  704. package/dist/esm/resources/utils/repository-dto-builder.utils.d.ts.map +1 -1
  705. package/dist/esm/resources/utils/required-fk-fillability.validation.d.ts.map +1 -1
  706. package/dist/esm/resources/utils/resource-operation-type-guards.utils.d.ts.map +1 -1
  707. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
  708. package/dist/esm/resources/utils/resource-polymorphism.relationships.d.ts.map +1 -1
  709. package/dist/esm/resources/utils/resource-polymorphism.schemas.d.ts.map +1 -1
  710. package/dist/esm/resources/utils/resource-polymorphism.utils.d.ts.map +1 -1
  711. package/dist/esm/resources/utils/resource-subtree.utils.d.ts.map +1 -1
  712. package/dist/esm/resources/utils/resources-config-context-needs.utils.d.ts.map +1 -1
  713. package/dist/esm/resources/utils/resources-config-naming.utils.d.ts +15 -0
  714. package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
  715. package/dist/esm/resources/utils/resources-config-naming.utils.js +56 -11
  716. package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
  717. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +51 -1
  718. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  719. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +210 -51
  720. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  721. package/dist/esm/resources/utils/resources-config-operations.path.utils.d.ts.map +1 -1
  722. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts +34 -0
  723. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
  724. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js +45 -1
  725. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
  726. package/dist/esm/resources/utils/resources-config-operations.utils.d.ts.map +1 -1
  727. package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
  728. package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
  729. package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
  730. package/dist/esm/resources/utils/schema-family-builder.utils.d.ts.map +1 -1
  731. package/dist/esm/resources/utils/schema-type-inference.utils.d.ts.map +1 -1
  732. package/dist/esm/resources/utils/schema-type-utils.d.ts.map +1 -1
  733. package/dist/esm/resources/utils/schema-variant-resolver.utils.d.ts.map +1 -1
  734. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts +29 -0
  735. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  736. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +30 -0
  737. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  738. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
  739. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js +49 -11
  740. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
  741. package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
  742. package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
  743. package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
  744. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  745. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +4 -1
  746. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  747. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  748. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +4 -1
  749. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  750. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
  751. package/dist/esm/security/authentications/anonymous-session/anonymous-session.shared.contract.d.ts.map +1 -1
  752. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +128 -16
  753. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  754. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +160 -6
  755. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  756. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +324 -9
  757. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  758. package/dist/esm/security/authentications/authentication.shared.schemas.js +411 -8
  759. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  760. package/dist/esm/security/authentications/authentication.shared.utils.d.ts +87 -4
  761. package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
  762. package/dist/esm/security/authentications/authentication.shared.utils.js +95 -6
  763. package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
  764. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +23 -1
  765. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
  766. package/dist/esm/security/authentications/consumable-token.shared.schemas.js +23 -1
  767. package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
  768. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts +7 -1
  769. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
  770. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js +7 -1
  771. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
  772. package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts +74 -0
  773. package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -0
  774. package/dist/esm/security/authentications/password-blocklist.shared.utils.js +122 -0
  775. package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -0
  776. package/dist/esm/security/authentications/password-reset.shared.dto.schemas.d.ts.map +1 -1
  777. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts +88 -2
  778. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  779. package/dist/esm/security/authentications/registration.shared.dto.schemas.js +149 -2
  780. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  781. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts +57 -11
  782. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
  783. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js +44 -11
  784. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  785. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  786. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js +20 -7
  787. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  788. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +16 -2
  789. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  790. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +32 -2
  791. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  792. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
  793. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js +7 -1
  794. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  795. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
  796. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  797. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js +4 -1
  798. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  799. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.schemas.d.ts.map +1 -1
  800. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts +27 -0
  801. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -0
  802. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js +109 -0
  803. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -0
  804. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts +66 -0
  805. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -0
  806. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js +107 -0
  807. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -0
  808. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -1
  809. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -1
  810. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts +19 -0
  811. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
  812. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js +50 -13
  813. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
  814. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts +18 -6
  815. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
  816. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js +133 -4
  817. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  818. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts +26 -0
  819. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  820. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +46 -17
  821. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  822. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts +0 -40
  823. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  824. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +100 -26
  825. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  826. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts +9 -1
  827. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  828. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js +9 -1
  829. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  830. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +6 -2
  831. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  832. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +76 -4
  833. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  834. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts +5 -4
  835. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  836. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js +5 -4
  837. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  838. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts +4 -0
  839. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  840. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js +8 -0
  841. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
  842. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts +44 -0
  843. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -1
  844. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js +52 -0
  845. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -1
  846. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  847. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  848. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  849. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  850. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  851. package/dist/esm/security/authorizations/roles.shared.defaults.js +6 -0
  852. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  853. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +14 -0
  854. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  855. package/dist/esm/security/authorizations/roles.shared.schemas.js +19 -0
  856. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  857. package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
  858. package/dist/esm/security/authorizations/roles.shared.utils.js +2 -0
  859. package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
  860. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +4 -1
  861. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  862. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
  863. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +5 -2
  864. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  865. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +13 -42
  866. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  867. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +201 -14
  868. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  869. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +237 -49
  870. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  871. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts +6 -3
  872. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  873. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +74 -4
  874. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  875. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +5 -2
  876. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  877. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +105 -3
  878. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  879. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  880. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  881. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
  882. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
  883. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
  884. package/dist/esm/security/oauth-clients/oauth-resource-server.shared.schemas.d.ts.map +1 -1
  885. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts +67 -0
  886. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -0
  887. package/dist/esm/security/outbound-target-control.shared.schemas.js +69 -0
  888. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -0
  889. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts +159 -0
  890. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -0
  891. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js +164 -0
  892. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -0
  893. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts +209 -0
  894. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -0
  895. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js +150 -0
  896. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -0
  897. package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts +79 -0
  898. package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -0
  899. package/dist/esm/systems-of-record/system-of-record-env.shared.js +116 -0
  900. package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -0
  901. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts +145 -0
  902. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -0
  903. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js +146 -0
  904. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -0
  905. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts +478 -0
  906. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -0
  907. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js +619 -0
  908. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -0
  909. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts +31 -0
  910. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -0
  911. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js +232 -0
  912. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -0
  913. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts +127 -0
  914. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -0
  915. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js +204 -0
  916. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -0
  917. package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
  918. package/dist/esm/testing/resource-config-builders.js +10 -4
  919. package/dist/esm/testing/resource-config-builders.js.map +1 -1
  920. package/dist/esm/testing.d.ts.map +1 -1
  921. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts +2 -1
  922. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
  923. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js +2 -1
  924. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
  925. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts +139 -24
  926. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  927. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js +255 -0
  928. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  929. package/dist/esm/users/anonymous-users.shared.schema.d.ts +5 -3
  930. package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
  931. package/dist/esm/users/anonymous-users.shared.schema.js +18 -1
  932. package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
  933. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +2 -1
  934. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  935. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +23 -0
  936. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  937. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts +2 -1
  938. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
  939. package/dist/esm/users/user-consent-decision.shared.utils.d.ts +127 -0
  940. package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -0
  941. package/dist/esm/users/user-consent-decision.shared.utils.js +189 -0
  942. package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -0
  943. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
  944. package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
  945. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts +1 -0
  946. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
  947. package/dist/esm/users/user-identity-links.shared.schemas.d.ts +1 -0
  948. package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
  949. package/dist/esm/users/user-identity-links.shared.schemas.js +30 -0
  950. package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
  951. package/dist/esm/users/user-preferences-reset.shared.utils.d.ts +6 -6
  952. package/dist/esm/users/user-preferences-reset.shared.utils.d.ts.map +1 -1
  953. package/dist/esm/users/user-preferences-reset.shared.utils.js +6 -6
  954. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  955. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +74 -29
  956. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  957. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js +99 -0
  958. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
  959. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  960. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js +25 -9
  961. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
  962. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +4 -4
  963. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  964. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js +12 -1
  965. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
  966. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  967. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts +1 -0
  968. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  969. package/dist/esm/users/user-self.shared.resources-config.schemas.js +2 -2
  970. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  971. package/dist/esm/users/users.shared.resources-config.schemas.d.ts +1 -0
  972. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  973. package/dist/esm/users/users.shared.resources-config.schemas.js +2 -2
  974. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  975. package/dist/esm/users/users.shared.schemas.d.ts +11 -9
  976. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  977. package/dist/esm/users/users.shared.schemas.js +68 -9
  978. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  979. package/dist/tsconfig.build.tsbuildinfo +1 -1
  980. package/package.json +14 -35
  981. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.d.ts +0 -19
  982. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.d.ts.map +0 -1
  983. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.js +0 -35
  984. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.js.map +0 -1
  985. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts +0 -213
  986. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts.map +0 -1
  987. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.js +0 -287
  988. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.js.map +0 -1
  989. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.d.ts +0 -236
  990. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.d.ts.map +0 -1
  991. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.js +0 -212
  992. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.js.map +0 -1
  993. package/dist/esm/flows-actors/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +0 -1
  994. package/dist/esm/flows-actors/meta-workflows/actions.meta-workflows.shared.schemas.js.map +0 -1
  995. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts +0 -17
  996. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts.map +0 -1
  997. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js +0 -31
  998. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js.map +0 -1
  999. package/dist/esm/flows-actors/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +0 -1
  1000. package/dist/esm/flows-actors/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +0 -1
  1001. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +0 -1
  1002. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +0 -1
  1003. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.d.ts +0 -28
  1004. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.d.ts.map +0 -1
  1005. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.js +0 -28
  1006. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.js.map +0 -1
  1007. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +0 -1
  1008. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +0 -1
  1009. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts +0 -100
  1010. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts.map +0 -1
  1011. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js +0 -232
  1012. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js.map +0 -1
  1013. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.d.ts +0 -29
  1014. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.d.ts.map +0 -1
  1015. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.js +0 -58
  1016. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.js.map +0 -1
  1017. package/dist/esm/flows-actors/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +0 -1
  1018. package/dist/esm/flows-actors/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +0 -1
  1019. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.d.ts +0 -81
  1020. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.d.ts.map +0 -1
  1021. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.js +0 -82
  1022. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.js.map +0 -1
  1023. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.d.ts +0 -2
  1024. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.d.ts.map +0 -1
  1025. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.js +0 -1
  1026. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.js.map +0 -1
  1027. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/actions.meta-workflows.shared.schemas.d.ts +0 -0
  1028. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/actions.meta-workflows.shared.schemas.js +0 -0
  1029. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/catalog.meta-workflows.shared.schemas.d.ts +0 -0
  1030. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/catalog.meta-workflows.shared.schemas.js +0 -0
  1031. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/context-selection.meta-workflows.shared.schemas.d.ts +0 -0
  1032. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/context-selection.meta-workflows.shared.schemas.js +0 -0
@@ -24,7 +24,8 @@
24
24
  *
25
25
  * `secretValue` holds an AES-256-GCM envelope, never the plaintext an operator typed. The seal is
26
26
  * applied on the way in and opened only by the resolver — see
27
- * `provider-credential-envelope.backend.utils.ts` for the envelope and its key derivation. The
27
+ * `provider-credential-envelope.backend.utils.ts` for its key domains and binding, over the shared
28
+ * `bound-secret-envelope` core that does the sealing (#366). The
28
29
  * schema cannot enforce that (a string is a string), so the write path is what guarantees it and
29
30
  * the pins are what keep it guaranteed.
30
31
  */
@@ -47,17 +48,59 @@ export var ProviderCredentialValidationState;
47
48
  ProviderCredentialValidationState["INVALID"] = "invalid";
48
49
  })(ProviderCredentialValidationState || (ProviderCredentialValidationState = {}));
49
50
  /**
50
- * The organization's credential for one (provider, secret slug) pair.
51
+ * Why a write door refused to store a credential VALUE under the slot it named — the stable,
52
+ * client-branchable `code` every door carries (#624).
51
53
  *
52
- * ## The scope identifier is TOP-LEVEL and stays that way
54
+ * A stored row is keyed `(owner, providerRef, secretSlug)` on the provider's secrets-contract KEY, and
55
+ * every reader asks for that key. A value written under any other name is a secret nothing can ever
56
+ * read, and before these refusals the write reported success — which is how a regenerated provider,
57
+ * a free-text slug or a test script produced rows that looked connected and resolved as absent.
53
58
  *
54
- * `organizationId` is the only `organizationId`-named path in this schema, and nothing nested may
55
- * ever be named `organizationId` or `userId`. `buildContextualFilter` injects the scope FK by
56
- * matching that field name at EVERY schema path, so a nested key of the same name adds a phantom
57
- * exact-subdocument clause and the scoped read silently matches zero rows — a credential that
58
- * exists and cannot be resolved, which reads exactly like a credential that was never set.
59
- * `setByUserId` is deliberately spelled so it cannot be caught by that matcher.
59
+ * The member values are the wire codes the connect leg already answered with, so one vocabulary
60
+ * serves the connect leg, the resource's own CREATE / UPDATE doors and any client that branches.
60
61
  */
62
+ export var ProviderCredentialSlotWriteRefusal;
63
+ (function (ProviderCredentialSlotWriteRefusal) {
64
+ /**
65
+ * The provider's current secrets contract declares no slot by that name — under either of a slot's
66
+ * two names. Also the answer for a provider that is not registered at all, and for ROTATING a value
67
+ * into an existing row whose stored name is not a contract KEY — a retired name, or a spelling no
68
+ * reader asks for: a fresh secret sealed there is as unreadable as the old one.
69
+ */
70
+ ProviderCredentialSlotWriteRefusal["SECRET_SLUG_NOT_DECLARED"] = "SECRET_SLUG_NOT_DECLARED";
71
+ /**
72
+ * The slot exists but holds the APPLICATION's own registration (an OAuth2 client id or secret),
73
+ * which is authored in the deployment environment and never read from a credential row.
74
+ */
75
+ ProviderCredentialSlotWriteRefusal["SECRET_SLUG_NOT_A_CREDENTIAL"] = "SECRET_SLUG_NOT_A_CREDENTIAL";
76
+ /**
77
+ * An UPDATE named a different `providerRef` or `secretSlug` for an existing row. The sealed value is
78
+ * bound to both, so a row cannot move: a credential for another slot is a new row, and the old one is
79
+ * deleted.
80
+ */
81
+ ProviderCredentialSlotWriteRefusal["CREDENTIAL_SLOT_IMMUTABLE"] = "CREDENTIAL_SLOT_IMMUTABLE";
82
+ })(ProviderCredentialSlotWriteRefusal || (ProviderCredentialSlotWriteRefusal = {}));
83
+ /**
84
+ * How one connection fact got onto a credential row (#333, #1047). The distinction is what decides who may
85
+ * change it: an answer changes only when the person reconnects, a vendor report whenever the vendor
86
+ * reports it again.
87
+ */
88
+ export var ProviderConnectionFactProvenance;
89
+ (function (ProviderConnectionFactProvenance) {
90
+ /**
91
+ * Typed by the person connecting, for an endpoint or scope `{placeholder}` at the OAuth2 start — or, for a
92
+ * vendor whose credential is PASTED, for a `{placeholder}` of the REST base URL at the typed-credential store
93
+ * (#1097). Replaced only by reconnecting or re-entering the credential.
94
+ */
95
+ ProviderConnectionFactProvenance["ANSWERED_AT_CONNECT"] = "ANSWERED_AT_CONNECT";
96
+ /** Reported by the vendor in its token answer, at the authorization or at a refresh. A refresh may move it. */
97
+ ProviderConnectionFactProvenance["REPORTED_BY_VENDOR"] = "REPORTED_BY_VENDOR";
98
+ })(ProviderConnectionFactProvenance || (ProviderConnectionFactProvenance = {}));
99
+ /** One value in a credential row's `connectionFacts`. */
100
+ export const ProviderConnectionFactSchema = z.strictObject({
101
+ value: z.string(),
102
+ provenance: z.enum(ProviderConnectionFactProvenance),
103
+ });
61
104
  /**
62
105
  * WHERE a resolved provider secret came from.
63
106
  *
@@ -88,7 +131,73 @@ export var ProviderCredentialResolutionSource;
88
131
  */
89
132
  ProviderCredentialResolutionSource["USER_CREDENTIAL"] = "user_credential";
90
133
  })(ProviderCredentialResolutionSource || (ProviderCredentialResolutionSource = {}));
91
- /** Why a credential row stopped existing. */
134
+ /**
135
+ * What telling the VENDOR achieved when a credential was removed (#545).
136
+ *
137
+ * A separate axis from {@link ProviderCredentialDeletionReason} on purpose: that one says why OUR
138
+ * COPY stopped existing, this one says whether the authorization itself was withdrawn where it
139
+ * lives. They were one question for as long as the answer was always "it was not".
140
+ *
141
+ * Every member is EVIDENCE, and none of them is control flow — the local delete proceeds whatever
142
+ * this says, because a vendor being unreachable must not stop somebody disconnecting.
143
+ */
144
+ export var ProviderOAuth2RevocationOutcome;
145
+ (function (ProviderOAuth2RevocationOutcome) {
146
+ /**
147
+ * The vendor answered 200.
148
+ *
149
+ * Under RFC 7009 that also covers a token the server did not recognise, which is the intended
150
+ * reading: the grant is gone either way.
151
+ * spec-cite: RFC 7009 §2.2 — *"The authorization server responds with HTTP status code 200 if the
152
+ * token has been revoked successfully or if the client submitted an invalid token"*.
153
+ */
154
+ ProviderOAuth2RevocationOutcome["REVOKED"] = "revoked";
155
+ /**
156
+ * Nothing was sent, and that is the ordinary case rather than a failure.
157
+ *
158
+ * Three situations share this member because they are one fact from the person's side — the vendor
159
+ * was not told: the provider declares no `rfc7009RevocationUrl`; the credential was a PASTED
160
+ * long-lived key rather than a grant, so there is nothing to revoke; or the grant carried no token.
161
+ */
162
+ ProviderOAuth2RevocationOutcome["NOT_DECLARED"] = "not_declared";
163
+ /** The application's own client registration for this vendor is unset, so nothing could be sent. */
164
+ ProviderOAuth2RevocationOutcome["NOT_CONFIGURED"] = "not_configured";
165
+ /** The endpoint could not be reached, or did not answer within the deadline. */
166
+ ProviderOAuth2RevocationOutcome["UNREACHABLE"] = "unreachable";
167
+ /** The endpoint answered, and not with 200. */
168
+ ProviderOAuth2RevocationOutcome["REFUSED"] = "refused";
169
+ })(ProviderOAuth2RevocationOutcome || (ProviderOAuth2RevocationOutcome = {}));
170
+ /** The wire values of {@link ProviderOAuth2RevocationOutcome}, for a Zod enum over them. */
171
+ export const ProviderOAuth2RevocationOutcomeValues = ProviderOAuth2RevocationOutcome;
172
+ /**
173
+ * Why a credential row stopped existing.
174
+ *
175
+ * ## Every member describes OUR COPY; whether the VENDOR was told is a SECOND axis (#545)
176
+ *
177
+ * Removing a credential deletes the token Wildo holds. Until 2026-09-18 it also did nothing else,
178
+ * so the GRANT survived at the vendor: the person's connected-accounts screen showed the application
179
+ * gone while Asana or Google still listed it as authorized, and a stored refresh token remained
180
+ * valid until it expired on the vendor's schedule — which, for a refresh token, is frequently never.
181
+ *
182
+ * That is stated HERE because this vocabulary is what an operator points at when asked whether an
183
+ * erasure reached someone's third-party credentials, and silence on a compliance surface reads as
184
+ * "done".
185
+ *
186
+ * **It is no longer silent.** Both deletion events now carry
187
+ * {@link ProviderOAuth2RevocationOutcome}, so the trail answers the vendor question separately from
188
+ * the local one. What that outcome can SAY still depends on the vendor: RFC 7009 is the only
189
+ * revocation standard and the vendors do not agree with it, so `google-drive` and `asana` declare an
190
+ * endpoint and are told, while Slack's `auth.revoke` (a Web API method) and GitHub's
191
+ * `DELETE /applications/{client_id}/token` (basic auth, JSON body) are not expressible as one and
192
+ * record `not_declared` rather than implying they were reached.
193
+ *
194
+ * An earlier revision of this block argued the mechanism should NOT be built, because *"no
195
+ * admissible provider declares one today, so the field would ship inert"*. That was true when it was
196
+ * written and stopped being true when `google-drive` gained an admissible USER connection: Google's
197
+ * `https://oauth2.googleapis.com/revoke` is RFC 7009-conformant, so the mechanism has a reachable
198
+ * user and a proven vendor. Kept as history rather than deleted, because the reasoning was sound and
199
+ * the thing that changed was the world, not the argument.
200
+ */
92
201
  export var ProviderCredentialDeletionReason;
93
202
  (function (ProviderCredentialDeletionReason) {
94
203
  /** An administrator of the owning tenant removed it. */
@@ -103,8 +212,36 @@ export var ProviderCredentialDeletionReason;
103
212
  * Distinct from `ORGANIZATION_PURGED` because this one is EVIDENCE: it is what an operator points
104
213
  * at when asked whether a subject-erasure request reached the person's third-party credentials.
105
214
  * Collapsing the two into a generic "cascade" would make that question unanswerable from the trail.
215
+ *
216
+ * **Who sets it:** the cascade observer, for a cascade declaring itself a `SUBJECT_ERASURE`. The record
217
+ * carries `deletedBy` = whoever EXECUTED the erasure (a person's id when one was carried on the erasure's
218
+ * context, else the `SYSTEM` sentinel), so the erased person is the record's SUBJECT and never its actor
219
+ * (#1088).
106
220
  */
107
221
  ProviderCredentialDeletionReason["USER_ERASED"] = "user_erased";
222
+ /**
223
+ * The owning user ROW was deleted outright and the composition cascade destroyed the credential with it (#1016).
224
+ *
225
+ * **Who sets it:** the user-credential parent-cascade removal observer
226
+ * (`registerUserProviderCredentialCascadeEvidence`), for a cascade that declares its cause as an ordinary parent
227
+ * delete of the `users` row. Two doors reach it today: an administrator's hard `DELETE` (`deletedBy` is that
228
+ * administrator), and the organization-member invitation sweep reaping an orphaned pending user under an internal
229
+ * context (`deletedBy` is the `SYSTEM` sentinel). The record carries `deletedBy`, resolved from the deleting
230
+ * execution context, so it names the principal who deleted the account rather than the person whose credential
231
+ * it was.
232
+ *
233
+ * **Distinct from `USER_ERASED`**, and the distinction is the reason this member exists: an erasure answers a
234
+ * data-subject request, keeps the person's row scrubbed and is evidence that the request reached their third-party
235
+ * credentials. A deletion asserts no such request. Recording it as `USER_ERASED` would forge erasure evidence;
236
+ * recording nothing left an account deletion that destroyed OAuth grants and API keys with no row naming them.
237
+ *
238
+ * **Distinct from `ORGANIZATION_PURGED`**: that is a tenant teardown removing the ORGANIZATION's credentials. This
239
+ * removes one PERSON's own credentials, which no organization owns.
240
+ *
241
+ * Named for what happened to the owner, not for who did it: the cascade cannot tell an administrator's delete from
242
+ * any other deletion of the row, and `deletedBy` is where the actor is stated.
243
+ */
244
+ ProviderCredentialDeletionReason["USER_DELETED"] = "user_deleted";
108
245
  })(ProviderCredentialDeletionReason || (ProviderCredentialDeletionReason = {}));
109
246
  /**
110
247
  * The fields that IDENTIFY a credential within its tenant.
@@ -118,6 +255,18 @@ export const ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [
118
255
  'providerRef',
119
256
  'secretSlug',
120
257
  ];
258
+ /**
259
+ * The organization's credential for one (provider, secret slug) pair.
260
+ *
261
+ * ## The scope identifier is TOP-LEVEL and stays that way
262
+ *
263
+ * `organizationId` is the only `organizationId`-named path in this schema, and nothing nested may
264
+ * ever be named `organizationId` or `userId`. `buildContextualFilter` injects the scope FK by
265
+ * matching that field name at EVERY schema path, so a nested key of the same name adds a phantom
266
+ * exact-subdocument clause and the scoped read silently matches zero rows — a credential that
267
+ * exists and cannot be resolved, which reads exactly like a credential that was never set.
268
+ * `setByUserId` is deliberately spelled so it cannot be caught by that matcher.
269
+ */
121
270
  export const OrganizationProviderCredentialSchema = z.object({
122
271
  _id: z.string().min(1).isPrimaryKey().isSummaryField(),
123
272
  /**
@@ -134,10 +283,13 @@ export const OrganizationProviderCredentialSchema = z.object({
134
283
  */
135
284
  providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),
136
285
  /**
137
- * The slug in the provider's `secretsContract` that this value satisfies — the same identifier
138
- * the deployment's env projection carries, so the two resolution places name the same thing.
139
- * Immutable: re-pointing a stored secret at a different slug would silently hand one vendor
140
- * credential to a different vendor field.
286
+ * The provider's `secretsContract` KEY this value satisfies (`accessToken`, `clientSecret`) —
287
+ * NOT the slot's env-var spelling (`ASANA_ACCESS_TOKEN`), which is what the deployment's env
288
+ * projection carries and what a provider regeneration may rename. The two resolution places name
289
+ * the same SLOT by different names, and only the key is stable enough to key a durable row on
290
+ * (#624). Immutable: re-pointing a stored secret at a different slug would silently hand one vendor
291
+ * credential to a different vendor field — and the sealed value binds the slug, so a row stored
292
+ * under a name the provider no longer declares cannot be renamed, only replaced by reconnecting.
141
293
  */
142
294
  secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),
143
295
  /**
@@ -187,26 +339,28 @@ export const OrganizationProviderCredentialSchema = z.object({
187
339
  secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),
188
340
  /** Free-text operator note. Never a place for the value; enforced by the write-path pins. */
189
341
  /**
190
- * Answers for the `{placeholder}` holes this provider's OAuth2 endpoints carry — which cloud,
191
- * which directory, which region.
342
+ * Every fact about the connected ACCOUNT, each value carrying how it got here — see
343
+ * {@link ProviderConnectionFactProvenance} (#333, #1047).
192
344
  *
193
- * On the ROW rather than only in the connect flow, because a REFRESH needs them again. The
194
- * authorization record that held them lives ten minutes; the token it produced is renewed for as
195
- * long as the connection lasts, and a templated token URL is still templated an hour later.
196
- * Without them here, every one of the 21 vendors whose endpoints carry a placeholder — Microsoft,
197
- * Azure, and everything regional — would connect successfully and then fail its first renewal with
198
- * `needs a value for 'cloud'`: the exact failure the placeholder machinery exists to prevent, one
199
- * layer up.
345
+ * ONE record for two sources, by decision: the answers a person typed for the endpoints'
346
+ * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for
347
+ * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor
348
+ * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's
349
+ * `api_domain`). Two records would let an operation read one and a refresh update the other.
200
350
  *
201
- * NOT secret, and deliberately client-readable: a tenant id is an identifier a person needs to see
202
- * to recognise which account they connected. The secret half is the grant, and it is sealed.
351
+ * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a
352
+ * templated token URL is still templated an hour later — and every CALL needs a reported origin.
203
353
  *
204
- * `.excludeFromUpdate()` — chosen at connect time, and they describe the ACCOUNT the grant is for.
205
- * Changing them under a live grant would point the refresh at a different directory than the one
206
- * that issued the token, failing at the vendor with nothing local explaining why. Reconnecting is
207
- * the honest way to change them.
354
+ * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person
355
+ * recognises which account they connected. The secret half is the grant, and it is sealed.
356
+ *
357
+ * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds
358
+ * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would
359
+ * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES
360
+ * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them
361
+ * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.
208
362
  */
209
- connectionParameters: z.record(z.string(), z.string()).optional().excludeFromUpdate(),
363
+ connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),
210
364
  description: z.string().max(500).optional(),
211
365
  createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),
212
366
  updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),
@@ -278,9 +432,9 @@ export const UserProviderCredentialSchema = z.object({
278
432
  userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),
279
433
  /** As the organization-owned sibling: an OPEN string, because the provider set is not closed. */
280
434
  providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),
281
- /** The slug in the provider's `secretsContract` this value satisfies. Immutable, for the same
282
- * reason as the sibling: re-pointing a stored secret at a different slug would hand one vendor
283
- * credential to a different vendor field. */
435
+ /** The provider's `secretsContract` KEY this value satisfies — never the env-var spelling, as the
436
+ * sibling explains (#624). Immutable, for the same reason as the sibling: re-pointing a stored secret
437
+ * at a different slug would hand one vendor credential to a different vendor field. */
284
438
  secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),
285
439
  /**
286
440
  * The credential, SEALED — an AES-256-GCM envelope bound to this row's identity, never plaintext.
@@ -305,26 +459,28 @@ export const UserProviderCredentialSchema = z.object({
305
459
  secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),
306
460
  /** The holder's own note. Never a place for the value; enforced by the write-path pins. */
307
461
  /**
308
- * Answers for the `{placeholder}` holes this provider's OAuth2 endpoints carry — which cloud,
309
- * which directory, which region.
462
+ * Every fact about the connected ACCOUNT, each value carrying how it got here — see
463
+ * {@link ProviderConnectionFactProvenance} (#333, #1047).
464
+ *
465
+ * ONE record for two sources, by decision: the answers a person typed for the endpoints'
466
+ * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for
467
+ * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor
468
+ * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's
469
+ * `api_domain`). Two records would let an operation read one and a refresh update the other.
310
470
  *
311
- * On the ROW rather than only in the connect flow, because a REFRESH needs them again. The
312
- * authorization record that held them lives ten minutes; the token it produced is renewed for as
313
- * long as the connection lasts, and a templated token URL is still templated an hour later.
314
- * Without them here, every one of the 21 vendors whose endpoints carry a placeholder — Microsoft,
315
- * Azure, and everything regional — would connect successfully and then fail its first renewal with
316
- * `needs a value for 'cloud'`: the exact failure the placeholder machinery exists to prevent, one
317
- * layer up.
471
+ * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a
472
+ * templated token URL is still templated an hour later — and every CALL needs a reported origin.
318
473
  *
319
- * NOT secret, and deliberately client-readable: a tenant id is an identifier a person needs to see
320
- * to recognise which account they connected. The secret half is the grant, and it is sealed.
474
+ * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person
475
+ * recognises which account they connected. The secret half is the grant, and it is sealed.
321
476
  *
322
- * `.excludeFromUpdate()` — chosen at connect time, and they describe the ACCOUNT the grant is for.
323
- * Changing them under a live grant would point the refresh at a different directory than the one
324
- * that issued the token, failing at the vendor with nothing local explaining why. Reconnecting is
325
- * the honest way to change them.
477
+ * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds
478
+ * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would
479
+ * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES
480
+ * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them
481
+ * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.
326
482
  */
327
- connectionParameters: z.record(z.string(), z.string()).optional().excludeFromUpdate(),
483
+ connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),
328
484
  description: z.string().max(500).optional(),
329
485
  createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),
330
486
  updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),
@@ -413,6 +569,38 @@ export var ProviderConnectabilityBlocker;
413
569
  * connectable and the gap is ours.
414
570
  */
415
571
  ProviderConnectabilityBlocker["APPLICATION_NOT_REGISTERED"] = "application-not-registered";
572
+ /**
573
+ * An OAuth2 endpoint's HOST or ORIGIN — or the origin a SCOPE names (`{hostUrl}/.default`, #991) — is a
574
+ * placeholder the provider declares no allowance for, so no value can ever be admitted there (#623):
575
+ * the token endpoint receives the application's client secret, and a host is never taken from what
576
+ * somebody types. Nobody connecting can fix it; the provider needs a recorded host allowance.
577
+ */
578
+ ProviderConnectabilityBlocker["ENDPOINT_HOST_NOT_DECLARED"] = "endpoint-host-not-declared";
579
+ /**
580
+ * The provider's OAuth2 endpoint definition cannot be resolved safely whatever is supplied — a
581
+ * malformed template, an unresolved source expression, or an allowance that cannot apply where its
582
+ * placeholder sits. A provider-definition defect, not a deployment or account gap.
583
+ */
584
+ ProviderConnectabilityBlocker["ENDPOINT_DEFINITION_INVALID"] = "endpoint-definition-invalid";
585
+ /**
586
+ * The provider's OAuth2 origin is filled from this DEPLOYMENT's configured base URL (a self-hosted
587
+ * vendor such as Gitea), and that base URL is unset or unusable. An OPERATOR acts.
588
+ */
589
+ ProviderConnectabilityBlocker["DEPLOYMENT_BASE_URL_UNUSABLE"] = "deployment-base-url-unusable";
590
+ /**
591
+ * An OAuth2 endpoint host is filled from a deployment environment variable dedicated to it (Workday's
592
+ * `WORKDAY_AUTH_HOST` / `WORKDAY_API_HOST`, #992), and that variable is unset or not a DNS name. An
593
+ * OPERATOR acts; the variable is named in the catalogue entry's `missingRegistration`.
594
+ */
595
+ ProviderConnectabilityBlocker["DEPLOYMENT_CONFIGURED_HOST_UNUSABLE"] = "deployment-configured-host-unusable";
596
+ /**
597
+ * The vendor's credential is PASTED and its REST base URL forms its HOST or ORIGIN from a placeholder the
598
+ * provider declares no allowance for (`https://{subdomain}.vendor.com` with no `baseUrlHostAllowances`
599
+ * entry), so no answer the typed-credential store could collect is ever admitted and every call would
600
+ * refuse (#1097). Nobody connecting can fix it; the provider needs a recorded host allowance — the
601
+ * base-URL twin of `ENDPOINT_HOST_NOT_DECLARED`.
602
+ */
603
+ ProviderConnectabilityBlocker["BASE_URL_HOST_NOT_DECLARED"] = "base-url-host-not-declared";
416
604
  })(ProviderConnectabilityBlocker || (ProviderConnectabilityBlocker = {}));
417
605
  export var ProviderStoredCredentialKind;
418
606
  (function (ProviderStoredCredentialKind) {
@@ -1 +1 @@
1
- {"version":3,"file":"provider-credentials.shared.schemas.js","sourceRoot":"","sources":["../../../../src/security/connected-accounts/provider-credentials.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,iCAOX;AAPD,WAAY,iCAAiC;IAC3C,0FAA0F;IAC1F,gEAA2B,CAAA;IAC3B,gDAAgD;IAChD,oDAAe,CAAA;IACf,8EAA8E;IAC9E,wDAAmB,CAAA;AACrB,CAAC,EAPW,iCAAiC,KAAjC,iCAAiC,QAO5C;AAED;;;;;;;;;;;GAWG;AACH;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,kCAmBX;AAnBD,WAAY,kCAAkC;IAC5C,yEAAyE;IACzE,yFAAmD,CAAA;IACnD;;;OAGG;IACH,uFAAiD,CAAA;IACjD;;;;;;;;;OASG;IACH,yEAAmC,CAAA;AACrC,CAAC,EAnBW,kCAAkC,KAAlC,kCAAkC,QAmB7C;AAED,6CAA6C;AAC7C,MAAM,CAAN,IAAY,gCAeX;AAfD,WAAY,gCAAgC;IAC1C,wDAAwD;IACxD,mFAA+C,CAAA;IAC/C,iGAAiG;IACjG,+EAA2C,CAAA;IAC3C,gEAAgE;IAChE,mEAA+B,CAAA;IAC/B;;;;;;OAMG;IACH,+DAA2B,CAAA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9F,yFAAyF;cACzF,qCAAqC,CACxC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAEvD,MAAM,UAAU,+BAA+B,CAAC,KAA0B,EAAE,MAAY,IAAI,IAAI,EAAE;IAChG,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,oCAAoC,GAAG,IAAI,CAAC;AAC/E,CAAC","sourcesContent":["/**\n * Organization Provider Credentials — shared schemas.\n *\n * ## What this resource is, and what it is NOT\n *\n * It is an ORGANIZATION's OWN credential toward a third party: the Slack workspace token, the CRM\n * API key, the SMTP password that belongs to THAT tenant. The organization is the third-party\n * principal, and the credential is a service credential the tenant's administrator supplies.\n *\n * It is NOT a user's delegated OAuth grant. A delegated grant is a different object with a\n * different lifetime (a refresh loop, a revocation the USER can perform, a consent record) and it\n * lands as `connected accounts` beside this file — see issue #333. Merging the two would give one\n * row two owners and two revocation semantics.\n *\n * ## Why it has to exist\n *\n * Before this resource, every provider secret resolved from `process.env` through the\n * `SecretsContract`, so a credential was per-PROCESS and per-DEPLOYMENT. One application serving\n * many organizations therefore had ONE Slack token for all of them, and the failure was silent in\n * the worst direction: an operator sets one key and every tenant thereafter acts as the SAME\n * third-party principal, with nothing anywhere saying so.\n *\n * ## The value is sealed, and this file is where that is stated\n *\n * `secretValue` holds an AES-256-GCM envelope, never the plaintext an operator typed. The seal is\n * applied on the way in and opened only by the resolver — see\n * `provider-credential-envelope.backend.utils.ts` for the envelope and its key derivation. The\n * schema cannot enforce that (a string is a string), so the write path is what guarantees it and\n * the pins are what keep it guaranteed.\n */\n\nimport { z } from 'zod';\n\n/**\n * Whether the stored credential has been shown to work against the provider.\n *\n * A closed vocabulary rather than a boolean because \"we have never tried\" and \"we tried and it\n * failed\" are different states with different operator actions, and a boolean would merge them\n * into the same falsy answer. `UNVALIDATED` is the honest default: storing a credential proves\n * only that somebody typed one.\n */\nexport enum ProviderCredentialValidationState {\n /** Stored, never exercised against the provider. The state every credential starts in. */\n UNVALIDATED = 'unvalidated',\n /** The provider accepted it on its last use. */\n VALID = 'valid',\n /** The provider rejected it on its last use — the operator must rotate it. */\n INVALID = 'invalid',\n}\n\n/**\n * The organization's credential for one (provider, secret slug) pair.\n *\n * ## The scope identifier is TOP-LEVEL and stays that way\n *\n * `organizationId` is the only `organizationId`-named path in this schema, and nothing nested may\n * ever be named `organizationId` or `userId`. `buildContextualFilter` injects the scope FK by\n * matching that field name at EVERY schema path, so a nested key of the same name adds a phantom\n * exact-subdocument clause and the scoped read silently matches zero rows — a credential that\n * exists and cannot be resolved, which reads exactly like a credential that was never set.\n * `setByUserId` is deliberately spelled so it cannot be caught by that matcher.\n */\n/**\n * WHERE a resolved provider secret came from.\n *\n * The whole point of this slice is that the answer used to be unanswerable: every secret came from\n * `process.env`, so \"which principal did this tenant act as?\" had one answer for every tenant and\n * nothing recorded it. Making the source an explicit, closed value means an audit reader can see a\n * tenant falling back to the shared deployment credential — the exact condition the resource exists\n * to make visible — instead of having to infer it from an absence.\n */\nexport enum ProviderCredentialResolutionSource {\n /** The organization's own credential row. The tenant acted as itself. */\n ORGANIZATION_CREDENTIAL = 'organization_credential',\n /**\n * The deployment's env-projected `SecretsContract`. Legitimate — a single-tenant deployment, or a\n * provider the operator intends every tenant to share — but never silent.\n */\n DEPLOYMENT_ENVIRONMENT = 'deployment_environment',\n /**\n * A PERSON's own credential row. The application acted as that individual.\n *\n * This member has no sibling fallback, and that asymmetry is deliberate rather than an omission.\n * An organization with no credential of its own may legitimately fall through to the deployment's\n * — an operator can intend every tenant to share one integration. A person cannot: the vendor\n * attributes the act to whoever's token was spent, so acting for someone under the deployment's\n * principal would put the wrong name on the record that outlives us. A person who has connected\n * nothing gets a refusal, not a substitute.\n */\n USER_CREDENTIAL = 'user_credential',\n}\n\n/** Why a credential row stopped existing. */\nexport enum ProviderCredentialDeletionReason {\n /** An administrator of the owning tenant removed it. */\n ADMINISTRATOR_REVOKED = 'administrator_revoked',\n /** The owning organization was purged and the composition cascade removed it with the tenant. */\n ORGANIZATION_PURGED = 'organization_purged',\n /** The person whose credential it was removed it themselves. */\n OWNER_REVOKED = 'owner_revoked',\n /**\n * The owning user was erased and the composition cascade destroyed it with them.\n *\n * Distinct from `ORGANIZATION_PURGED` because this one is EVIDENCE: it is what an operator points\n * at when asked whether a subject-erasure request reached the person's third-party credentials.\n * Collapsing the two into a generic \"cascade\" would make that question unanswerable from the trail.\n */\n USER_ERASED = 'user_erased',\n}\n\n/**\n * The fields that IDENTIFY a credential within its tenant.\n *\n * One tenant holds at most one credential per (provider, slug). Exported rather than repeated so\n * the uniqueness contract, the resolver's lookup and the tests cannot drift apart — three copies\n * of a compound key is how two of them come to disagree about what identity means.\n */\nexport const ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'organizationId',\n 'providerRef',\n 'secretSlug',\n] as const;\n\nexport const OrganizationProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The tenant that owns this credential. Injected by the context machinery from the request\n * scope, never from a caller-supplied field — which is what makes the isolation structural\n * rather than a filter somebody has to remember to write.\n */\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /**\n * The provider this credential authenticates toward (`slack`, `stripe`, a generated package's\n * ref). An OPEN string, matching `ProviderRef`'s own openness — the whole point of the provider\n * work is that the set is not closed, so a closed enum here would refuse every generated\n * provider.\n */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The slug in the provider's `secretsContract` that this value satisfies — the same identifier\n * the deployment's env projection carries, so the two resolution places name the same thing.\n * Immutable: re-pointing a stored secret at a different slug would silently hand one vendor\n * credential to a different vendor field.\n */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED.\n *\n * `.isWriteOnlySecret()` is the framework's write-then-masked contract and is exactly right\n * here: the operator supplies and rotates the value, so it must stay in the CREATE/UPDATE\n * request DTO; the framework redacts it to a placeholder at the client boundary, so no read\n * ever returns it; and the backend keeps the stored content for its own resolution.\n *\n * `.isBackendOnly()` was rejected — it strips the field from the client DTO, so the operator's\n * typed value is dropped before it is ever stored and the surface silently accepts nothing.\n *\n * What is PERSISTED is the envelope, never the plaintext. The write path seals it; a value that\n * reaches persistence unsealed is a defect, not a tolerated legacy shape.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n /**\n * Whether this credential may be spent. An operator can park a credential without deleting it —\n * which matters during an incident, where deleting is not reversible and disabling is.\n */\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField(),\n\n /**\n * Why the last use failed, when it did. PROVIDER-supplied text about the CREDENTIAL's status —\n * never the credential. A resolver writing anything derived from `secretValue` here would defeat\n * every other precaution in this file, because this field IS client-readable.\n */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /**\n * WHO set it — the acting user's id, recorded for the audit trail.\n *\n * Deliberately NOT a registered `USERS` relationship. Declaring that edge would put a CREDENTIAL\n * row on the Art. 15 subject-export graph, and a credential is precisely the class of row that\n * must never reach a data subject. The id is recorded because \"who set this\" is the first\n * question of any credential incident; the edge is withheld because the answer must not travel\n * with a subject export.\n */\n setByUserId: z.string().min(1).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** Free-text operator note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Answers for the `{placeholder}` holes this provider's OAuth2 endpoints carry — which cloud,\n * which directory, which region.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs them again. The\n * authorization record that held them lives ten minutes; the token it produced is renewed for as\n * long as the connection lasts, and a templated token URL is still templated an hour later.\n * Without them here, every one of the 21 vendors whose endpoints carry a placeholder — Microsoft,\n * Azure, and everything regional — would connect successfully and then fail its first renewal with\n * `needs a value for 'cloud'`: the exact failure the placeholder machinery exists to prevent, one\n * layer up.\n *\n * NOT secret, and deliberately client-readable: a tenant id is an identifier a person needs to see\n * to recognise which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromUpdate()` — chosen at connect time, and they describe the ACCOUNT the grant is for.\n * Changing them under a live grant would point the refresh at a different directory than the one\n * that issued the token, failing at the vendor with nothing local explaining why. Reconnecting is\n * the honest way to change them.\n */\n connectionParameters: z.record(z.string(), z.string()).optional().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per tenant per (provider, slug), enforced by a compound UNIQUE index rather\n * than by a read-then-write.\n *\n * The race it closes is not academic: two administrators saving a rotated Slack token in the\n * same minute would otherwise leave two rows, and the resolver would then pick one of them\n * arbitrarily — so half the tenant's outbound calls would carry the old credential and nobody\n * could tell which half.\n *\n * No `customMessageReference`: that option exists so an integrator can tell WHICH identity a\n * duplicate violated, and this resource declares exactly one. A dedicated reference here would\n * disambiguate nothing.\n */\n .businessKeySet([...ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type OrganizationProviderCredential = z.infer<typeof OrganizationProviderCredentialSchema>;\n\n\n\n// =============================================================================\n// USER-OWNED CREDENTIALS\n// =============================================================================\n\n/**\n * The fields that IDENTIFY a credential within its OWNER.\n *\n * Exported per owner rather than shared, because the compound key differs in its first component and\n * a single constant would have to be assembled by each side — which is how two copies of a key come\n * to disagree about what identity means.\n */\nexport const USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'userId',\n 'providerRef',\n 'secretSlug',\n] as const;\n\n/**\n * A PERSON's own credential toward a third party — the key they authored for themselves.\n *\n * ## Why this is a separate resource and not a nullable column beside the organization's\n *\n * Wildo's tenancy is STRUCTURAL: the contextual filter injects the scope FK by matching a field name\n * at every schema path, so a resource belongs to exactly one primary scope. One table holding both a\n * nullable `organizationId` and a nullable `userId` would turn that structural guarantee into a\n * filter somebody has to remember to write, on the one resource where forgetting it discloses a\n * credential. Two resources, each scoped by construction, is the framework working as designed\n * rather than a duplication.\n *\n * ## Not a delegated OAuth grant, and the difference is not subtle\n *\n * This is a key the user PASTED: they hold an account with the vendor and chose to let this\n * application spend it. A delegated grant is the vendor minting a token because the user approved a\n * consent screen, and it carries a refresh loop, an expiry and a revocation the vendor also honours.\n * Merging them would give one row two lifecycles and two revocation semantics — see #333, which owns\n * the second.\n *\n * ## Only the holder may spend it\n *\n * Not an administrator of their organization, and not a platform operator. Consent to STORE a\n * personal key is not consent for somebody else to use it, and the vendor would record the act as\n * the holder's own. The authorization side of that is\n * `InitiatorMembershipConnectionTargetAuthorization`; this schema is what makes the row reachable\n * only through the owner's own scope.\n */\nexport const UserProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The person who owns this credential. Injected by the context machinery from the authenticated\n * scope, never from a caller-supplied field — the same structural isolation the organization-owned\n * sibling relies on, which is what makes \"another user's key\" unreachable rather than filtered.\n */\n userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /** As the organization-owned sibling: an OPEN string, because the provider set is not closed. */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /** The slug in the provider's `secretsContract` this value satisfies. Immutable, for the same\n * reason as the sibling: re-pointing a stored secret at a different slug would hand one vendor\n * credential to a different vendor field. */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED — an AES-256-GCM envelope bound to this row's identity, never plaintext.\n *\n * `.isWriteOnlySecret()` for the same reason as the sibling: the holder supplies and rotates it, so\n * it must survive into the CREATE/UPDATE request DTO, and the framework masks it at the client\n * boundary so no read ever returns it.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField(),\n\n /** Why the last use failed. PROVIDER text about the CREDENTIAL, never anything derived from it —\n * this field IS client-readable. */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** The holder's own note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Answers for the `{placeholder}` holes this provider's OAuth2 endpoints carry — which cloud,\n * which directory, which region.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs them again. The\n * authorization record that held them lives ten minutes; the token it produced is renewed for as\n * long as the connection lasts, and a templated token URL is still templated an hour later.\n * Without them here, every one of the 21 vendors whose endpoints carry a placeholder — Microsoft,\n * Azure, and everything regional — would connect successfully and then fail its first renewal with\n * `needs a value for 'cloud'`: the exact failure the placeholder machinery exists to prevent, one\n * layer up.\n *\n * NOT secret, and deliberately client-readable: a tenant id is an identifier a person needs to see\n * to recognise which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromUpdate()` — chosen at connect time, and they describe the ACCOUNT the grant is for.\n * Changing them under a live grant would point the refresh at a different directory than the one\n * that issued the token, failing at the vendor with nothing local explaining why. Reconnecting is\n * the honest way to change them.\n */\n connectionParameters: z.record(z.string(), z.string()).optional().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per person per (provider, slug), enforced by a compound UNIQUE index rather than\n * a read-then-write — the same race the organization-owned sibling closes, and for the same\n * reason: two rows would leave the resolver picking one arbitrarily, so half the holder's outbound\n * calls would carry a rotated-away credential and nothing would say which half.\n */\n .businessKeySet([...USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type UserProviderCredential = z.infer<typeof UserProviderCredentialSchema>;\n\n\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n// OAUTH2 GRANTS\n//\n// A credential a vendor MINTS rather than one a person pastes. It rides in the same `secretValue`\n// field of the same two resources — sealed, as JSON — and that reuse is deliberate.\n//\n// ## Why the same rows rather than a third resource\n//\n// The identity is the same triple (owner, providerRef, secretSlug), the ownership semantics are the\n// same, the authorization is the same, the erasure is the same, and the resolver already routes by\n// scope. Only the PAYLOAD differs. A separate resource would duplicate every one of those and force\n// each consumer to ask \"which store?\" before it could ask anything useful.\n//\n// Note this is the OPPOSITE call from the one that split USER from ORGANIZATION, and the difference\n// is what makes both right: there the TENANCY differed, and tenancy in this framework is structural\n// — one table with a nullable owner would turn a structural guarantee into a filter somebody must\n// remember to write. Here nothing about ownership changes; a string becomes an object.\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n\n/**\n * What an authorization exchange gives back, as it is stored.\n *\n * Sealed as JSON into `secretValue`, so `.isWriteOnlySecret()` keeps masking it at the client\n * boundary and the envelope keeps binding it to its row — both mechanisms work on a string and\n * neither needs to know the string is structured.\n */\n/**\n * What SHAPE a sealed credential holds, once opened.\n *\n * One member today and a named vocabulary anyway, because the day a second sealed payload exists —\n * a service-account key, a signed JWT assertion — the discriminant is what tells them apart, and a\n * bare literal is where per-member explanation cannot live. It is also the value a reader needs to\n * understand `PROVIDER_OAUTH2_GRANT_PREFIX`: the prefix is how the shape is recognised WITHOUT\n * parsing, and this is what it recognises.\n */\n/**\n * Why a provider cannot be connected HERE, even though the vendor is in the catalogue.\n *\n * \"Connectable\" is a property of the DEPLOYMENT and not of the vendor, and conflating the two put a\n * Connect button on a screen that could only ever fail. Asana supports OAuth2 perfectly well; this\n * application has simply never registered with Asana, and no amount of pressing the button changes\n * that.\n *\n * The two members lead to different actions by different people, which is the whole reason they are\n * distinguished rather than collapsed into a boolean.\n */\n/**\n * HOW a connection to a provider is established — the shape of the act, which decides the screen.\n *\n * A connect surface cannot be one form. Granting consent at a vendor and typing a key are different\n * acts with different inputs and different failure modes, and a screen that offered one button for\n * both would be wrong for whichever it was not built around.\n */\nexport enum ProviderAuthMethod {\n /** The authorization-code round trip: leave, consent at the vendor, come back with a grant. */\n OAUTH2_AUTHORIZATION_CODE = 'oauth2-authorization-code',\n /**\n * A value somebody holds and types — an API key, a personal access token. The fields are DECLARED\n * by the provider's secrets contract, so a screen names them rather than asking for a slug.\n */\n DECLARED_SECRET = 'declared-secret',\n}\n\nexport enum ProviderConnectabilityBlocker {\n /**\n * The vendor has no authorization flow in the catalogue: its credential is PASTED, not granted.\n * Nothing is missing and nothing is broken — this provider is authored on the credential screen\n * instead, and an application author is the one who acts.\n */\n NO_AUTHORIZATION_FLOW = 'no-authorization-flow',\n /**\n * The vendor has a flow and THIS DEPLOYMENT has not registered with it — no client id, or no client\n * secret. An OPERATOR acts: register an application with the vendor and set the two environment\n * variables the provider's contract names. Distinct from the above because the vendor is perfectly\n * connectable and the gap is ours.\n */\n APPLICATION_NOT_REGISTERED = 'application-not-registered',\n}\n\n/**\n * One secret slot a provider declares, as a SCREEN needs it — never the value.\n *\n * Exists so nothing is typed by hand. The slug names the field, the environment variable tells an\n * operator exactly what to set, and `configured` lets a missing one be REPORTED rather than\n * discovered by pressing a button that fails.\n */\nexport interface ProviderSecretSlotView {\n readonly slug: string;\n readonly envVarName: string;\n readonly required: boolean;\n readonly description: string;\n /** Whether the deployment supplies it. There is deliberately no field for the value. */\n readonly configured: boolean;\n}\n\nexport enum ProviderStoredCredentialKind {\n /** An OAuth2 grant: an access token, and what is needed to renew it. */\n OAUTH2_GRANT = 'oauth2-grant',\n}\n\nexport const ProviderOAuth2GrantSchema = z.object({\n /**\n * A discriminant, so an opened envelope announces which shape it is.\n *\n * Without it the reader would have to guess from whether the plaintext parses as JSON — and a\n * pasted credential that happens to be JSON (a service-account key, which several vendors issue\n * exactly that way) would be misread as a grant. A guess that is right almost always is the worst\n * kind here, because the failure is a malformed Authorization header on somebody else's account.\n */\n kind: z.literal(ProviderStoredCredentialKind.OAUTH2_GRANT),\n\n /** The token that actually goes on the wire. */\n accessToken: z.string().min(1),\n\n /**\n * Present when the vendor issues one. Absent is normal and permanent for vendors that do not —\n * Slack's bot tokens do not expire and have no refresh — so its absence must not read as an\n * incomplete grant.\n */\n refreshToken: z.string().min(1).optional(),\n\n /**\n * When the access token stops being accepted, as an ISO instant.\n *\n * Optional because a non-expiring token genuinely has none. A grant with a refresh token and no\n * expiry is refreshed only after the vendor rejects it, which is correct but slower than\n * refreshing ahead of a known deadline.\n */\n expiresAt: z.iso.datetime().optional(),\n\n /**\n * What the vendor actually GRANTED, which is not always what was asked for.\n *\n * Recorded because the difference is invisible until a call fails: a vendor may issue a token for\n * a subset of the requested scopes, and the resulting `missing_scope` arrives on an unrelated\n * operation weeks later. Holding the granted set lets that be answered from the row.\n */\n grantedScopes: z.array(z.string()).optional(),\n\n /**\n * The vendor's own identifier for the account this grant is on — a Slack team id, a Google sub, a\n * Microsoft tenant id.\n *\n * Not used for lookup and deliberately not part of the row's identity. It exists so a person\n * reading their connections can tell WHICH account they connected, which a provider ref cannot\n * answer for anyone who has two.\n */\n accountRef: z.string().optional(),\n});\n\nexport type ProviderOAuth2Grant = z.infer<typeof ProviderOAuth2GrantSchema>;\n\n/**\n * The marker that opens the sealed plaintext of a grant rather than a pasted credential.\n *\n * A prefix on the JSON rather than a field inside it, so the decision can be made without parsing —\n * the same reason the envelope carries a prefix. Parsing first would mean feeding an arbitrary\n * pasted credential to `JSON.parse` on every resolution.\n */\nexport const PROVIDER_OAUTH2_GRANT_PREFIX = 'wildo-oauth2-grant:';\n\n/** Whether an OPENED credential is a grant. Cheap, and does not parse. */\nexport function isProviderOAuth2GrantPlaintext(plaintext: string): boolean {\n return plaintext.startsWith(PROVIDER_OAUTH2_GRANT_PREFIX);\n}\n\n/** Render a grant for sealing. The inverse of {@link parseProviderOAuth2Grant}. */\nexport function serializeProviderOAuth2Grant(grant: ProviderOAuth2Grant): string {\n return `${PROVIDER_OAUTH2_GRANT_PREFIX}${JSON.stringify(grant)}`;\n}\n\n/**\n * Read a grant back, or `undefined` when the plaintext is an ordinary pasted credential.\n *\n * THROWS when the value announces itself as a grant and then does not parse or does not validate.\n * That is the same posture the envelope takes toward a value the write path could not have\n * produced: a credential which claims a shape it does not have is a fault worth failing on, never\n * one worth falling back from — falling back would put a JSON blob on the wire as a bearer token.\n */\nexport function parseProviderOAuth2Grant(plaintext: string): ProviderOAuth2Grant | undefined {\n if (!isProviderOAuth2GrantPlaintext(plaintext)) return undefined;\n const body = plaintext.slice(PROVIDER_OAUTH2_GRANT_PREFIX.length);\n let parsed: unknown;\n try {\n parsed = JSON.parse(body);\n } catch {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant and is not valid JSON. It was '\n + 'written by something other than the authorization exchange; reconnect the account.',\n );\n }\n const result = ProviderOAuth2GrantSchema.safeParse(parsed);\n if (!result.success) {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant but does not match the grant '\n + 'shape. Reconnect the account rather than editing the row — the value on the wire would '\n + 'otherwise be a fragment of a token.',\n );\n }\n return result.data;\n}\n\n/**\n * Whether a grant should be refreshed BEFORE it is spent.\n *\n * The skew is what makes this useful rather than decorative: a token that expires in two seconds is\n * still \"valid\" and will have expired by the time the request reaches the vendor, so refreshing only\n * on expiry guarantees a population of calls that fail for a reason nothing recorded. Sixty seconds\n * is the industry's common floor and comfortably exceeds any plausible clock skew plus flight time.\n *\n * Returns false when there is no expiry — a non-expiring token is refreshed reactively, after the\n * vendor rejects it, because there is no deadline to act ahead of.\n */\nexport const PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS = 60;\n\nexport function providerOAuth2GrantNeedsRefresh(grant: ProviderOAuth2Grant, now: Date = new Date()): boolean {\n if (grant.expiresAt === undefined) return false;\n const expiry = Date.parse(grant.expiresAt);\n if (Number.isNaN(expiry)) return true;\n return expiry - now.getTime() <= PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS * 1000;\n}\n"]}
1
+ {"version":3,"file":"provider-credentials.shared.schemas.js","sourceRoot":"","sources":["../../../../../src/security/connected-accounts/provider-credentials.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,iCAOX;AAPD,WAAY,iCAAiC;IAC3C,0FAA0F;IAC1F,gEAA2B,CAAA;IAC3B,gDAAgD;IAChD,oDAAe,CAAA;IACf,8EAA8E;IAC9E,wDAAmB,CAAA;AACrB,CAAC,EAPW,iCAAiC,KAAjC,iCAAiC,QAO5C;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,kCAmBX;AAnBD,WAAY,kCAAkC;IAC5C;;;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,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC;IAClE,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,iGAAiG;cAC/F,oFAAoF,CACvF,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,yBAAyB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,gGAAgG;cAC9F,yFAAyF;cACzF,qCAAqC,CACxC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAEvD,MAAM,UAAU,+BAA+B,CAAC,KAA0B,EAAE,MAAY,IAAI,IAAI,EAAE;IAChG,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,IAAI,oCAAoC,GAAG,IAAI,CAAC;AAC/E,CAAC","sourcesContent":["/**\n * Organization Provider Credentials — shared schemas.\n *\n * ## What this resource is, and what it is NOT\n *\n * It is an ORGANIZATION's OWN credential toward a third party: the Slack workspace token, the CRM\n * API key, the SMTP password that belongs to THAT tenant. The organization is the third-party\n * principal, and the credential is a service credential the tenant's administrator supplies.\n *\n * It is NOT a user's delegated OAuth grant. A delegated grant is a different object with a\n * different lifetime (a refresh loop, a revocation the USER can perform, a consent record) and it\n * lands as `connected accounts` beside this file — see issue #333. Merging the two would give one\n * row two owners and two revocation semantics.\n *\n * ## Why it has to exist\n *\n * Before this resource, every provider secret resolved from `process.env` through the\n * `SecretsContract`, so a credential was per-PROCESS and per-DEPLOYMENT. One application serving\n * many organizations therefore had ONE Slack token for all of them, and the failure was silent in\n * the worst direction: an operator sets one key and every tenant thereafter acts as the SAME\n * third-party principal, with nothing anywhere saying so.\n *\n * ## The value is sealed, and this file is where that is stated\n *\n * `secretValue` holds an AES-256-GCM envelope, never the plaintext an operator typed. The seal is\n * applied on the way in and opened only by the resolver — see\n * `provider-credential-envelope.backend.utils.ts` for its key domains and binding, over the shared\n * `bound-secret-envelope` core that does the sealing (#366). The\n * schema cannot enforce that (a string is a string), so the write path is what guarantees it and\n * the pins are what keep it guaranteed.\n */\n\nimport { z } from 'zod';\n\n/**\n * Whether the stored credential has been shown to work against the provider.\n *\n * A closed vocabulary rather than a boolean because \"we have never tried\" and \"we tried and it\n * failed\" are different states with different operator actions, and a boolean would merge them\n * into the same falsy answer. `UNVALIDATED` is the honest default: storing a credential proves\n * only that somebody typed one.\n */\nexport enum ProviderCredentialValidationState {\n /** Stored, never exercised against the provider. The state every credential starts in. */\n UNVALIDATED = 'unvalidated',\n /** The provider accepted it on its last use. */\n VALID = 'valid',\n /** The provider rejected it on its last use — the operator must rotate it. */\n INVALID = 'invalid',\n}\n\n/**\n * Why a write door refused to store a credential VALUE under the slot it named — the stable,\n * client-branchable `code` every door carries (#624).\n *\n * A stored row is keyed `(owner, providerRef, secretSlug)` on the provider's secrets-contract KEY, and\n * every reader asks for that key. A value written under any other name is a secret nothing can ever\n * read, and before these refusals the write reported success — which is how a regenerated provider,\n * a free-text slug or a test script produced rows that looked connected and resolved as absent.\n *\n * The member values are the wire codes the connect leg already answered with, so one vocabulary\n * serves the connect leg, the resource's own CREATE / UPDATE doors and any client that branches.\n */\nexport enum ProviderCredentialSlotWriteRefusal {\n /**\n * The provider's current secrets contract declares no slot by that name — under either of a slot's\n * two names. Also the answer for a provider that is not registered at all, and for ROTATING a value\n * into an existing row whose stored name is not a contract KEY — a retired name, or a spelling no\n * reader asks for: a fresh secret sealed there is as unreadable as the old one.\n */\n SECRET_SLUG_NOT_DECLARED = 'SECRET_SLUG_NOT_DECLARED',\n /**\n * The slot exists but holds the APPLICATION's own registration (an OAuth2 client id or secret),\n * which is authored in the deployment environment and never read from a credential row.\n */\n SECRET_SLUG_NOT_A_CREDENTIAL = 'SECRET_SLUG_NOT_A_CREDENTIAL',\n /**\n * An UPDATE named a different `providerRef` or `secretSlug` for an existing row. The sealed value is\n * bound to both, so a row cannot move: a credential for another slot is a new row, and the old one is\n * deleted.\n */\n CREDENTIAL_SLOT_IMMUTABLE = 'CREDENTIAL_SLOT_IMMUTABLE',\n}\n\n/**\n * How one connection fact got onto a credential row (#333, #1047). The distinction is what decides who may\n * change it: an answer changes only when the person reconnects, a vendor report whenever the vendor\n * reports it again.\n */\nexport enum ProviderConnectionFactProvenance {\n /**\n * Typed by the person connecting, for an endpoint or scope `{placeholder}` at the OAuth2 start — or, for a\n * vendor whose credential is PASTED, for a `{placeholder}` of the REST base URL at the typed-credential store\n * (#1097). Replaced only by reconnecting or re-entering the credential.\n */\n ANSWERED_AT_CONNECT = 'ANSWERED_AT_CONNECT',\n /** Reported by the vendor in its token answer, at the authorization or at a refresh. A refresh may move it. */\n REPORTED_BY_VENDOR = 'REPORTED_BY_VENDOR',\n}\n\n/** One value in a credential row's `connectionFacts`. */\nexport const ProviderConnectionFactSchema = z.strictObject({\n value: z.string(),\n provenance: z.enum(ProviderConnectionFactProvenance),\n});\n\nexport type ProviderConnectionFact = z.infer<typeof ProviderConnectionFactSchema>;\n\n/** A credential row's facts, keyed by fact name. */\nexport type ProviderConnectionFacts = Readonly<Record<string, ProviderConnectionFact>>;\n\n/**\n * WHERE a resolved provider secret came from.\n *\n * The whole point of this slice is that the answer used to be unanswerable: every secret came from\n * `process.env`, so \"which principal did this tenant act as?\" had one answer for every tenant and\n * nothing recorded it. Making the source an explicit, closed value means an audit reader can see a\n * tenant falling back to the shared deployment credential — the exact condition the resource exists\n * to make visible — instead of having to infer it from an absence.\n */\nexport enum ProviderCredentialResolutionSource {\n /** The organization's own credential row. The tenant acted as itself. */\n ORGANIZATION_CREDENTIAL = 'organization_credential',\n /**\n * The deployment's env-projected `SecretsContract`. Legitimate — a single-tenant deployment, or a\n * provider the operator intends every tenant to share — but never silent.\n */\n DEPLOYMENT_ENVIRONMENT = 'deployment_environment',\n /**\n * A PERSON's own credential row. The application acted as that individual.\n *\n * This member has no sibling fallback, and that asymmetry is deliberate rather than an omission.\n * An organization with no credential of its own may legitimately fall through to the deployment's\n * — an operator can intend every tenant to share one integration. A person cannot: the vendor\n * attributes the act to whoever's token was spent, so acting for someone under the deployment's\n * principal would put the wrong name on the record that outlives us. A person who has connected\n * nothing gets a refusal, not a substitute.\n */\n USER_CREDENTIAL = 'user_credential',\n}\n\n/**\n * What telling the VENDOR achieved when a credential was removed (#545).\n *\n * A separate axis from {@link ProviderCredentialDeletionReason} on purpose: that one says why OUR\n * COPY stopped existing, this one says whether the authorization itself was withdrawn where it\n * lives. They were one question for as long as the answer was always \"it was not\".\n *\n * Every member is EVIDENCE, and none of them is control flow — the local delete proceeds whatever\n * this says, because a vendor being unreachable must not stop somebody disconnecting.\n */\nexport enum ProviderOAuth2RevocationOutcome {\n /**\n * The vendor answered 200.\n *\n * Under RFC 7009 that also covers a token the server did not recognise, which is the intended\n * reading: the grant is gone either way.\n * spec-cite: RFC 7009 §2.2 — *\"The authorization server responds with HTTP status code 200 if the\n * token has been revoked successfully or if the client submitted an invalid token\"*.\n */\n REVOKED = 'revoked',\n /**\n * Nothing was sent, and that is the ordinary case rather than a failure.\n *\n * Three situations share this member because they are one fact from the person's side — the vendor\n * was not told: the provider declares no `rfc7009RevocationUrl`; the credential was a PASTED\n * long-lived key rather than a grant, so there is nothing to revoke; or the grant carried no token.\n */\n NOT_DECLARED = 'not_declared',\n /** The application's own client registration for this vendor is unset, so nothing could be sent. */\n NOT_CONFIGURED = 'not_configured',\n /** The endpoint could not be reached, or did not answer within the deadline. */\n UNREACHABLE = 'unreachable',\n /** The endpoint answered, and not with 200. */\n REFUSED = 'refused',\n}\n\n/** The wire values of {@link ProviderOAuth2RevocationOutcome}, for a Zod enum over them. */\nexport const ProviderOAuth2RevocationOutcomeValues = ProviderOAuth2RevocationOutcome;\n\n/**\n * Why a credential row stopped existing.\n *\n * ## Every member describes OUR COPY; whether the VENDOR was told is a SECOND axis (#545)\n *\n * Removing a credential deletes the token Wildo holds. Until 2026-09-18 it also did nothing else,\n * so the GRANT survived at the vendor: the person's connected-accounts screen showed the application\n * gone while Asana or Google still listed it as authorized, and a stored refresh token remained\n * valid until it expired on the vendor's schedule — which, for a refresh token, is frequently never.\n *\n * That is stated HERE because this vocabulary is what an operator points at when asked whether an\n * erasure reached someone's third-party credentials, and silence on a compliance surface reads as\n * \"done\".\n *\n * **It is no longer silent.** Both deletion events now carry\n * {@link ProviderOAuth2RevocationOutcome}, so the trail answers the vendor question separately from\n * the local one. What that outcome can SAY still depends on the vendor: RFC 7009 is the only\n * revocation standard and the vendors do not agree with it, so `google-drive` and `asana` declare an\n * endpoint and are told, while Slack's `auth.revoke` (a Web API method) and GitHub's\n * `DELETE /applications/{client_id}/token` (basic auth, JSON body) are not expressible as one and\n * record `not_declared` rather than implying they were reached.\n *\n * An earlier revision of this block argued the mechanism should NOT be built, because *\"no\n * admissible provider declares one today, so the field would ship inert\"*. That was true when it was\n * written and stopped being true when `google-drive` gained an admissible USER connection: Google's\n * `https://oauth2.googleapis.com/revoke` is RFC 7009-conformant, so the mechanism has a reachable\n * user and a proven vendor. Kept as history rather than deleted, because the reasoning was sound and\n * the thing that changed was the world, not the argument.\n */\nexport enum ProviderCredentialDeletionReason {\n /** An administrator of the owning tenant removed it. */\n ADMINISTRATOR_REVOKED = 'administrator_revoked',\n /** The owning organization was purged and the composition cascade removed it with the tenant. */\n ORGANIZATION_PURGED = 'organization_purged',\n /** The person whose credential it was removed it themselves. */\n OWNER_REVOKED = 'owner_revoked',\n /**\n * The owning user was erased and the composition cascade destroyed it with them.\n *\n * Distinct from `ORGANIZATION_PURGED` because this one is EVIDENCE: it is what an operator points\n * at when asked whether a subject-erasure request reached the person's third-party credentials.\n * Collapsing the two into a generic \"cascade\" would make that question unanswerable from the trail.\n *\n * **Who sets it:** the cascade observer, for a cascade declaring itself a `SUBJECT_ERASURE`. The record\n * carries `deletedBy` = whoever EXECUTED the erasure (a person's id when one was carried on the erasure's\n * context, else the `SYSTEM` sentinel), so the erased person is the record's SUBJECT and never its actor\n * (#1088).\n */\n USER_ERASED = 'user_erased',\n /**\n * The owning user ROW was deleted outright and the composition cascade destroyed the credential with it (#1016).\n *\n * **Who sets it:** the user-credential parent-cascade removal observer\n * (`registerUserProviderCredentialCascadeEvidence`), for a cascade that declares its cause as an ordinary parent\n * delete of the `users` row. Two doors reach it today: an administrator's hard `DELETE` (`deletedBy` is that\n * administrator), and the organization-member invitation sweep reaping an orphaned pending user under an internal\n * context (`deletedBy` is the `SYSTEM` sentinel). The record carries `deletedBy`, resolved from the deleting\n * execution context, so it names the principal who deleted the account rather than the person whose credential\n * it was.\n *\n * **Distinct from `USER_ERASED`**, and the distinction is the reason this member exists: an erasure answers a\n * data-subject request, keeps the person's row scrubbed and is evidence that the request reached their third-party\n * credentials. A deletion asserts no such request. Recording it as `USER_ERASED` would forge erasure evidence;\n * recording nothing left an account deletion that destroyed OAuth grants and API keys with no row naming them.\n *\n * **Distinct from `ORGANIZATION_PURGED`**: that is a tenant teardown removing the ORGANIZATION's credentials. This\n * removes one PERSON's own credentials, which no organization owns.\n *\n * Named for what happened to the owner, not for who did it: the cascade cannot tell an administrator's delete from\n * any other deletion of the row, and `deletedBy` is where the actor is stated.\n */\n USER_DELETED = 'user_deleted',\n}\n\n/**\n * The fields that IDENTIFY a credential within its tenant.\n *\n * One tenant holds at most one credential per (provider, slug). Exported rather than repeated so\n * the uniqueness contract, the resolver's lookup and the tests cannot drift apart — three copies\n * of a compound key is how two of them come to disagree about what identity means.\n */\nexport const ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'organizationId',\n 'providerRef',\n 'secretSlug',\n] as const;\n\n/**\n * The organization's credential for one (provider, secret slug) pair.\n *\n * ## The scope identifier is TOP-LEVEL and stays that way\n *\n * `organizationId` is the only `organizationId`-named path in this schema, and nothing nested may\n * ever be named `organizationId` or `userId`. `buildContextualFilter` injects the scope FK by\n * matching that field name at EVERY schema path, so a nested key of the same name adds a phantom\n * exact-subdocument clause and the scoped read silently matches zero rows — a credential that\n * exists and cannot be resolved, which reads exactly like a credential that was never set.\n * `setByUserId` is deliberately spelled so it cannot be caught by that matcher.\n */\nexport const OrganizationProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The tenant that owns this credential. Injected by the context machinery from the request\n * scope, never from a caller-supplied field — which is what makes the isolation structural\n * rather than a filter somebody has to remember to write.\n */\n organizationId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /**\n * The provider this credential authenticates toward (`slack`, `stripe`, a generated package's\n * ref). An OPEN string, matching `ProviderRef`'s own openness — the whole point of the provider\n * work is that the set is not closed, so a closed enum here would refuse every generated\n * provider.\n */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The provider's `secretsContract` KEY this value satisfies (`accessToken`, `clientSecret`) —\n * NOT the slot's env-var spelling (`ASANA_ACCESS_TOKEN`), which is what the deployment's env\n * projection carries and what a provider regeneration may rename. The two resolution places name\n * the same SLOT by different names, and only the key is stable enough to key a durable row on\n * (#624). Immutable: re-pointing a stored secret at a different slug would silently hand one vendor\n * credential to a different vendor field — and the sealed value binds the slug, so a row stored\n * under a name the provider no longer declares cannot be renamed, only replaced by reconnecting.\n */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED.\n *\n * `.isWriteOnlySecret()` is the framework's write-then-masked contract and is exactly right\n * here: the operator supplies and rotates the value, so it must stay in the CREATE/UPDATE\n * request DTO; the framework redacts it to a placeholder at the client boundary, so no read\n * ever returns it; and the backend keeps the stored content for its own resolution.\n *\n * `.isBackendOnly()` was rejected — it strips the field from the client DTO, so the operator's\n * typed value is dropped before it is ever stored and the surface silently accepts nothing.\n *\n * What is PERSISTED is the envelope, never the plaintext. The write path seals it; a value that\n * reaches persistence unsealed is a defect, not a tolerated legacy shape.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n /**\n * Whether this credential may be spent. An operator can park a credential without deleting it —\n * which matters during an incident, where deleting is not reversible and disabling is.\n */\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField(),\n\n /**\n * Why the last use failed, when it did. PROVIDER-supplied text about the CREDENTIAL's status —\n * never the credential. A resolver writing anything derived from `secretValue` here would defeat\n * every other precaution in this file, because this field IS client-readable.\n */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /**\n * WHO set it — the acting user's id, recorded for the audit trail.\n *\n * Deliberately NOT a registered `USERS` relationship. Declaring that edge would put a CREDENTIAL\n * row on the Art. 15 subject-export graph, and a credential is precisely the class of row that\n * must never reach a data subject. The id is recorded because \"who set this\" is the first\n * question of any credential incident; the edge is withheld because the answer must not travel\n * with a subject export.\n */\n setByUserId: z.string().min(1).optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** Free-text operator note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Every fact about the connected ACCOUNT, each value carrying how it got here — see\n * {@link ProviderConnectionFactProvenance} (#333, #1047).\n *\n * ONE record for two sources, by decision: the answers a person typed for the endpoints'\n * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for\n * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor\n * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's\n * `api_domain`). Two records would let an operation read one and a refresh update the other.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a\n * templated token URL is still templated an hour later — and every CALL needs a reported origin.\n *\n * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person\n * recognises which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds\n * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would\n * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES\n * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them\n * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.\n */\n connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per tenant per (provider, slug), enforced by a compound UNIQUE index rather\n * than by a read-then-write.\n *\n * The race it closes is not academic: two administrators saving a rotated Slack token in the\n * same minute would otherwise leave two rows, and the resolver would then pick one of them\n * arbitrarily — so half the tenant's outbound calls would carry the old credential and nobody\n * could tell which half.\n *\n * No `customMessageReference`: that option exists so an integrator can tell WHICH identity a\n * duplicate violated, and this resource declares exactly one. A dedicated reference here would\n * disambiguate nothing.\n */\n .businessKeySet([...ORGANIZATION_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type OrganizationProviderCredential = z.infer<typeof OrganizationProviderCredentialSchema>;\n\n\n\n// =============================================================================\n// USER-OWNED CREDENTIALS\n// =============================================================================\n\n/**\n * The fields that IDENTIFY a credential within its OWNER.\n *\n * Exported per owner rather than shared, because the compound key differs in its first component and\n * a single constant would have to be assembled by each side — which is how two copies of a key come\n * to disagree about what identity means.\n */\nexport const USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS = [\n 'userId',\n 'providerRef',\n 'secretSlug',\n] as const;\n\n/**\n * A PERSON's own credential toward a third party — the key they authored for themselves.\n *\n * ## Why this is a separate resource and not a nullable column beside the organization's\n *\n * Wildo's tenancy is STRUCTURAL: the contextual filter injects the scope FK by matching a field name\n * at every schema path, so a resource belongs to exactly one primary scope. One table holding both a\n * nullable `organizationId` and a nullable `userId` would turn that structural guarantee into a\n * filter somebody has to remember to write, on the one resource where forgetting it discloses a\n * credential. Two resources, each scoped by construction, is the framework working as designed\n * rather than a duplication.\n *\n * ## Not a delegated OAuth grant, and the difference is not subtle\n *\n * This is a key the user PASTED: they hold an account with the vendor and chose to let this\n * application spend it. A delegated grant is the vendor minting a token because the user approved a\n * consent screen, and it carries a refresh loop, an expiry and a revocation the vendor also honours.\n * Merging them would give one row two lifecycles and two revocation semantics — see #333, which owns\n * the second.\n *\n * ## Only the holder may spend it\n *\n * Not an administrator of their organization, and not a platform operator. Consent to STORE a\n * personal key is not consent for somebody else to use it, and the vendor would record the act as\n * the holder's own. The authorization side of that is\n * `InitiatorMembershipConnectionTargetAuthorization`; this schema is what makes the row reachable\n * only through the owner's own scope.\n */\nexport const UserProviderCredentialSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The person who owns this credential. Injected by the context machinery from the authenticated\n * scope, never from a caller-supplied field — the same structural isolation the organization-owned\n * sibling relies on, which is what makes \"another user's key\" unreachable rather than filtered.\n */\n userId: z.string().min(1).isDBIndexed().isForeignKey().isSummaryField().excludeFromUpdate(),\n\n /** As the organization-owned sibling: an OPEN string, because the provider set is not closed. */\n providerRef: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /** The provider's `secretsContract` KEY this value satisfies — never the env-var spelling, as the\n * sibling explains (#624). Immutable, for the same reason as the sibling: re-pointing a stored secret\n * at a different slug would hand one vendor credential to a different vendor field. */\n secretSlug: z.string().min(1).max(200).isDBIndexed().isSummaryField().excludeFromUpdate(),\n\n /**\n * The credential, SEALED — an AES-256-GCM envelope bound to this row's identity, never plaintext.\n *\n * `.isWriteOnlySecret()` for the same reason as the sibling: the holder supplies and rotates it, so\n * it must survive into the CREATE/UPDATE request DTO, and the framework masks it at the client\n * boundary so no read ever returns it.\n */\n secretValue: z.string().min(1).isWriteOnlySecret(),\n\n enabled: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n validationState: z\n .enum(ProviderCredentialValidationState)\n .default(ProviderCredentialValidationState.UNVALIDATED)\n .isDBIndexed()\n .isSummaryField(),\n\n /** Why the last use failed. PROVIDER text about the CREDENTIAL, never anything derived from it —\n * this field IS client-readable. */\n validationError: z.string().max(500).optional().excludeFromCreate().excludeFromUpdate(),\n\n lastValidatedAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n lastUsedAt: z.date().optional().isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n\n /** When the stored VALUE last changed — distinct from `updatedAt`, which any field write moves. */\n secretSetAt: z.date().optional().excludeFromCreate().excludeFromUpdate(),\n\n /** The holder's own note. Never a place for the value; enforced by the write-path pins. */\n /**\n * Every fact about the connected ACCOUNT, each value carrying how it got here — see\n * {@link ProviderConnectionFactProvenance} (#333, #1047).\n *\n * ONE record for two sources, by decision: the answers a person typed for the endpoints'\n * `{placeholder}` holes (which cloud, which directory, which region) — or, for a PASTED credential, for\n * the REST base URL's holes at the typed-credential store (#1097) — and the facts the vendor\n * reported in its token answer that operations consume (Salesforce's `instance_url`, Pipedrive's\n * `api_domain`). Two records would let an operation read one and a refresh update the other.\n *\n * On the ROW rather than only in the connect flow, because a REFRESH needs the answers again — a\n * templated token URL is still templated an hour later — and every CALL needs a reported origin.\n *\n * NOT secret, and deliberately client-readable: a tenant id or an instance URL is how a person\n * recognises which account they connected. The secret half is the grant, and it is sealed.\n *\n * `.excludeFromCreate().excludeFromUpdate()` — no CLIENT write may carry it, create included: the field holds\n * a provenance the resolver trusts, and a pasted-credential create that could type `REPORTED_BY_VENDOR` would\n * forge the one mark that decides where a request is sent (review F1). Answers change only by reconnecting, which REPLACES\n * the record with the grant; vendor-reported facts are also rewritten by a refresh that reports them\n * again. Both are server writes, allow-listed through `preserveServerInjectedFields`.\n */\n connectionFacts: z.record(z.string(), ProviderConnectionFactSchema).optional().excludeFromCreate().excludeFromUpdate(),\n\n\n description: z.string().max(500).optional(),\n\n createdAt: z.date().default(() => new Date()).isDBIndexed().isSummaryField().excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).isDBIndexed().excludeFromCreate().excludeFromUpdate(),\n})\n /**\n * One credential per person per (provider, slug), enforced by a compound UNIQUE index rather than\n * a read-then-write — the same race the organization-owned sibling closes, and for the same\n * reason: two rows would leave the resolver picking one arbitrarily, so half the holder's outbound\n * calls would carry a rotated-away credential and nothing would say which half.\n */\n .businessKeySet([...USER_PROVIDER_CREDENTIAL_IDENTITY_FIELDS]);\n\nexport type UserProviderCredential = z.infer<typeof UserProviderCredentialSchema>;\n\n\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n// OAUTH2 GRANTS\n//\n// A credential a vendor MINTS rather than one a person pastes. It rides in the same `secretValue`\n// field of the same two resources — sealed, as JSON — and that reuse is deliberate.\n//\n// ## Why the same rows rather than a third resource\n//\n// The identity is the same triple (owner, providerRef, secretSlug), the ownership semantics are the\n// same, the authorization is the same, the erasure is the same, and the resolver already routes by\n// scope. Only the PAYLOAD differs. A separate resource would duplicate every one of those and force\n// each consumer to ask \"which store?\" before it could ask anything useful.\n//\n// Note this is the OPPOSITE call from the one that split USER from ORGANIZATION, and the difference\n// is what makes both right: there the TENANCY differed, and tenancy in this framework is structural\n// — one table with a nullable owner would turn a structural guarantee into a filter somebody must\n// remember to write. Here nothing about ownership changes; a string becomes an object.\n// ══════════════════════════════════════════════════════════════════════════════════════════════\n\n/**\n * What an authorization exchange gives back, as it is stored.\n *\n * Sealed as JSON into `secretValue`, so `.isWriteOnlySecret()` keeps masking it at the client\n * boundary and the envelope keeps binding it to its row — both mechanisms work on a string and\n * neither needs to know the string is structured.\n */\n/**\n * What SHAPE a sealed credential holds, once opened.\n *\n * One member today and a named vocabulary anyway, because the day a second sealed payload exists —\n * a service-account key, a signed JWT assertion — the discriminant is what tells them apart, and a\n * bare literal is where per-member explanation cannot live. It is also the value a reader needs to\n * understand `PROVIDER_OAUTH2_GRANT_PREFIX`: the prefix is how the shape is recognised WITHOUT\n * parsing, and this is what it recognises.\n */\n/**\n * Why a provider cannot be connected HERE, even though the vendor is in the catalogue.\n *\n * \"Connectable\" is a property of the DEPLOYMENT and not of the vendor, and conflating the two put a\n * Connect button on a screen that could only ever fail. Asana supports OAuth2 perfectly well; this\n * application has simply never registered with Asana, and no amount of pressing the button changes\n * that.\n *\n * The two members lead to different actions by different people, which is the whole reason they are\n * distinguished rather than collapsed into a boolean.\n */\n/**\n * HOW a connection to a provider is established — the shape of the act, which decides the screen.\n *\n * A connect surface cannot be one form. Granting consent at a vendor and typing a key are different\n * acts with different inputs and different failure modes, and a screen that offered one button for\n * both would be wrong for whichever it was not built around.\n */\nexport enum ProviderAuthMethod {\n /** The authorization-code round trip: leave, consent at the vendor, come back with a grant. */\n OAUTH2_AUTHORIZATION_CODE = 'oauth2-authorization-code',\n /**\n * A value somebody holds and types — an API key, a personal access token. The fields are DECLARED\n * by the provider's secrets contract, so a screen names them rather than asking for a slug.\n */\n DECLARED_SECRET = 'declared-secret',\n}\n\nexport enum ProviderConnectabilityBlocker {\n /**\n * The vendor has no authorization flow in the catalogue: its credential is PASTED, not granted.\n * Nothing is missing and nothing is broken — this provider is authored on the credential screen\n * instead, and an application author is the one who acts.\n */\n NO_AUTHORIZATION_FLOW = 'no-authorization-flow',\n /**\n * The vendor has a flow and THIS DEPLOYMENT has not registered with it — no client id, or no client\n * secret. An OPERATOR acts: register an application with the vendor and set the two environment\n * variables the provider's contract names. Distinct from the above because the vendor is perfectly\n * connectable and the gap is ours.\n */\n APPLICATION_NOT_REGISTERED = 'application-not-registered',\n /**\n * An OAuth2 endpoint's HOST or ORIGIN — or the origin a SCOPE names (`{hostUrl}/.default`, #991) — is a\n * placeholder the provider declares no allowance for, so no value can ever be admitted there (#623):\n * the token endpoint receives the application's client secret, and a host is never taken from what\n * somebody types. Nobody connecting can fix it; the provider needs a recorded host allowance.\n */\n ENDPOINT_HOST_NOT_DECLARED = 'endpoint-host-not-declared',\n /**\n * The provider's OAuth2 endpoint definition cannot be resolved safely whatever is supplied — a\n * malformed template, an unresolved source expression, or an allowance that cannot apply where its\n * placeholder sits. A provider-definition defect, not a deployment or account gap.\n */\n ENDPOINT_DEFINITION_INVALID = 'endpoint-definition-invalid',\n /**\n * The provider's OAuth2 origin is filled from this DEPLOYMENT's configured base URL (a self-hosted\n * vendor such as Gitea), and that base URL is unset or unusable. An OPERATOR acts.\n */\n DEPLOYMENT_BASE_URL_UNUSABLE = 'deployment-base-url-unusable',\n /**\n * An OAuth2 endpoint host is filled from a deployment environment variable dedicated to it (Workday's\n * `WORKDAY_AUTH_HOST` / `WORKDAY_API_HOST`, #992), and that variable is unset or not a DNS name. An\n * OPERATOR acts; the variable is named in the catalogue entry's `missingRegistration`.\n */\n DEPLOYMENT_CONFIGURED_HOST_UNUSABLE = 'deployment-configured-host-unusable',\n /**\n * The vendor's credential is PASTED and its REST base URL forms its HOST or ORIGIN from a placeholder the\n * provider declares no allowance for (`https://{subdomain}.vendor.com` with no `baseUrlHostAllowances`\n * entry), so no answer the typed-credential store could collect is ever admitted and every call would\n * refuse (#1097). Nobody connecting can fix it; the provider needs a recorded host allowance — the\n * base-URL twin of `ENDPOINT_HOST_NOT_DECLARED`.\n */\n BASE_URL_HOST_NOT_DECLARED = 'base-url-host-not-declared',\n}\n\n/**\n * One secret slot a provider declares, as a SCREEN needs it — never the value.\n *\n * Exists so nothing is typed by hand. The slug names the field, the environment variable tells an\n * operator exactly what to set, and `configured` lets a missing one be REPORTED rather than\n * discovered by pressing a button that fails.\n */\nexport interface ProviderSecretSlotView {\n readonly slug: string;\n readonly envVarName: string;\n readonly required: boolean;\n readonly description: string;\n /** Whether the deployment supplies it. There is deliberately no field for the value. */\n readonly configured: boolean;\n}\n\nexport enum ProviderStoredCredentialKind {\n /** An OAuth2 grant: an access token, and what is needed to renew it. */\n OAUTH2_GRANT = 'oauth2-grant',\n}\n\nexport const ProviderOAuth2GrantSchema = z.object({\n /**\n * A discriminant, so an opened envelope announces which shape it is.\n *\n * Without it the reader would have to guess from whether the plaintext parses as JSON — and a\n * pasted credential that happens to be JSON (a service-account key, which several vendors issue\n * exactly that way) would be misread as a grant. A guess that is right almost always is the worst\n * kind here, because the failure is a malformed Authorization header on somebody else's account.\n */\n kind: z.literal(ProviderStoredCredentialKind.OAUTH2_GRANT),\n\n /** The token that actually goes on the wire. */\n accessToken: z.string().min(1),\n\n /**\n * Present when the vendor issues one. Absent is normal and permanent for vendors that do not —\n * Slack's bot tokens do not expire and have no refresh — so its absence must not read as an\n * incomplete grant.\n */\n refreshToken: z.string().min(1).optional(),\n\n /**\n * When the access token stops being accepted, as an ISO instant.\n *\n * Optional because a non-expiring token genuinely has none. A grant with a refresh token and no\n * expiry is refreshed only after the vendor rejects it, which is correct but slower than\n * refreshing ahead of a known deadline.\n */\n expiresAt: z.iso.datetime().optional(),\n\n /**\n * What the vendor actually GRANTED, which is not always what was asked for.\n *\n * Recorded because the difference is invisible until a call fails: a vendor may issue a token for\n * a subset of the requested scopes, and the resulting `missing_scope` arrives on an unrelated\n * operation weeks later. Holding the granted set lets that be answered from the row.\n */\n grantedScopes: z.array(z.string()).optional(),\n\n /**\n * The vendor's own identifier for the account this grant is on — a Slack team id, a Google sub, a\n * Microsoft tenant id.\n *\n * Not used for lookup and deliberately not part of the row's identity. It exists so a person\n * reading their connections can tell WHICH account they connected, which a provider ref cannot\n * answer for anyone who has two.\n */\n accountRef: z.string().optional(),\n});\n\nexport type ProviderOAuth2Grant = z.infer<typeof ProviderOAuth2GrantSchema>;\n\n/**\n * The marker that opens the sealed plaintext of a grant rather than a pasted credential.\n *\n * A prefix on the JSON rather than a field inside it, so the decision can be made without parsing —\n * the same reason the envelope carries a prefix. Parsing first would mean feeding an arbitrary\n * pasted credential to `JSON.parse` on every resolution.\n */\nexport const PROVIDER_OAUTH2_GRANT_PREFIX = 'wildo-oauth2-grant:';\n\n/** Whether an OPENED credential is a grant. Cheap, and does not parse. */\nexport function isProviderOAuth2GrantPlaintext(plaintext: string): boolean {\n return plaintext.startsWith(PROVIDER_OAUTH2_GRANT_PREFIX);\n}\n\n/** Render a grant for sealing. The inverse of {@link parseProviderOAuth2Grant}. */\nexport function serializeProviderOAuth2Grant(grant: ProviderOAuth2Grant): string {\n return `${PROVIDER_OAUTH2_GRANT_PREFIX}${JSON.stringify(grant)}`;\n}\n\n/**\n * Read a grant back, or `undefined` when the plaintext is an ordinary pasted credential.\n *\n * THROWS when the value announces itself as a grant and then does not parse or does not validate.\n * That is the same posture the envelope takes toward a value the write path could not have\n * produced: a credential which claims a shape it does not have is a fault worth failing on, never\n * one worth falling back from — falling back would put a JSON blob on the wire as a bearer token.\n */\nexport function parseProviderOAuth2Grant(plaintext: string): ProviderOAuth2Grant | undefined {\n if (!isProviderOAuth2GrantPlaintext(plaintext)) return undefined;\n const body = plaintext.slice(PROVIDER_OAUTH2_GRANT_PREFIX.length);\n let parsed: unknown;\n try {\n parsed = JSON.parse(body);\n } catch {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant and is not valid JSON. It was '\n + 'written by something other than the authorization exchange; reconnect the account.',\n );\n }\n const result = ProviderOAuth2GrantSchema.safeParse(parsed);\n if (!result.success) {\n throw new Error(\n 'A stored provider credential announces itself as an OAuth2 grant but does not match the grant '\n + 'shape. Reconnect the account rather than editing the row — the value on the wire would '\n + 'otherwise be a fragment of a token.',\n );\n }\n return result.data;\n}\n\n/**\n * Whether a grant should be refreshed BEFORE it is spent.\n *\n * The skew is what makes this useful rather than decorative: a token that expires in two seconds is\n * still \"valid\" and will have expired by the time the request reaches the vendor, so refreshing only\n * on expiry guarantees a population of calls that fail for a reason nothing recorded. Sixty seconds\n * is the industry's common floor and comfortably exceeds any plausible clock skew plus flight time.\n *\n * Returns false when there is no expiry — a non-expiring token is refreshed reactively, after the\n * vendor rejects it, because there is no deadline to act ahead of.\n */\nexport const PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS = 60;\n\nexport function providerOAuth2GrantNeedsRefresh(grant: ProviderOAuth2Grant, now: Date = new Date()): boolean {\n if (grant.expiresAt === undefined) return false;\n const expiry = Date.parse(grant.expiresAt);\n if (Number.isNaN(expiry)) return true;\n return expiry - now.getTime() <= PROVIDER_OAUTH2_REFRESH_SKEW_SECONDS * 1000;\n}\n"]}