@mackenly/planningcenterkit 0.4.41 → 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.
- package/README.md +472 -31
- package/dist/cjs/client.d.ts +145 -0
- package/dist/cjs/client.d.ts.map +1 -0
- package/dist/cjs/client.js +176 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/core/auth.d.ts +105 -0
- package/dist/cjs/core/auth.d.ts.map +1 -0
- package/dist/cjs/core/auth.js +219 -0
- package/dist/cjs/core/auth.js.map +1 -0
- package/dist/cjs/core/errors.d.ts +145 -0
- package/dist/cjs/core/errors.d.ts.map +1 -0
- package/dist/cjs/core/errors.js +202 -0
- package/dist/cjs/core/errors.js.map +1 -0
- package/dist/cjs/core/graph.d.ts +110 -0
- package/dist/cjs/core/graph.d.ts.map +1 -0
- package/dist/cjs/core/graph.js +14 -0
- package/dist/cjs/core/graph.js.map +1 -0
- package/dist/cjs/core/http.d.ts +147 -0
- package/dist/cjs/core/http.d.ts.map +1 -0
- package/dist/cjs/core/http.js +478 -0
- package/dist/cjs/core/http.js.map +1 -0
- package/dist/cjs/core/jsonapi.d.ts +65 -0
- package/dist/cjs/core/jsonapi.d.ts.map +1 -0
- package/dist/{types.js → cjs/core/jsonapi.js} +1 -2
- package/dist/cjs/core/jsonapi.js.map +1 -0
- package/dist/cjs/core/oauth.d.ts +202 -0
- package/dist/cjs/core/oauth.d.ts.map +1 -0
- package/dist/cjs/core/oauth.js +290 -0
- package/dist/cjs/core/oauth.js.map +1 -0
- package/dist/cjs/core/product.d.ts +78 -0
- package/dist/cjs/core/product.d.ts.map +1 -0
- package/dist/cjs/core/product.js +57 -0
- package/dist/cjs/core/product.js.map +1 -0
- package/dist/cjs/core/query.d.ts +489 -0
- package/dist/cjs/core/query.d.ts.map +1 -0
- package/dist/cjs/core/query.js +435 -0
- package/dist/cjs/core/query.js.map +1 -0
- package/dist/cjs/core/transport.d.ts +57 -0
- package/dist/cjs/core/transport.d.ts.map +1 -0
- package/dist/cjs/core/transport.js +7 -0
- package/dist/cjs/core/transport.js.map +1 -0
- package/dist/cjs/entries/api.d.ts +26 -0
- package/dist/cjs/entries/api.d.ts.map +1 -0
- package/dist/cjs/entries/api.js +40 -0
- package/dist/cjs/entries/api.js.map +1 -0
- package/dist/cjs/entries/calendar.d.ts +26 -0
- package/dist/cjs/entries/calendar.d.ts.map +1 -0
- package/dist/cjs/entries/calendar.js +40 -0
- package/dist/cjs/entries/calendar.js.map +1 -0
- package/dist/cjs/entries/check-ins.d.ts +26 -0
- package/dist/cjs/entries/check-ins.d.ts.map +1 -0
- package/dist/cjs/entries/check-ins.js +40 -0
- package/dist/cjs/entries/check-ins.js.map +1 -0
- package/dist/cjs/entries/current.d.ts +26 -0
- package/dist/cjs/entries/current.d.ts.map +1 -0
- package/dist/cjs/entries/current.js +40 -0
- package/dist/cjs/entries/current.js.map +1 -0
- package/dist/cjs/entries/giving.d.ts +26 -0
- package/dist/cjs/entries/giving.d.ts.map +1 -0
- package/dist/cjs/entries/giving.js +40 -0
- package/dist/cjs/entries/giving.js.map +1 -0
- package/dist/cjs/entries/groups.d.ts +26 -0
- package/dist/cjs/entries/groups.d.ts.map +1 -0
- package/dist/cjs/entries/groups.js +40 -0
- package/dist/cjs/entries/groups.js.map +1 -0
- package/dist/cjs/entries/oauth.d.ts +8 -0
- package/dist/cjs/entries/oauth.d.ts.map +1 -0
- package/dist/cjs/entries/oauth.js +27 -0
- package/dist/cjs/entries/oauth.js.map +1 -0
- package/dist/cjs/entries/people.d.ts +26 -0
- package/dist/cjs/entries/people.d.ts.map +1 -0
- package/dist/cjs/entries/people.js +40 -0
- package/dist/cjs/entries/people.js.map +1 -0
- package/dist/cjs/entries/publishing.d.ts +26 -0
- package/dist/cjs/entries/publishing.d.ts.map +1 -0
- package/dist/cjs/entries/publishing.js +40 -0
- package/dist/cjs/entries/publishing.js.map +1 -0
- package/dist/cjs/entries/registrations.d.ts +26 -0
- package/dist/cjs/entries/registrations.d.ts.map +1 -0
- package/dist/cjs/entries/registrations.js +40 -0
- package/dist/cjs/entries/registrations.js.map +1 -0
- package/dist/cjs/entries/services.d.ts +26 -0
- package/dist/cjs/entries/services.d.ts.map +1 -0
- package/dist/cjs/entries/services.js +40 -0
- package/dist/cjs/entries/services.js.map +1 -0
- package/dist/cjs/entries/webhooks-api.d.ts +26 -0
- package/dist/cjs/entries/webhooks-api.d.ts.map +1 -0
- package/dist/cjs/entries/webhooks-api.js +40 -0
- package/dist/cjs/entries/webhooks-api.js.map +1 -0
- package/dist/cjs/entries/webhooks.d.ts +6 -0
- package/dist/cjs/entries/webhooks.d.ts.map +1 -0
- package/dist/cjs/entries/webhooks.js +22 -0
- package/dist/cjs/entries/webhooks.js.map +1 -0
- package/dist/cjs/generated/api.d.ts +426 -0
- package/dist/cjs/generated/api.d.ts.map +1 -0
- package/dist/cjs/generated/api.js +77 -0
- package/dist/cjs/generated/api.js.map +1 -0
- package/dist/cjs/generated/calendar.d.ts +2849 -0
- package/dist/cjs/generated/calendar.d.ts.map +1 -0
- package/dist/cjs/generated/calendar.js +299 -0
- package/dist/cjs/generated/calendar.js.map +1 -0
- package/dist/cjs/generated/check-ins.d.ts +2383 -0
- package/dist/cjs/generated/check-ins.d.ts.map +1 -0
- package/dist/cjs/generated/check-ins.js +298 -0
- package/dist/cjs/generated/check-ins.js.map +1 -0
- package/dist/cjs/generated/current.d.ts +135 -0
- package/dist/cjs/generated/current.d.ts.map +1 -0
- package/dist/cjs/generated/current.js +34 -0
- package/dist/cjs/generated/current.js.map +1 -0
- package/dist/cjs/generated/giving.d.ts +2309 -0
- package/dist/cjs/generated/giving.d.ts.map +1 -0
- package/dist/cjs/generated/giving.js +228 -0
- package/dist/cjs/generated/giving.js.map +1 -0
- package/dist/cjs/generated/groups.d.ts +1789 -0
- package/dist/cjs/generated/groups.d.ts.map +1 -0
- package/dist/cjs/generated/groups.js +200 -0
- package/dist/cjs/generated/groups.js.map +1 -0
- package/dist/cjs/generated/index.d.ts +5067 -0
- package/dist/cjs/generated/index.d.ts.map +1 -0
- package/dist/cjs/generated/index.js +73 -0
- package/dist/cjs/generated/index.js.map +1 -0
- package/dist/cjs/generated/people.d.ts +6001 -0
- package/dist/cjs/generated/people.d.ts.map +1 -0
- package/dist/cjs/generated/people.js +694 -0
- package/dist/cjs/generated/people.js.map +1 -0
- package/dist/cjs/generated/publishing.d.ts +1468 -0
- package/dist/cjs/generated/publishing.d.ts.map +1 -0
- package/dist/cjs/generated/publishing.js +180 -0
- package/dist/cjs/generated/publishing.js.map +1 -0
- package/dist/cjs/generated/registrations.d.ts +936 -0
- package/dist/cjs/generated/registrations.d.ts.map +1 -0
- package/dist/cjs/generated/registrations.js +122 -0
- package/dist/cjs/generated/registrations.js.map +1 -0
- package/dist/cjs/generated/services.d.ts +6301 -0
- package/dist/cjs/generated/services.d.ts.map +1 -0
- package/dist/cjs/generated/services.js +634 -0
- package/dist/cjs/generated/services.js.map +1 -0
- package/dist/cjs/generated/webhooks.d.ts +325 -0
- package/dist/cjs/generated/webhooks.d.ts.map +1 -0
- package/dist/cjs/generated/webhooks.js +58 -0
- package/dist/cjs/generated/webhooks.js.map +1 -0
- package/dist/cjs/index.d.ts +29 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +51 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/webhooks/errors.d.ts +51 -0
- package/dist/cjs/webhooks/errors.d.ts.map +1 -0
- package/dist/cjs/webhooks/errors.js +56 -0
- package/dist/cjs/webhooks/errors.js.map +1 -0
- package/dist/cjs/webhooks/events.d.ts +144 -0
- package/dist/cjs/webhooks/events.d.ts.map +1 -0
- package/dist/cjs/webhooks/events.js +160 -0
- package/dist/cjs/webhooks/events.js.map +1 -0
- package/dist/cjs/webhooks/handle.d.ts +103 -0
- package/dist/cjs/webhooks/handle.d.ts.map +1 -0
- package/dist/cjs/webhooks/handle.js +140 -0
- package/dist/cjs/webhooks/handle.js.map +1 -0
- package/dist/cjs/webhooks/index.d.ts +33 -0
- package/dist/cjs/webhooks/index.d.ts.map +1 -0
- package/dist/cjs/webhooks/index.js +46 -0
- package/dist/cjs/webhooks/index.js.map +1 -0
- package/dist/cjs/webhooks/signature.d.ts +84 -0
- package/dist/cjs/webhooks/signature.d.ts.map +1 -0
- package/dist/cjs/webhooks/signature.js +126 -0
- package/dist/cjs/webhooks/signature.js.map +1 -0
- package/dist/esm/client.d.ts +145 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +172 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/core/auth.d.ts +105 -0
- package/dist/esm/core/auth.d.ts.map +1 -0
- package/dist/esm/core/auth.js +215 -0
- package/dist/esm/core/auth.js.map +1 -0
- package/dist/esm/core/errors.d.ts +145 -0
- package/dist/esm/core/errors.d.ts.map +1 -0
- package/dist/esm/core/errors.js +185 -0
- package/dist/esm/core/errors.js.map +1 -0
- package/dist/esm/core/graph.d.ts +110 -0
- package/dist/esm/core/graph.d.ts.map +1 -0
- package/dist/esm/core/graph.js +13 -0
- package/dist/esm/core/graph.js.map +1 -0
- package/dist/esm/core/http.d.ts +147 -0
- package/dist/esm/core/http.d.ts.map +1 -0
- package/dist/esm/core/http.js +473 -0
- package/dist/esm/core/http.js.map +1 -0
- package/dist/esm/core/jsonapi.d.ts +65 -0
- package/dist/esm/core/jsonapi.d.ts.map +1 -0
- package/dist/esm/core/jsonapi.js +2 -0
- package/dist/esm/core/jsonapi.js.map +1 -0
- package/dist/esm/core/oauth.d.ts +202 -0
- package/dist/esm/core/oauth.d.ts.map +1 -0
- package/dist/esm/core/oauth.js +280 -0
- package/dist/esm/core/oauth.js.map +1 -0
- package/dist/esm/core/product.d.ts +78 -0
- package/dist/esm/core/product.d.ts.map +1 -0
- package/dist/esm/core/product.js +54 -0
- package/dist/esm/core/product.js.map +1 -0
- package/dist/esm/core/query.d.ts +489 -0
- package/dist/esm/core/query.d.ts.map +1 -0
- package/dist/esm/core/query.js +431 -0
- package/dist/esm/core/query.js.map +1 -0
- package/dist/esm/core/transport.d.ts +57 -0
- package/dist/esm/core/transport.d.ts.map +1 -0
- package/dist/esm/core/transport.js +6 -0
- package/dist/esm/core/transport.js.map +1 -0
- package/dist/esm/entries/api.d.ts +26 -0
- package/dist/esm/entries/api.d.ts.map +1 -0
- package/dist/esm/entries/api.js +23 -0
- package/dist/esm/entries/api.js.map +1 -0
- package/dist/esm/entries/calendar.d.ts +26 -0
- package/dist/esm/entries/calendar.d.ts.map +1 -0
- package/dist/esm/entries/calendar.js +23 -0
- package/dist/esm/entries/calendar.js.map +1 -0
- package/dist/esm/entries/check-ins.d.ts +26 -0
- package/dist/esm/entries/check-ins.d.ts.map +1 -0
- package/dist/esm/entries/check-ins.js +23 -0
- package/dist/esm/entries/check-ins.js.map +1 -0
- package/dist/esm/entries/current.d.ts +26 -0
- package/dist/esm/entries/current.d.ts.map +1 -0
- package/dist/esm/entries/current.js +23 -0
- package/dist/esm/entries/current.js.map +1 -0
- package/dist/esm/entries/giving.d.ts +26 -0
- package/dist/esm/entries/giving.d.ts.map +1 -0
- package/dist/esm/entries/giving.js +23 -0
- package/dist/esm/entries/giving.js.map +1 -0
- package/dist/esm/entries/groups.d.ts +26 -0
- package/dist/esm/entries/groups.d.ts.map +1 -0
- package/dist/esm/entries/groups.js +23 -0
- package/dist/esm/entries/groups.js.map +1 -0
- package/dist/esm/entries/oauth.d.ts +8 -0
- package/dist/esm/entries/oauth.d.ts.map +1 -0
- package/dist/esm/entries/oauth.js +7 -0
- package/dist/esm/entries/oauth.js.map +1 -0
- package/dist/esm/entries/people.d.ts +26 -0
- package/dist/esm/entries/people.d.ts.map +1 -0
- package/dist/esm/entries/people.js +23 -0
- package/dist/esm/entries/people.js.map +1 -0
- package/dist/esm/entries/publishing.d.ts +26 -0
- package/dist/esm/entries/publishing.d.ts.map +1 -0
- package/dist/esm/entries/publishing.js +23 -0
- package/dist/esm/entries/publishing.js.map +1 -0
- package/dist/esm/entries/registrations.d.ts +26 -0
- package/dist/esm/entries/registrations.d.ts.map +1 -0
- package/dist/esm/entries/registrations.js +23 -0
- package/dist/esm/entries/registrations.js.map +1 -0
- package/dist/esm/entries/services.d.ts +26 -0
- package/dist/esm/entries/services.d.ts.map +1 -0
- package/dist/esm/entries/services.js +23 -0
- package/dist/esm/entries/services.js.map +1 -0
- package/dist/esm/entries/webhooks-api.d.ts +26 -0
- package/dist/esm/entries/webhooks-api.d.ts.map +1 -0
- package/dist/esm/entries/webhooks-api.js +23 -0
- package/dist/esm/entries/webhooks-api.js.map +1 -0
- package/dist/esm/entries/webhooks.d.ts +6 -0
- package/dist/esm/entries/webhooks.d.ts.map +1 -0
- package/dist/esm/entries/webhooks.js +6 -0
- package/dist/esm/entries/webhooks.js.map +1 -0
- package/dist/esm/generated/api.d.ts +426 -0
- package/dist/esm/generated/api.d.ts.map +1 -0
- package/dist/esm/generated/api.js +74 -0
- package/dist/esm/generated/api.js.map +1 -0
- package/dist/esm/generated/calendar.d.ts +2849 -0
- package/dist/esm/generated/calendar.d.ts.map +1 -0
- package/dist/esm/generated/calendar.js +296 -0
- package/dist/esm/generated/calendar.js.map +1 -0
- package/dist/esm/generated/check-ins.d.ts +2383 -0
- package/dist/esm/generated/check-ins.d.ts.map +1 -0
- package/dist/esm/generated/check-ins.js +295 -0
- package/dist/esm/generated/check-ins.js.map +1 -0
- package/dist/esm/generated/current.d.ts +135 -0
- package/dist/esm/generated/current.d.ts.map +1 -0
- package/dist/esm/generated/current.js +31 -0
- package/dist/esm/generated/current.js.map +1 -0
- package/dist/esm/generated/giving.d.ts +2309 -0
- package/dist/esm/generated/giving.d.ts.map +1 -0
- package/dist/esm/generated/giving.js +225 -0
- package/dist/esm/generated/giving.js.map +1 -0
- package/dist/esm/generated/groups.d.ts +1789 -0
- package/dist/esm/generated/groups.d.ts.map +1 -0
- package/dist/esm/generated/groups.js +197 -0
- package/dist/esm/generated/groups.js.map +1 -0
- package/dist/esm/generated/index.d.ts +5067 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/dist/esm/generated/index.js +37 -0
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/people.d.ts +6001 -0
- package/dist/esm/generated/people.d.ts.map +1 -0
- package/dist/esm/generated/people.js +691 -0
- package/dist/esm/generated/people.js.map +1 -0
- package/dist/esm/generated/publishing.d.ts +1468 -0
- package/dist/esm/generated/publishing.d.ts.map +1 -0
- package/dist/esm/generated/publishing.js +177 -0
- package/dist/esm/generated/publishing.js.map +1 -0
- package/dist/esm/generated/registrations.d.ts +936 -0
- package/dist/esm/generated/registrations.d.ts.map +1 -0
- package/dist/esm/generated/registrations.js +119 -0
- package/dist/esm/generated/registrations.js.map +1 -0
- package/dist/esm/generated/services.d.ts +6301 -0
- package/dist/esm/generated/services.d.ts.map +1 -0
- package/dist/esm/generated/services.js +631 -0
- package/dist/esm/generated/services.js.map +1 -0
- package/dist/esm/generated/webhooks.d.ts +325 -0
- package/dist/esm/generated/webhooks.d.ts.map +1 -0
- package/dist/esm/generated/webhooks.js +55 -0
- package/dist/esm/generated/webhooks.js.map +1 -0
- package/dist/esm/index.d.ts +29 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/webhooks/errors.d.ts +51 -0
- package/dist/esm/webhooks/errors.d.ts.map +1 -0
- package/dist/esm/webhooks/errors.js +51 -0
- package/dist/esm/webhooks/errors.js.map +1 -0
- package/dist/esm/webhooks/events.d.ts +144 -0
- package/dist/esm/webhooks/events.d.ts.map +1 -0
- package/dist/esm/webhooks/events.js +155 -0
- package/dist/esm/webhooks/events.js.map +1 -0
- package/dist/esm/webhooks/handle.d.ts +103 -0
- package/dist/esm/webhooks/handle.d.ts.map +1 -0
- package/dist/esm/webhooks/handle.js +137 -0
- package/dist/esm/webhooks/handle.js.map +1 -0
- package/dist/esm/webhooks/index.d.ts +33 -0
- package/dist/esm/webhooks/index.d.ts.map +1 -0
- package/dist/esm/webhooks/index.js +33 -0
- package/dist/esm/webhooks/index.js.map +1 -0
- package/dist/esm/webhooks/signature.d.ts +84 -0
- package/dist/esm/webhooks/signature.d.ts.map +1 -0
- package/dist/esm/webhooks/signature.js +120 -0
- package/dist/esm/webhooks/signature.js.map +1 -0
- package/llms.txt +119 -0
- package/package.json +79 -14
- package/src/client.ts +169 -282
- package/src/core/auth.ts +317 -0
- package/src/core/errors.ts +219 -0
- package/src/core/graph.ts +137 -0
- package/src/core/http.ts +594 -0
- package/src/core/jsonapi.ts +64 -0
- package/src/core/oauth.ts +403 -0
- package/src/core/product.ts +137 -0
- package/src/core/query.ts +1011 -0
- package/src/core/transport.ts +62 -0
- package/src/entries/api.ts +28 -0
- package/src/entries/calendar.ts +28 -0
- package/src/entries/check-ins.ts +28 -0
- package/src/entries/current.ts +28 -0
- package/src/entries/giving.ts +28 -0
- package/src/entries/groups.ts +28 -0
- package/src/entries/oauth.ts +7 -0
- package/src/entries/people.ts +28 -0
- package/src/entries/publishing.ts +28 -0
- package/src/entries/registrations.ts +28 -0
- package/src/entries/services.ts +28 -0
- package/src/entries/webhooks-api.ts +28 -0
- package/src/entries/webhooks.ts +5 -0
- package/src/generated/api.ts +401 -0
- package/src/generated/calendar.ts +2380 -0
- package/src/generated/check-ins.ts +1783 -0
- package/src/generated/current.ts +136 -0
- package/src/generated/giving.ts +1956 -0
- package/src/generated/groups.ts +1474 -0
- package/src/generated/index.ts +59 -0
- package/src/generated/people.ts +5103 -0
- package/src/generated/publishing.ts +1321 -0
- package/src/generated/registrations.ts +799 -0
- package/src/generated/services.ts +5427 -0
- package/src/generated/webhooks.ts +314 -0
- package/src/index.ts +74 -4
- package/src/webhooks/errors.ts +52 -0
- package/src/webhooks/events.ts +272 -0
- package/src/webhooks/handle.ts +163 -0
- package/src/webhooks/index.ts +54 -0
- package/src/webhooks/signature.ts +140 -0
- package/.gitattributes +0 -2
- package/.github/FUNDING.yml +0 -3
- package/.github/dependabot.yml +0 -21
- package/.github/workflows/ci-publish.yml +0 -84
- package/SECURITY.md +0 -13
- package/TODO.md +0 -6
- package/dist/client.d.ts +0 -216
- package/dist/client.js +0 -265
- package/dist/client.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -6
- package/dist/index.js.map +0 -1
- package/dist/modules/calendar.d.ts +0 -5
- package/dist/modules/calendar.js +0 -11
- package/dist/modules/calendar.js.map +0 -1
- package/dist/modules/checkins.d.ts +0 -0
- package/dist/modules/checkins.js +0 -2
- package/dist/modules/checkins.js.map +0 -1
- package/dist/modules/giving.d.ts +0 -0
- package/dist/modules/giving.js +0 -2
- package/dist/modules/giving.js.map +0 -1
- package/dist/modules/groups.d.ts +0 -4
- package/dist/modules/groups.js +0 -22
- package/dist/modules/groups.js.map +0 -1
- package/dist/modules/people.d.ts +0 -66
- package/dist/modules/people.js +0 -40
- package/dist/modules/people.js.map +0 -1
- package/dist/modules/publishing.d.ts +0 -0
- package/dist/modules/publishing.js +0 -2
- package/dist/modules/publishing.js.map +0 -1
- package/dist/modules/services.d.ts +0 -0
- package/dist/modules/services.js +0 -2
- package/dist/modules/services.js.map +0 -1
- package/dist/modules/webhooks.d.ts +0 -0
- package/dist/modules/webhooks.js +0 -2
- package/dist/modules/webhooks.js.map +0 -1
- package/dist/types.d.ts +0 -6
- package/dist/types.js.map +0 -1
- package/src/index.test.ts +0 -7
- package/src/modules/calendar.ts +0 -11
- package/src/modules/checkins.ts +0 -0
- package/src/modules/giving.ts +0 -0
- package/src/modules/groups.ts +0 -7
- package/src/modules/people.ts +0 -92
- package/src/modules/publishing.ts +0 -0
- package/src/modules/services.ts +0 -0
- package/src/modules/webhooks.ts +0 -0
- package/src/types.ts +0 -8
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/@mackenly/planningcenterkit)
|
|
9
|
+
[](https://github.com/mackenly/planningcenterkit/actions/workflows/ci-publish.yml)
|
|
10
|
+
[](./LICENSE)
|
|
11
|
+
[](./package.json)
|
|
12
|
+
[](https://www.npmjs.com/package/@mackenly/planningcenterkit#provenance)
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
##
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
28
|
-
```bash
|
|
76
|
+
# or
|
|
77
|
+
pnpm add @mackenly/planningcenterkit
|
|
29
78
|
yarn add @mackenly/planningcenterkit
|
|
79
|
+
bun add @mackenly/planningcenterkit
|
|
30
80
|
```
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
|
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
|
-
|
|
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
|