digital-tools 2.0.1

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 (452) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +1144 -0
  4. package/dist/define.d.ts +109 -0
  5. package/dist/define.d.ts.map +1 -0
  6. package/dist/define.js +268 -0
  7. package/dist/define.js.map +1 -0
  8. package/dist/entities/advertising.d.ts +79 -0
  9. package/dist/entities/advertising.d.ts.map +1 -0
  10. package/dist/entities/advertising.js +1000 -0
  11. package/dist/entities/advertising.js.map +1 -0
  12. package/dist/entities/ai.d.ts +69 -0
  13. package/dist/entities/ai.d.ts.map +1 -0
  14. package/dist/entities/ai.js +757 -0
  15. package/dist/entities/ai.js.map +1 -0
  16. package/dist/entities/analytics.d.ts +83 -0
  17. package/dist/entities/analytics.d.ts.map +1 -0
  18. package/dist/entities/analytics.js +1589 -0
  19. package/dist/entities/analytics.js.map +1 -0
  20. package/dist/entities/automation.d.ts +61 -0
  21. package/dist/entities/automation.d.ts.map +1 -0
  22. package/dist/entities/automation.js +602 -0
  23. package/dist/entities/automation.js.map +1 -0
  24. package/dist/entities/communication.d.ts +96 -0
  25. package/dist/entities/communication.d.ts.map +1 -0
  26. package/dist/entities/communication.js +1151 -0
  27. package/dist/entities/communication.js.map +1 -0
  28. package/dist/entities/crm.d.ts +91 -0
  29. package/dist/entities/crm.d.ts.map +1 -0
  30. package/dist/entities/crm.js +1387 -0
  31. package/dist/entities/crm.js.map +1 -0
  32. package/dist/entities/design.d.ts +61 -0
  33. package/dist/entities/design.d.ts.map +1 -0
  34. package/dist/entities/design.js +547 -0
  35. package/dist/entities/design.js.map +1 -0
  36. package/dist/entities/development.d.ts +145 -0
  37. package/dist/entities/development.d.ts.map +1 -0
  38. package/dist/entities/development.js +2213 -0
  39. package/dist/entities/development.js.map +1 -0
  40. package/dist/entities/document.d.ts +54 -0
  41. package/dist/entities/document.d.ts.map +1 -0
  42. package/dist/entities/document.js +875 -0
  43. package/dist/entities/document.js.map +1 -0
  44. package/dist/entities/ecommerce.d.ts +93 -0
  45. package/dist/entities/ecommerce.d.ts.map +1 -0
  46. package/dist/entities/ecommerce.js +1430 -0
  47. package/dist/entities/ecommerce.js.map +1 -0
  48. package/dist/entities/experiment.d.ts +89 -0
  49. package/dist/entities/experiment.d.ts.map +1 -0
  50. package/dist/entities/experiment.js +1040 -0
  51. package/dist/entities/experiment.js.map +1 -0
  52. package/dist/entities/finance.d.ts +272 -0
  53. package/dist/entities/finance.d.ts.map +1 -0
  54. package/dist/entities/finance.js +3479 -0
  55. package/dist/entities/finance.js.map +1 -0
  56. package/dist/entities/forms.d.ts +91 -0
  57. package/dist/entities/forms.d.ts.map +1 -0
  58. package/dist/entities/forms.js +1893 -0
  59. package/dist/entities/forms.js.map +1 -0
  60. package/dist/entities/hr.d.ts +62 -0
  61. package/dist/entities/hr.d.ts.map +1 -0
  62. package/dist/entities/hr.js +662 -0
  63. package/dist/entities/hr.js.map +1 -0
  64. package/dist/entities/identity.d.ts +90 -0
  65. package/dist/entities/identity.d.ts.map +1 -0
  66. package/dist/entities/identity.js +998 -0
  67. package/dist/entities/identity.js.map +1 -0
  68. package/dist/entities/index.d.ts +410 -0
  69. package/dist/entities/index.d.ts.map +1 -0
  70. package/dist/entities/index.js +283 -0
  71. package/dist/entities/index.js.map +1 -0
  72. package/dist/entities/infrastructure.d.ts +98 -0
  73. package/dist/entities/infrastructure.d.ts.map +1 -0
  74. package/dist/entities/infrastructure.js +1154 -0
  75. package/dist/entities/infrastructure.js.map +1 -0
  76. package/dist/entities/knowledge.d.ts +98 -0
  77. package/dist/entities/knowledge.d.ts.map +1 -0
  78. package/dist/entities/knowledge.js +1439 -0
  79. package/dist/entities/knowledge.js.map +1 -0
  80. package/dist/entities/marketing.d.ts +82 -0
  81. package/dist/entities/marketing.d.ts.map +1 -0
  82. package/dist/entities/marketing.js +1611 -0
  83. package/dist/entities/marketing.js.map +1 -0
  84. package/dist/entities/media.d.ts +83 -0
  85. package/dist/entities/media.d.ts.map +1 -0
  86. package/dist/entities/media.js +1635 -0
  87. package/dist/entities/media.js.map +1 -0
  88. package/dist/entities/notification.d.ts +76 -0
  89. package/dist/entities/notification.d.ts.map +1 -0
  90. package/dist/entities/notification.js +1200 -0
  91. package/dist/entities/notification.js.map +1 -0
  92. package/dist/entities/presentation.d.ts +61 -0
  93. package/dist/entities/presentation.d.ts.map +1 -0
  94. package/dist/entities/presentation.js +1275 -0
  95. package/dist/entities/presentation.js.map +1 -0
  96. package/dist/entities/productivity.d.ts +92 -0
  97. package/dist/entities/productivity.d.ts.map +1 -0
  98. package/dist/entities/productivity.js +1318 -0
  99. package/dist/entities/productivity.js.map +1 -0
  100. package/dist/entities/project-management.d.ts +89 -0
  101. package/dist/entities/project-management.d.ts.map +1 -0
  102. package/dist/entities/project-management.js +1137 -0
  103. package/dist/entities/project-management.js.map +1 -0
  104. package/dist/entities/recruiting.d.ts +54 -0
  105. package/dist/entities/recruiting.d.ts.map +1 -0
  106. package/dist/entities/recruiting.js +737 -0
  107. package/dist/entities/recruiting.js.map +1 -0
  108. package/dist/entities/shipping.d.ts +52 -0
  109. package/dist/entities/shipping.d.ts.map +1 -0
  110. package/dist/entities/shipping.js +510 -0
  111. package/dist/entities/shipping.js.map +1 -0
  112. package/dist/entities/signature.d.ts +83 -0
  113. package/dist/entities/signature.d.ts.map +1 -0
  114. package/dist/entities/signature.js +1103 -0
  115. package/dist/entities/signature.js.map +1 -0
  116. package/dist/entities/site.d.ts +33 -0
  117. package/dist/entities/site.d.ts.map +1 -0
  118. package/dist/entities/site.js +223 -0
  119. package/dist/entities/site.js.map +1 -0
  120. package/dist/entities/spreadsheet.d.ts +68 -0
  121. package/dist/entities/spreadsheet.d.ts.map +1 -0
  122. package/dist/entities/spreadsheet.js +1342 -0
  123. package/dist/entities/spreadsheet.js.map +1 -0
  124. package/dist/entities/storage.d.ts +74 -0
  125. package/dist/entities/storage.d.ts.map +1 -0
  126. package/dist/entities/storage.js +1199 -0
  127. package/dist/entities/storage.js.map +1 -0
  128. package/dist/entities/support.d.ts +83 -0
  129. package/dist/entities/support.d.ts.map +1 -0
  130. package/dist/entities/support.js +1167 -0
  131. package/dist/entities/support.js.map +1 -0
  132. package/dist/entities/video-conferencing.d.ts +129 -0
  133. package/dist/entities/video-conferencing.d.ts.map +1 -0
  134. package/dist/entities/video-conferencing.js +1751 -0
  135. package/dist/entities/video-conferencing.js.map +1 -0
  136. package/dist/entities/video.d.ts +76 -0
  137. package/dist/entities/video.d.ts.map +1 -0
  138. package/dist/entities/video.js +951 -0
  139. package/dist/entities/video.js.map +1 -0
  140. package/dist/entities.d.ts +147 -0
  141. package/dist/entities.d.ts.map +1 -0
  142. package/dist/entities.js +1664 -0
  143. package/dist/entities.js.map +1 -0
  144. package/dist/index.d.ts +29 -0
  145. package/dist/index.d.ts.map +1 -0
  146. package/dist/index.js +75 -0
  147. package/dist/index.js.map +1 -0
  148. package/dist/providers/analytics/index.d.ts +19 -0
  149. package/dist/providers/analytics/index.d.ts.map +1 -0
  150. package/dist/providers/analytics/index.js +18 -0
  151. package/dist/providers/analytics/index.js.map +1 -0
  152. package/dist/providers/analytics/mixpanel.d.ts +25 -0
  153. package/dist/providers/analytics/mixpanel.d.ts.map +1 -0
  154. package/dist/providers/analytics/mixpanel.js +256 -0
  155. package/dist/providers/analytics/mixpanel.js.map +1 -0
  156. package/dist/providers/calendar/cal-com.d.ts +26 -0
  157. package/dist/providers/calendar/cal-com.d.ts.map +1 -0
  158. package/dist/providers/calendar/cal-com.js +304 -0
  159. package/dist/providers/calendar/cal-com.js.map +1 -0
  160. package/dist/providers/calendar/google-calendar.d.ts +25 -0
  161. package/dist/providers/calendar/google-calendar.d.ts.map +1 -0
  162. package/dist/providers/calendar/google-calendar.js +336 -0
  163. package/dist/providers/calendar/google-calendar.js.map +1 -0
  164. package/dist/providers/calendar/index.d.ts +20 -0
  165. package/dist/providers/calendar/index.d.ts.map +1 -0
  166. package/dist/providers/calendar/index.js +21 -0
  167. package/dist/providers/calendar/index.js.map +1 -0
  168. package/dist/providers/crm/hubspot.d.ts +25 -0
  169. package/dist/providers/crm/hubspot.d.ts.map +1 -0
  170. package/dist/providers/crm/hubspot.js +567 -0
  171. package/dist/providers/crm/hubspot.js.map +1 -0
  172. package/dist/providers/crm/index.d.ts +19 -0
  173. package/dist/providers/crm/index.d.ts.map +1 -0
  174. package/dist/providers/crm/index.js +18 -0
  175. package/dist/providers/crm/index.js.map +1 -0
  176. package/dist/providers/development/github.d.ts +25 -0
  177. package/dist/providers/development/github.d.ts.map +1 -0
  178. package/dist/providers/development/github.js +473 -0
  179. package/dist/providers/development/github.js.map +1 -0
  180. package/dist/providers/development/index.d.ts +19 -0
  181. package/dist/providers/development/index.d.ts.map +1 -0
  182. package/dist/providers/development/index.js +18 -0
  183. package/dist/providers/development/index.js.map +1 -0
  184. package/dist/providers/ecommerce/index.d.ts +19 -0
  185. package/dist/providers/ecommerce/index.d.ts.map +1 -0
  186. package/dist/providers/ecommerce/index.js +18 -0
  187. package/dist/providers/ecommerce/index.js.map +1 -0
  188. package/dist/providers/ecommerce/shopify.d.ts +25 -0
  189. package/dist/providers/ecommerce/shopify.d.ts.map +1 -0
  190. package/dist/providers/ecommerce/shopify.js +379 -0
  191. package/dist/providers/ecommerce/shopify.js.map +1 -0
  192. package/dist/providers/email/index.d.ts +20 -0
  193. package/dist/providers/email/index.d.ts.map +1 -0
  194. package/dist/providers/email/index.js +21 -0
  195. package/dist/providers/email/index.js.map +1 -0
  196. package/dist/providers/email/resend.d.ts +25 -0
  197. package/dist/providers/email/resend.d.ts.map +1 -0
  198. package/dist/providers/email/resend.js +259 -0
  199. package/dist/providers/email/resend.js.map +1 -0
  200. package/dist/providers/email/sendgrid.d.ts +25 -0
  201. package/dist/providers/email/sendgrid.d.ts.map +1 -0
  202. package/dist/providers/email/sendgrid.js +162 -0
  203. package/dist/providers/email/sendgrid.js.map +1 -0
  204. package/dist/providers/finance/index.d.ts +19 -0
  205. package/dist/providers/finance/index.d.ts.map +1 -0
  206. package/dist/providers/finance/index.js +18 -0
  207. package/dist/providers/finance/index.js.map +1 -0
  208. package/dist/providers/finance/stripe.d.ts +25 -0
  209. package/dist/providers/finance/stripe.d.ts.map +1 -0
  210. package/dist/providers/finance/stripe.js +550 -0
  211. package/dist/providers/finance/stripe.js.map +1 -0
  212. package/dist/providers/forms/index.d.ts +19 -0
  213. package/dist/providers/forms/index.d.ts.map +1 -0
  214. package/dist/providers/forms/index.js +18 -0
  215. package/dist/providers/forms/index.js.map +1 -0
  216. package/dist/providers/forms/typeform.d.ts +25 -0
  217. package/dist/providers/forms/typeform.d.ts.map +1 -0
  218. package/dist/providers/forms/typeform.js +501 -0
  219. package/dist/providers/forms/typeform.js.map +1 -0
  220. package/dist/providers/index.d.ts +56 -0
  221. package/dist/providers/index.d.ts.map +1 -0
  222. package/dist/providers/index.js +124 -0
  223. package/dist/providers/index.js.map +1 -0
  224. package/dist/providers/knowledge/index.d.ts +19 -0
  225. package/dist/providers/knowledge/index.d.ts.map +1 -0
  226. package/dist/providers/knowledge/index.js +18 -0
  227. package/dist/providers/knowledge/index.js.map +1 -0
  228. package/dist/providers/knowledge/notion.d.ts +25 -0
  229. package/dist/providers/knowledge/notion.d.ts.map +1 -0
  230. package/dist/providers/knowledge/notion.js +390 -0
  231. package/dist/providers/knowledge/notion.js.map +1 -0
  232. package/dist/providers/marketing/index.d.ts +19 -0
  233. package/dist/providers/marketing/index.d.ts.map +1 -0
  234. package/dist/providers/marketing/index.js +18 -0
  235. package/dist/providers/marketing/index.js.map +1 -0
  236. package/dist/providers/marketing/mailchimp.d.ts +25 -0
  237. package/dist/providers/marketing/mailchimp.d.ts.map +1 -0
  238. package/dist/providers/marketing/mailchimp.js +444 -0
  239. package/dist/providers/marketing/mailchimp.js.map +1 -0
  240. package/dist/providers/media/cloudinary.d.ts +25 -0
  241. package/dist/providers/media/cloudinary.d.ts.map +1 -0
  242. package/dist/providers/media/cloudinary.js +319 -0
  243. package/dist/providers/media/cloudinary.js.map +1 -0
  244. package/dist/providers/media/index.d.ts +19 -0
  245. package/dist/providers/media/index.d.ts.map +1 -0
  246. package/dist/providers/media/index.js +18 -0
  247. package/dist/providers/media/index.js.map +1 -0
  248. package/dist/providers/messaging/index.d.ts +24 -0
  249. package/dist/providers/messaging/index.d.ts.map +1 -0
  250. package/dist/providers/messaging/index.js +21 -0
  251. package/dist/providers/messaging/index.js.map +1 -0
  252. package/dist/providers/messaging/slack.d.ts +25 -0
  253. package/dist/providers/messaging/slack.d.ts.map +1 -0
  254. package/dist/providers/messaging/slack.js +394 -0
  255. package/dist/providers/messaging/slack.js.map +1 -0
  256. package/dist/providers/messaging/twilio-sms.d.ts +25 -0
  257. package/dist/providers/messaging/twilio-sms.d.ts.map +1 -0
  258. package/dist/providers/messaging/twilio-sms.js +250 -0
  259. package/dist/providers/messaging/twilio-sms.js.map +1 -0
  260. package/dist/providers/project-management/index.d.ts +19 -0
  261. package/dist/providers/project-management/index.d.ts.map +1 -0
  262. package/dist/providers/project-management/index.js +18 -0
  263. package/dist/providers/project-management/index.js.map +1 -0
  264. package/dist/providers/project-management/linear.d.ts +25 -0
  265. package/dist/providers/project-management/linear.d.ts.map +1 -0
  266. package/dist/providers/project-management/linear.js +576 -0
  267. package/dist/providers/project-management/linear.js.map +1 -0
  268. package/dist/providers/registry.d.ts +41 -0
  269. package/dist/providers/registry.d.ts.map +1 -0
  270. package/dist/providers/registry.js +87 -0
  271. package/dist/providers/registry.js.map +1 -0
  272. package/dist/providers/spreadsheet/google-sheets.d.ts +25 -0
  273. package/dist/providers/spreadsheet/google-sheets.d.ts.map +1 -0
  274. package/dist/providers/spreadsheet/google-sheets.js +376 -0
  275. package/dist/providers/spreadsheet/google-sheets.js.map +1 -0
  276. package/dist/providers/spreadsheet/index.d.ts +20 -0
  277. package/dist/providers/spreadsheet/index.d.ts.map +1 -0
  278. package/dist/providers/spreadsheet/index.js +21 -0
  279. package/dist/providers/spreadsheet/index.js.map +1 -0
  280. package/dist/providers/spreadsheet/xlsx.d.ts +26 -0
  281. package/dist/providers/spreadsheet/xlsx.d.ts.map +1 -0
  282. package/dist/providers/spreadsheet/xlsx.js +424 -0
  283. package/dist/providers/spreadsheet/xlsx.js.map +1 -0
  284. package/dist/providers/storage/index.d.ts +30 -0
  285. package/dist/providers/storage/index.d.ts.map +1 -0
  286. package/dist/providers/storage/index.js +25 -0
  287. package/dist/providers/storage/index.js.map +1 -0
  288. package/dist/providers/storage/s3.d.ts +25 -0
  289. package/dist/providers/storage/s3.d.ts.map +1 -0
  290. package/dist/providers/storage/s3.js +420 -0
  291. package/dist/providers/storage/s3.js.map +1 -0
  292. package/dist/providers/support/index.d.ts +19 -0
  293. package/dist/providers/support/index.d.ts.map +1 -0
  294. package/dist/providers/support/index.js +18 -0
  295. package/dist/providers/support/index.js.map +1 -0
  296. package/dist/providers/support/zendesk.d.ts +25 -0
  297. package/dist/providers/support/zendesk.d.ts.map +1 -0
  298. package/dist/providers/support/zendesk.js +374 -0
  299. package/dist/providers/support/zendesk.js.map +1 -0
  300. package/dist/providers/tasks/index.d.ts +19 -0
  301. package/dist/providers/tasks/index.d.ts.map +1 -0
  302. package/dist/providers/tasks/index.js +18 -0
  303. package/dist/providers/tasks/index.js.map +1 -0
  304. package/dist/providers/tasks/todoist.d.ts +25 -0
  305. package/dist/providers/tasks/todoist.d.ts.map +1 -0
  306. package/dist/providers/tasks/todoist.js +287 -0
  307. package/dist/providers/tasks/todoist.js.map +1 -0
  308. package/dist/providers/types.d.ts +1753 -0
  309. package/dist/providers/types.d.ts.map +1 -0
  310. package/dist/providers/types.js +10 -0
  311. package/dist/providers/types.js.map +1 -0
  312. package/dist/providers/video-conferencing/google-meet.d.ts +26 -0
  313. package/dist/providers/video-conferencing/google-meet.d.ts.map +1 -0
  314. package/dist/providers/video-conferencing/google-meet.js +287 -0
  315. package/dist/providers/video-conferencing/google-meet.js.map +1 -0
  316. package/dist/providers/video-conferencing/index.d.ts +22 -0
  317. package/dist/providers/video-conferencing/index.d.ts.map +1 -0
  318. package/dist/providers/video-conferencing/index.js +32 -0
  319. package/dist/providers/video-conferencing/index.js.map +1 -0
  320. package/dist/providers/video-conferencing/jitsi.d.ts +26 -0
  321. package/dist/providers/video-conferencing/jitsi.d.ts.map +1 -0
  322. package/dist/providers/video-conferencing/jitsi.js +255 -0
  323. package/dist/providers/video-conferencing/jitsi.js.map +1 -0
  324. package/dist/providers/video-conferencing/teams.d.ts +26 -0
  325. package/dist/providers/video-conferencing/teams.d.ts.map +1 -0
  326. package/dist/providers/video-conferencing/teams.js +271 -0
  327. package/dist/providers/video-conferencing/teams.js.map +1 -0
  328. package/dist/providers/video-conferencing/zoom.d.ts +25 -0
  329. package/dist/providers/video-conferencing/zoom.d.ts.map +1 -0
  330. package/dist/providers/video-conferencing/zoom.js +333 -0
  331. package/dist/providers/video-conferencing/zoom.js.map +1 -0
  332. package/dist/providers/voice/vapi.d.ts +27 -0
  333. package/dist/providers/voice/vapi.d.ts.map +1 -0
  334. package/dist/providers/voice/vapi.js +440 -0
  335. package/dist/providers/voice/vapi.js.map +1 -0
  336. package/dist/registry.d.ts +38 -0
  337. package/dist/registry.d.ts.map +1 -0
  338. package/dist/registry.js +129 -0
  339. package/dist/registry.js.map +1 -0
  340. package/dist/tools/communication.d.ts +94 -0
  341. package/dist/tools/communication.d.ts.map +1 -0
  342. package/dist/tools/communication.js +185 -0
  343. package/dist/tools/communication.js.map +1 -0
  344. package/dist/tools/data.d.ts +61 -0
  345. package/dist/tools/data.d.ts.map +1 -0
  346. package/dist/tools/data.js +206 -0
  347. package/dist/tools/data.js.map +1 -0
  348. package/dist/tools/index.d.ts +12 -0
  349. package/dist/tools/index.d.ts.map +1 -0
  350. package/dist/tools/index.js +12 -0
  351. package/dist/tools/index.js.map +1 -0
  352. package/dist/tools/web.d.ts +45 -0
  353. package/dist/tools/web.d.ts.map +1 -0
  354. package/dist/tools/web.js +138 -0
  355. package/dist/tools/web.js.map +1 -0
  356. package/dist/types.d.ts +330 -0
  357. package/dist/types.d.ts.map +1 -0
  358. package/dist/types.js +11 -0
  359. package/dist/types.js.map +1 -0
  360. package/package.json +45 -0
  361. package/src/define.ts +321 -0
  362. package/src/entities/advertising.ts +1086 -0
  363. package/src/entities/ai.ts +835 -0
  364. package/src/entities/analytics.ts +1690 -0
  365. package/src/entities/automation.ts +669 -0
  366. package/src/entities/communication.ts +1255 -0
  367. package/src/entities/crm.ts +1481 -0
  368. package/src/entities/design.ts +606 -0
  369. package/src/entities/development.ts +2392 -0
  370. package/src/entities/document.ts +930 -0
  371. package/src/entities/ecommerce.ts +1539 -0
  372. package/src/entities/experiment.ts +1139 -0
  373. package/src/entities/finance.ts +3907 -0
  374. package/src/entities/forms.ts +2021 -0
  375. package/src/entities/hr.ts +725 -0
  376. package/src/entities/identity.ts +1093 -0
  377. package/src/entities/index.ts +731 -0
  378. package/src/entities/infrastructure.ts +1254 -0
  379. package/src/entities/knowledge.ts +1547 -0
  380. package/src/entities/marketing.ts +1718 -0
  381. package/src/entities/media.ts +1747 -0
  382. package/src/entities/notification.ts +1260 -0
  383. package/src/entities/presentation.ts +1360 -0
  384. package/src/entities/productivity.ts +1411 -0
  385. package/src/entities/project-management.ts +1222 -0
  386. package/src/entities/recruiting.ts +797 -0
  387. package/src/entities/shipping.ts +566 -0
  388. package/src/entities/signature.ts +1204 -0
  389. package/src/entities/site.ts +244 -0
  390. package/src/entities/spreadsheet.ts +1434 -0
  391. package/src/entities/storage.ts +1290 -0
  392. package/src/entities/support.ts +1267 -0
  393. package/src/entities/video-conferencing.ts +1874 -0
  394. package/src/entities/video.ts +1035 -0
  395. package/src/entities.ts +1795 -0
  396. package/src/index.ts +176 -0
  397. package/src/providers/analytics/index.ts +21 -0
  398. package/src/providers/analytics/mixpanel.ts +311 -0
  399. package/src/providers/calendar/cal-com.ts +435 -0
  400. package/src/providers/calendar/google-calendar.ts +412 -0
  401. package/src/providers/calendar/index.ts +24 -0
  402. package/src/providers/crm/hubspot.ts +667 -0
  403. package/src/providers/crm/index.ts +21 -0
  404. package/src/providers/development/github.ts +608 -0
  405. package/src/providers/development/index.ts +21 -0
  406. package/src/providers/ecommerce/index.ts +21 -0
  407. package/src/providers/ecommerce/shopify.ts +451 -0
  408. package/src/providers/email/index.ts +24 -0
  409. package/src/providers/email/resend.ts +301 -0
  410. package/src/providers/email/sendgrid.ts +196 -0
  411. package/src/providers/finance/index.ts +21 -0
  412. package/src/providers/finance/stripe.ts +665 -0
  413. package/src/providers/forms/index.ts +21 -0
  414. package/src/providers/forms/typeform.ts +598 -0
  415. package/src/providers/index.ts +281 -0
  416. package/src/providers/knowledge/index.ts +21 -0
  417. package/src/providers/knowledge/notion.ts +497 -0
  418. package/src/providers/marketing/index.ts +21 -0
  419. package/src/providers/marketing/mailchimp.ts +656 -0
  420. package/src/providers/media/cloudinary.ts +373 -0
  421. package/src/providers/media/index.ts +21 -0
  422. package/src/providers/messaging/index.ts +24 -0
  423. package/src/providers/messaging/slack.ts +487 -0
  424. package/src/providers/messaging/twilio-sms.ts +301 -0
  425. package/src/providers/project-management/index.ts +21 -0
  426. package/src/providers/project-management/linear.ts +693 -0
  427. package/src/providers/registry.ts +119 -0
  428. package/src/providers/spreadsheet/google-sheets.ts +464 -0
  429. package/src/providers/spreadsheet/index.ts +24 -0
  430. package/src/providers/spreadsheet/xlsx.ts +542 -0
  431. package/src/providers/storage/index.ts +35 -0
  432. package/src/providers/storage/s3.ts +513 -0
  433. package/src/providers/support/index.ts +21 -0
  434. package/src/providers/support/zendesk.ts +417 -0
  435. package/src/providers/tasks/index.ts +21 -0
  436. package/src/providers/tasks/todoist.ts +407 -0
  437. package/src/providers/types.ts +2113 -0
  438. package/src/providers/video-conferencing/google-meet.ts +412 -0
  439. package/src/providers/video-conferencing/index.ts +35 -0
  440. package/src/providers/video-conferencing/jitsi.ts +324 -0
  441. package/src/providers/video-conferencing/teams.ts +408 -0
  442. package/src/providers/video-conferencing/zoom.ts +451 -0
  443. package/src/registry.ts +172 -0
  444. package/src/tools/communication.ts +256 -0
  445. package/src/tools/data.ts +236 -0
  446. package/src/tools/index.ts +12 -0
  447. package/src/tools/web.ts +161 -0
  448. package/src/types.ts +539 -0
  449. package/test/define.test.ts +367 -0
  450. package/test/registry.test.ts +444 -0
  451. package/test/tools.test.ts +453 -0
  452. package/tsconfig.json +20 -0
@@ -0,0 +1,3907 @@
1
+ /**
2
+ * Finance Entity Types (Nouns) - Stripe API Inspired
3
+ *
4
+ * Semantic type definitions for financial digital tools that can be used by
5
+ * both remote human workers AND AI agents. Each entity defines:
6
+ * - Properties: The data fields
7
+ * - Actions: Operations that can be performed (Verbs)
8
+ * - Events: State changes that occur
9
+ *
10
+ * Heavily influenced by Stripe's API structure and nomenclature.
11
+ *
12
+ * @packageDocumentation
13
+ */
14
+
15
+ import type { Noun } from 'ai-database'
16
+
17
+ // =============================================================================
18
+ // CORE
19
+ // =============================================================================
20
+
21
+ /**
22
+ * Customer entity
23
+ *
24
+ * Represents a customer - person or business making purchases
25
+ */
26
+ export const Customer: Noun = {
27
+ singular: 'customer',
28
+ plural: 'customers',
29
+ description: 'A person or business making purchases',
30
+
31
+ properties: {
32
+ // Identity
33
+ customerId: {
34
+ type: 'string',
35
+ description: 'Unique customer identifier',
36
+ },
37
+ email: {
38
+ type: 'string',
39
+ optional: true,
40
+ description: 'Customer email address',
41
+ },
42
+ phone: {
43
+ type: 'string',
44
+ optional: true,
45
+ description: 'Customer phone number',
46
+ },
47
+
48
+ // Name
49
+ name: {
50
+ type: 'string',
51
+ optional: true,
52
+ description: 'Customer full name',
53
+ },
54
+ description: {
55
+ type: 'string',
56
+ optional: true,
57
+ description: 'Description of the customer',
58
+ },
59
+
60
+ // Address
61
+ address: {
62
+ type: 'json',
63
+ optional: true,
64
+ description: 'Customer address',
65
+ },
66
+ shippingAddress: {
67
+ type: 'json',
68
+ optional: true,
69
+ description: 'Shipping address',
70
+ },
71
+
72
+ // Balance & Credit
73
+ balance: {
74
+ type: 'number',
75
+ optional: true,
76
+ description: 'Current balance in cents (positive = customer owes, negative = credit)',
77
+ },
78
+ currency: {
79
+ type: 'string',
80
+ optional: true,
81
+ description: 'Currency code (ISO 4217)',
82
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
83
+ },
84
+
85
+ // Tax
86
+ taxExempt: {
87
+ type: 'string',
88
+ optional: true,
89
+ description: 'Tax exemption status: none, exempt, reverse',
90
+ examples: ['none', 'exempt', 'reverse'],
91
+ },
92
+ taxIds: {
93
+ type: 'json',
94
+ array: true,
95
+ optional: true,
96
+ description: 'Tax IDs for the customer',
97
+ },
98
+
99
+ // Preferences
100
+ preferredLocales: {
101
+ type: 'string',
102
+ array: true,
103
+ optional: true,
104
+ description: 'Preferred locales',
105
+ },
106
+ invoicePrefix: {
107
+ type: 'string',
108
+ optional: true,
109
+ description: 'Prefix for invoice numbers',
110
+ },
111
+
112
+ // Status
113
+ delinquent: {
114
+ type: 'boolean',
115
+ optional: true,
116
+ description: 'Whether customer has overdue invoices',
117
+ },
118
+
119
+ // Metadata
120
+ metadata: {
121
+ type: 'json',
122
+ optional: true,
123
+ description: 'Additional metadata',
124
+ },
125
+
126
+ // Timestamps
127
+ created: {
128
+ type: 'datetime',
129
+ description: 'Time at which the customer was created',
130
+ },
131
+ },
132
+
133
+ relationships: {
134
+ defaultPaymentMethod: {
135
+ type: 'PaymentMethod',
136
+ required: false,
137
+ description: 'Default payment method',
138
+ },
139
+ paymentMethods: {
140
+ type: 'PaymentMethod[]',
141
+ description: 'Payment methods on file',
142
+ },
143
+ invoices: {
144
+ type: 'Invoice[]',
145
+ backref: 'customer',
146
+ description: 'Customer invoices',
147
+ },
148
+ subscriptions: {
149
+ type: 'Subscription[]',
150
+ backref: 'customer',
151
+ description: 'Customer subscriptions',
152
+ },
153
+ charges: {
154
+ type: 'Charge[]',
155
+ description: 'Charges for this customer',
156
+ },
157
+ balanceTransactions: {
158
+ type: 'BalanceTransaction[]',
159
+ description: 'Balance transactions',
160
+ },
161
+ },
162
+
163
+ actions: [
164
+ 'create',
165
+ 'update',
166
+ 'delete',
167
+ 'list',
168
+ 'retrieve',
169
+ 'search',
170
+ 'createBalanceTransaction',
171
+ 'listBalanceTransactions',
172
+ 'updateBalance',
173
+ ],
174
+
175
+ events: [
176
+ 'customer.created',
177
+ 'customer.updated',
178
+ 'customer.deleted',
179
+ 'customer.balance.updated',
180
+ ],
181
+ }
182
+
183
+ /**
184
+ * Product entity
185
+ *
186
+ * Represents goods or services for sale
187
+ */
188
+ export const Product: Noun = {
189
+ singular: 'product',
190
+ plural: 'products',
191
+ description: 'Goods or services for sale',
192
+
193
+ properties: {
194
+ // Identity
195
+ productId: {
196
+ type: 'string',
197
+ description: 'Unique product identifier',
198
+ },
199
+ name: {
200
+ type: 'string',
201
+ description: 'Product name',
202
+ },
203
+ description: {
204
+ type: 'string',
205
+ optional: true,
206
+ description: 'Product description',
207
+ },
208
+
209
+ // Status
210
+ active: {
211
+ type: 'boolean',
212
+ description: 'Whether product is available for purchase',
213
+ },
214
+
215
+ // Classification
216
+ type: {
217
+ type: 'string',
218
+ optional: true,
219
+ description: 'Product type: service or good',
220
+ examples: ['service', 'good'],
221
+ },
222
+ unitLabel: {
223
+ type: 'string',
224
+ optional: true,
225
+ description: 'Unit label (e.g., "per seat", "per GB")',
226
+ },
227
+
228
+ // Display
229
+ images: {
230
+ type: 'url',
231
+ array: true,
232
+ optional: true,
233
+ description: 'Product images',
234
+ },
235
+ url: {
236
+ type: 'url',
237
+ optional: true,
238
+ description: 'Product URL',
239
+ },
240
+
241
+ // Features
242
+ features: {
243
+ type: 'json',
244
+ array: true,
245
+ optional: true,
246
+ description: 'Product features',
247
+ },
248
+
249
+ // Tax
250
+ taxCode: {
251
+ type: 'string',
252
+ optional: true,
253
+ description: 'Tax code for product',
254
+ },
255
+
256
+ // Metadata
257
+ metadata: {
258
+ type: 'json',
259
+ optional: true,
260
+ description: 'Additional metadata',
261
+ },
262
+
263
+ // Timestamps
264
+ created: {
265
+ type: 'datetime',
266
+ description: 'Time at which the product was created',
267
+ },
268
+ updated: {
269
+ type: 'datetime',
270
+ optional: true,
271
+ description: 'Time at which the product was last updated',
272
+ },
273
+ },
274
+
275
+ relationships: {
276
+ prices: {
277
+ type: 'Price[]',
278
+ backref: 'product',
279
+ description: 'Prices for this product',
280
+ },
281
+ defaultPrice: {
282
+ type: 'Price',
283
+ required: false,
284
+ description: 'Default price',
285
+ },
286
+ },
287
+
288
+ actions: [
289
+ 'create',
290
+ 'update',
291
+ 'delete',
292
+ 'list',
293
+ 'retrieve',
294
+ 'search',
295
+ ],
296
+
297
+ events: [
298
+ 'product.created',
299
+ 'product.updated',
300
+ 'product.deleted',
301
+ ],
302
+ }
303
+
304
+ /**
305
+ * Price entity
306
+ *
307
+ * Represents pricing configuration (one-time or recurring)
308
+ */
309
+ export const Price: Noun = {
310
+ singular: 'price',
311
+ plural: 'prices',
312
+ description: 'Pricing configuration for a product',
313
+
314
+ properties: {
315
+ // Identity
316
+ priceId: {
317
+ type: 'string',
318
+ description: 'Unique price identifier',
319
+ },
320
+ nickname: {
321
+ type: 'string',
322
+ optional: true,
323
+ description: 'Price nickname',
324
+ },
325
+
326
+ // Status
327
+ active: {
328
+ type: 'boolean',
329
+ description: 'Whether price is available for new purchases',
330
+ },
331
+
332
+ // Type
333
+ type: {
334
+ type: 'string',
335
+ description: 'Pricing type: one_time or recurring',
336
+ examples: ['one_time', 'recurring'],
337
+ },
338
+
339
+ // Amount
340
+ unitAmount: {
341
+ type: 'number',
342
+ optional: true,
343
+ description: 'Unit price in cents',
344
+ },
345
+ unitAmountDecimal: {
346
+ type: 'string',
347
+ optional: true,
348
+ description: 'Unit price as decimal string for precision',
349
+ },
350
+ currency: {
351
+ type: 'string',
352
+ description: 'Currency code (ISO 4217)',
353
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
354
+ },
355
+
356
+ // Billing Scheme
357
+ billingScheme: {
358
+ type: 'string',
359
+ optional: true,
360
+ description: 'Billing scheme: per_unit or tiered',
361
+ examples: ['per_unit', 'tiered'],
362
+ },
363
+ tiers: {
364
+ type: 'json',
365
+ array: true,
366
+ optional: true,
367
+ description: 'Pricing tiers (for tiered billing)',
368
+ },
369
+ tiersMode: {
370
+ type: 'string',
371
+ optional: true,
372
+ description: 'Tiers mode: graduated or volume',
373
+ examples: ['graduated', 'volume'],
374
+ },
375
+
376
+ // Recurring Details
377
+ recurring: {
378
+ type: 'json',
379
+ optional: true,
380
+ description: 'Recurring pricing details (interval, interval_count, usage_type, aggregate_usage)',
381
+ },
382
+
383
+ // Transform Quantity
384
+ transformQuantity: {
385
+ type: 'json',
386
+ optional: true,
387
+ description: 'Transform quantity settings',
388
+ },
389
+
390
+ // Tax
391
+ taxBehavior: {
392
+ type: 'string',
393
+ optional: true,
394
+ description: 'Tax behavior: inclusive, exclusive, unspecified',
395
+ examples: ['inclusive', 'exclusive', 'unspecified'],
396
+ },
397
+
398
+ // Metadata
399
+ metadata: {
400
+ type: 'json',
401
+ optional: true,
402
+ description: 'Additional metadata',
403
+ },
404
+
405
+ // Timestamps
406
+ created: {
407
+ type: 'datetime',
408
+ description: 'Time at which the price was created',
409
+ },
410
+ },
411
+
412
+ relationships: {
413
+ product: {
414
+ type: 'Product',
415
+ backref: 'prices',
416
+ description: 'Product this price belongs to',
417
+ },
418
+ },
419
+
420
+ actions: [
421
+ 'create',
422
+ 'update',
423
+ 'list',
424
+ 'retrieve',
425
+ 'search',
426
+ ],
427
+
428
+ events: [
429
+ 'price.created',
430
+ 'price.updated',
431
+ 'price.deleted',
432
+ ],
433
+ }
434
+
435
+ // =============================================================================
436
+ // PAYMENTS
437
+ // =============================================================================
438
+
439
+ /**
440
+ * PaymentMethod entity
441
+ *
442
+ * Represents a payment method (card, bank account, etc.)
443
+ */
444
+ export const PaymentMethod: Noun = {
445
+ singular: 'payment method',
446
+ plural: 'payment methods',
447
+ description: 'A payment method such as card or bank account',
448
+
449
+ properties: {
450
+ // Identity
451
+ paymentMethodId: {
452
+ type: 'string',
453
+ description: 'Unique payment method identifier',
454
+ },
455
+
456
+ // Type
457
+ type: {
458
+ type: 'string',
459
+ description: 'Payment method type: card, us_bank_account, sepa_debit, etc.',
460
+ examples: ['card', 'us_bank_account', 'sepa_debit', 'acss_debit', 'alipay', 'wechat_pay'],
461
+ },
462
+
463
+ // Card Details
464
+ card: {
465
+ type: 'json',
466
+ optional: true,
467
+ description: 'Card details (brand, last4, exp_month, exp_year, etc.)',
468
+ },
469
+
470
+ // Bank Account Details
471
+ usBankAccount: {
472
+ type: 'json',
473
+ optional: true,
474
+ description: 'US bank account details',
475
+ },
476
+ sepaDebit: {
477
+ type: 'json',
478
+ optional: true,
479
+ description: 'SEPA debit details',
480
+ },
481
+
482
+ // Billing Details
483
+ billingDetails: {
484
+ type: 'json',
485
+ optional: true,
486
+ description: 'Billing details (name, email, phone, address)',
487
+ },
488
+
489
+ // Metadata
490
+ metadata: {
491
+ type: 'json',
492
+ optional: true,
493
+ description: 'Additional metadata',
494
+ },
495
+
496
+ // Timestamps
497
+ created: {
498
+ type: 'datetime',
499
+ description: 'Time at which the payment method was created',
500
+ },
501
+ },
502
+
503
+ relationships: {
504
+ customer: {
505
+ type: 'Customer',
506
+ required: false,
507
+ description: 'Customer this payment method belongs to',
508
+ },
509
+ },
510
+
511
+ actions: [
512
+ 'create',
513
+ 'update',
514
+ 'attach',
515
+ 'detach',
516
+ 'list',
517
+ 'retrieve',
518
+ ],
519
+
520
+ events: [
521
+ 'payment_method.attached',
522
+ 'payment_method.detached',
523
+ 'payment_method.updated',
524
+ 'payment_method.automatically_updated',
525
+ ],
526
+ }
527
+
528
+ /**
529
+ * PaymentIntent entity
530
+ *
531
+ * Represents an intent to collect payment
532
+ */
533
+ export const PaymentIntent: Noun = {
534
+ singular: 'payment intent',
535
+ plural: 'payment intents',
536
+ description: 'An intent to collect payment from a customer',
537
+
538
+ properties: {
539
+ // Identity
540
+ paymentIntentId: {
541
+ type: 'string',
542
+ description: 'Unique payment intent identifier',
543
+ },
544
+ clientSecret: {
545
+ type: 'string',
546
+ optional: true,
547
+ description: 'Client secret for completing payment',
548
+ },
549
+
550
+ // Amount
551
+ amount: {
552
+ type: 'number',
553
+ description: 'Amount in cents',
554
+ },
555
+ amountCapturable: {
556
+ type: 'number',
557
+ optional: true,
558
+ description: 'Amount capturable in cents',
559
+ },
560
+ amountReceived: {
561
+ type: 'number',
562
+ optional: true,
563
+ description: 'Amount received in cents',
564
+ },
565
+ currency: {
566
+ type: 'string',
567
+ description: 'Currency code (ISO 4217)',
568
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
569
+ },
570
+
571
+ // Status
572
+ status: {
573
+ type: 'string',
574
+ description: 'Status: requires_payment_method, requires_confirmation, requires_action, processing, succeeded, canceled',
575
+ examples: ['requires_payment_method', 'requires_confirmation', 'requires_action', 'processing', 'succeeded', 'canceled'],
576
+ },
577
+ cancellationReason: {
578
+ type: 'string',
579
+ optional: true,
580
+ description: 'Cancellation reason',
581
+ },
582
+
583
+ // Capture
584
+ captureMethod: {
585
+ type: 'string',
586
+ optional: true,
587
+ description: 'Capture method: automatic or manual',
588
+ examples: ['automatic', 'manual'],
589
+ },
590
+
591
+ // Confirmation
592
+ confirmationMethod: {
593
+ type: 'string',
594
+ optional: true,
595
+ description: 'Confirmation method: automatic or manual',
596
+ examples: ['automatic', 'manual'],
597
+ },
598
+
599
+ // Description
600
+ description: {
601
+ type: 'string',
602
+ optional: true,
603
+ description: 'Description of payment',
604
+ },
605
+ statementDescriptor: {
606
+ type: 'string',
607
+ optional: true,
608
+ description: 'Statement descriptor',
609
+ },
610
+
611
+ // Receipt
612
+ receiptEmail: {
613
+ type: 'string',
614
+ optional: true,
615
+ description: 'Email to send receipt to',
616
+ },
617
+
618
+ // Setup Future Usage
619
+ setupFutureUsage: {
620
+ type: 'string',
621
+ optional: true,
622
+ description: 'Setup for future usage: on_session or off_session',
623
+ examples: ['on_session', 'off_session'],
624
+ },
625
+
626
+ // Metadata
627
+ metadata: {
628
+ type: 'json',
629
+ optional: true,
630
+ description: 'Additional metadata',
631
+ },
632
+
633
+ // Timestamps
634
+ created: {
635
+ type: 'datetime',
636
+ description: 'Time at which the payment intent was created',
637
+ },
638
+ canceledAt: {
639
+ type: 'datetime',
640
+ optional: true,
641
+ description: 'Time at which the payment intent was canceled',
642
+ },
643
+ },
644
+
645
+ relationships: {
646
+ customer: {
647
+ type: 'Customer',
648
+ required: false,
649
+ description: 'Customer making the payment',
650
+ },
651
+ paymentMethod: {
652
+ type: 'PaymentMethod',
653
+ required: false,
654
+ description: 'Payment method used',
655
+ },
656
+ invoice: {
657
+ type: 'Invoice',
658
+ required: false,
659
+ description: 'Invoice this payment is for',
660
+ },
661
+ charges: {
662
+ type: 'Charge[]',
663
+ description: 'Charges created by this payment intent',
664
+ },
665
+ },
666
+
667
+ actions: [
668
+ 'create',
669
+ 'update',
670
+ 'confirm',
671
+ 'capture',
672
+ 'cancel',
673
+ 'list',
674
+ 'retrieve',
675
+ ],
676
+
677
+ events: [
678
+ 'payment_intent.created',
679
+ 'payment_intent.succeeded',
680
+ 'payment_intent.canceled',
681
+ 'payment_intent.processing',
682
+ 'payment_intent.payment_failed',
683
+ 'payment_intent.amount_capturable_updated',
684
+ ],
685
+ }
686
+
687
+ /**
688
+ * Charge entity
689
+ *
690
+ * Represents a charge attempt
691
+ */
692
+ export const Charge: Noun = {
693
+ singular: 'charge',
694
+ plural: 'charges',
695
+ description: 'A charge attempt on a payment source',
696
+
697
+ properties: {
698
+ // Identity
699
+ chargeId: {
700
+ type: 'string',
701
+ description: 'Unique charge identifier',
702
+ },
703
+
704
+ // Amount
705
+ amount: {
706
+ type: 'number',
707
+ description: 'Amount charged in cents',
708
+ },
709
+ amountCaptured: {
710
+ type: 'number',
711
+ optional: true,
712
+ description: 'Amount captured in cents',
713
+ },
714
+ amountRefunded: {
715
+ type: 'number',
716
+ optional: true,
717
+ description: 'Amount refunded in cents',
718
+ },
719
+ currency: {
720
+ type: 'string',
721
+ description: 'Currency code (ISO 4217)',
722
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
723
+ },
724
+
725
+ // Status
726
+ status: {
727
+ type: 'string',
728
+ description: 'Status: succeeded, pending, failed',
729
+ examples: ['succeeded', 'pending', 'failed'],
730
+ },
731
+ paid: {
732
+ type: 'boolean',
733
+ description: 'Whether charge was paid',
734
+ },
735
+ refunded: {
736
+ type: 'boolean',
737
+ optional: true,
738
+ description: 'Whether charge was refunded',
739
+ },
740
+ captured: {
741
+ type: 'boolean',
742
+ optional: true,
743
+ description: 'Whether charge was captured',
744
+ },
745
+
746
+ // Description
747
+ description: {
748
+ type: 'string',
749
+ optional: true,
750
+ description: 'Charge description',
751
+ },
752
+ statementDescriptor: {
753
+ type: 'string',
754
+ optional: true,
755
+ description: 'Statement descriptor',
756
+ },
757
+
758
+ // Receipt
759
+ receiptEmail: {
760
+ type: 'string',
761
+ optional: true,
762
+ description: 'Email receipt was sent to',
763
+ },
764
+ receiptNumber: {
765
+ type: 'string',
766
+ optional: true,
767
+ description: 'Receipt number',
768
+ },
769
+ receiptUrl: {
770
+ type: 'url',
771
+ optional: true,
772
+ description: 'Receipt URL',
773
+ },
774
+
775
+ // Failure
776
+ failureCode: {
777
+ type: 'string',
778
+ optional: true,
779
+ description: 'Failure code',
780
+ },
781
+ failureMessage: {
782
+ type: 'string',
783
+ optional: true,
784
+ description: 'Failure message',
785
+ },
786
+
787
+ // Payment Details
788
+ paymentMethodDetails: {
789
+ type: 'json',
790
+ optional: true,
791
+ description: 'Payment method details',
792
+ },
793
+
794
+ // Fraud Detection
795
+ fraudDetails: {
796
+ type: 'json',
797
+ optional: true,
798
+ description: 'Fraud detection details',
799
+ },
800
+
801
+ // Metadata
802
+ metadata: {
803
+ type: 'json',
804
+ optional: true,
805
+ description: 'Additional metadata',
806
+ },
807
+
808
+ // Timestamps
809
+ created: {
810
+ type: 'datetime',
811
+ description: 'Time at which the charge was created',
812
+ },
813
+ },
814
+
815
+ relationships: {
816
+ customer: {
817
+ type: 'Customer',
818
+ required: false,
819
+ description: 'Customer charged',
820
+ },
821
+ paymentIntent: {
822
+ type: 'PaymentIntent',
823
+ required: false,
824
+ description: 'Payment intent that created this charge',
825
+ },
826
+ paymentMethod: {
827
+ type: 'PaymentMethod',
828
+ required: false,
829
+ description: 'Payment method used',
830
+ },
831
+ invoice: {
832
+ type: 'Invoice',
833
+ required: false,
834
+ description: 'Invoice this charge is for',
835
+ },
836
+ refunds: {
837
+ type: 'Refund[]',
838
+ backref: 'charge',
839
+ description: 'Refunds for this charge',
840
+ },
841
+ balanceTransaction: {
842
+ type: 'BalanceTransaction',
843
+ required: false,
844
+ description: 'Balance transaction',
845
+ },
846
+ },
847
+
848
+ actions: [
849
+ 'create',
850
+ 'update',
851
+ 'capture',
852
+ 'list',
853
+ 'retrieve',
854
+ ],
855
+
856
+ events: [
857
+ 'charge.succeeded',
858
+ 'charge.failed',
859
+ 'charge.pending',
860
+ 'charge.captured',
861
+ 'charge.updated',
862
+ 'charge.refunded',
863
+ 'charge.dispute.created',
864
+ 'charge.dispute.updated',
865
+ 'charge.dispute.closed',
866
+ ],
867
+ }
868
+
869
+ /**
870
+ * Refund entity
871
+ *
872
+ * Represents a refund of a charge
873
+ */
874
+ export const Refund: Noun = {
875
+ singular: 'refund',
876
+ plural: 'refunds',
877
+ description: 'A refund of a charge',
878
+
879
+ properties: {
880
+ // Identity
881
+ refundId: {
882
+ type: 'string',
883
+ description: 'Unique refund identifier',
884
+ },
885
+
886
+ // Amount
887
+ amount: {
888
+ type: 'number',
889
+ description: 'Amount refunded in cents',
890
+ },
891
+ currency: {
892
+ type: 'string',
893
+ description: 'Currency code (ISO 4217)',
894
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
895
+ },
896
+
897
+ // Status
898
+ status: {
899
+ type: 'string',
900
+ optional: true,
901
+ description: 'Status: succeeded, failed, pending, canceled',
902
+ examples: ['succeeded', 'failed', 'pending', 'canceled'],
903
+ },
904
+
905
+ // Reason
906
+ reason: {
907
+ type: 'string',
908
+ optional: true,
909
+ description: 'Reason: duplicate, fraudulent, requested_by_customer',
910
+ examples: ['duplicate', 'fraudulent', 'requested_by_customer'],
911
+ },
912
+
913
+ // Receipt
914
+ receiptNumber: {
915
+ type: 'string',
916
+ optional: true,
917
+ description: 'Receipt number',
918
+ },
919
+
920
+ // Failure
921
+ failureReason: {
922
+ type: 'string',
923
+ optional: true,
924
+ description: 'Failure reason',
925
+ },
926
+
927
+ // Metadata
928
+ metadata: {
929
+ type: 'json',
930
+ optional: true,
931
+ description: 'Additional metadata',
932
+ },
933
+
934
+ // Timestamps
935
+ created: {
936
+ type: 'datetime',
937
+ description: 'Time at which the refund was created',
938
+ },
939
+ },
940
+
941
+ relationships: {
942
+ charge: {
943
+ type: 'Charge',
944
+ backref: 'refunds',
945
+ description: 'Charge that was refunded',
946
+ },
947
+ paymentIntent: {
948
+ type: 'PaymentIntent',
949
+ required: false,
950
+ description: 'Payment intent that was refunded',
951
+ },
952
+ balanceTransaction: {
953
+ type: 'BalanceTransaction',
954
+ required: false,
955
+ description: 'Balance transaction',
956
+ },
957
+ },
958
+
959
+ actions: [
960
+ 'create',
961
+ 'update',
962
+ 'cancel',
963
+ 'list',
964
+ 'retrieve',
965
+ ],
966
+
967
+ events: [
968
+ 'charge.refund.updated',
969
+ ],
970
+ }
971
+
972
+ // =============================================================================
973
+ // BILLING
974
+ // =============================================================================
975
+
976
+ /**
977
+ * Invoice entity
978
+ *
979
+ * Represents a statement of amounts owed
980
+ */
981
+ export const Invoice: Noun = {
982
+ singular: 'invoice',
983
+ plural: 'invoices',
984
+ description: 'A statement of amounts owed by a customer',
985
+
986
+ properties: {
987
+ // Identity
988
+ invoiceId: {
989
+ type: 'string',
990
+ description: 'Unique invoice identifier',
991
+ },
992
+ number: {
993
+ type: 'string',
994
+ optional: true,
995
+ description: 'Invoice number',
996
+ },
997
+
998
+ // Status
999
+ status: {
1000
+ type: 'string',
1001
+ optional: true,
1002
+ description: 'Status: draft, open, paid, void, uncollectible',
1003
+ examples: ['draft', 'open', 'paid', 'void', 'uncollectible'],
1004
+ },
1005
+
1006
+ // Amount
1007
+ amountDue: {
1008
+ type: 'number',
1009
+ optional: true,
1010
+ description: 'Amount due in cents',
1011
+ },
1012
+ amountPaid: {
1013
+ type: 'number',
1014
+ optional: true,
1015
+ description: 'Amount paid in cents',
1016
+ },
1017
+ amountRemaining: {
1018
+ type: 'number',
1019
+ optional: true,
1020
+ description: 'Amount remaining in cents',
1021
+ },
1022
+ subtotal: {
1023
+ type: 'number',
1024
+ optional: true,
1025
+ description: 'Subtotal before discounts and tax',
1026
+ },
1027
+ total: {
1028
+ type: 'number',
1029
+ optional: true,
1030
+ description: 'Total amount',
1031
+ },
1032
+ tax: {
1033
+ type: 'number',
1034
+ optional: true,
1035
+ description: 'Tax amount',
1036
+ },
1037
+ currency: {
1038
+ type: 'string',
1039
+ description: 'Currency code (ISO 4217)',
1040
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
1041
+ },
1042
+
1043
+ // Description
1044
+ description: {
1045
+ type: 'string',
1046
+ optional: true,
1047
+ description: 'Invoice description',
1048
+ },
1049
+ footer: {
1050
+ type: 'string',
1051
+ optional: true,
1052
+ description: 'Invoice footer',
1053
+ },
1054
+
1055
+ // Collection
1056
+ collectionMethod: {
1057
+ type: 'string',
1058
+ optional: true,
1059
+ description: 'Collection method: charge_automatically or send_invoice',
1060
+ examples: ['charge_automatically', 'send_invoice'],
1061
+ },
1062
+ attemptCount: {
1063
+ type: 'number',
1064
+ optional: true,
1065
+ description: 'Number of payment attempts',
1066
+ },
1067
+ attempted: {
1068
+ type: 'boolean',
1069
+ optional: true,
1070
+ description: 'Whether payment was attempted',
1071
+ },
1072
+
1073
+ // Dates
1074
+ created: {
1075
+ type: 'datetime',
1076
+ description: 'Time at which the invoice was created',
1077
+ },
1078
+ dueDate: {
1079
+ type: 'datetime',
1080
+ optional: true,
1081
+ description: 'Date payment is due',
1082
+ },
1083
+ periodStart: {
1084
+ type: 'datetime',
1085
+ optional: true,
1086
+ description: 'Start of billing period',
1087
+ },
1088
+ periodEnd: {
1089
+ type: 'datetime',
1090
+ optional: true,
1091
+ description: 'End of billing period',
1092
+ },
1093
+
1094
+ // Payment
1095
+ paid: {
1096
+ type: 'boolean',
1097
+ optional: true,
1098
+ description: 'Whether invoice has been paid',
1099
+ },
1100
+ paidAt: {
1101
+ type: 'datetime',
1102
+ optional: true,
1103
+ description: 'Time at which payment occurred',
1104
+ },
1105
+
1106
+ // Invoice PDF
1107
+ invoicePdf: {
1108
+ type: 'url',
1109
+ optional: true,
1110
+ description: 'URL to invoice PDF',
1111
+ },
1112
+ hostedInvoiceUrl: {
1113
+ type: 'url',
1114
+ optional: true,
1115
+ description: 'URL to hosted invoice page',
1116
+ },
1117
+
1118
+ // Auto Advance
1119
+ autoAdvance: {
1120
+ type: 'boolean',
1121
+ optional: true,
1122
+ description: 'Whether to auto-finalize draft after period end',
1123
+ },
1124
+
1125
+ // Metadata
1126
+ metadata: {
1127
+ type: 'json',
1128
+ optional: true,
1129
+ description: 'Additional metadata',
1130
+ },
1131
+ },
1132
+
1133
+ relationships: {
1134
+ customer: {
1135
+ type: 'Customer',
1136
+ backref: 'invoices',
1137
+ description: 'Customer being invoiced',
1138
+ },
1139
+ subscription: {
1140
+ type: 'Subscription',
1141
+ required: false,
1142
+ description: 'Subscription this invoice is for',
1143
+ },
1144
+ lines: {
1145
+ type: 'InvoiceLineItem[]',
1146
+ backref: 'invoice',
1147
+ description: 'Line items',
1148
+ },
1149
+ charge: {
1150
+ type: 'Charge',
1151
+ required: false,
1152
+ description: 'Latest charge for this invoice',
1153
+ },
1154
+ paymentIntent: {
1155
+ type: 'PaymentIntent',
1156
+ required: false,
1157
+ description: 'Payment intent for this invoice',
1158
+ },
1159
+ defaultPaymentMethod: {
1160
+ type: 'PaymentMethod',
1161
+ required: false,
1162
+ description: 'Default payment method',
1163
+ },
1164
+ quote: {
1165
+ type: 'Quote',
1166
+ required: false,
1167
+ description: 'Quote this invoice was created from',
1168
+ },
1169
+ },
1170
+
1171
+ actions: [
1172
+ 'create',
1173
+ 'update',
1174
+ 'delete',
1175
+ 'finalize',
1176
+ 'pay',
1177
+ 'send',
1178
+ 'voidInvoice',
1179
+ 'markUncollectible',
1180
+ 'list',
1181
+ 'retrieve',
1182
+ 'upcomingInvoice',
1183
+ ],
1184
+
1185
+ events: [
1186
+ 'invoice.created',
1187
+ 'invoice.updated',
1188
+ 'invoice.deleted',
1189
+ 'invoice.finalized',
1190
+ 'invoice.paid',
1191
+ 'invoice.payment_failed',
1192
+ 'invoice.payment_action_required',
1193
+ 'invoice.sent',
1194
+ 'invoice.voided',
1195
+ 'invoice.marked_uncollectible',
1196
+ ],
1197
+ }
1198
+
1199
+ /**
1200
+ * InvoiceLineItem entity
1201
+ *
1202
+ * Represents a line item on an invoice
1203
+ */
1204
+ export const InvoiceLineItem: Noun = {
1205
+ singular: 'invoice line item',
1206
+ plural: 'invoice line items',
1207
+ description: 'A line item on an invoice',
1208
+
1209
+ properties: {
1210
+ // Identity
1211
+ lineItemId: {
1212
+ type: 'string',
1213
+ description: 'Unique line item identifier',
1214
+ },
1215
+
1216
+ // Type
1217
+ type: {
1218
+ type: 'string',
1219
+ optional: true,
1220
+ description: 'Type: invoiceitem or subscription',
1221
+ examples: ['invoiceitem', 'subscription'],
1222
+ },
1223
+
1224
+ // Amount
1225
+ amount: {
1226
+ type: 'number',
1227
+ description: 'Amount in cents',
1228
+ },
1229
+ currency: {
1230
+ type: 'string',
1231
+ description: 'Currency code (ISO 4217)',
1232
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
1233
+ },
1234
+
1235
+ // Description
1236
+ description: {
1237
+ type: 'string',
1238
+ optional: true,
1239
+ description: 'Line item description',
1240
+ },
1241
+
1242
+ // Quantity
1243
+ quantity: {
1244
+ type: 'number',
1245
+ optional: true,
1246
+ description: 'Quantity',
1247
+ },
1248
+
1249
+ // Unit Amount
1250
+ unitAmount: {
1251
+ type: 'number',
1252
+ optional: true,
1253
+ description: 'Unit amount in cents',
1254
+ },
1255
+ unitAmountExcludingTax: {
1256
+ type: 'number',
1257
+ optional: true,
1258
+ description: 'Unit amount excluding tax',
1259
+ },
1260
+
1261
+ // Period
1262
+ period: {
1263
+ type: 'json',
1264
+ optional: true,
1265
+ description: 'Period this line item covers',
1266
+ },
1267
+
1268
+ // Proration
1269
+ proration: {
1270
+ type: 'boolean',
1271
+ optional: true,
1272
+ description: 'Whether this is a proration',
1273
+ },
1274
+
1275
+ // Metadata
1276
+ metadata: {
1277
+ type: 'json',
1278
+ optional: true,
1279
+ description: 'Additional metadata',
1280
+ },
1281
+ },
1282
+
1283
+ relationships: {
1284
+ invoice: {
1285
+ type: 'Invoice',
1286
+ backref: 'lines',
1287
+ description: 'Invoice this line item belongs to',
1288
+ },
1289
+ price: {
1290
+ type: 'Price',
1291
+ required: false,
1292
+ description: 'Price for this line item',
1293
+ },
1294
+ subscription: {
1295
+ type: 'Subscription',
1296
+ required: false,
1297
+ description: 'Subscription this line item is for',
1298
+ },
1299
+ subscriptionItem: {
1300
+ type: 'SubscriptionItem',
1301
+ required: false,
1302
+ description: 'Subscription item',
1303
+ },
1304
+ },
1305
+
1306
+ actions: [
1307
+ 'create',
1308
+ 'update',
1309
+ 'delete',
1310
+ 'list',
1311
+ 'retrieve',
1312
+ ],
1313
+
1314
+ events: [],
1315
+ }
1316
+
1317
+ /**
1318
+ * Subscription entity
1319
+ *
1320
+ * Represents a recurring payment arrangement
1321
+ */
1322
+ export const Subscription: Noun = {
1323
+ singular: 'subscription',
1324
+ plural: 'subscriptions',
1325
+ description: 'A recurring payment arrangement',
1326
+
1327
+ properties: {
1328
+ // Identity
1329
+ subscriptionId: {
1330
+ type: 'string',
1331
+ description: 'Unique subscription identifier',
1332
+ },
1333
+
1334
+ // Status
1335
+ status: {
1336
+ type: 'string',
1337
+ description: 'Status: incomplete, incomplete_expired, trialing, active, past_due, canceled, unpaid, paused',
1338
+ examples: ['incomplete', 'incomplete_expired', 'trialing', 'active', 'past_due', 'canceled', 'unpaid', 'paused'],
1339
+ },
1340
+
1341
+ // Collection
1342
+ collectionMethod: {
1343
+ type: 'string',
1344
+ optional: true,
1345
+ description: 'Collection method: charge_automatically or send_invoice',
1346
+ examples: ['charge_automatically', 'send_invoice'],
1347
+ },
1348
+
1349
+ // Billing
1350
+ billingCycleAnchor: {
1351
+ type: 'datetime',
1352
+ optional: true,
1353
+ description: 'Billing cycle anchor',
1354
+ },
1355
+ currentPeriodStart: {
1356
+ type: 'datetime',
1357
+ optional: true,
1358
+ description: 'Start of current period',
1359
+ },
1360
+ currentPeriodEnd: {
1361
+ type: 'datetime',
1362
+ optional: true,
1363
+ description: 'End of current period',
1364
+ },
1365
+
1366
+ // Cancellation
1367
+ cancelAtPeriodEnd: {
1368
+ type: 'boolean',
1369
+ optional: true,
1370
+ description: 'Whether to cancel at period end',
1371
+ },
1372
+ canceledAt: {
1373
+ type: 'datetime',
1374
+ optional: true,
1375
+ description: 'Time subscription was canceled',
1376
+ },
1377
+ cancelAt: {
1378
+ type: 'datetime',
1379
+ optional: true,
1380
+ description: 'Time to cancel subscription',
1381
+ },
1382
+
1383
+ // Trial
1384
+ trialStart: {
1385
+ type: 'datetime',
1386
+ optional: true,
1387
+ description: 'Start of trial period',
1388
+ },
1389
+ trialEnd: {
1390
+ type: 'datetime',
1391
+ optional: true,
1392
+ description: 'End of trial period',
1393
+ },
1394
+
1395
+ // Dates
1396
+ created: {
1397
+ type: 'datetime',
1398
+ description: 'Time at which the subscription was created',
1399
+ },
1400
+ startDate: {
1401
+ type: 'datetime',
1402
+ optional: true,
1403
+ description: 'Subscription start date',
1404
+ },
1405
+ endedAt: {
1406
+ type: 'datetime',
1407
+ optional: true,
1408
+ description: 'Time subscription ended',
1409
+ },
1410
+
1411
+ // Days Until Due
1412
+ daysUntilDue: {
1413
+ type: 'number',
1414
+ optional: true,
1415
+ description: 'Days until payment is due',
1416
+ },
1417
+
1418
+ // Discount
1419
+ discount: {
1420
+ type: 'json',
1421
+ optional: true,
1422
+ description: 'Discount applied to subscription',
1423
+ },
1424
+
1425
+ // Description
1426
+ description: {
1427
+ type: 'string',
1428
+ optional: true,
1429
+ description: 'Subscription description',
1430
+ },
1431
+
1432
+ // Metadata
1433
+ metadata: {
1434
+ type: 'json',
1435
+ optional: true,
1436
+ description: 'Additional metadata',
1437
+ },
1438
+ },
1439
+
1440
+ relationships: {
1441
+ customer: {
1442
+ type: 'Customer',
1443
+ backref: 'subscriptions',
1444
+ description: 'Customer subscribed',
1445
+ },
1446
+ items: {
1447
+ type: 'SubscriptionItem[]',
1448
+ backref: 'subscription',
1449
+ description: 'Subscription items',
1450
+ },
1451
+ defaultPaymentMethod: {
1452
+ type: 'PaymentMethod',
1453
+ required: false,
1454
+ description: 'Default payment method',
1455
+ },
1456
+ latestInvoice: {
1457
+ type: 'Invoice',
1458
+ required: false,
1459
+ description: 'Latest invoice',
1460
+ },
1461
+ },
1462
+
1463
+ actions: [
1464
+ 'create',
1465
+ 'update',
1466
+ 'cancel',
1467
+ 'resume',
1468
+ 'pause',
1469
+ 'list',
1470
+ 'retrieve',
1471
+ 'search',
1472
+ ],
1473
+
1474
+ events: [
1475
+ 'customer.subscription.created',
1476
+ 'customer.subscription.updated',
1477
+ 'customer.subscription.deleted',
1478
+ 'customer.subscription.paused',
1479
+ 'customer.subscription.resumed',
1480
+ 'customer.subscription.trial_will_end',
1481
+ ],
1482
+ }
1483
+
1484
+ /**
1485
+ * SubscriptionItem entity
1486
+ *
1487
+ * Represents an item in a subscription
1488
+ */
1489
+ export const SubscriptionItem: Noun = {
1490
+ singular: 'subscription item',
1491
+ plural: 'subscription items',
1492
+ description: 'An item in a subscription',
1493
+
1494
+ properties: {
1495
+ // Identity
1496
+ subscriptionItemId: {
1497
+ type: 'string',
1498
+ description: 'Unique subscription item identifier',
1499
+ },
1500
+
1501
+ // Billing Thresholds
1502
+ billingThresholds: {
1503
+ type: 'json',
1504
+ optional: true,
1505
+ description: 'Billing thresholds',
1506
+ },
1507
+
1508
+ // Quantity
1509
+ quantity: {
1510
+ type: 'number',
1511
+ optional: true,
1512
+ description: 'Quantity',
1513
+ },
1514
+
1515
+ // Tax Rates
1516
+ taxRates: {
1517
+ type: 'json',
1518
+ array: true,
1519
+ optional: true,
1520
+ description: 'Tax rates',
1521
+ },
1522
+
1523
+ // Metadata
1524
+ metadata: {
1525
+ type: 'json',
1526
+ optional: true,
1527
+ description: 'Additional metadata',
1528
+ },
1529
+
1530
+ // Timestamps
1531
+ created: {
1532
+ type: 'datetime',
1533
+ description: 'Time at which the subscription item was created',
1534
+ },
1535
+ },
1536
+
1537
+ relationships: {
1538
+ subscription: {
1539
+ type: 'Subscription',
1540
+ backref: 'items',
1541
+ description: 'Subscription this item belongs to',
1542
+ },
1543
+ price: {
1544
+ type: 'Price',
1545
+ description: 'Price for this item',
1546
+ },
1547
+ },
1548
+
1549
+ actions: [
1550
+ 'create',
1551
+ 'update',
1552
+ 'delete',
1553
+ 'list',
1554
+ 'retrieve',
1555
+ ],
1556
+
1557
+ events: [],
1558
+ }
1559
+
1560
+ /**
1561
+ * Quote entity
1562
+ *
1563
+ * Represents proposed pricing for a customer
1564
+ */
1565
+ export const Quote: Noun = {
1566
+ singular: 'quote',
1567
+ plural: 'quotes',
1568
+ description: 'Proposed pricing for a customer',
1569
+
1570
+ properties: {
1571
+ // Identity
1572
+ quoteId: {
1573
+ type: 'string',
1574
+ description: 'Unique quote identifier',
1575
+ },
1576
+ number: {
1577
+ type: 'string',
1578
+ optional: true,
1579
+ description: 'Quote number',
1580
+ },
1581
+
1582
+ // Status
1583
+ status: {
1584
+ type: 'string',
1585
+ description: 'Status: draft, open, accepted, canceled',
1586
+ examples: ['draft', 'open', 'accepted', 'canceled'],
1587
+ },
1588
+
1589
+ // Amount
1590
+ amountSubtotal: {
1591
+ type: 'number',
1592
+ optional: true,
1593
+ description: 'Subtotal amount in cents',
1594
+ },
1595
+ amountTotal: {
1596
+ type: 'number',
1597
+ optional: true,
1598
+ description: 'Total amount in cents',
1599
+ },
1600
+ currency: {
1601
+ type: 'string',
1602
+ description: 'Currency code (ISO 4217)',
1603
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
1604
+ },
1605
+
1606
+ // Description
1607
+ description: {
1608
+ type: 'string',
1609
+ optional: true,
1610
+ description: 'Quote description',
1611
+ },
1612
+ header: {
1613
+ type: 'string',
1614
+ optional: true,
1615
+ description: 'Quote header',
1616
+ },
1617
+ footer: {
1618
+ type: 'string',
1619
+ optional: true,
1620
+ description: 'Quote footer',
1621
+ },
1622
+
1623
+ // Expiration
1624
+ expiresAt: {
1625
+ type: 'datetime',
1626
+ optional: true,
1627
+ description: 'Quote expiration time',
1628
+ },
1629
+
1630
+ // Collection
1631
+ collectionMethod: {
1632
+ type: 'string',
1633
+ optional: true,
1634
+ description: 'Collection method: charge_automatically or send_invoice',
1635
+ examples: ['charge_automatically', 'send_invoice'],
1636
+ },
1637
+
1638
+ // Metadata
1639
+ metadata: {
1640
+ type: 'json',
1641
+ optional: true,
1642
+ description: 'Additional metadata',
1643
+ },
1644
+
1645
+ // Timestamps
1646
+ created: {
1647
+ type: 'datetime',
1648
+ description: 'Time at which the quote was created',
1649
+ },
1650
+ },
1651
+
1652
+ relationships: {
1653
+ customer: {
1654
+ type: 'Customer',
1655
+ description: 'Customer being quoted',
1656
+ },
1657
+ invoice: {
1658
+ type: 'Invoice',
1659
+ required: false,
1660
+ description: 'Invoice created from quote',
1661
+ },
1662
+ subscription: {
1663
+ type: 'Subscription',
1664
+ required: false,
1665
+ description: 'Subscription created from quote',
1666
+ },
1667
+ },
1668
+
1669
+ actions: [
1670
+ 'create',
1671
+ 'update',
1672
+ 'finalize',
1673
+ 'accept',
1674
+ 'cancel',
1675
+ 'list',
1676
+ 'retrieve',
1677
+ 'pdf',
1678
+ ],
1679
+
1680
+ events: [
1681
+ 'quote.created',
1682
+ 'quote.finalized',
1683
+ 'quote.accepted',
1684
+ 'quote.canceled',
1685
+ ],
1686
+ }
1687
+
1688
+ // =============================================================================
1689
+ // BALANCE
1690
+ // =============================================================================
1691
+
1692
+ /**
1693
+ * Balance entity
1694
+ *
1695
+ * Represents the Stripe account balance
1696
+ */
1697
+ export const Balance: Noun = {
1698
+ singular: 'balance',
1699
+ plural: 'balances',
1700
+ description: 'The balance of a Stripe account',
1701
+
1702
+ properties: {
1703
+ // Available
1704
+ available: {
1705
+ type: 'json',
1706
+ array: true,
1707
+ description: 'Available balance by currency',
1708
+ },
1709
+
1710
+ // Pending
1711
+ pending: {
1712
+ type: 'json',
1713
+ array: true,
1714
+ description: 'Pending balance by currency',
1715
+ },
1716
+
1717
+ // Livemode
1718
+ livemode: {
1719
+ type: 'boolean',
1720
+ description: 'Whether in live mode',
1721
+ },
1722
+ },
1723
+
1724
+ relationships: {},
1725
+
1726
+ actions: [
1727
+ 'retrieve',
1728
+ ],
1729
+
1730
+ events: [],
1731
+ }
1732
+
1733
+ /**
1734
+ * BalanceTransaction entity
1735
+ *
1736
+ * Represents a transaction affecting the account balance
1737
+ */
1738
+ export const BalanceTransaction: Noun = {
1739
+ singular: 'balance transaction',
1740
+ plural: 'balance transactions',
1741
+ description: 'A transaction affecting the account balance',
1742
+
1743
+ properties: {
1744
+ // Identity
1745
+ balanceTransactionId: {
1746
+ type: 'string',
1747
+ description: 'Unique balance transaction identifier',
1748
+ },
1749
+
1750
+ // Amount
1751
+ amount: {
1752
+ type: 'number',
1753
+ description: 'Gross amount in cents',
1754
+ },
1755
+ net: {
1756
+ type: 'number',
1757
+ description: 'Net amount in cents',
1758
+ },
1759
+ fee: {
1760
+ type: 'number',
1761
+ optional: true,
1762
+ description: 'Fee amount in cents',
1763
+ },
1764
+ currency: {
1765
+ type: 'string',
1766
+ description: 'Currency code (ISO 4217)',
1767
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
1768
+ },
1769
+
1770
+ // Type
1771
+ type: {
1772
+ type: 'string',
1773
+ description: 'Transaction type: charge, refund, adjustment, application_fee, etc.',
1774
+ examples: ['charge', 'refund', 'adjustment', 'application_fee', 'application_fee_refund', 'transfer', 'payment', 'payout'],
1775
+ },
1776
+
1777
+ // Description
1778
+ description: {
1779
+ type: 'string',
1780
+ optional: true,
1781
+ description: 'Transaction description',
1782
+ },
1783
+
1784
+ // Status
1785
+ status: {
1786
+ type: 'string',
1787
+ description: 'Status: available or pending',
1788
+ examples: ['available', 'pending'],
1789
+ },
1790
+
1791
+ // Reporting Category
1792
+ reportingCategory: {
1793
+ type: 'string',
1794
+ optional: true,
1795
+ description: 'Reporting category',
1796
+ },
1797
+
1798
+ // Fee Details
1799
+ feeDetails: {
1800
+ type: 'json',
1801
+ array: true,
1802
+ optional: true,
1803
+ description: 'Breakdown of fees',
1804
+ },
1805
+
1806
+ // Dates
1807
+ created: {
1808
+ type: 'datetime',
1809
+ description: 'Time at which the transaction was created',
1810
+ },
1811
+ availableOn: {
1812
+ type: 'datetime',
1813
+ optional: true,
1814
+ description: 'Time funds become available',
1815
+ },
1816
+ },
1817
+
1818
+ relationships: {
1819
+ source: {
1820
+ type: 'json',
1821
+ required: false,
1822
+ description: 'Source object (Charge, Refund, Transfer, etc.)',
1823
+ },
1824
+ },
1825
+
1826
+ actions: [
1827
+ 'list',
1828
+ 'retrieve',
1829
+ ],
1830
+
1831
+ events: [],
1832
+ }
1833
+
1834
+ // =============================================================================
1835
+ // CONNECT (for platforms)
1836
+ // =============================================================================
1837
+
1838
+ /**
1839
+ * Account entity (Stripe Connect)
1840
+ *
1841
+ * Represents a connected Stripe account
1842
+ */
1843
+ export const Account: Noun = {
1844
+ singular: 'account',
1845
+ plural: 'accounts',
1846
+ description: 'A connected Stripe account',
1847
+
1848
+ properties: {
1849
+ // Identity
1850
+ accountId: {
1851
+ type: 'string',
1852
+ description: 'Unique account identifier',
1853
+ },
1854
+ email: {
1855
+ type: 'string',
1856
+ optional: true,
1857
+ description: 'Account email',
1858
+ },
1859
+
1860
+ // Type
1861
+ type: {
1862
+ type: 'string',
1863
+ optional: true,
1864
+ description: 'Account type: standard, express, custom',
1865
+ examples: ['standard', 'express', 'custom'],
1866
+ },
1867
+
1868
+ // Business
1869
+ businessType: {
1870
+ type: 'string',
1871
+ optional: true,
1872
+ description: 'Business type: individual, company, non_profit, government_entity',
1873
+ examples: ['individual', 'company', 'non_profit', 'government_entity'],
1874
+ },
1875
+ businessProfile: {
1876
+ type: 'json',
1877
+ optional: true,
1878
+ description: 'Business profile information',
1879
+ },
1880
+ company: {
1881
+ type: 'json',
1882
+ optional: true,
1883
+ description: 'Company information',
1884
+ },
1885
+ individual: {
1886
+ type: 'json',
1887
+ optional: true,
1888
+ description: 'Individual information',
1889
+ },
1890
+
1891
+ // Capabilities
1892
+ capabilities: {
1893
+ type: 'json',
1894
+ optional: true,
1895
+ description: 'Account capabilities',
1896
+ },
1897
+
1898
+ // Requirements
1899
+ requirements: {
1900
+ type: 'json',
1901
+ optional: true,
1902
+ description: 'Account requirements',
1903
+ },
1904
+
1905
+ // Settings
1906
+ settings: {
1907
+ type: 'json',
1908
+ optional: true,
1909
+ description: 'Account settings',
1910
+ },
1911
+
1912
+ // Charges
1913
+ chargesEnabled: {
1914
+ type: 'boolean',
1915
+ optional: true,
1916
+ description: 'Whether charges are enabled',
1917
+ },
1918
+ payoutsEnabled: {
1919
+ type: 'boolean',
1920
+ optional: true,
1921
+ description: 'Whether payouts are enabled',
1922
+ },
1923
+ detailsSubmitted: {
1924
+ type: 'boolean',
1925
+ optional: true,
1926
+ description: 'Whether account details have been submitted',
1927
+ },
1928
+
1929
+ // Country
1930
+ country: {
1931
+ type: 'string',
1932
+ optional: true,
1933
+ description: 'Country code',
1934
+ },
1935
+ defaultCurrency: {
1936
+ type: 'string',
1937
+ optional: true,
1938
+ description: 'Default currency',
1939
+ },
1940
+
1941
+ // Metadata
1942
+ metadata: {
1943
+ type: 'json',
1944
+ optional: true,
1945
+ description: 'Additional metadata',
1946
+ },
1947
+
1948
+ // Timestamps
1949
+ created: {
1950
+ type: 'datetime',
1951
+ description: 'Time at which the account was created',
1952
+ },
1953
+ },
1954
+
1955
+ relationships: {
1956
+ externalAccounts: {
1957
+ type: 'BankAccount[]',
1958
+ description: 'External accounts (bank accounts, cards)',
1959
+ },
1960
+ },
1961
+
1962
+ actions: [
1963
+ 'create',
1964
+ 'update',
1965
+ 'delete',
1966
+ 'reject',
1967
+ 'list',
1968
+ 'retrieve',
1969
+ ],
1970
+
1971
+ events: [
1972
+ 'account.updated',
1973
+ 'account.application.authorized',
1974
+ 'account.application.deauthorized',
1975
+ 'account.external_account.created',
1976
+ 'account.external_account.deleted',
1977
+ 'account.external_account.updated',
1978
+ ],
1979
+ }
1980
+
1981
+ /**
1982
+ * AccountLink entity
1983
+ *
1984
+ * Represents an onboarding link for a connected account
1985
+ */
1986
+ export const AccountLink: Noun = {
1987
+ singular: 'account link',
1988
+ plural: 'account links',
1989
+ description: 'An onboarding link for a connected account',
1990
+
1991
+ properties: {
1992
+ // URL
1993
+ url: {
1994
+ type: 'url',
1995
+ description: 'URL for account onboarding',
1996
+ },
1997
+
1998
+ // Expiration
1999
+ expiresAt: {
2000
+ type: 'datetime',
2001
+ description: 'Time at which the link expires',
2002
+ },
2003
+
2004
+ // Created
2005
+ created: {
2006
+ type: 'datetime',
2007
+ description: 'Time at which the link was created',
2008
+ },
2009
+ },
2010
+
2011
+ relationships: {
2012
+ account: {
2013
+ type: 'Account',
2014
+ description: 'Account this link is for',
2015
+ },
2016
+ },
2017
+
2018
+ actions: [
2019
+ 'create',
2020
+ ],
2021
+
2022
+ events: [],
2023
+ }
2024
+
2025
+ /**
2026
+ * Transfer entity
2027
+ *
2028
+ * Represents a transfer to a connected account
2029
+ */
2030
+ export const Transfer: Noun = {
2031
+ singular: 'transfer',
2032
+ plural: 'transfers',
2033
+ description: 'A transfer to a connected Stripe account',
2034
+
2035
+ properties: {
2036
+ // Identity
2037
+ transferId: {
2038
+ type: 'string',
2039
+ description: 'Unique transfer identifier',
2040
+ },
2041
+
2042
+ // Amount
2043
+ amount: {
2044
+ type: 'number',
2045
+ description: 'Amount transferred in cents',
2046
+ },
2047
+ amountReversed: {
2048
+ type: 'number',
2049
+ optional: true,
2050
+ description: 'Amount reversed in cents',
2051
+ },
2052
+ currency: {
2053
+ type: 'string',
2054
+ description: 'Currency code (ISO 4217)',
2055
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2056
+ },
2057
+
2058
+ // Description
2059
+ description: {
2060
+ type: 'string',
2061
+ optional: true,
2062
+ description: 'Transfer description',
2063
+ },
2064
+
2065
+ // Status
2066
+ reversed: {
2067
+ type: 'boolean',
2068
+ optional: true,
2069
+ description: 'Whether transfer has been reversed',
2070
+ },
2071
+
2072
+ // Source Transaction
2073
+ sourceType: {
2074
+ type: 'string',
2075
+ optional: true,
2076
+ description: 'Source type: card, bank_account, etc.',
2077
+ },
2078
+
2079
+ // Metadata
2080
+ metadata: {
2081
+ type: 'json',
2082
+ optional: true,
2083
+ description: 'Additional metadata',
2084
+ },
2085
+
2086
+ // Timestamps
2087
+ created: {
2088
+ type: 'datetime',
2089
+ description: 'Time at which the transfer was created',
2090
+ },
2091
+ },
2092
+
2093
+ relationships: {
2094
+ destination: {
2095
+ type: 'Account',
2096
+ description: 'Destination account',
2097
+ },
2098
+ sourceTransaction: {
2099
+ type: 'Charge',
2100
+ required: false,
2101
+ description: 'Source transaction',
2102
+ },
2103
+ balanceTransaction: {
2104
+ type: 'BalanceTransaction',
2105
+ required: false,
2106
+ description: 'Balance transaction',
2107
+ },
2108
+ reversals: {
2109
+ type: 'json[]',
2110
+ description: 'Transfer reversals',
2111
+ },
2112
+ },
2113
+
2114
+ actions: [
2115
+ 'create',
2116
+ 'update',
2117
+ 'list',
2118
+ 'retrieve',
2119
+ 'reverse',
2120
+ ],
2121
+
2122
+ events: [
2123
+ 'transfer.created',
2124
+ 'transfer.updated',
2125
+ 'transfer.reversed',
2126
+ ],
2127
+ }
2128
+
2129
+ /**
2130
+ * Payout entity
2131
+ *
2132
+ * Represents a payout to an external account
2133
+ */
2134
+ export const Payout: Noun = {
2135
+ singular: 'payout',
2136
+ plural: 'payouts',
2137
+ description: 'A payout to an external bank account or debit card',
2138
+
2139
+ properties: {
2140
+ // Identity
2141
+ payoutId: {
2142
+ type: 'string',
2143
+ description: 'Unique payout identifier',
2144
+ },
2145
+
2146
+ // Amount
2147
+ amount: {
2148
+ type: 'number',
2149
+ description: 'Amount paid out in cents',
2150
+ },
2151
+ currency: {
2152
+ type: 'string',
2153
+ description: 'Currency code (ISO 4217)',
2154
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2155
+ },
2156
+
2157
+ // Status
2158
+ status: {
2159
+ type: 'string',
2160
+ description: 'Status: pending, paid, failed, canceled',
2161
+ examples: ['pending', 'paid', 'failed', 'canceled'],
2162
+ },
2163
+
2164
+ // Type
2165
+ type: {
2166
+ type: 'string',
2167
+ optional: true,
2168
+ description: 'Payout type: bank_account or card',
2169
+ examples: ['bank_account', 'card'],
2170
+ },
2171
+ method: {
2172
+ type: 'string',
2173
+ optional: true,
2174
+ description: 'Payout method: standard or instant',
2175
+ examples: ['standard', 'instant'],
2176
+ },
2177
+
2178
+ // Description
2179
+ description: {
2180
+ type: 'string',
2181
+ optional: true,
2182
+ description: 'Payout description',
2183
+ },
2184
+ statementDescriptor: {
2185
+ type: 'string',
2186
+ optional: true,
2187
+ description: 'Statement descriptor',
2188
+ },
2189
+
2190
+ // Failure
2191
+ failureCode: {
2192
+ type: 'string',
2193
+ optional: true,
2194
+ description: 'Failure code',
2195
+ },
2196
+ failureMessage: {
2197
+ type: 'string',
2198
+ optional: true,
2199
+ description: 'Failure message',
2200
+ },
2201
+
2202
+ // Dates
2203
+ created: {
2204
+ type: 'datetime',
2205
+ description: 'Time at which the payout was created',
2206
+ },
2207
+ arrivalDate: {
2208
+ type: 'datetime',
2209
+ optional: true,
2210
+ description: 'Expected arrival date',
2211
+ },
2212
+
2213
+ // Metadata
2214
+ metadata: {
2215
+ type: 'json',
2216
+ optional: true,
2217
+ description: 'Additional metadata',
2218
+ },
2219
+ },
2220
+
2221
+ relationships: {
2222
+ destination: {
2223
+ type: 'BankAccount',
2224
+ required: false,
2225
+ description: 'Destination bank account',
2226
+ },
2227
+ balanceTransaction: {
2228
+ type: 'BalanceTransaction',
2229
+ required: false,
2230
+ description: 'Balance transaction',
2231
+ },
2232
+ },
2233
+
2234
+ actions: [
2235
+ 'create',
2236
+ 'update',
2237
+ 'cancel',
2238
+ 'reverse',
2239
+ 'list',
2240
+ 'retrieve',
2241
+ ],
2242
+
2243
+ events: [
2244
+ 'payout.created',
2245
+ 'payout.updated',
2246
+ 'payout.canceled',
2247
+ 'payout.failed',
2248
+ 'payout.paid',
2249
+ ],
2250
+ }
2251
+
2252
+ /**
2253
+ * ApplicationFee entity
2254
+ *
2255
+ * Represents a platform fee on a charge
2256
+ */
2257
+ export const ApplicationFee: Noun = {
2258
+ singular: 'application fee',
2259
+ plural: 'application fees',
2260
+ description: 'A platform fee collected on a charge',
2261
+
2262
+ properties: {
2263
+ // Identity
2264
+ applicationFeeId: {
2265
+ type: 'string',
2266
+ description: 'Unique application fee identifier',
2267
+ },
2268
+
2269
+ // Amount
2270
+ amount: {
2271
+ type: 'number',
2272
+ description: 'Fee amount in cents',
2273
+ },
2274
+ amountRefunded: {
2275
+ type: 'number',
2276
+ optional: true,
2277
+ description: 'Amount refunded in cents',
2278
+ },
2279
+ currency: {
2280
+ type: 'string',
2281
+ description: 'Currency code (ISO 4217)',
2282
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2283
+ },
2284
+
2285
+ // Status
2286
+ refunded: {
2287
+ type: 'boolean',
2288
+ optional: true,
2289
+ description: 'Whether fee has been refunded',
2290
+ },
2291
+
2292
+ // Livemode
2293
+ livemode: {
2294
+ type: 'boolean',
2295
+ description: 'Whether in live mode',
2296
+ },
2297
+
2298
+ // Timestamps
2299
+ created: {
2300
+ type: 'datetime',
2301
+ description: 'Time at which the fee was created',
2302
+ },
2303
+ },
2304
+
2305
+ relationships: {
2306
+ charge: {
2307
+ type: 'Charge',
2308
+ description: 'Charge this fee was collected on',
2309
+ },
2310
+ account: {
2311
+ type: 'Account',
2312
+ description: 'Connected account',
2313
+ },
2314
+ balanceTransaction: {
2315
+ type: 'BalanceTransaction',
2316
+ required: false,
2317
+ description: 'Balance transaction',
2318
+ },
2319
+ },
2320
+
2321
+ actions: [
2322
+ 'list',
2323
+ 'retrieve',
2324
+ 'refund',
2325
+ ],
2326
+
2327
+ events: [
2328
+ 'application_fee.created',
2329
+ 'application_fee.refunded',
2330
+ ],
2331
+ }
2332
+
2333
+ // =============================================================================
2334
+ // TREASURY (embedded banking)
2335
+ // =============================================================================
2336
+
2337
+ /**
2338
+ * FinancialAccount entity (Treasury)
2339
+ *
2340
+ * Represents a Treasury financial account
2341
+ */
2342
+ export const FinancialAccount: Noun = {
2343
+ singular: 'financial account',
2344
+ plural: 'financial accounts',
2345
+ description: 'A Treasury financial account for embedded banking',
2346
+
2347
+ properties: {
2348
+ // Identity
2349
+ financialAccountId: {
2350
+ type: 'string',
2351
+ description: 'Unique financial account identifier',
2352
+ },
2353
+
2354
+ // Balance
2355
+ balance: {
2356
+ type: 'json',
2357
+ description: 'Account balance',
2358
+ },
2359
+
2360
+ // Status
2361
+ status: {
2362
+ type: 'string',
2363
+ description: 'Status: open or closed',
2364
+ examples: ['open', 'closed'],
2365
+ },
2366
+
2367
+ // Supported Currencies
2368
+ supportedCurrencies: {
2369
+ type: 'string',
2370
+ array: true,
2371
+ description: 'Supported currencies',
2372
+ },
2373
+
2374
+ // Features
2375
+ features: {
2376
+ type: 'json',
2377
+ optional: true,
2378
+ description: 'Enabled features',
2379
+ },
2380
+
2381
+ // Financial Addresses
2382
+ financialAddresses: {
2383
+ type: 'json',
2384
+ array: true,
2385
+ optional: true,
2386
+ description: 'Financial addresses (e.g., ACH routing info)',
2387
+ },
2388
+
2389
+ // Metadata
2390
+ metadata: {
2391
+ type: 'json',
2392
+ optional: true,
2393
+ description: 'Additional metadata',
2394
+ },
2395
+
2396
+ // Timestamps
2397
+ created: {
2398
+ type: 'datetime',
2399
+ description: 'Time at which the account was created',
2400
+ },
2401
+ },
2402
+
2403
+ relationships: {},
2404
+
2405
+ actions: [
2406
+ 'create',
2407
+ 'update',
2408
+ 'retrieve',
2409
+ 'list',
2410
+ ],
2411
+
2412
+ events: [
2413
+ 'treasury.financial_account.created',
2414
+ 'treasury.financial_account.closed',
2415
+ 'treasury.financial_account.features_status_updated',
2416
+ ],
2417
+ }
2418
+
2419
+ /**
2420
+ * TreasuryTransaction entity
2421
+ *
2422
+ * Represents a transaction in a Treasury financial account
2423
+ */
2424
+ export const TreasuryTransaction: Noun = {
2425
+ singular: 'treasury transaction',
2426
+ plural: 'treasury transactions',
2427
+ description: 'A transaction in a Treasury financial account',
2428
+
2429
+ properties: {
2430
+ // Identity
2431
+ treasuryTransactionId: {
2432
+ type: 'string',
2433
+ description: 'Unique transaction identifier',
2434
+ },
2435
+
2436
+ // Amount
2437
+ amount: {
2438
+ type: 'number',
2439
+ description: 'Transaction amount in cents',
2440
+ },
2441
+ currency: {
2442
+ type: 'string',
2443
+ description: 'Currency code (ISO 4217)',
2444
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2445
+ },
2446
+
2447
+ // Description
2448
+ description: {
2449
+ type: 'string',
2450
+ optional: true,
2451
+ description: 'Transaction description',
2452
+ },
2453
+
2454
+ // Flow
2455
+ flowType: {
2456
+ type: 'string',
2457
+ description: 'Flow type: inbound_transfer, outbound_transfer, outbound_payment, received_credit, received_debit',
2458
+ examples: ['inbound_transfer', 'outbound_transfer', 'outbound_payment', 'received_credit', 'received_debit'],
2459
+ },
2460
+
2461
+ // Status
2462
+ status: {
2463
+ type: 'string',
2464
+ description: 'Status: open, posted, void',
2465
+ examples: ['open', 'posted', 'void'],
2466
+ },
2467
+
2468
+ // Balance Impact
2469
+ balanceImpact: {
2470
+ type: 'json',
2471
+ optional: true,
2472
+ description: 'Impact on balance',
2473
+ },
2474
+
2475
+ // Timestamps
2476
+ created: {
2477
+ type: 'datetime',
2478
+ description: 'Time at which the transaction was created',
2479
+ },
2480
+ },
2481
+
2482
+ relationships: {
2483
+ financialAccount: {
2484
+ type: 'FinancialAccount',
2485
+ description: 'Financial account',
2486
+ },
2487
+ flowDetails: {
2488
+ type: 'json',
2489
+ required: false,
2490
+ description: 'Details about the flow',
2491
+ },
2492
+ },
2493
+
2494
+ actions: [
2495
+ 'list',
2496
+ 'retrieve',
2497
+ ],
2498
+
2499
+ events: [
2500
+ 'treasury.transaction_entry.created',
2501
+ ],
2502
+ }
2503
+
2504
+ /**
2505
+ * InboundTransfer entity (Treasury)
2506
+ *
2507
+ * Represents a transfer into a Treasury financial account
2508
+ */
2509
+ export const InboundTransfer: Noun = {
2510
+ singular: 'inbound transfer',
2511
+ plural: 'inbound transfers',
2512
+ description: 'A transfer into a Treasury financial account',
2513
+
2514
+ properties: {
2515
+ // Identity
2516
+ inboundTransferId: {
2517
+ type: 'string',
2518
+ description: 'Unique inbound transfer identifier',
2519
+ },
2520
+
2521
+ // Amount
2522
+ amount: {
2523
+ type: 'number',
2524
+ description: 'Transfer amount in cents',
2525
+ },
2526
+ currency: {
2527
+ type: 'string',
2528
+ description: 'Currency code (ISO 4217)',
2529
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2530
+ },
2531
+
2532
+ // Description
2533
+ description: {
2534
+ type: 'string',
2535
+ optional: true,
2536
+ description: 'Transfer description',
2537
+ },
2538
+
2539
+ // Origin
2540
+ originPaymentMethod: {
2541
+ type: 'string',
2542
+ optional: true,
2543
+ description: 'Origin payment method',
2544
+ },
2545
+ originPaymentMethodDetails: {
2546
+ type: 'json',
2547
+ optional: true,
2548
+ description: 'Origin payment method details',
2549
+ },
2550
+
2551
+ // Status
2552
+ status: {
2553
+ type: 'string',
2554
+ description: 'Status: processing, succeeded, failed, canceled',
2555
+ examples: ['processing', 'succeeded', 'failed', 'canceled'],
2556
+ },
2557
+
2558
+ // Failure
2559
+ failureDetails: {
2560
+ type: 'json',
2561
+ optional: true,
2562
+ description: 'Failure details',
2563
+ },
2564
+
2565
+ // Metadata
2566
+ metadata: {
2567
+ type: 'json',
2568
+ optional: true,
2569
+ description: 'Additional metadata',
2570
+ },
2571
+
2572
+ // Timestamps
2573
+ created: {
2574
+ type: 'datetime',
2575
+ description: 'Time at which the transfer was created',
2576
+ },
2577
+ },
2578
+
2579
+ relationships: {
2580
+ financialAccount: {
2581
+ type: 'FinancialAccount',
2582
+ description: 'Destination financial account',
2583
+ },
2584
+ },
2585
+
2586
+ actions: [
2587
+ 'create',
2588
+ 'cancel',
2589
+ 'list',
2590
+ 'retrieve',
2591
+ ],
2592
+
2593
+ events: [
2594
+ 'treasury.inbound_transfer.created',
2595
+ 'treasury.inbound_transfer.succeeded',
2596
+ 'treasury.inbound_transfer.failed',
2597
+ 'treasury.inbound_transfer.canceled',
2598
+ ],
2599
+ }
2600
+
2601
+ /**
2602
+ * OutboundTransfer entity (Treasury)
2603
+ *
2604
+ * Represents a transfer out of a Treasury financial account
2605
+ */
2606
+ export const OutboundTransfer: Noun = {
2607
+ singular: 'outbound transfer',
2608
+ plural: 'outbound transfers',
2609
+ description: 'A transfer out of a Treasury financial account',
2610
+
2611
+ properties: {
2612
+ // Identity
2613
+ outboundTransferId: {
2614
+ type: 'string',
2615
+ description: 'Unique outbound transfer identifier',
2616
+ },
2617
+
2618
+ // Amount
2619
+ amount: {
2620
+ type: 'number',
2621
+ description: 'Transfer amount in cents',
2622
+ },
2623
+ currency: {
2624
+ type: 'string',
2625
+ description: 'Currency code (ISO 4217)',
2626
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2627
+ },
2628
+
2629
+ // Description
2630
+ description: {
2631
+ type: 'string',
2632
+ optional: true,
2633
+ description: 'Transfer description',
2634
+ },
2635
+ statementDescriptor: {
2636
+ type: 'string',
2637
+ optional: true,
2638
+ description: 'Statement descriptor',
2639
+ },
2640
+
2641
+ // Destination
2642
+ destinationPaymentMethod: {
2643
+ type: 'string',
2644
+ optional: true,
2645
+ description: 'Destination payment method',
2646
+ },
2647
+ destinationPaymentMethodDetails: {
2648
+ type: 'json',
2649
+ optional: true,
2650
+ description: 'Destination payment method details',
2651
+ },
2652
+
2653
+ // Status
2654
+ status: {
2655
+ type: 'string',
2656
+ description: 'Status: processing, posted, failed, canceled, returned',
2657
+ examples: ['processing', 'posted', 'failed', 'canceled', 'returned'],
2658
+ },
2659
+
2660
+ // Expected Arrival
2661
+ expectedArrivalDate: {
2662
+ type: 'datetime',
2663
+ optional: true,
2664
+ description: 'Expected arrival date',
2665
+ },
2666
+
2667
+ // Return Details
2668
+ returnedDetails: {
2669
+ type: 'json',
2670
+ optional: true,
2671
+ description: 'Return details if returned',
2672
+ },
2673
+
2674
+ // Metadata
2675
+ metadata: {
2676
+ type: 'json',
2677
+ optional: true,
2678
+ description: 'Additional metadata',
2679
+ },
2680
+
2681
+ // Timestamps
2682
+ created: {
2683
+ type: 'datetime',
2684
+ description: 'Time at which the transfer was created',
2685
+ },
2686
+ },
2687
+
2688
+ relationships: {
2689
+ financialAccount: {
2690
+ type: 'FinancialAccount',
2691
+ description: 'Source financial account',
2692
+ },
2693
+ },
2694
+
2695
+ actions: [
2696
+ 'create',
2697
+ 'cancel',
2698
+ 'list',
2699
+ 'retrieve',
2700
+ ],
2701
+
2702
+ events: [
2703
+ 'treasury.outbound_transfer.created',
2704
+ 'treasury.outbound_transfer.posted',
2705
+ 'treasury.outbound_transfer.failed',
2706
+ 'treasury.outbound_transfer.canceled',
2707
+ 'treasury.outbound_transfer.returned',
2708
+ ],
2709
+ }
2710
+
2711
+ /**
2712
+ * OutboundPayment entity (Treasury)
2713
+ *
2714
+ * Represents a payment from a Treasury financial account
2715
+ */
2716
+ export const OutboundPayment: Noun = {
2717
+ singular: 'outbound payment',
2718
+ plural: 'outbound payments',
2719
+ description: 'A payment from a Treasury financial account',
2720
+
2721
+ properties: {
2722
+ // Identity
2723
+ outboundPaymentId: {
2724
+ type: 'string',
2725
+ description: 'Unique outbound payment identifier',
2726
+ },
2727
+
2728
+ // Amount
2729
+ amount: {
2730
+ type: 'number',
2731
+ description: 'Payment amount in cents',
2732
+ },
2733
+ currency: {
2734
+ type: 'string',
2735
+ description: 'Currency code (ISO 4217)',
2736
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2737
+ },
2738
+
2739
+ // Description
2740
+ description: {
2741
+ type: 'string',
2742
+ optional: true,
2743
+ description: 'Payment description',
2744
+ },
2745
+ statementDescriptor: {
2746
+ type: 'string',
2747
+ optional: true,
2748
+ description: 'Statement descriptor',
2749
+ },
2750
+
2751
+ // Destination
2752
+ destinationPaymentMethod: {
2753
+ type: 'string',
2754
+ optional: true,
2755
+ description: 'Destination payment method',
2756
+ },
2757
+ destinationPaymentMethodDetails: {
2758
+ type: 'json',
2759
+ optional: true,
2760
+ description: 'Destination payment method details',
2761
+ },
2762
+
2763
+ // Status
2764
+ status: {
2765
+ type: 'string',
2766
+ description: 'Status: processing, posted, failed, canceled, returned',
2767
+ examples: ['processing', 'posted', 'failed', 'canceled', 'returned'],
2768
+ },
2769
+
2770
+ // End User Details
2771
+ endUserDetails: {
2772
+ type: 'json',
2773
+ optional: true,
2774
+ description: 'End user details',
2775
+ },
2776
+
2777
+ // Metadata
2778
+ metadata: {
2779
+ type: 'json',
2780
+ optional: true,
2781
+ description: 'Additional metadata',
2782
+ },
2783
+
2784
+ // Timestamps
2785
+ created: {
2786
+ type: 'datetime',
2787
+ description: 'Time at which the payment was created',
2788
+ },
2789
+ },
2790
+
2791
+ relationships: {
2792
+ financialAccount: {
2793
+ type: 'FinancialAccount',
2794
+ description: 'Source financial account',
2795
+ },
2796
+ },
2797
+
2798
+ actions: [
2799
+ 'create',
2800
+ 'cancel',
2801
+ 'list',
2802
+ 'retrieve',
2803
+ ],
2804
+
2805
+ events: [
2806
+ 'treasury.outbound_payment.created',
2807
+ 'treasury.outbound_payment.posted',
2808
+ 'treasury.outbound_payment.failed',
2809
+ 'treasury.outbound_payment.canceled',
2810
+ 'treasury.outbound_payment.returned',
2811
+ ],
2812
+ }
2813
+
2814
+ /**
2815
+ * ReceivedCredit entity (Treasury)
2816
+ *
2817
+ * Represents a credit received into a Treasury financial account
2818
+ */
2819
+ export const ReceivedCredit: Noun = {
2820
+ singular: 'received credit',
2821
+ plural: 'received credits',
2822
+ description: 'A credit received into a Treasury financial account',
2823
+
2824
+ properties: {
2825
+ // Identity
2826
+ receivedCreditId: {
2827
+ type: 'string',
2828
+ description: 'Unique received credit identifier',
2829
+ },
2830
+
2831
+ // Amount
2832
+ amount: {
2833
+ type: 'number',
2834
+ description: 'Credit amount in cents',
2835
+ },
2836
+ currency: {
2837
+ type: 'string',
2838
+ description: 'Currency code (ISO 4217)',
2839
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2840
+ },
2841
+
2842
+ // Description
2843
+ description: {
2844
+ type: 'string',
2845
+ optional: true,
2846
+ description: 'Credit description',
2847
+ },
2848
+
2849
+ // Network
2850
+ network: {
2851
+ type: 'string',
2852
+ description: 'Network: ach, us_domestic_wire',
2853
+ examples: ['ach', 'us_domestic_wire'],
2854
+ },
2855
+
2856
+ // Initiating Payment Method Details
2857
+ initiatingPaymentMethodDetails: {
2858
+ type: 'json',
2859
+ optional: true,
2860
+ description: 'Initiating payment method details',
2861
+ },
2862
+
2863
+ // Status
2864
+ status: {
2865
+ type: 'string',
2866
+ description: 'Status: succeeded or failed',
2867
+ examples: ['succeeded', 'failed'],
2868
+ },
2869
+
2870
+ // Failure Code
2871
+ failureCode: {
2872
+ type: 'string',
2873
+ optional: true,
2874
+ description: 'Failure code',
2875
+ },
2876
+
2877
+ // Timestamps
2878
+ created: {
2879
+ type: 'datetime',
2880
+ description: 'Time at which the credit was received',
2881
+ },
2882
+ },
2883
+
2884
+ relationships: {
2885
+ financialAccount: {
2886
+ type: 'FinancialAccount',
2887
+ description: 'Financial account',
2888
+ },
2889
+ },
2890
+
2891
+ actions: [
2892
+ 'list',
2893
+ 'retrieve',
2894
+ ],
2895
+
2896
+ events: [
2897
+ 'treasury.received_credit.created',
2898
+ 'treasury.received_credit.succeeded',
2899
+ 'treasury.received_credit.failed',
2900
+ ],
2901
+ }
2902
+
2903
+ /**
2904
+ * ReceivedDebit entity (Treasury)
2905
+ *
2906
+ * Represents a debit received from a Treasury financial account
2907
+ */
2908
+ export const ReceivedDebit: Noun = {
2909
+ singular: 'received debit',
2910
+ plural: 'received debits',
2911
+ description: 'A debit received from a Treasury financial account',
2912
+
2913
+ properties: {
2914
+ // Identity
2915
+ receivedDebitId: {
2916
+ type: 'string',
2917
+ description: 'Unique received debit identifier',
2918
+ },
2919
+
2920
+ // Amount
2921
+ amount: {
2922
+ type: 'number',
2923
+ description: 'Debit amount in cents',
2924
+ },
2925
+ currency: {
2926
+ type: 'string',
2927
+ description: 'Currency code (ISO 4217)',
2928
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
2929
+ },
2930
+
2931
+ // Description
2932
+ description: {
2933
+ type: 'string',
2934
+ optional: true,
2935
+ description: 'Debit description',
2936
+ },
2937
+
2938
+ // Network
2939
+ network: {
2940
+ type: 'string',
2941
+ description: 'Network: ach',
2942
+ examples: ['ach'],
2943
+ },
2944
+
2945
+ // Initiating Payment Method Details
2946
+ initiatingPaymentMethodDetails: {
2947
+ type: 'json',
2948
+ optional: true,
2949
+ description: 'Initiating payment method details',
2950
+ },
2951
+
2952
+ // Status
2953
+ status: {
2954
+ type: 'string',
2955
+ description: 'Status: succeeded or failed',
2956
+ examples: ['succeeded', 'failed'],
2957
+ },
2958
+
2959
+ // Failure Code
2960
+ failureCode: {
2961
+ type: 'string',
2962
+ optional: true,
2963
+ description: 'Failure code',
2964
+ },
2965
+
2966
+ // Timestamps
2967
+ created: {
2968
+ type: 'datetime',
2969
+ description: 'Time at which the debit was received',
2970
+ },
2971
+ },
2972
+
2973
+ relationships: {
2974
+ financialAccount: {
2975
+ type: 'FinancialAccount',
2976
+ description: 'Financial account',
2977
+ },
2978
+ },
2979
+
2980
+ actions: [
2981
+ 'list',
2982
+ 'retrieve',
2983
+ ],
2984
+
2985
+ events: [
2986
+ 'treasury.received_debit.created',
2987
+ ],
2988
+ }
2989
+
2990
+ // =============================================================================
2991
+ // ISSUING (cards)
2992
+ // =============================================================================
2993
+
2994
+ /**
2995
+ * IssuingCard entity
2996
+ *
2997
+ * Represents an issued payment card
2998
+ */
2999
+ export const IssuingCard: Noun = {
3000
+ singular: 'issuing card',
3001
+ plural: 'issuing cards',
3002
+ description: 'An issued physical or virtual payment card',
3003
+
3004
+ properties: {
3005
+ // Identity
3006
+ issuingCardId: {
3007
+ type: 'string',
3008
+ description: 'Unique card identifier',
3009
+ },
3010
+ last4: {
3011
+ type: 'string',
3012
+ optional: true,
3013
+ description: 'Last 4 digits of card number',
3014
+ },
3015
+
3016
+ // Brand
3017
+ brand: {
3018
+ type: 'string',
3019
+ description: 'Card brand: visa or mastercard',
3020
+ examples: ['visa', 'mastercard'],
3021
+ },
3022
+
3023
+ // Type
3024
+ type: {
3025
+ type: 'string',
3026
+ description: 'Card type: physical or virtual',
3027
+ examples: ['physical', 'virtual'],
3028
+ },
3029
+
3030
+ // Status
3031
+ status: {
3032
+ type: 'string',
3033
+ description: 'Status: active, inactive, canceled',
3034
+ examples: ['active', 'inactive', 'canceled'],
3035
+ },
3036
+
3037
+ // Cancellation
3038
+ cancellationReason: {
3039
+ type: 'string',
3040
+ optional: true,
3041
+ description: 'Cancellation reason',
3042
+ },
3043
+
3044
+ // Spending Controls
3045
+ spendingControls: {
3046
+ type: 'json',
3047
+ optional: true,
3048
+ description: 'Spending controls and limits',
3049
+ },
3050
+
3051
+ // Shipping
3052
+ shipping: {
3053
+ type: 'json',
3054
+ optional: true,
3055
+ description: 'Shipping information (for physical cards)',
3056
+ },
3057
+
3058
+ // Expiration
3059
+ expMonth: {
3060
+ type: 'number',
3061
+ optional: true,
3062
+ description: 'Expiration month',
3063
+ },
3064
+ expYear: {
3065
+ type: 'number',
3066
+ optional: true,
3067
+ description: 'Expiration year',
3068
+ },
3069
+
3070
+ // Currency
3071
+ currency: {
3072
+ type: 'string',
3073
+ description: 'Currency code (ISO 4217)',
3074
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
3075
+ },
3076
+
3077
+ // Metadata
3078
+ metadata: {
3079
+ type: 'json',
3080
+ optional: true,
3081
+ description: 'Additional metadata',
3082
+ },
3083
+
3084
+ // Timestamps
3085
+ created: {
3086
+ type: 'datetime',
3087
+ description: 'Time at which the card was created',
3088
+ },
3089
+ },
3090
+
3091
+ relationships: {
3092
+ cardholder: {
3093
+ type: 'IssuingCardholder',
3094
+ description: 'Cardholder',
3095
+ },
3096
+ replacementFor: {
3097
+ type: 'IssuingCard',
3098
+ required: false,
3099
+ description: 'Card being replaced',
3100
+ },
3101
+ replacedBy: {
3102
+ type: 'IssuingCard',
3103
+ required: false,
3104
+ description: 'Replacement card',
3105
+ },
3106
+ },
3107
+
3108
+ actions: [
3109
+ 'create',
3110
+ 'update',
3111
+ 'cancel',
3112
+ 'list',
3113
+ 'retrieve',
3114
+ ],
3115
+
3116
+ events: [
3117
+ 'issuing_card.created',
3118
+ 'issuing_card.updated',
3119
+ ],
3120
+ }
3121
+
3122
+ /**
3123
+ * IssuingCardholder entity
3124
+ *
3125
+ * Represents a cardholder
3126
+ */
3127
+ export const IssuingCardholder: Noun = {
3128
+ singular: 'issuing cardholder',
3129
+ plural: 'issuing cardholders',
3130
+ description: 'A cardholder for issued cards',
3131
+
3132
+ properties: {
3133
+ // Identity
3134
+ issuingCardholderId: {
3135
+ type: 'string',
3136
+ description: 'Unique cardholder identifier',
3137
+ },
3138
+ name: {
3139
+ type: 'string',
3140
+ description: 'Cardholder name',
3141
+ },
3142
+ email: {
3143
+ type: 'string',
3144
+ optional: true,
3145
+ description: 'Cardholder email',
3146
+ },
3147
+ phoneNumber: {
3148
+ type: 'string',
3149
+ optional: true,
3150
+ description: 'Cardholder phone number',
3151
+ },
3152
+
3153
+ // Type
3154
+ type: {
3155
+ type: 'string',
3156
+ description: 'Cardholder type: individual or company',
3157
+ examples: ['individual', 'company'],
3158
+ },
3159
+
3160
+ // Billing
3161
+ billing: {
3162
+ type: 'json',
3163
+ description: 'Billing information',
3164
+ },
3165
+
3166
+ // Company
3167
+ company: {
3168
+ type: 'json',
3169
+ optional: true,
3170
+ description: 'Company information (for company type)',
3171
+ },
3172
+
3173
+ // Individual
3174
+ individual: {
3175
+ type: 'json',
3176
+ optional: true,
3177
+ description: 'Individual information (for individual type)',
3178
+ },
3179
+
3180
+ // Status
3181
+ status: {
3182
+ type: 'string',
3183
+ description: 'Status: active, inactive, blocked',
3184
+ examples: ['active', 'inactive', 'blocked'],
3185
+ },
3186
+
3187
+ // Spending Controls
3188
+ spendingControls: {
3189
+ type: 'json',
3190
+ optional: true,
3191
+ description: 'Default spending controls',
3192
+ },
3193
+
3194
+ // Requirements
3195
+ requirements: {
3196
+ type: 'json',
3197
+ optional: true,
3198
+ description: 'Verification requirements',
3199
+ },
3200
+
3201
+ // Metadata
3202
+ metadata: {
3203
+ type: 'json',
3204
+ optional: true,
3205
+ description: 'Additional metadata',
3206
+ },
3207
+
3208
+ // Timestamps
3209
+ created: {
3210
+ type: 'datetime',
3211
+ description: 'Time at which the cardholder was created',
3212
+ },
3213
+ },
3214
+
3215
+ relationships: {
3216
+ cards: {
3217
+ type: 'IssuingCard[]',
3218
+ backref: 'cardholder',
3219
+ description: 'Cards issued to this cardholder',
3220
+ },
3221
+ },
3222
+
3223
+ actions: [
3224
+ 'create',
3225
+ 'update',
3226
+ 'list',
3227
+ 'retrieve',
3228
+ ],
3229
+
3230
+ events: [
3231
+ 'issuing_cardholder.created',
3232
+ 'issuing_cardholder.updated',
3233
+ ],
3234
+ }
3235
+
3236
+ /**
3237
+ * IssuingAuthorization entity
3238
+ *
3239
+ * Represents a card authorization attempt
3240
+ */
3241
+ export const IssuingAuthorization: Noun = {
3242
+ singular: 'issuing authorization',
3243
+ plural: 'issuing authorizations',
3244
+ description: 'A card authorization attempt',
3245
+
3246
+ properties: {
3247
+ // Identity
3248
+ issuingAuthorizationId: {
3249
+ type: 'string',
3250
+ description: 'Unique authorization identifier',
3251
+ },
3252
+
3253
+ // Amount
3254
+ amount: {
3255
+ type: 'number',
3256
+ description: 'Authorization amount in cents',
3257
+ },
3258
+ amountDetails: {
3259
+ type: 'json',
3260
+ optional: true,
3261
+ description: 'Amount details (atm_fee, cashback, etc.)',
3262
+ },
3263
+ currency: {
3264
+ type: 'string',
3265
+ description: 'Currency code (ISO 4217)',
3266
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
3267
+ },
3268
+
3269
+ // Status
3270
+ status: {
3271
+ type: 'string',
3272
+ description: 'Status: pending, reversed, closed',
3273
+ examples: ['pending', 'reversed', 'closed'],
3274
+ },
3275
+ approved: {
3276
+ type: 'boolean',
3277
+ description: 'Whether authorization was approved',
3278
+ },
3279
+
3280
+ // Merchant
3281
+ merchantAmount: {
3282
+ type: 'number',
3283
+ optional: true,
3284
+ description: 'Merchant amount in merchant currency',
3285
+ },
3286
+ merchantCurrency: {
3287
+ type: 'string',
3288
+ optional: true,
3289
+ description: 'Merchant currency',
3290
+ },
3291
+ merchantData: {
3292
+ type: 'json',
3293
+ optional: true,
3294
+ description: 'Merchant data',
3295
+ },
3296
+
3297
+ // Verification Data
3298
+ verificationData: {
3299
+ type: 'json',
3300
+ optional: true,
3301
+ description: 'Verification data',
3302
+ },
3303
+
3304
+ // Request History
3305
+ requestHistory: {
3306
+ type: 'json',
3307
+ array: true,
3308
+ optional: true,
3309
+ description: 'Request history',
3310
+ },
3311
+
3312
+ // Metadata
3313
+ metadata: {
3314
+ type: 'json',
3315
+ optional: true,
3316
+ description: 'Additional metadata',
3317
+ },
3318
+
3319
+ // Timestamps
3320
+ created: {
3321
+ type: 'datetime',
3322
+ description: 'Time at which the authorization was created',
3323
+ },
3324
+ },
3325
+
3326
+ relationships: {
3327
+ card: {
3328
+ type: 'IssuingCard',
3329
+ description: 'Card used',
3330
+ },
3331
+ cardholder: {
3332
+ type: 'IssuingCardholder',
3333
+ required: false,
3334
+ description: 'Cardholder',
3335
+ },
3336
+ transactions: {
3337
+ type: 'IssuingTransaction[]',
3338
+ description: 'Transactions created from this authorization',
3339
+ },
3340
+ },
3341
+
3342
+ actions: [
3343
+ 'approve',
3344
+ 'decline',
3345
+ 'list',
3346
+ 'retrieve',
3347
+ 'update',
3348
+ ],
3349
+
3350
+ events: [
3351
+ 'issuing_authorization.created',
3352
+ 'issuing_authorization.updated',
3353
+ 'issuing_authorization.request',
3354
+ ],
3355
+ }
3356
+
3357
+ /**
3358
+ * IssuingTransaction entity
3359
+ *
3360
+ * Represents a completed card transaction
3361
+ */
3362
+ export const IssuingTransaction: Noun = {
3363
+ singular: 'issuing transaction',
3364
+ plural: 'issuing transactions',
3365
+ description: 'A completed card transaction',
3366
+
3367
+ properties: {
3368
+ // Identity
3369
+ issuingTransactionId: {
3370
+ type: 'string',
3371
+ description: 'Unique transaction identifier',
3372
+ },
3373
+
3374
+ // Amount
3375
+ amount: {
3376
+ type: 'number',
3377
+ description: 'Transaction amount in cents',
3378
+ },
3379
+ amountDetails: {
3380
+ type: 'json',
3381
+ optional: true,
3382
+ description: 'Amount details',
3383
+ },
3384
+ currency: {
3385
+ type: 'string',
3386
+ description: 'Currency code (ISO 4217)',
3387
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
3388
+ },
3389
+
3390
+ // Type
3391
+ type: {
3392
+ type: 'string',
3393
+ description: 'Transaction type: capture or refund',
3394
+ examples: ['capture', 'refund'],
3395
+ },
3396
+
3397
+ // Merchant
3398
+ merchantAmount: {
3399
+ type: 'number',
3400
+ optional: true,
3401
+ description: 'Merchant amount',
3402
+ },
3403
+ merchantCurrency: {
3404
+ type: 'string',
3405
+ optional: true,
3406
+ description: 'Merchant currency',
3407
+ },
3408
+ merchantData: {
3409
+ type: 'json',
3410
+ optional: true,
3411
+ description: 'Merchant data',
3412
+ },
3413
+
3414
+ // Purchase Details
3415
+ purchaseDetails: {
3416
+ type: 'json',
3417
+ optional: true,
3418
+ description: 'Purchase details',
3419
+ },
3420
+
3421
+ // Metadata
3422
+ metadata: {
3423
+ type: 'json',
3424
+ optional: true,
3425
+ description: 'Additional metadata',
3426
+ },
3427
+
3428
+ // Timestamps
3429
+ created: {
3430
+ type: 'datetime',
3431
+ description: 'Time at which the transaction was created',
3432
+ },
3433
+ },
3434
+
3435
+ relationships: {
3436
+ card: {
3437
+ type: 'IssuingCard',
3438
+ description: 'Card used',
3439
+ },
3440
+ cardholder: {
3441
+ type: 'IssuingCardholder',
3442
+ required: false,
3443
+ description: 'Cardholder',
3444
+ },
3445
+ authorization: {
3446
+ type: 'IssuingAuthorization',
3447
+ required: false,
3448
+ description: 'Authorization',
3449
+ },
3450
+ dispute: {
3451
+ type: 'IssuingDispute',
3452
+ required: false,
3453
+ description: 'Dispute if disputed',
3454
+ },
3455
+ },
3456
+
3457
+ actions: [
3458
+ 'list',
3459
+ 'retrieve',
3460
+ 'update',
3461
+ ],
3462
+
3463
+ events: [
3464
+ 'issuing_transaction.created',
3465
+ 'issuing_transaction.updated',
3466
+ ],
3467
+ }
3468
+
3469
+ /**
3470
+ * IssuingDispute entity
3471
+ *
3472
+ * Represents a dispute on a card transaction
3473
+ */
3474
+ export const IssuingDispute: Noun = {
3475
+ singular: 'issuing dispute',
3476
+ plural: 'issuing disputes',
3477
+ description: 'A dispute on a card transaction',
3478
+
3479
+ properties: {
3480
+ // Identity
3481
+ issuingDisputeId: {
3482
+ type: 'string',
3483
+ description: 'Unique dispute identifier',
3484
+ },
3485
+
3486
+ // Amount
3487
+ amount: {
3488
+ type: 'number',
3489
+ description: 'Disputed amount in cents',
3490
+ },
3491
+ currency: {
3492
+ type: 'string',
3493
+ description: 'Currency code (ISO 4217)',
3494
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
3495
+ },
3496
+
3497
+ // Status
3498
+ status: {
3499
+ type: 'string',
3500
+ description: 'Status: unsubmitted, submitted, won, lost, expired',
3501
+ examples: ['unsubmitted', 'submitted', 'won', 'lost', 'expired'],
3502
+ },
3503
+
3504
+ // Evidence
3505
+ evidence: {
3506
+ type: 'json',
3507
+ optional: true,
3508
+ description: 'Evidence for dispute',
3509
+ },
3510
+
3511
+ // Metadata
3512
+ metadata: {
3513
+ type: 'json',
3514
+ optional: true,
3515
+ description: 'Additional metadata',
3516
+ },
3517
+
3518
+ // Timestamps
3519
+ created: {
3520
+ type: 'datetime',
3521
+ description: 'Time at which the dispute was created',
3522
+ },
3523
+ },
3524
+
3525
+ relationships: {
3526
+ transaction: {
3527
+ type: 'IssuingTransaction',
3528
+ description: 'Transaction being disputed',
3529
+ },
3530
+ },
3531
+
3532
+ actions: [
3533
+ 'create',
3534
+ 'submit',
3535
+ 'list',
3536
+ 'retrieve',
3537
+ 'update',
3538
+ ],
3539
+
3540
+ events: [
3541
+ 'issuing_dispute.created',
3542
+ 'issuing_dispute.updated',
3543
+ 'issuing_dispute.closed',
3544
+ 'issuing_dispute.funds_reinstated',
3545
+ ],
3546
+ }
3547
+
3548
+ // =============================================================================
3549
+ // BANK
3550
+ // =============================================================================
3551
+
3552
+ /**
3553
+ * BankAccount entity
3554
+ *
3555
+ * Represents an external bank account
3556
+ */
3557
+ export const BankAccount: Noun = {
3558
+ singular: 'bank account',
3559
+ plural: 'bank accounts',
3560
+ description: 'An external bank account',
3561
+
3562
+ properties: {
3563
+ // Identity
3564
+ bankAccountId: {
3565
+ type: 'string',
3566
+ description: 'Unique bank account identifier',
3567
+ },
3568
+ accountHolderName: {
3569
+ type: 'string',
3570
+ optional: true,
3571
+ description: 'Account holder name',
3572
+ },
3573
+ accountHolderType: {
3574
+ type: 'string',
3575
+ optional: true,
3576
+ description: 'Account holder type: individual or company',
3577
+ examples: ['individual', 'company'],
3578
+ },
3579
+
3580
+ // Bank Details
3581
+ bankName: {
3582
+ type: 'string',
3583
+ optional: true,
3584
+ description: 'Bank name',
3585
+ },
3586
+ country: {
3587
+ type: 'string',
3588
+ description: 'Country code',
3589
+ },
3590
+ currency: {
3591
+ type: 'string',
3592
+ description: 'Currency code (ISO 4217)',
3593
+ examples: ['USD', 'EUR', 'GBP', 'JPY'],
3594
+ },
3595
+
3596
+ // Account Number
3597
+ last4: {
3598
+ type: 'string',
3599
+ optional: true,
3600
+ description: 'Last 4 digits of account number',
3601
+ },
3602
+ routingNumber: {
3603
+ type: 'string',
3604
+ optional: true,
3605
+ description: 'Routing number',
3606
+ },
3607
+
3608
+ // Status
3609
+ status: {
3610
+ type: 'string',
3611
+ optional: true,
3612
+ description: 'Status: new, validated, verified, verification_failed, errored',
3613
+ examples: ['new', 'validated', 'verified', 'verification_failed', 'errored'],
3614
+ },
3615
+
3616
+ // Fingerprint
3617
+ fingerprint: {
3618
+ type: 'string',
3619
+ optional: true,
3620
+ description: 'Unique fingerprint',
3621
+ },
3622
+
3623
+ // Metadata
3624
+ metadata: {
3625
+ type: 'json',
3626
+ optional: true,
3627
+ description: 'Additional metadata',
3628
+ },
3629
+ },
3630
+
3631
+ relationships: {
3632
+ customer: {
3633
+ type: 'Customer',
3634
+ required: false,
3635
+ description: 'Customer this bank account belongs to',
3636
+ },
3637
+ account: {
3638
+ type: 'Account',
3639
+ required: false,
3640
+ description: 'Connected account this bank account belongs to',
3641
+ },
3642
+ },
3643
+
3644
+ actions: [
3645
+ 'create',
3646
+ 'update',
3647
+ 'delete',
3648
+ 'verify',
3649
+ 'list',
3650
+ 'retrieve',
3651
+ ],
3652
+
3653
+ events: [],
3654
+ }
3655
+
3656
+ // =============================================================================
3657
+ // WEBHOOKS
3658
+ // =============================================================================
3659
+
3660
+ /**
3661
+ * WebhookEndpoint entity
3662
+ *
3663
+ * Represents a webhook endpoint configuration
3664
+ */
3665
+ export const WebhookEndpoint: Noun = {
3666
+ singular: 'webhook endpoint',
3667
+ plural: 'webhook endpoints',
3668
+ description: 'A webhook endpoint for receiving events',
3669
+
3670
+ properties: {
3671
+ // Identity
3672
+ webhookEndpointId: {
3673
+ type: 'string',
3674
+ description: 'Unique webhook endpoint identifier',
3675
+ },
3676
+
3677
+ // URL
3678
+ url: {
3679
+ type: 'url',
3680
+ description: 'Webhook URL',
3681
+ },
3682
+
3683
+ // Status
3684
+ status: {
3685
+ type: 'string',
3686
+ optional: true,
3687
+ description: 'Status: enabled or disabled',
3688
+ examples: ['enabled', 'disabled'],
3689
+ },
3690
+
3691
+ // Events
3692
+ enabledEvents: {
3693
+ type: 'string',
3694
+ array: true,
3695
+ description: 'Events to send to this endpoint',
3696
+ },
3697
+
3698
+ // API Version
3699
+ apiVersion: {
3700
+ type: 'string',
3701
+ optional: true,
3702
+ description: 'API version',
3703
+ },
3704
+
3705
+ // Description
3706
+ description: {
3707
+ type: 'string',
3708
+ optional: true,
3709
+ description: 'Endpoint description',
3710
+ },
3711
+
3712
+ // Secret
3713
+ secret: {
3714
+ type: 'string',
3715
+ optional: true,
3716
+ description: 'Webhook signing secret',
3717
+ },
3718
+
3719
+ // Metadata
3720
+ metadata: {
3721
+ type: 'json',
3722
+ optional: true,
3723
+ description: 'Additional metadata',
3724
+ },
3725
+
3726
+ // Timestamps
3727
+ created: {
3728
+ type: 'datetime',
3729
+ description: 'Time at which the endpoint was created',
3730
+ },
3731
+ },
3732
+
3733
+ relationships: {},
3734
+
3735
+ actions: [
3736
+ 'create',
3737
+ 'update',
3738
+ 'delete',
3739
+ 'list',
3740
+ 'retrieve',
3741
+ ],
3742
+
3743
+ events: [],
3744
+ }
3745
+
3746
+ /**
3747
+ * Event entity
3748
+ *
3749
+ * Represents a Stripe event
3750
+ */
3751
+ export const Event: Noun = {
3752
+ singular: 'event',
3753
+ plural: 'events',
3754
+ description: 'A Stripe API event',
3755
+
3756
+ properties: {
3757
+ // Identity
3758
+ eventId: {
3759
+ type: 'string',
3760
+ description: 'Unique event identifier',
3761
+ },
3762
+
3763
+ // Type
3764
+ type: {
3765
+ type: 'string',
3766
+ description: 'Event type (e.g., customer.created, charge.succeeded)',
3767
+ },
3768
+
3769
+ // Data
3770
+ data: {
3771
+ type: 'json',
3772
+ description: 'Event data',
3773
+ },
3774
+
3775
+ // API Version
3776
+ apiVersion: {
3777
+ type: 'string',
3778
+ optional: true,
3779
+ description: 'API version',
3780
+ },
3781
+
3782
+ // Request
3783
+ request: {
3784
+ type: 'json',
3785
+ optional: true,
3786
+ description: 'Request information',
3787
+ },
3788
+
3789
+ // Pending Webhooks
3790
+ pendingWebhooks: {
3791
+ type: 'number',
3792
+ optional: true,
3793
+ description: 'Number of pending webhooks',
3794
+ },
3795
+
3796
+ // Livemode
3797
+ livemode: {
3798
+ type: 'boolean',
3799
+ description: 'Whether in live mode',
3800
+ },
3801
+
3802
+ // Timestamps
3803
+ created: {
3804
+ type: 'datetime',
3805
+ description: 'Time at which the event was created',
3806
+ },
3807
+ },
3808
+
3809
+ relationships: {},
3810
+
3811
+ actions: [
3812
+ 'list',
3813
+ 'retrieve',
3814
+ ],
3815
+
3816
+ events: [],
3817
+ }
3818
+
3819
+ // =============================================================================
3820
+ // EXPORTS
3821
+ // =============================================================================
3822
+
3823
+ /**
3824
+ * All finance entity types
3825
+ */
3826
+ export const FinanceEntities = {
3827
+ // Core
3828
+ Customer,
3829
+ Product,
3830
+ Price,
3831
+
3832
+ // Payments
3833
+ PaymentMethod,
3834
+ PaymentIntent,
3835
+ Charge,
3836
+ Refund,
3837
+
3838
+ // Billing
3839
+ Invoice,
3840
+ InvoiceLineItem,
3841
+ Subscription,
3842
+ SubscriptionItem,
3843
+ Quote,
3844
+
3845
+ // Balance
3846
+ Balance,
3847
+ BalanceTransaction,
3848
+
3849
+ // Connect
3850
+ Account,
3851
+ AccountLink,
3852
+ Transfer,
3853
+ Payout,
3854
+ ApplicationFee,
3855
+
3856
+ // Treasury
3857
+ FinancialAccount,
3858
+ TreasuryTransaction,
3859
+ InboundTransfer,
3860
+ OutboundTransfer,
3861
+ OutboundPayment,
3862
+ ReceivedCredit,
3863
+ ReceivedDebit,
3864
+
3865
+ // Issuing
3866
+ IssuingCard,
3867
+ IssuingCardholder,
3868
+ IssuingAuthorization,
3869
+ IssuingTransaction,
3870
+ IssuingDispute,
3871
+
3872
+ // Bank
3873
+ BankAccount,
3874
+
3875
+ // Webhooks
3876
+ WebhookEndpoint,
3877
+ Event,
3878
+ }
3879
+
3880
+ /**
3881
+ * Entity categories for organization
3882
+ */
3883
+ export const FinanceCategories = {
3884
+ core: ['Customer', 'Product', 'Price'],
3885
+ payments: ['PaymentMethod', 'PaymentIntent', 'Charge', 'Refund'],
3886
+ billing: ['Invoice', 'InvoiceLineItem', 'Subscription', 'SubscriptionItem', 'Quote'],
3887
+ balance: ['Balance', 'BalanceTransaction'],
3888
+ connect: ['Account', 'AccountLink', 'Transfer', 'Payout', 'ApplicationFee'],
3889
+ treasury: [
3890
+ 'FinancialAccount',
3891
+ 'TreasuryTransaction',
3892
+ 'InboundTransfer',
3893
+ 'OutboundTransfer',
3894
+ 'OutboundPayment',
3895
+ 'ReceivedCredit',
3896
+ 'ReceivedDebit',
3897
+ ],
3898
+ issuing: [
3899
+ 'IssuingCard',
3900
+ 'IssuingCardholder',
3901
+ 'IssuingAuthorization',
3902
+ 'IssuingTransaction',
3903
+ 'IssuingDispute',
3904
+ ],
3905
+ bank: ['BankAccount'],
3906
+ webhooks: ['WebhookEndpoint', 'Event'],
3907
+ } as const