@mackenly/planningcenterkit 0.4.42 → 1.0.0

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 (422) hide show
  1. package/README.md +472 -31
  2. package/dist/cjs/client.d.ts +145 -0
  3. package/dist/cjs/client.d.ts.map +1 -0
  4. package/dist/cjs/client.js +176 -0
  5. package/dist/cjs/client.js.map +1 -0
  6. package/dist/cjs/core/auth.d.ts +105 -0
  7. package/dist/cjs/core/auth.d.ts.map +1 -0
  8. package/dist/cjs/core/auth.js +219 -0
  9. package/dist/cjs/core/auth.js.map +1 -0
  10. package/dist/cjs/core/errors.d.ts +145 -0
  11. package/dist/cjs/core/errors.d.ts.map +1 -0
  12. package/dist/cjs/core/errors.js +202 -0
  13. package/dist/cjs/core/errors.js.map +1 -0
  14. package/dist/cjs/core/graph.d.ts +110 -0
  15. package/dist/cjs/core/graph.d.ts.map +1 -0
  16. package/dist/cjs/core/graph.js +14 -0
  17. package/dist/cjs/core/graph.js.map +1 -0
  18. package/dist/cjs/core/http.d.ts +147 -0
  19. package/dist/cjs/core/http.d.ts.map +1 -0
  20. package/dist/cjs/core/http.js +478 -0
  21. package/dist/cjs/core/http.js.map +1 -0
  22. package/dist/cjs/core/jsonapi.d.ts +65 -0
  23. package/dist/cjs/core/jsonapi.d.ts.map +1 -0
  24. package/dist/{types.js → cjs/core/jsonapi.js} +1 -2
  25. package/dist/cjs/core/jsonapi.js.map +1 -0
  26. package/dist/cjs/core/oauth.d.ts +202 -0
  27. package/dist/cjs/core/oauth.d.ts.map +1 -0
  28. package/dist/cjs/core/oauth.js +290 -0
  29. package/dist/cjs/core/oauth.js.map +1 -0
  30. package/dist/cjs/core/product.d.ts +78 -0
  31. package/dist/cjs/core/product.d.ts.map +1 -0
  32. package/dist/cjs/core/product.js +57 -0
  33. package/dist/cjs/core/product.js.map +1 -0
  34. package/dist/cjs/core/query.d.ts +489 -0
  35. package/dist/cjs/core/query.d.ts.map +1 -0
  36. package/dist/cjs/core/query.js +435 -0
  37. package/dist/cjs/core/query.js.map +1 -0
  38. package/dist/cjs/core/transport.d.ts +57 -0
  39. package/dist/cjs/core/transport.d.ts.map +1 -0
  40. package/dist/cjs/core/transport.js +7 -0
  41. package/dist/cjs/core/transport.js.map +1 -0
  42. package/dist/cjs/entries/api.d.ts +26 -0
  43. package/dist/cjs/entries/api.d.ts.map +1 -0
  44. package/dist/cjs/entries/api.js +40 -0
  45. package/dist/cjs/entries/api.js.map +1 -0
  46. package/dist/cjs/entries/calendar.d.ts +26 -0
  47. package/dist/cjs/entries/calendar.d.ts.map +1 -0
  48. package/dist/cjs/entries/calendar.js +40 -0
  49. package/dist/cjs/entries/calendar.js.map +1 -0
  50. package/dist/cjs/entries/check-ins.d.ts +26 -0
  51. package/dist/cjs/entries/check-ins.d.ts.map +1 -0
  52. package/dist/cjs/entries/check-ins.js +40 -0
  53. package/dist/cjs/entries/check-ins.js.map +1 -0
  54. package/dist/cjs/entries/current.d.ts +26 -0
  55. package/dist/cjs/entries/current.d.ts.map +1 -0
  56. package/dist/cjs/entries/current.js +40 -0
  57. package/dist/cjs/entries/current.js.map +1 -0
  58. package/dist/cjs/entries/giving.d.ts +26 -0
  59. package/dist/cjs/entries/giving.d.ts.map +1 -0
  60. package/dist/cjs/entries/giving.js +40 -0
  61. package/dist/cjs/entries/giving.js.map +1 -0
  62. package/dist/cjs/entries/groups.d.ts +26 -0
  63. package/dist/cjs/entries/groups.d.ts.map +1 -0
  64. package/dist/cjs/entries/groups.js +40 -0
  65. package/dist/cjs/entries/groups.js.map +1 -0
  66. package/dist/cjs/entries/oauth.d.ts +8 -0
  67. package/dist/cjs/entries/oauth.d.ts.map +1 -0
  68. package/dist/cjs/entries/oauth.js +27 -0
  69. package/dist/cjs/entries/oauth.js.map +1 -0
  70. package/dist/cjs/entries/people.d.ts +26 -0
  71. package/dist/cjs/entries/people.d.ts.map +1 -0
  72. package/dist/cjs/entries/people.js +40 -0
  73. package/dist/cjs/entries/people.js.map +1 -0
  74. package/dist/cjs/entries/publishing.d.ts +26 -0
  75. package/dist/cjs/entries/publishing.d.ts.map +1 -0
  76. package/dist/cjs/entries/publishing.js +40 -0
  77. package/dist/cjs/entries/publishing.js.map +1 -0
  78. package/dist/cjs/entries/registrations.d.ts +26 -0
  79. package/dist/cjs/entries/registrations.d.ts.map +1 -0
  80. package/dist/cjs/entries/registrations.js +40 -0
  81. package/dist/cjs/entries/registrations.js.map +1 -0
  82. package/dist/cjs/entries/services.d.ts +26 -0
  83. package/dist/cjs/entries/services.d.ts.map +1 -0
  84. package/dist/cjs/entries/services.js +40 -0
  85. package/dist/cjs/entries/services.js.map +1 -0
  86. package/dist/cjs/entries/webhooks-api.d.ts +26 -0
  87. package/dist/cjs/entries/webhooks-api.d.ts.map +1 -0
  88. package/dist/cjs/entries/webhooks-api.js +40 -0
  89. package/dist/cjs/entries/webhooks-api.js.map +1 -0
  90. package/dist/cjs/entries/webhooks.d.ts +6 -0
  91. package/dist/cjs/entries/webhooks.d.ts.map +1 -0
  92. package/dist/cjs/entries/webhooks.js +22 -0
  93. package/dist/cjs/entries/webhooks.js.map +1 -0
  94. package/dist/cjs/generated/api.d.ts +426 -0
  95. package/dist/cjs/generated/api.d.ts.map +1 -0
  96. package/dist/cjs/generated/api.js +77 -0
  97. package/dist/cjs/generated/api.js.map +1 -0
  98. package/dist/cjs/generated/calendar.d.ts +2849 -0
  99. package/dist/cjs/generated/calendar.d.ts.map +1 -0
  100. package/dist/cjs/generated/calendar.js +299 -0
  101. package/dist/cjs/generated/calendar.js.map +1 -0
  102. package/dist/cjs/generated/check-ins.d.ts +2383 -0
  103. package/dist/cjs/generated/check-ins.d.ts.map +1 -0
  104. package/dist/cjs/generated/check-ins.js +298 -0
  105. package/dist/cjs/generated/check-ins.js.map +1 -0
  106. package/dist/cjs/generated/current.d.ts +135 -0
  107. package/dist/cjs/generated/current.d.ts.map +1 -0
  108. package/dist/cjs/generated/current.js +34 -0
  109. package/dist/cjs/generated/current.js.map +1 -0
  110. package/dist/cjs/generated/giving.d.ts +2309 -0
  111. package/dist/cjs/generated/giving.d.ts.map +1 -0
  112. package/dist/cjs/generated/giving.js +228 -0
  113. package/dist/cjs/generated/giving.js.map +1 -0
  114. package/dist/cjs/generated/groups.d.ts +1789 -0
  115. package/dist/cjs/generated/groups.d.ts.map +1 -0
  116. package/dist/cjs/generated/groups.js +200 -0
  117. package/dist/cjs/generated/groups.js.map +1 -0
  118. package/dist/cjs/generated/index.d.ts +5067 -0
  119. package/dist/cjs/generated/index.d.ts.map +1 -0
  120. package/dist/cjs/generated/index.js +73 -0
  121. package/dist/cjs/generated/index.js.map +1 -0
  122. package/dist/cjs/generated/people.d.ts +6001 -0
  123. package/dist/cjs/generated/people.d.ts.map +1 -0
  124. package/dist/cjs/generated/people.js +694 -0
  125. package/dist/cjs/generated/people.js.map +1 -0
  126. package/dist/cjs/generated/publishing.d.ts +1468 -0
  127. package/dist/cjs/generated/publishing.d.ts.map +1 -0
  128. package/dist/cjs/generated/publishing.js +180 -0
  129. package/dist/cjs/generated/publishing.js.map +1 -0
  130. package/dist/cjs/generated/registrations.d.ts +936 -0
  131. package/dist/cjs/generated/registrations.d.ts.map +1 -0
  132. package/dist/cjs/generated/registrations.js +122 -0
  133. package/dist/cjs/generated/registrations.js.map +1 -0
  134. package/dist/cjs/generated/services.d.ts +6301 -0
  135. package/dist/cjs/generated/services.d.ts.map +1 -0
  136. package/dist/cjs/generated/services.js +634 -0
  137. package/dist/cjs/generated/services.js.map +1 -0
  138. package/dist/cjs/generated/webhooks.d.ts +325 -0
  139. package/dist/cjs/generated/webhooks.d.ts.map +1 -0
  140. package/dist/cjs/generated/webhooks.js +58 -0
  141. package/dist/cjs/generated/webhooks.js.map +1 -0
  142. package/dist/cjs/index.d.ts +29 -0
  143. package/dist/cjs/index.d.ts.map +1 -0
  144. package/dist/cjs/index.js +51 -0
  145. package/dist/cjs/index.js.map +1 -0
  146. package/dist/cjs/package.json +1 -0
  147. package/dist/cjs/webhooks/errors.d.ts +51 -0
  148. package/dist/cjs/webhooks/errors.d.ts.map +1 -0
  149. package/dist/cjs/webhooks/errors.js +56 -0
  150. package/dist/cjs/webhooks/errors.js.map +1 -0
  151. package/dist/cjs/webhooks/events.d.ts +144 -0
  152. package/dist/cjs/webhooks/events.d.ts.map +1 -0
  153. package/dist/cjs/webhooks/events.js +160 -0
  154. package/dist/cjs/webhooks/events.js.map +1 -0
  155. package/dist/cjs/webhooks/handle.d.ts +103 -0
  156. package/dist/cjs/webhooks/handle.d.ts.map +1 -0
  157. package/dist/cjs/webhooks/handle.js +140 -0
  158. package/dist/cjs/webhooks/handle.js.map +1 -0
  159. package/dist/cjs/webhooks/index.d.ts +33 -0
  160. package/dist/cjs/webhooks/index.d.ts.map +1 -0
  161. package/dist/cjs/webhooks/index.js +46 -0
  162. package/dist/cjs/webhooks/index.js.map +1 -0
  163. package/dist/cjs/webhooks/signature.d.ts +84 -0
  164. package/dist/cjs/webhooks/signature.d.ts.map +1 -0
  165. package/dist/cjs/webhooks/signature.js +126 -0
  166. package/dist/cjs/webhooks/signature.js.map +1 -0
  167. package/dist/esm/client.d.ts +145 -0
  168. package/dist/esm/client.d.ts.map +1 -0
  169. package/dist/esm/client.js +172 -0
  170. package/dist/esm/client.js.map +1 -0
  171. package/dist/esm/core/auth.d.ts +105 -0
  172. package/dist/esm/core/auth.d.ts.map +1 -0
  173. package/dist/esm/core/auth.js +215 -0
  174. package/dist/esm/core/auth.js.map +1 -0
  175. package/dist/esm/core/errors.d.ts +145 -0
  176. package/dist/esm/core/errors.d.ts.map +1 -0
  177. package/dist/esm/core/errors.js +185 -0
  178. package/dist/esm/core/errors.js.map +1 -0
  179. package/dist/esm/core/graph.d.ts +110 -0
  180. package/dist/esm/core/graph.d.ts.map +1 -0
  181. package/dist/esm/core/graph.js +13 -0
  182. package/dist/esm/core/graph.js.map +1 -0
  183. package/dist/esm/core/http.d.ts +147 -0
  184. package/dist/esm/core/http.d.ts.map +1 -0
  185. package/dist/esm/core/http.js +473 -0
  186. package/dist/esm/core/http.js.map +1 -0
  187. package/dist/esm/core/jsonapi.d.ts +65 -0
  188. package/dist/esm/core/jsonapi.d.ts.map +1 -0
  189. package/dist/esm/core/jsonapi.js +2 -0
  190. package/dist/esm/core/jsonapi.js.map +1 -0
  191. package/dist/esm/core/oauth.d.ts +202 -0
  192. package/dist/esm/core/oauth.d.ts.map +1 -0
  193. package/dist/esm/core/oauth.js +280 -0
  194. package/dist/esm/core/oauth.js.map +1 -0
  195. package/dist/esm/core/product.d.ts +78 -0
  196. package/dist/esm/core/product.d.ts.map +1 -0
  197. package/dist/esm/core/product.js +54 -0
  198. package/dist/esm/core/product.js.map +1 -0
  199. package/dist/esm/core/query.d.ts +489 -0
  200. package/dist/esm/core/query.d.ts.map +1 -0
  201. package/dist/esm/core/query.js +431 -0
  202. package/dist/esm/core/query.js.map +1 -0
  203. package/dist/esm/core/transport.d.ts +57 -0
  204. package/dist/esm/core/transport.d.ts.map +1 -0
  205. package/dist/esm/core/transport.js +6 -0
  206. package/dist/esm/core/transport.js.map +1 -0
  207. package/dist/esm/entries/api.d.ts +26 -0
  208. package/dist/esm/entries/api.d.ts.map +1 -0
  209. package/dist/esm/entries/api.js +23 -0
  210. package/dist/esm/entries/api.js.map +1 -0
  211. package/dist/esm/entries/calendar.d.ts +26 -0
  212. package/dist/esm/entries/calendar.d.ts.map +1 -0
  213. package/dist/esm/entries/calendar.js +23 -0
  214. package/dist/esm/entries/calendar.js.map +1 -0
  215. package/dist/esm/entries/check-ins.d.ts +26 -0
  216. package/dist/esm/entries/check-ins.d.ts.map +1 -0
  217. package/dist/esm/entries/check-ins.js +23 -0
  218. package/dist/esm/entries/check-ins.js.map +1 -0
  219. package/dist/esm/entries/current.d.ts +26 -0
  220. package/dist/esm/entries/current.d.ts.map +1 -0
  221. package/dist/esm/entries/current.js +23 -0
  222. package/dist/esm/entries/current.js.map +1 -0
  223. package/dist/esm/entries/giving.d.ts +26 -0
  224. package/dist/esm/entries/giving.d.ts.map +1 -0
  225. package/dist/esm/entries/giving.js +23 -0
  226. package/dist/esm/entries/giving.js.map +1 -0
  227. package/dist/esm/entries/groups.d.ts +26 -0
  228. package/dist/esm/entries/groups.d.ts.map +1 -0
  229. package/dist/esm/entries/groups.js +23 -0
  230. package/dist/esm/entries/groups.js.map +1 -0
  231. package/dist/esm/entries/oauth.d.ts +8 -0
  232. package/dist/esm/entries/oauth.d.ts.map +1 -0
  233. package/dist/esm/entries/oauth.js +7 -0
  234. package/dist/esm/entries/oauth.js.map +1 -0
  235. package/dist/esm/entries/people.d.ts +26 -0
  236. package/dist/esm/entries/people.d.ts.map +1 -0
  237. package/dist/esm/entries/people.js +23 -0
  238. package/dist/esm/entries/people.js.map +1 -0
  239. package/dist/esm/entries/publishing.d.ts +26 -0
  240. package/dist/esm/entries/publishing.d.ts.map +1 -0
  241. package/dist/esm/entries/publishing.js +23 -0
  242. package/dist/esm/entries/publishing.js.map +1 -0
  243. package/dist/esm/entries/registrations.d.ts +26 -0
  244. package/dist/esm/entries/registrations.d.ts.map +1 -0
  245. package/dist/esm/entries/registrations.js +23 -0
  246. package/dist/esm/entries/registrations.js.map +1 -0
  247. package/dist/esm/entries/services.d.ts +26 -0
  248. package/dist/esm/entries/services.d.ts.map +1 -0
  249. package/dist/esm/entries/services.js +23 -0
  250. package/dist/esm/entries/services.js.map +1 -0
  251. package/dist/esm/entries/webhooks-api.d.ts +26 -0
  252. package/dist/esm/entries/webhooks-api.d.ts.map +1 -0
  253. package/dist/esm/entries/webhooks-api.js +23 -0
  254. package/dist/esm/entries/webhooks-api.js.map +1 -0
  255. package/dist/esm/entries/webhooks.d.ts +6 -0
  256. package/dist/esm/entries/webhooks.d.ts.map +1 -0
  257. package/dist/esm/entries/webhooks.js +6 -0
  258. package/dist/esm/entries/webhooks.js.map +1 -0
  259. package/dist/esm/generated/api.d.ts +426 -0
  260. package/dist/esm/generated/api.d.ts.map +1 -0
  261. package/dist/esm/generated/api.js +74 -0
  262. package/dist/esm/generated/api.js.map +1 -0
  263. package/dist/esm/generated/calendar.d.ts +2849 -0
  264. package/dist/esm/generated/calendar.d.ts.map +1 -0
  265. package/dist/esm/generated/calendar.js +296 -0
  266. package/dist/esm/generated/calendar.js.map +1 -0
  267. package/dist/esm/generated/check-ins.d.ts +2383 -0
  268. package/dist/esm/generated/check-ins.d.ts.map +1 -0
  269. package/dist/esm/generated/check-ins.js +295 -0
  270. package/dist/esm/generated/check-ins.js.map +1 -0
  271. package/dist/esm/generated/current.d.ts +135 -0
  272. package/dist/esm/generated/current.d.ts.map +1 -0
  273. package/dist/esm/generated/current.js +31 -0
  274. package/dist/esm/generated/current.js.map +1 -0
  275. package/dist/esm/generated/giving.d.ts +2309 -0
  276. package/dist/esm/generated/giving.d.ts.map +1 -0
  277. package/dist/esm/generated/giving.js +225 -0
  278. package/dist/esm/generated/giving.js.map +1 -0
  279. package/dist/esm/generated/groups.d.ts +1789 -0
  280. package/dist/esm/generated/groups.d.ts.map +1 -0
  281. package/dist/esm/generated/groups.js +197 -0
  282. package/dist/esm/generated/groups.js.map +1 -0
  283. package/dist/esm/generated/index.d.ts +5067 -0
  284. package/dist/esm/generated/index.d.ts.map +1 -0
  285. package/dist/esm/generated/index.js +37 -0
  286. package/dist/esm/generated/index.js.map +1 -0
  287. package/dist/esm/generated/people.d.ts +6001 -0
  288. package/dist/esm/generated/people.d.ts.map +1 -0
  289. package/dist/esm/generated/people.js +691 -0
  290. package/dist/esm/generated/people.js.map +1 -0
  291. package/dist/esm/generated/publishing.d.ts +1468 -0
  292. package/dist/esm/generated/publishing.d.ts.map +1 -0
  293. package/dist/esm/generated/publishing.js +177 -0
  294. package/dist/esm/generated/publishing.js.map +1 -0
  295. package/dist/esm/generated/registrations.d.ts +936 -0
  296. package/dist/esm/generated/registrations.d.ts.map +1 -0
  297. package/dist/esm/generated/registrations.js +119 -0
  298. package/dist/esm/generated/registrations.js.map +1 -0
  299. package/dist/esm/generated/services.d.ts +6301 -0
  300. package/dist/esm/generated/services.d.ts.map +1 -0
  301. package/dist/esm/generated/services.js +631 -0
  302. package/dist/esm/generated/services.js.map +1 -0
  303. package/dist/esm/generated/webhooks.d.ts +325 -0
  304. package/dist/esm/generated/webhooks.d.ts.map +1 -0
  305. package/dist/esm/generated/webhooks.js +55 -0
  306. package/dist/esm/generated/webhooks.js.map +1 -0
  307. package/dist/esm/index.d.ts +29 -0
  308. package/dist/esm/index.d.ts.map +1 -0
  309. package/dist/esm/index.js +26 -0
  310. package/dist/esm/index.js.map +1 -0
  311. package/dist/esm/webhooks/errors.d.ts +51 -0
  312. package/dist/esm/webhooks/errors.d.ts.map +1 -0
  313. package/dist/esm/webhooks/errors.js +51 -0
  314. package/dist/esm/webhooks/errors.js.map +1 -0
  315. package/dist/esm/webhooks/events.d.ts +144 -0
  316. package/dist/esm/webhooks/events.d.ts.map +1 -0
  317. package/dist/esm/webhooks/events.js +155 -0
  318. package/dist/esm/webhooks/events.js.map +1 -0
  319. package/dist/esm/webhooks/handle.d.ts +103 -0
  320. package/dist/esm/webhooks/handle.d.ts.map +1 -0
  321. package/dist/esm/webhooks/handle.js +137 -0
  322. package/dist/esm/webhooks/handle.js.map +1 -0
  323. package/dist/esm/webhooks/index.d.ts +33 -0
  324. package/dist/esm/webhooks/index.d.ts.map +1 -0
  325. package/dist/esm/webhooks/index.js +33 -0
  326. package/dist/esm/webhooks/index.js.map +1 -0
  327. package/dist/esm/webhooks/signature.d.ts +84 -0
  328. package/dist/esm/webhooks/signature.d.ts.map +1 -0
  329. package/dist/esm/webhooks/signature.js +120 -0
  330. package/dist/esm/webhooks/signature.js.map +1 -0
  331. package/llms.txt +119 -0
  332. package/package.json +79 -14
  333. package/src/client.ts +169 -282
  334. package/src/core/auth.ts +317 -0
  335. package/src/core/errors.ts +219 -0
  336. package/src/core/graph.ts +137 -0
  337. package/src/core/http.ts +594 -0
  338. package/src/core/jsonapi.ts +64 -0
  339. package/src/core/oauth.ts +403 -0
  340. package/src/core/product.ts +137 -0
  341. package/src/core/query.ts +1011 -0
  342. package/src/core/transport.ts +62 -0
  343. package/src/entries/api.ts +28 -0
  344. package/src/entries/calendar.ts +28 -0
  345. package/src/entries/check-ins.ts +28 -0
  346. package/src/entries/current.ts +28 -0
  347. package/src/entries/giving.ts +28 -0
  348. package/src/entries/groups.ts +28 -0
  349. package/src/entries/oauth.ts +7 -0
  350. package/src/entries/people.ts +28 -0
  351. package/src/entries/publishing.ts +28 -0
  352. package/src/entries/registrations.ts +28 -0
  353. package/src/entries/services.ts +28 -0
  354. package/src/entries/webhooks-api.ts +28 -0
  355. package/src/entries/webhooks.ts +5 -0
  356. package/src/generated/api.ts +401 -0
  357. package/src/generated/calendar.ts +2380 -0
  358. package/src/generated/check-ins.ts +1783 -0
  359. package/src/generated/current.ts +136 -0
  360. package/src/generated/giving.ts +1956 -0
  361. package/src/generated/groups.ts +1474 -0
  362. package/src/generated/index.ts +59 -0
  363. package/src/generated/people.ts +5103 -0
  364. package/src/generated/publishing.ts +1321 -0
  365. package/src/generated/registrations.ts +799 -0
  366. package/src/generated/services.ts +5427 -0
  367. package/src/generated/webhooks.ts +314 -0
  368. package/src/index.ts +74 -4
  369. package/src/webhooks/errors.ts +52 -0
  370. package/src/webhooks/events.ts +272 -0
  371. package/src/webhooks/handle.ts +163 -0
  372. package/src/webhooks/index.ts +54 -0
  373. package/src/webhooks/signature.ts +140 -0
  374. package/.gitattributes +0 -2
  375. package/.github/FUNDING.yml +0 -3
  376. package/.github/dependabot.yml +0 -21
  377. package/.github/workflows/ci-publish.yml +0 -84
  378. package/SECURITY.md +0 -13
  379. package/TODO.md +0 -6
  380. package/dist/client.d.ts +0 -216
  381. package/dist/client.js +0 -265
  382. package/dist/client.js.map +0 -1
  383. package/dist/index.d.ts +0 -4
  384. package/dist/index.js +0 -6
  385. package/dist/index.js.map +0 -1
  386. package/dist/modules/calendar.d.ts +0 -5
  387. package/dist/modules/calendar.js +0 -11
  388. package/dist/modules/calendar.js.map +0 -1
  389. package/dist/modules/checkins.d.ts +0 -0
  390. package/dist/modules/checkins.js +0 -2
  391. package/dist/modules/checkins.js.map +0 -1
  392. package/dist/modules/giving.d.ts +0 -0
  393. package/dist/modules/giving.js +0 -2
  394. package/dist/modules/giving.js.map +0 -1
  395. package/dist/modules/groups.d.ts +0 -4
  396. package/dist/modules/groups.js +0 -22
  397. package/dist/modules/groups.js.map +0 -1
  398. package/dist/modules/people.d.ts +0 -66
  399. package/dist/modules/people.js +0 -40
  400. package/dist/modules/people.js.map +0 -1
  401. package/dist/modules/publishing.d.ts +0 -0
  402. package/dist/modules/publishing.js +0 -2
  403. package/dist/modules/publishing.js.map +0 -1
  404. package/dist/modules/services.d.ts +0 -0
  405. package/dist/modules/services.js +0 -2
  406. package/dist/modules/services.js.map +0 -1
  407. package/dist/modules/webhooks.d.ts +0 -0
  408. package/dist/modules/webhooks.js +0 -2
  409. package/dist/modules/webhooks.js.map +0 -1
  410. package/dist/types.d.ts +0 -6
  411. package/dist/types.js.map +0 -1
  412. package/src/index.test.ts +0 -7
  413. package/src/modules/calendar.ts +0 -11
  414. package/src/modules/checkins.ts +0 -0
  415. package/src/modules/giving.ts +0 -0
  416. package/src/modules/groups.ts +0 -7
  417. package/src/modules/people.ts +0 -92
  418. package/src/modules/publishing.ts +0 -0
  419. package/src/modules/services.ts +0 -0
  420. package/src/modules/webhooks.ts +0 -0
  421. package/src/types.ts +0 -8
  422. package/tsconfig.json +0 -111
package/README.md CHANGED
@@ -1,53 +1,494 @@
1
- # Planning Center Kit
2
- ORM for Planning Center Online's APIs
1
+ # Unofficial Planning Center Kit
3
2
 
4
- > [!WARNING]
5
- > This project is very much a work in progress and is not yet ready for production use (unless you're feeling adventurous!). Please check back later for updates.
3
+ A fully typed, zero-dependency TypeScript client for every Planning Center API.
6
4
 
7
- While [Planning Center Online](https://www.planningcenter.com/developers) (PCO) offers a robust set of APIs, working with them can be cumbersome and time-consuming. This library aims to simplify the process of working with PCO's APIs by providing a flexible ORM that allows you to interact with the APIs in a more intuitive way using typed objects and methods.
5
+ > [!IMPORTANT]
6
+ > **Unofficial.** This is an independent, community-maintained project. It is not supported by, endorsed by, or affiliated with Planning Center.
8
7
 
9
- If you don't use TypeScript, don't worry! This library is written in TypeScript but works just as well in plain JavaScript.
8
+ [![npm version](https://img.shields.io/npm/v/@mackenly/planningcenterkit?logo=npm)](https://www.npmjs.com/package/@mackenly/planningcenterkit)
9
+ [![CI](https://github.com/mackenly/planningcenterkit/actions/workflows/ci-publish.yml/badge.svg?branch=main)](https://github.com/mackenly/planningcenterkit/actions/workflows/ci-publish.yml)
10
+ [![License: Apache-2.0](https://img.shields.io/npm/l/@mackenly/planningcenterkit)](./LICENSE)
11
+ [![Zero dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](./package.json)
12
+ [![npm provenance](https://img.shields.io/badge/npm-provenance-blue?logo=npm)](https://www.npmjs.com/package/@mackenly/planningcenterkit#provenance)
10
13
 
11
- ## Table of Contents
12
- - [Features](#features)
13
- - [Installation](#installation)
14
- - [Usage](#usage)
14
+ ```ts
15
+ import { PlanningCenter } from '@mackenly/planningcenterkit';
16
+
17
+ const pco = new PlanningCenter({
18
+ auth: { applicationId: process.env.PCO_APP_ID!, secret: process.env.PCO_SECRET! },
19
+ });
20
+
21
+ for await (const person of pco.people.people.where('status', 'active').order('last_name').all()) {
22
+ console.log(person.attributes.name); // string | null
23
+ }
24
+ ```
25
+
26
+ **[Documentation](https://planningcenterkit.mackenly.com/)** · **[Guides](https://planningcenterkit.mackenly.com/guides/getting-started/)** · **[Reference](https://planningcenterkit.mackenly.com/reference/)** · **[Examples](https://github.com/mackenly/planningcenterkit/tree/main/examples)** · **[Changelog](./CHANGELOG.md)**
27
+
28
+ ## Contents
29
+
30
+ - [Why Planning Center Kit](#why-planning-center-kit)
31
+ - [Install](#install)
32
+ - [Quick start](#quick-start)
33
+ - [Authentication](#authentication)
34
+ - [Querying](#querying)
35
+ - [Navigating nested resources](#navigating-nested-resources)
36
+ - [Creating, updating, deleting, and actions](#creating-updating-deleting-and-actions)
37
+ - [Errors](#errors)
38
+ - [Rate limits, retries, timeouts, and logging](#rate-limits-retries-timeouts-and-logging)
39
+ - [Receiving webhooks](#receiving-webhooks)
40
+ - [File uploads](#file-uploads)
41
+ - [Raw requests](#raw-requests)
42
+ - [Per-product imports](#per-product-imports)
43
+ - [TypeScript](#typescript)
44
+ - [API versions](#api-versions)
45
+ - [Supported runtimes](#supported-runtimes)
46
+ - [Contributing](#contributing)
15
47
  - [Sponsors](#sponsors)
16
48
  - [Disclaimer](#disclaimer)
17
49
 
18
- ## Features
19
- - [ ] Flexible ORM for PCO APIs - in progress
20
- - [ ] More..
21
- - [ ] React integration
22
-
23
- ## Installation
50
+ ## Why Planning Center Kit
51
+
52
+ - **Every product, every resource.** All 11 Planning Center products (API, Calendar, Check-Ins,
53
+ Current, Giving, Groups, People, Publishing, Registrations, Services, Webhooks) are generated
54
+ from Planning Center's own published API documentation, so every resource, edge, include,
55
+ `where` field, `order` field, filter, and action is there.
56
+ - **Types for everything.** Attribute types, create/update payloads, valid query names, and the
57
+ resources you pull out of `included` are all typed and autocompleted. Typos fail at compile time.
58
+ - **Names match the docs.** Edges and attributes are `snake_case` exactly as in Planning Center's
59
+ reference, so what you read there is what you type.
60
+ - **Handles the hard parts.** Automatic pagination, rate limiting from Planning Center's headers,
61
+ `Retry-After`, retries with backoff, timeouts, and `AbortSignal` support.
62
+ - **OAuth done right.** Automatic token refresh with rotating refresh tokens, an `onTokenRefresh`
63
+ hook to persist them, and helpers for the authorization flow with PKCE.
64
+ - **Webhooks.** Constant-time signature verification (WebCrypto) and typed event parsing.
65
+ - **Runs anywhere.** Node 22+, Bun, Deno, Cloudflare Workers, Vercel, and any runtime with `fetch`.
66
+ - **Zero dependencies, signed releases.** ESM and CommonJS builds, tree-shakeable per-product
67
+ imports, and npm packages published with [provenance](https://docs.npmjs.com/generating-provenance-statements).
68
+
69
+ This is version 1.0. The public API follows [semantic versioning](https://semver.org): breaking
70
+ changes only in major versions. Coming from 0.x? See the [migration guide](https://planningcenterkit.mackenly.com/guides/migrating-from-0-x/).
71
+
72
+ ## Install
73
+
24
74
  ```bash
25
75
  npm install @mackenly/planningcenterkit
26
- ```
27
- Or use yarn
28
- ```bash
76
+ # or
77
+ pnpm add @mackenly/planningcenterkit
29
78
  yarn add @mackenly/planningcenterkit
79
+ bun add @mackenly/planningcenterkit
30
80
  ```
31
- Or use pnpm
32
- ```bash
33
- pnpm add @mackenly/planningcenterkit
81
+
82
+ ## Quick start
83
+
84
+ Create a personal access token at
85
+ [api.planningcenteronline.com/oauth/applications](https://api.planningcenteronline.com/oauth/applications),
86
+ then:
87
+
88
+ ```ts
89
+ import { PlanningCenter } from '@mackenly/planningcenterkit';
90
+
91
+ const pco = new PlanningCenter({
92
+ auth: { applicationId: process.env.PCO_APP_ID!, secret: process.env.PCO_SECRET! },
93
+ });
94
+
95
+ // One page, with filters, side-loaded emails, and sorting.
96
+ const page = await pco.people.people
97
+ .where('created_at', 'gte', '2026-01-01')
98
+ .include('emails')
99
+ .order('-created_at')
100
+ .perPage(25)
101
+ .list();
102
+
103
+ for (const person of page.data) {
104
+ const emails = page.related(person, 'emails').map((email) => email.attributes.address);
105
+ console.log(person.attributes.name, emails);
106
+ }
107
+
108
+ // Follow nested edges exactly like the URLs do.
109
+ const plans = await pco.services.service_types.id('123').plans.filter('future').list();
110
+
111
+ // Writes are typed against the attributes Planning Center accepts.
112
+ const { data: ada } = await pco.people.people.create({ first_name: 'Ada', last_name: 'Lovelace' });
113
+ await pco.people.people.id(ada.id).emails.create({ address: 'ada@example.com', location: 'Home' });
34
114
  ```
35
- Currently published on npm and GitHub Packages. Plans to add to other package registries in the future.
36
115
 
37
- ## Quick Start Usage
38
- ```javascript
39
- // coming soon...
116
+ More in [Getting started](https://planningcenterkit.mackenly.com/guides/getting-started/).
117
+
118
+ ## Authentication
119
+
120
+ Pass exactly one strategy as `auth`. Full details: [Authentication guide](https://planningcenterkit.mackenly.com/guides/authentication/).
121
+
122
+ **Personal access token** (scripts and servers that act for your own organization):
123
+
124
+ ```ts
125
+ const pco = new PlanningCenter({ auth: { applicationId: '...', secret: '...' } });
126
+ ```
127
+
128
+ **OAuth** (apps used by many organizations). With `refreshToken`, `clientId`, and `clientSecret`
129
+ set, the client refreshes the access token shortly before `expiresAt` and once after any `401`.
130
+ Planning Center refresh tokens **rotate**: each refresh invalidates the previous one, so persist
131
+ the new tokens in `onTokenRefresh`:
132
+
133
+ ```ts
134
+ const pco = new PlanningCenter({
135
+ auth: {
136
+ accessToken: saved.accessToken,
137
+ refreshToken: saved.refreshToken,
138
+ expiresAt: saved.expiresAt, // ms since epoch, or a Date
139
+ clientId: process.env.PCO_CLIENT_ID!,
140
+ clientSecret: process.env.PCO_CLIENT_SECRET!,
141
+ onTokenRefresh: (tokens) => db.saveTokens(userId, tokens),
142
+ },
143
+ });
40
144
  ```
41
145
 
42
- ## Documentation
43
- For the full documentation, please visit the [documentation site](https://planningcenterkit.mackenly.com). There you'll find detailed information on how to use the library, including examples and API references.
146
+ **Token provider** (you own storage and refresh):
147
+
148
+ ```ts
149
+ const pco = new PlanningCenter({ auth: { getAccessToken: () => tokenStore.getFreshToken(userId) } });
150
+ ```
151
+
152
+ **OAuth flow helpers** live in `@mackenly/planningcenterkit/oauth` and work without a client:
153
+
154
+ ```ts
155
+ import { createPkceChallenge, exchangeCodeForToken, getAuthorizationUrl } from '@mackenly/planningcenterkit/oauth';
156
+
157
+ // 1. Redirect the user to Planning Center.
158
+ const { codeVerifier, codeChallenge } = await createPkceChallenge();
159
+ const state = crypto.randomUUID(); // store state + codeVerifier in the session
160
+ const url = getAuthorizationUrl({
161
+ clientId: process.env.PCO_CLIENT_ID!,
162
+ redirectUri: 'https://example.com/auth/complete',
163
+ scopes: ['people', 'services'],
164
+ state,
165
+ codeChallenge,
166
+ });
167
+
168
+ // 2. On the redirect back, check `state`, then exchange the code.
169
+ const tokens = await exchangeCodeForToken({
170
+ clientId: process.env.PCO_CLIENT_ID!,
171
+ clientSecret: process.env.PCO_CLIENT_SECRET!,
172
+ code: callbackUrl.searchParams.get('code')!,
173
+ redirectUri: 'https://example.com/auth/complete',
174
+ codeVerifier,
175
+ });
176
+ await db.saveTokens(userId, tokens); // { accessToken, refreshToken, expiresAt, scope, ... }
177
+ ```
178
+
179
+ `refreshAccessToken`, `revokeToken`, `introspectToken`, and `normalizeTokens` are there too. A
180
+ runnable server: [examples/oauth-flow.ts](./examples/oauth-flow.ts).
181
+
182
+ ## Querying
183
+
184
+ Every collection is an immutable builder; each method returns a new builder, so you can share a
185
+ base query. Full details: [Querying guide](https://planningcenterkit.mackenly.com/guides/querying/).
186
+
187
+ ```ts
188
+ const people = pco.people.people
189
+ .where('first_name', 'Tim%') // where[first_name]=Tim% (% is a wildcard)
190
+ .where('created_at', 'gte', '2026-01-01') // where[created_at][gte]=2026-01-01
191
+ .where('created_at', 'lt', new Date('2026-02-01')) // Dates are sent as ISO 8601
192
+ .filter('created_since') // filter=created_since
193
+ .include('emails', 'phone_numbers') // include=emails,phone_numbers
194
+ .order('last_name', '-created_at') // order=last_name,-created_at
195
+ .perPage(50) // per_page=50 (1-100)
196
+ .offset(100); // offset=100
197
+ ```
198
+
199
+ `where` operators (`gt`, `gte`, `lt`, `lte`) are only accepted on fields Planning Center lets you
200
+ compare (dates, times, some numbers); everything else is equality. Field names, value types,
201
+ filters, includes, and order fields are all checked against the docs for that resource.
202
+
203
+ Running a query:
204
+
205
+ | Method | Returns |
206
+ | --- | --- |
207
+ | `list()` | One page: `{ data, included, meta, links, totalCount, nextOffset, related() }` |
208
+ | `all()` | Async iterator over every matching resource, following pagination (100 per page) |
209
+ | `pages()` | Async iterator over pages, each with its own `included` and `related()` |
210
+ | `toArray({ max })` | Every matching resource (or the first `max`) in an array |
211
+ | `first()` | The first resource, or `undefined` |
212
+ | `count()` | `meta.total_count` for the query |
213
+ | `get(id, { include })` | One resource by id |
214
+
215
+ Side-loaded resources are read with `related()`, which is typed from the relationship name:
216
+
217
+ ```ts
218
+ const { data, related } = await pco.people.people.include('emails', 'primary_campus').list();
219
+ for (const person of data) {
220
+ const emails = related(person, 'emails'); // People.Email[]
221
+ const [campus] = related(person, 'primary_campus'); // People.Campus | undefined
222
+ }
223
+ ```
224
+
225
+ ## Navigating nested resources
226
+
227
+ `id()` gives you a reference to one resource; every edge Planning Center documents for it is a
228
+ property you can follow, as deep as the URLs go:
229
+
230
+ ```ts
231
+ // GET /people/v2/people/1/emails
232
+ const emails = await pco.people.people.id('1').emails.list();
233
+
234
+ // GET /services/v2/service_types/1/plans/2?include=plan_times
235
+ const { data: plan, related } = await pco.services.service_types.id('1').plans.id('2').get({ include: ['plan_times'] });
236
+
237
+ // GET /services/v2/service_types/1/plans/2/items
238
+ const items = await pco.services.service_types.id('1').plans.id('2').items.toArray();
239
+
240
+ // The product root (usually the organization)
241
+ const { data: org } = await pco.people.get();
242
+ ```
243
+
244
+ An edge whose name collides with a builder method is reachable with `.edge('name')`.
245
+
246
+ ## Creating, updating, deleting, and actions
247
+
248
+ `create` exists only on collections Planning Center lets you `POST` to, `update` and `delete`
249
+ only on resources that support them, and `action` only accepts the resource's documented actions.
250
+ Full details: [Writing data guide](https://planningcenterkit.mackenly.com/guides/writing-data/).
251
+
252
+ ```ts
253
+ const { data: person } = await pco.people.people.create({ first_name: 'Ada', last_name: 'Lovelace' });
254
+ await pco.people.people.id(person.id).update({ nickname: 'Ada' });
255
+ await pco.people.people.id(person.id).emails.create({ address: 'ada@example.com', location: 'Home' });
256
+ await pco.people.people.id(person.id).delete();
257
+
258
+ // Actions: POST /people/v2/lists/1/run
259
+ await pco.people.lists.id('1').action('run');
260
+ ```
261
+
262
+ ## Errors
263
+
264
+ Every error extends `PcoError`. Non-2xx responses become a `PcoApiError` subclass chosen by status.
265
+ Full details: [Errors and retries guide](https://planningcenterkit.mackenly.com/guides/errors-and-retries/).
266
+
267
+ | Class | When | Extras |
268
+ | --- | --- | --- |
269
+ | `PcoError` | Base class; also invalid arguments (bad id, unknown action) | |
270
+ | `PcoApiError` | Any non-2xx response | `status`, `method`, `url`, `errors`, `hint`, `headers`, `body` |
271
+ | `PcoBadRequestError` | 400 | |
272
+ | `PcoAuthenticationError` | 401 | `hint`, e.g. `BABOON` (expired token) |
273
+ | `PcoForbiddenError` | 403 | |
274
+ | `PcoNotFoundError` | 404 | |
275
+ | `PcoConflictError` | 409 | |
276
+ | `PcoValidationError` | 422 | `fieldErrors`: messages keyed by attribute |
277
+ | `PcoRateLimitError` | 429 after retries | `retryAfter` (seconds) |
278
+ | `PcoServerError` | 5xx after retries | |
279
+ | `PcoNetworkError` | No response (DNS, reset, ...) | `cause` |
280
+ | `PcoTimeoutError` | Exceeded `timeoutMs` | `cause` |
281
+ | `PcoOAuthError` | OAuth exchange/refresh/revoke failed | `status`, `error` (e.g. `invalid_grant`), `errorDescription` |
282
+ | `PcoWebhookVerificationError` | Bad webhook signature | `status` = 401 |
283
+ | `PcoWebhookParseError` | Malformed webhook body | `status` = 400 |
284
+
285
+ ```ts
286
+ import { PcoAuthenticationError, PcoValidationError } from '@mackenly/planningcenterkit';
287
+
288
+ try {
289
+ await pco.people.people.create({ first_name: '' });
290
+ } catch (err) {
291
+ if (err instanceof PcoValidationError) console.log(err.fieldErrors); // { first_name: ["can't be blank"] }
292
+ else if (err instanceof PcoAuthenticationError && err.hint === 'BABOON') console.log('token expired');
293
+ else throw err;
294
+ }
295
+ ```
296
+
297
+ ## Rate limits, retries, timeouts, and logging
298
+
299
+ Defaults that work for most apps, all configurable:
300
+
301
+ ```ts
302
+ const pco = new PlanningCenter({
303
+ auth,
304
+ timeoutMs: 30_000, // per attempt
305
+ maxConcurrency: 10, // requests in flight at once
306
+ retry: { maxRetries: 3, retryServerErrors: true, maxRetryAfterSeconds: 60 },
307
+ rateLimit: { throttle: true }, // pace from X-PCO-API-Request-Rate-* headers
308
+ userAgent: 'my-app/1.0',
309
+ hooks: {
310
+ onResponse: ({ method, url, status, durationMs }) => console.log(method, url, status, `${durationMs}ms`),
311
+ onRetry: ({ reason, attempt, delayMs }) => console.warn(`retry #${attempt + 1} (${reason}) in ${delayMs}ms`),
312
+ onThrottle: ({ delayMs }) => console.warn(`rate limit: waiting ${delayMs}ms`),
313
+ },
314
+ });
315
+
316
+ // Cancel any request.
317
+ const controller = new AbortController();
318
+ await pco.people.people.list({ signal: controller.signal });
319
+ ```
320
+
321
+ - **429** responses wait for `Retry-After` and retry (any method, since the request wasn't processed).
322
+ - **5xx, network errors, and timeouts** are retried with jittered exponential backoff for `GET`
323
+ and `DELETE` only. `POST` and `PATCH` are never retried for these, since they may have applied.
324
+ - All products on one client share a transport, so rate limiting is coordinated across them.
325
+ - Hooks never receive credentials.
326
+
327
+ ## Receiving webhooks
328
+
329
+ `@mackenly/planningcenterkit/webhooks` verifies the `X-PCO-Webhooks-Authenticity` signature
330
+ against the raw body and parses deliveries into typed events. Full details:
331
+ [Webhooks guide](https://planningcenterkit.mackenly.com/guides/webhooks/).
332
+
333
+ > **Two different "webhooks".** `@mackenly/planningcenterkit/webhooks` is for *receiving* webhooks
334
+ > on your server. `pco.webhooks` (or `@mackenly/planningcenterkit/webhooks-api`) is the Webhooks
335
+ > *product API*, for managing subscriptions and listing available events.
336
+
337
+ ```ts
338
+ import { handleWebhook, isEvent, PcoWebhookError } from '@mackenly/planningcenterkit/webhooks';
339
+
340
+ export default {
341
+ async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
342
+ try {
343
+ // Each subscription has its own secret: pass all of them, or a function of the event name.
344
+ const events = await handleWebhook(request, { secret: [env.PCO_CREATED_SECRET, env.PCO_UPDATED_SECRET] });
345
+ ctx.waitUntil(Promise.all(events.map(async (event) => {
346
+ if (isEvent(event, 'people.v2.events.person.created')) await onNewPerson(event.payload.data.id);
347
+ })));
348
+ return new Response('ok'); // respond 200 fast; anything else is retried
349
+ } catch (err) {
350
+ const status = err instanceof PcoWebhookError && 'status' in err ? Number(err.status) : 500;
351
+ return new Response('Rejected', { status }); // 401 or 400; never 410 (deactivates the subscription)
352
+ }
353
+ },
354
+ };
355
+ ```
356
+
357
+ `handleWebhook` takes a standard `Request` (Workers, Next.js App Router, Bun, Deno, Hono). For
358
+ Express, use `express.raw({ type: 'application/json' })` with `verifyWebhookSignature` and
359
+ `parseWebhook`; see the guide. A full Worker: [examples/cloudflare-worker-webhooks.ts](./examples/cloudflare-worker-webhooks.ts).
360
+
361
+ ## File uploads
362
+
363
+ Upload to Planning Center's upload service, then pass the returned id to an attribute that takes a file:
364
+
365
+ ```ts
366
+ import { readFile } from 'node:fs/promises';
367
+
368
+ const file = await pco.uploadFile(await readFile('avatar.png'), { filename: 'avatar.png', contentType: 'image/png' });
369
+ await pco.people.people.id('123').update({ avatar: file.id });
370
+ ```
371
+
372
+ Accepts a `Blob`/`File`, `ArrayBuffer`, or `Uint8Array` (a Node `Buffer` works).
373
+
374
+ ## Raw requests
375
+
376
+ For anything the typed clients don't cover, `request()` is still authenticated, rate limited, and retried:
377
+
378
+ ```ts
379
+ import type { JsonApiDocument } from '@mackenly/planningcenterkit';
380
+
381
+ const me = await pco.request<JsonApiDocument>({ method: 'GET', path: '/people/v2/me' });
382
+ const page = await pco.request<JsonApiDocument>({
383
+ method: 'GET',
384
+ path: '/people/v2/people',
385
+ query: { 'where[search_name_or_email]': 'ada', per_page: 10 },
386
+ version: '2026-10-05', // raw requests send no X-PCO-API-Version unless you set one
387
+ });
388
+ ```
389
+
390
+ On a builder, `.param(key, value)` adds any raw query parameter.
391
+
392
+ ## Per-product imports
393
+
394
+ `PlanningCenter` gives you every product. If you only need one, each product has its own entry
395
+ point (the package is `sideEffects: false`, so bundlers drop the rest):
396
+
397
+ ```ts
398
+ import { createPeopleClient } from '@mackenly/planningcenterkit/people';
399
+
400
+ const people = createPeopleClient({ auth: { applicationId: '...', secret: '...' } });
401
+ const { data } = await people.people.where('status', 'active').list();
402
+ ```
403
+
404
+ | Import | Exports |
405
+ | --- | --- |
406
+ | `@mackenly/planningcenterkit` | `PlanningCenter`, errors, OAuth helpers, all types |
407
+ | `@mackenly/planningcenterkit/{product}` | `create{Product}Client` and that product's types, for `api`, `calendar`, `check-ins`, `current`, `giving`, `groups`, `people`, `publishing`, `registrations`, `services` |
408
+ | `@mackenly/planningcenterkit/webhooks-api` | `createWebhooksClient` (the Webhooks product API: subscriptions, deliveries) |
409
+ | `@mackenly/planningcenterkit/webhooks` | Receiving webhooks: `handleWebhook`, `verifyWebhookSignature`, `parseWebhook`, ... |
410
+ | `@mackenly/planningcenterkit/oauth` | OAuth helpers only |
411
+
412
+ See [Products](https://planningcenterkit.mackenly.com/guides/products/) and the [reference](https://planningcenterkit.mackenly.com/reference/) for every product's client property, import, and root collections.
413
+
414
+ ## TypeScript
415
+
416
+ Every resource has a named type in its product namespace, and the result types are exported:
417
+
418
+ ```ts
419
+ import type { ListResult, People, Services } from '@mackenly/planningcenterkit';
420
+
421
+ function greet(person: People.Person) {
422
+ return `Hello, ${person.attributes.first_name ?? 'friend'}`;
423
+ }
424
+
425
+ type PlanTitle = Services.PlanAttributes['title']; // string | null
426
+ type PeoplePage = ListResult<People.PeopleSchema, 'person'>; // what pco.people.people.list() resolves to
427
+ type NewPerson = People.PeopleSchema['person']['create']; // accepted create attributes
428
+ ```
429
+
430
+ More in the [TypeScript guide](https://planningcenterkit.mackenly.com/guides/typescript/). Plain JavaScript works too; you just don't get the checking.
431
+
432
+ ## API versions
433
+
434
+ Planning Center versions each product's API by date. Each product client sends the version its
435
+ types were generated from in `X-PCO-API-Version`, so responses always match the types:
436
+
437
+ | Product | Version |
438
+ | --- | --- |
439
+ | API | 2026-09-24 |
440
+ | Calendar | 2026-06-22 |
441
+ | Check-Ins | 2025-05-28 |
442
+ | Current | 2018-08-01 |
443
+ | Giving | 2019-10-18 |
444
+ | Groups | 2026-11-10 |
445
+ | People | 2026-10-05 |
446
+ | Publishing | 2024-03-25 |
447
+ | Registrations | 2025-05-01 |
448
+ | Services | 2018-11-01 |
449
+ | Webhooks | 2022-10-20 |
450
+
451
+ Override per product with `new PlanningCenter({ auth, versions: { people: '2025-11-10' } })` (the
452
+ types won't follow). A scheduled workflow regenerates the types when Planning Center publishes new
453
+ versions; adopting a new version is called out in the changelog.
454
+
455
+ ## Supported runtimes
456
+
457
+ Node.js 22+, Bun, Deno, Cloudflare Workers, Vercel (Node and Edge), and any runtime with `fetch`,
458
+ `AbortSignal`, and WebCrypto. The library uses only web-standard globals and no Node built-ins.
459
+ Keep secrets and tokens on the server: don't ship personal access tokens or client secrets to a browser.
460
+
461
+ ## Contributing
462
+
463
+ Issues and pull requests are welcome. The code that covers Planning Center's resources is generated,
464
+ so fixes to resource types usually belong in `scripts/` rather than `src/generated/`.
465
+
466
+ | Script | What it does |
467
+ | --- | --- |
468
+ | `npm run spec:fetch` | Downloads Planning Center's API documentation into `spec/` |
469
+ | `npm run generate` | Regenerates `src/generated/` from `spec/` |
470
+ | `npm test` | Unit and type tests (Vitest) |
471
+ | `npm run test:live` | Read-only tests against a real organization; needs `PCO_TEST_CLIENT_ID` and `PCO_TEST_SECRET` (a personal access token), skipped otherwise |
472
+ | `npm run seed:test-org` | **Writes** to the organization in `PCO_TEST_CLIENT_ID`/`PCO_TEST_SECRET`: adds two `PCK-Test` people with marital status, name prefix/suffix, school, campus, and inactive reason set, so `test:live` can check those links. Safe to re-run. In CI: the **Seed test organization** workflow (Run workflow, or the `seed-test-org` label on a PR) |
473
+ | `npm run typecheck` | `tsc` over sources, tests, scripts, and examples |
474
+ | `npm run build` | Builds ESM and CommonJS output into `dist/` |
475
+ | `npm run check` | Typecheck, test, and build |
476
+ | `npm run docs:dev` | Generates the reference pages and runs the docs site locally (`site/`, Nimbus) |
477
+ | `npm run docs:build` | Generates the reference pages from `spec/` and builds the docs site |
44
478
 
45
479
  ## Sponsors
480
+
46
481
  [<img alt="Tricities Media Group" src="https://tricitiesmediagroup.com/TMG-black-1080x247.png" width="250" style="background-color: white">](https://tricitiesmediagroup.com?utm_source=planningcenterkit&utm_medium=github&utm_campaign=sponsorship)
47
482
 
48
- *Interested in getting your company's logo displayed here and support the project? [Contact me](https://tricitiesmediagroup.com/contact) to discuss sponsorship opportunities.*
483
+ *Interested in getting your company's logo displayed here and supporting the project? [Contact me](https://tricitiesmediagroup.com/contact) to discuss sponsorship opportunities.*
49
484
 
50
485
  ## Disclaimer
51
- This project is in no way supported or affiliated with Planning Center Online. It is a personal project that I am working on in my free time. As such, continued development is dependent on my availability, financial incentives, and interest in the project. If you would like to see this project maintained and further developed I encourage you to help contribute either with code or fiscally through [GitHub Sponsors](https://github.com/sponsors/mackenly). If you work at Planning Center and would like to support this project, I would be happy to discuss ways in which we could work together.
52
486
 
53
- Copyright 2024 Tricities Media Group LLC
487
+ This project is not supported by or affiliated with Planning Center. It is an independent,
488
+ community-maintained project, and continued development depends on the maintainer's availability,
489
+ financial support, and interest. If you'd like to see it maintained and further developed, please
490
+ contribute code or support it through [GitHub Sponsors](https://github.com/sponsors/mackenly). If
491
+ you work at Planning Center and would like to support this project, I'd be happy to discuss ways
492
+ we could work together.
493
+
494
+ Copyright 2024-2026 Tricities Media Group LLC
@@ -0,0 +1,145 @@
1
+ import type { ProductName } from './core/graph.js';
2
+ import { type TransportOptions } from './core/http.js';
3
+ import { type ProductClient } from './core/product.js';
4
+ import type { PcoRequest, PcoTransport, UploadedFile, UploadOptions } from './core/transport.js';
5
+ import { type ApiRoot, type ApiSchema } from './generated/api.js';
6
+ import { type CalendarRoot, type CalendarSchema } from './generated/calendar.js';
7
+ import { type CheckInsRoot, type CheckInsSchema } from './generated/check-ins.js';
8
+ import { type CurrentRoot, type CurrentSchema } from './generated/current.js';
9
+ import { type GivingRoot, type GivingSchema } from './generated/giving.js';
10
+ import { type GroupsRoot, type GroupsSchema } from './generated/groups.js';
11
+ import { type PeopleRoot, type PeopleSchema } from './generated/people.js';
12
+ import { type PublishingRoot, type PublishingSchema } from './generated/publishing.js';
13
+ import { type RegistrationsRoot, type RegistrationsSchema } from './generated/registrations.js';
14
+ import { type ServicesRoot, type ServicesSchema } from './generated/services.js';
15
+ import { type WebhooksRoot, type WebhooksSchema } from './generated/webhooks.js';
16
+ /**
17
+ * API versions to send per product, as `YYYY-MM-DD` (or `'LATEST'`).
18
+ *
19
+ * By default each product is pinned to the version this package's types were generated from,
20
+ * so responses always match the types. Override only if you need a different version, and note
21
+ * the types won't follow.
22
+ *
23
+ * @see https://api.planningcenteronline.com/docs/overview/versioning
24
+ */
25
+ export type ApiVersions = Partial<Record<ProductName, string>>;
26
+ /** Options for {@link PlanningCenter}: transport options plus per-product API versions. */
27
+ export interface PlanningCenterOptions extends TransportOptions {
28
+ /** Per-product API version overrides. */
29
+ versions?: ApiVersions;
30
+ }
31
+ /** Use an existing transport (e.g. a shared one, or a mock in tests) instead of creating one. */
32
+ export interface PlanningCenterTransportOptions {
33
+ transport: PcoTransport;
34
+ versions?: ApiVersions;
35
+ }
36
+ /**
37
+ * The Planning Center API client. One property per product, each generated from Planning
38
+ * Center's API documentation, plus raw `request()` and `uploadFile()`.
39
+ *
40
+ * Product clients are created on first use, and all share one transport, so authentication,
41
+ * rate limiting, and retries are coordinated across products.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * import { PlanningCenter } from '@mackenly/planningcenterkit';
46
+ *
47
+ * const pco = new PlanningCenter({
48
+ * auth: { applicationId: process.env.PCO_APP_ID!, secret: process.env.PCO_SECRET! },
49
+ * });
50
+ *
51
+ * const { data } = await pco.people.people
52
+ * .where('created_at', 'gte', '2026-01-01')
53
+ * .include('emails')
54
+ * .order('-created_at')
55
+ * .list();
56
+ *
57
+ * for await (const plan of pco.services.service_types.id('1').plans.filter('future').all()) {
58
+ * console.log(plan.attributes.title);
59
+ * }
60
+ * ```
61
+ */
62
+ export declare class PlanningCenter {
63
+ #private;
64
+ /** The underlying transport. Use it to share auth/rate limiting with your own code. */
65
+ readonly transport: PcoTransport;
66
+ constructor(options: PlanningCenterOptions | PlanningCenterTransportOptions);
67
+ /**
68
+ * Planning Center API: OAuth applications, personal access tokens, connected applications.
69
+ * @see https://api.planningcenteronline.com/docs/apps/api
70
+ */
71
+ get api(): ProductClient<ApiSchema, ApiRoot>;
72
+ /**
73
+ * Calendar: events, resources, rooms, approvals.
74
+ * @see https://api.planningcenteronline.com/docs/apps/calendar
75
+ */
76
+ get calendar(): ProductClient<CalendarSchema, CalendarRoot>;
77
+ /**
78
+ * Check-Ins: events, check-ins, locations, stations, labels.
79
+ * @see https://api.planningcenteronline.com/docs/apps/check-ins
80
+ */
81
+ get checkIns(): ProductClient<CheckInsSchema, CheckInsRoot>;
82
+ /**
83
+ * Current (legacy donations product).
84
+ * @see https://api.planningcenteronline.com/docs/apps/current
85
+ */
86
+ get current(): ProductClient<CurrentSchema, CurrentRoot>;
87
+ /**
88
+ * Giving: donations, funds, batches, pledges, recurring donations.
89
+ * @see https://api.planningcenteronline.com/docs/apps/giving
90
+ */
91
+ get giving(): ProductClient<GivingSchema, GivingRoot>;
92
+ /**
93
+ * Groups: groups, memberships, events, attendance, tags.
94
+ * @see https://api.planningcenteronline.com/docs/apps/groups
95
+ */
96
+ get groups(): ProductClient<GroupsSchema, GroupsRoot>;
97
+ /**
98
+ * People: people, households, lists, forms, workflows, notes, field data.
99
+ * @see https://api.planningcenteronline.com/docs/apps/people
100
+ */
101
+ get people(): ProductClient<PeopleSchema, PeopleRoot>;
102
+ /**
103
+ * Publishing: channels, episodes, series, speakers.
104
+ * @see https://api.planningcenteronline.com/docs/apps/publishing
105
+ */
106
+ get publishing(): ProductClient<PublishingSchema, PublishingRoot>;
107
+ /**
108
+ * Registrations: signups, attendees, registrations, selection types.
109
+ * @see https://api.planningcenteronline.com/docs/apps/registrations
110
+ */
111
+ get registrations(): ProductClient<RegistrationsSchema, RegistrationsRoot>;
112
+ /**
113
+ * Services: service types, plans, items, songs, arrangements, teams, schedules.
114
+ * @see https://api.planningcenteronline.com/docs/apps/services
115
+ */
116
+ get services(): ProductClient<ServicesSchema, ServicesRoot>;
117
+ /**
118
+ * Webhooks: subscriptions, available events, deliveries. To receive webhooks, see
119
+ * `@mackenly/planningcenterkit/webhooks`.
120
+ * @see https://api.planningcenteronline.com/docs/apps/webhooks
121
+ */
122
+ get webhooks(): ProductClient<WebhooksSchema, WebhooksRoot>;
123
+ /**
124
+ * Sends any request, authenticated, rate limited, and retried like every other call. Use it
125
+ * for endpoints or parameters the typed clients don't cover.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * const me = await pco.request<JsonApiDocument>({ method: 'GET', path: '/people/v2/me' });
130
+ * ```
131
+ */
132
+ request<T = unknown>(request: PcoRequest): Promise<T>;
133
+ /**
134
+ * Uploads a file and returns its UUID, which you then pass to an attribute that accepts files.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * const file = await pco.uploadFile(await fs.readFile('avatar.png'), { filename: 'avatar.png' });
139
+ * await pco.people.people.id('123').update({ avatar: file.id });
140
+ * ```
141
+ * @see https://api.planningcenteronline.com/docs/overview/file-uploads
142
+ */
143
+ uploadFile(file: Blob | ArrayBuffer | Uint8Array, options?: UploadOptions): Promise<UploadedFile>;
144
+ }
145
+ //# sourceMappingURL=client.d.ts.map