@rachelallyson/planning-center-check-ins-ts 1.0.0 → 3.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/CHANGELOG.md +48 -0
- package/README.md +4 -5
- package/dist/client.d.ts +0 -6
- package/dist/client.js +3 -12
- package/dist/index.d.ts +1 -1
- package/dist/modules/attendance-types.d.ts +11 -5
- package/dist/modules/attendance-types.js +20 -14
- package/dist/modules/check-in-groups.d.ts +13 -5
- package/dist/modules/check-in-groups.js +23 -15
- package/dist/modules/check-ins.d.ts +22 -6
- package/dist/modules/check-ins.js +39 -25
- package/dist/modules/event-times.d.ts +11 -5
- package/dist/modules/event-times.js +24 -18
- package/dist/modules/events.d.ts +57 -23
- package/dist/modules/events.js +85 -18
- package/dist/modules/headcounts.d.ts +11 -5
- package/dist/modules/headcounts.js +20 -14
- package/dist/modules/integration-links.d.ts +11 -5
- package/dist/modules/integration-links.js +20 -14
- package/dist/modules/labels.d.ts +12 -30
- package/dist/modules/labels.js +20 -71
- package/dist/modules/locations.d.ts +15 -6
- package/dist/modules/locations.js +27 -18
- package/dist/modules/options.d.ts +11 -5
- package/dist/modules/options.js +20 -14
- package/dist/modules/organization.js +2 -1
- package/dist/modules/passes.d.ts +11 -5
- package/dist/modules/passes.js +20 -14
- package/dist/modules/pre-checks.d.ts +11 -5
- package/dist/modules/pre-checks.js +20 -14
- package/dist/modules/roster-list-persons.d.ts +11 -5
- package/dist/modules/roster-list-persons.js +20 -14
- package/dist/modules/stations.d.ts +11 -5
- package/dist/modules/stations.js +20 -14
- package/dist/modules/themes.d.ts +11 -5
- package/dist/modules/themes.js +20 -14
- package/package.json +6 -6
- package/dist/modules/check-in-times.d.ts +0 -27
- package/dist/modules/check-in-times.js +0 -44
- package/dist/modules/event-periods.d.ts +0 -57
- package/dist/modules/event-periods.js +0 -75
- package/dist/modules/person-events.d.ts +0 -27
- package/dist/modules/person-events.js +0 -44
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,54 @@ All notable changes to this package will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.0.0] - 2026-02-02
|
|
9
|
+
|
|
10
|
+
### ⚠️ **Breaking Changes**
|
|
11
|
+
|
|
12
|
+
- **`getAll()` now fetches all pages**: `getAll()` previously called `getList()` and returned a single page. It now calls `getAllPages()` and returns **all** pages. The return type is now `PaginationResult<T>` (from base), which includes `data`, `totalCount`, `pagesFetched`, `duration`, `meta?`, and `links?`. If you need a single page, use **`getPage(options)`** instead.
|
|
13
|
+
- **`getPage()` for single-page fetching**: New method on all list-capable modules. Use `getPage({ perPage, page, where, include, ... })` when you want one page with full control. Use `getAll()` when you want every page automatically.
|
|
14
|
+
- **Flattened responses (from base)**: All methods that return resources use the base package’s flattened shape: **attributes and relationships are at the top level** (e.g. `resource.name` instead of `resource.attributes.name`, and related data at `resource.relation_name` instead of `resource.relationships.relation_name.data`). This matches the People and Base packages.
|
|
15
|
+
- **Same item shape for `getAll()` and `getPage()`**: Both return flattened items. `getAll().data` and `getPage().data` contain the same shape per item; only the wrapper differs—`getAll()` returns `PaginationResult<T>` (adds `totalCount`, `pagesFetched`, `duration`), while `getPage()` returns `{ data, meta?, links? }`.
|
|
16
|
+
- **Check-in groups require `stationId`**: `checkInGroups.getAll()` and `checkInGroups.getPage()` now require `stationId` in options. The API lists check-in groups per station: `GET /stations/:station_id/check_in_groups`. Pass `stationId` from a station you’ve fetched (e.g. `client.stations.getPage()`).
|
|
17
|
+
|
|
18
|
+
### ✨ **New Features**
|
|
19
|
+
|
|
20
|
+
- **`getPage()`** on all list-capable modules: `checkIns`, `events`, `labels`, `themes`, `stations`, `rosterListPersons`, `preChecks`, `passes`, `options`, `locations`, `integrationLinks`, `headcounts`, `eventTimes`, `checkInGroups`, `attendanceTypes`. Single-page fetch with full option support.
|
|
21
|
+
- **Consistent with People package**: Same `getAll()` (all pages) vs `getPage()` (one page) pattern, same flattened item shape from both methods.
|
|
22
|
+
- **`checkIns.getLocationLabels(checkInId, locationId)`**: New method to fetch location labels for a check-in at a specific location. The API exposes location labels under the check-in scope; use this when `locations.getLocationLabels(locationId)` is unsupported or returns empty.
|
|
23
|
+
|
|
24
|
+
### 🔄 **Dependency**
|
|
25
|
+
|
|
26
|
+
- **Base package**: `@rachelallyson/planning-center-base-ts` `^1.1.2`. Richer request events and flattened responses.
|
|
27
|
+
|
|
28
|
+
### 🧪 **Testing**
|
|
29
|
+
|
|
30
|
+
- **Integration tests**: Pre-checks tests skip when the Pre-checks API returns 404 (e.g. Church Center PreCheck not enabled). The “All Modules” test also skips optional modules (integrationLinks, themes, rosterListPersons) when they 404 or return empty.
|
|
31
|
+
- **Unit tests**: Default `npm test` excludes integration tests (`testPathIgnorePatterns`). Run integration tests with `npm run test:integration` (requires `.env.test` and Check-Ins scope).
|
|
32
|
+
|
|
33
|
+
## [2.0.0] - 2026-01-20
|
|
34
|
+
|
|
35
|
+
### ⚠️ **Breaking Changes**
|
|
36
|
+
|
|
37
|
+
- **Module Consolidation**: Removed standalone `checkInTimes`, `eventPeriods`, and `personEvents` modules
|
|
38
|
+
- Check-in times now accessible via `client.checkIns.getCheckInTimes(checkInId)`
|
|
39
|
+
- Event periods now accessible via `client.events.getEventPeriods(eventId)`
|
|
40
|
+
- Person events now accessible via `client.events.getPersonEvents(eventId)`
|
|
41
|
+
- **Reduced Module Count**: Client now has 16 modules instead of 19
|
|
42
|
+
|
|
43
|
+
### ✨ **New Features**
|
|
44
|
+
|
|
45
|
+
- **Enhanced Events Module**: Added `getAllEventPeriods()`, `getAllEvents()`, and `getEventTimesForPeriod()` methods
|
|
46
|
+
- **Improved Pagination**: Added `getAllPages()` support for comprehensive data retrieval
|
|
47
|
+
- **Better Type Safety**: Replaced `any` types with proper `Meta` and `TopLevelLinks` interfaces
|
|
48
|
+
- **Comprehensive Integration Tests**: Added type validation and endpoint coverage tests
|
|
49
|
+
|
|
50
|
+
### 🔧 **Technical Improvements**
|
|
51
|
+
|
|
52
|
+
- Consolidated related functionality into parent modules for better API design
|
|
53
|
+
- Enhanced error handling and type validation throughout
|
|
54
|
+
- Updated Jest configuration for local package resolution
|
|
55
|
+
|
|
8
56
|
## [1.0.0] - 2024-XX-XX
|
|
9
57
|
|
|
10
58
|
### Added
|
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ const checkIn = await client.checkIns.getById('123', ['person', 'event']);
|
|
|
35
35
|
## Features
|
|
36
36
|
|
|
37
37
|
- **Type-safe**: Full TypeScript support with complete type definitions for all 24 Check-Ins API resource types
|
|
38
|
-
- **Modular architecture**:
|
|
38
|
+
- **Modular architecture**: 16 specialized modules organized by resource domain
|
|
39
39
|
- **Batch operations**: Execute multiple operations with dependency resolution
|
|
40
40
|
- **Event system**: Monitor requests, errors, and rate limits
|
|
41
41
|
- **Rate limiting**: Automatic rate limit handling (100 requests per 20 seconds)
|
|
@@ -45,19 +45,16 @@ const checkIn = await client.checkIns.getById('123', ['person', 'event']);
|
|
|
45
45
|
|
|
46
46
|
## Modules
|
|
47
47
|
|
|
48
|
-
The client exposes
|
|
48
|
+
The client exposes 16 specialized modules:
|
|
49
49
|
|
|
50
50
|
- **events** - Event management (recurring events)
|
|
51
51
|
- **checkIns** - Check-in records (attendance)
|
|
52
52
|
- **locations** - Location management
|
|
53
|
-
- **eventPeriods** - Event period management
|
|
54
53
|
- **eventTimes** - Specific check-in times
|
|
55
54
|
- **stations** - Check-in stations
|
|
56
55
|
- **labels** - Labels for check-ins, events, and locations
|
|
57
56
|
- **options** - Check-in options
|
|
58
57
|
- **checkInGroups** - Group check-ins
|
|
59
|
-
- **checkInTimes** - When check-ins occurred
|
|
60
|
-
- **personEvents** - Person-event relationships
|
|
61
58
|
- **preChecks** - Pre-check records
|
|
62
59
|
- **passes** - Pass management
|
|
63
60
|
- **headcounts** - Headcount tracking
|
|
@@ -76,6 +73,7 @@ For complete documentation, see the [monorepo documentation site](../../docs/con
|
|
|
76
73
|
### Unit Tests (Mocked Data)
|
|
77
74
|
|
|
78
75
|
Run unit tests with mocked HTTP responses:
|
|
76
|
+
|
|
79
77
|
```bash
|
|
80
78
|
npm test
|
|
81
79
|
```
|
|
@@ -92,6 +90,7 @@ npm run test:integration
|
|
|
92
90
|
```
|
|
93
91
|
|
|
94
92
|
Integration tests verify:
|
|
93
|
+
|
|
95
94
|
- Real API responses and data structures
|
|
96
95
|
- End-to-end functionality with actual Planning Center data
|
|
97
96
|
- Error handling with real API errors
|
package/dist/client.d.ts
CHANGED
|
@@ -7,14 +7,11 @@ import { BatchExecutor } from '@rachelallyson/planning-center-base-ts';
|
|
|
7
7
|
import { EventsModule } from './modules/events';
|
|
8
8
|
import { CheckInsModule } from './modules/check-ins';
|
|
9
9
|
import { LocationsModule } from './modules/locations';
|
|
10
|
-
import { EventPeriodsModule } from './modules/event-periods';
|
|
11
10
|
import { EventTimesModule } from './modules/event-times';
|
|
12
11
|
import { StationsModule } from './modules/stations';
|
|
13
12
|
import { LabelsModule } from './modules/labels';
|
|
14
13
|
import { OptionsModule } from './modules/options';
|
|
15
14
|
import { CheckInGroupsModule } from './modules/check-in-groups';
|
|
16
|
-
import { CheckInTimesModule } from './modules/check-in-times';
|
|
17
|
-
import { PersonEventsModule } from './modules/person-events';
|
|
18
15
|
import { PreChecksModule } from './modules/pre-checks';
|
|
19
16
|
import { PassesModule } from './modules/passes';
|
|
20
17
|
import { HeadcountsModule } from './modules/headcounts';
|
|
@@ -27,14 +24,11 @@ export declare class PcoCheckInsClient implements EventEmitter {
|
|
|
27
24
|
events: EventsModule;
|
|
28
25
|
checkIns: CheckInsModule;
|
|
29
26
|
locations: LocationsModule;
|
|
30
|
-
eventPeriods: EventPeriodsModule;
|
|
31
27
|
eventTimes: EventTimesModule;
|
|
32
28
|
stations: StationsModule;
|
|
33
29
|
labels: LabelsModule;
|
|
34
30
|
options: OptionsModule;
|
|
35
31
|
checkInGroups: CheckInGroupsModule;
|
|
36
|
-
checkInTimes: CheckInTimesModule;
|
|
37
|
-
personEvents: PersonEventsModule;
|
|
38
32
|
preChecks: PreChecksModule;
|
|
39
33
|
passes: PassesModule;
|
|
40
34
|
headcounts: HeadcountsModule;
|
package/dist/client.js
CHANGED
|
@@ -8,14 +8,11 @@ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-t
|
|
|
8
8
|
const events_1 = require("./modules/events");
|
|
9
9
|
const check_ins_1 = require("./modules/check-ins");
|
|
10
10
|
const locations_1 = require("./modules/locations");
|
|
11
|
-
const event_periods_1 = require("./modules/event-periods");
|
|
12
11
|
const event_times_1 = require("./modules/event-times");
|
|
13
12
|
const stations_1 = require("./modules/stations");
|
|
14
13
|
const labels_1 = require("./modules/labels");
|
|
15
14
|
const options_1 = require("./modules/options");
|
|
16
15
|
const check_in_groups_1 = require("./modules/check-in-groups");
|
|
17
|
-
const check_in_times_1 = require("./modules/check-in-times");
|
|
18
|
-
const person_events_1 = require("./modules/person-events");
|
|
19
16
|
const pre_checks_1 = require("./modules/pre-checks");
|
|
20
17
|
const passes_1 = require("./modules/passes");
|
|
21
18
|
const headcounts_1 = require("./modules/headcounts");
|
|
@@ -30,7 +27,7 @@ class PcoCheckInsClient {
|
|
|
30
27
|
const { baseUrl, ...restConfig } = config;
|
|
31
28
|
const fullConfig = {
|
|
32
29
|
...restConfig,
|
|
33
|
-
baseURL: baseUrl || 'https://api.planningcenteronline.com',
|
|
30
|
+
baseURL: baseUrl || 'https://api.planningcenteronline.com/check-ins/v2',
|
|
34
31
|
};
|
|
35
32
|
this.config = config;
|
|
36
33
|
this.eventEmitter = new planning_center_base_ts_1.PcoEventEmitter();
|
|
@@ -40,14 +37,11 @@ class PcoCheckInsClient {
|
|
|
40
37
|
this.events = new events_1.EventsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
41
38
|
this.checkIns = new check_ins_1.CheckInsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
42
39
|
this.locations = new locations_1.LocationsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
43
|
-
this.eventPeriods = new event_periods_1.EventPeriodsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
44
40
|
this.eventTimes = new event_times_1.EventTimesModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
45
41
|
this.stations = new stations_1.StationsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
46
42
|
this.labels = new labels_1.LabelsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
47
43
|
this.options = new options_1.OptionsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
48
44
|
this.checkInGroups = new check_in_groups_1.CheckInGroupsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
49
|
-
this.checkInTimes = new check_in_times_1.CheckInTimesModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
50
|
-
this.personEvents = new person_events_1.PersonEventsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
51
45
|
this.preChecks = new pre_checks_1.PreChecksModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
52
46
|
this.passes = new passes_1.PassesModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
53
47
|
this.headcounts = new headcounts_1.HeadcountsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
@@ -60,7 +54,7 @@ class PcoCheckInsClient {
|
|
|
60
54
|
// Set up event handlers from config
|
|
61
55
|
this.setupEventHandlers();
|
|
62
56
|
}
|
|
63
|
-
// EventEmitter implementation
|
|
57
|
+
// EventEmitter implementation (call generic overload explicitly to avoid overload resolution picking 'error' only)
|
|
64
58
|
on(eventType, handler) {
|
|
65
59
|
this.eventEmitter.on(eventType, handler);
|
|
66
60
|
}
|
|
@@ -84,7 +78,7 @@ class PcoCheckInsClient {
|
|
|
84
78
|
const { baseUrl, ...restConfig } = this.config;
|
|
85
79
|
const fullConfig = {
|
|
86
80
|
...restConfig,
|
|
87
|
-
baseURL: baseUrl || 'https://api.planningcenteronline.com',
|
|
81
|
+
baseURL: baseUrl || 'https://api.planningcenteronline.com/check-ins/v2',
|
|
88
82
|
};
|
|
89
83
|
// Recreate HTTP client with new config
|
|
90
84
|
this.httpClient = new planning_center_base_ts_1.PcoHttpClient(fullConfig, this.eventEmitter);
|
|
@@ -145,14 +139,11 @@ class PcoCheckInsClient {
|
|
|
145
139
|
this.events = new events_1.EventsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
146
140
|
this.checkIns = new check_ins_1.CheckInsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
147
141
|
this.locations = new locations_1.LocationsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
148
|
-
this.eventPeriods = new event_periods_1.EventPeriodsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
149
142
|
this.eventTimes = new event_times_1.EventTimesModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
150
143
|
this.stations = new stations_1.StationsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
151
144
|
this.labels = new labels_1.LabelsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
152
145
|
this.options = new options_1.OptionsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
153
146
|
this.checkInGroups = new check_in_groups_1.CheckInGroupsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
154
|
-
this.checkInTimes = new check_in_times_1.CheckInTimesModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
155
|
-
this.personEvents = new person_events_1.PersonEventsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
156
147
|
this.preChecks = new pre_checks_1.PreChecksModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
157
148
|
this.passes = new passes_1.PassesModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
|
158
149
|
this.headcounts = new headcounts_1.HeadcountsModule(this.httpClient, this.paginationHelper, this.eventEmitter);
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { PcoCheckInsClient } from './client';
|
|
|
2
2
|
export type { PcoCheckInsClientConfig, } from './types/client';
|
|
3
3
|
export type { PcoEvent, EventHandler, EventType } from '@rachelallyson/planning-center-base-ts';
|
|
4
4
|
export type { BatchOperation, BatchResult, BatchOptions, BatchSummary } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
export type { Paginated, Relationship, ResourceIdentifier, ResourceObject, Response, } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
+
export type { Paginated, PaginationResult, Relationship, ResourceIdentifier, ResourceObject, Response, } from '@rachelallyson/planning-center-base-ts';
|
|
6
6
|
export type { EventResource, EventAttributes, EventRelationships, EventsList, EventSingle, CheckInResource, CheckInAttributes, CheckInRelationships, CheckInsList, CheckInSingle, LocationResource, LocationAttributes, LocationRelationships, LocationsList, LocationSingle, EventPeriodResource, EventPeriodAttributes, EventPeriodRelationships, EventPeriodsList, EventPeriodSingle, EventTimeResource, EventTimeAttributes, EventTimeRelationships, EventTimesList, EventTimeSingle, StationResource, StationAttributes, StationRelationships, StationsList, StationSingle, LabelResource, LabelAttributes, LabelRelationships, LabelsList, LabelSingle, EventLabelResource, EventLabelAttributes, EventLabelRelationships, EventLabelsList, EventLabelSingle, LocationLabelResource, LocationLabelAttributes, LocationLabelRelationships, LocationLabelsList, LocationLabelSingle, OptionResource, OptionAttributes, OptionRelationships, OptionsList, OptionSingle, CheckInGroupResource, CheckInGroupAttributes, CheckInGroupRelationships, CheckInGroupsList, CheckInGroupSingle, CheckInTimeResource, CheckInTimeAttributes, CheckInTimeRelationships, CheckInTimesList, CheckInTimeSingle, PersonEventResource, PersonEventAttributes, PersonEventRelationships, PersonEventsList, PersonEventSingle, PreCheckResource, PreCheckAttributes, PreCheckRelationships, PreChecksList, PreCheckSingle, PassResource, PassAttributes, PassRelationships, PassesList, PassSingle, HeadcountResource, HeadcountAttributes, HeadcountRelationships, HeadcountsList, HeadcountSingle, AttendanceTypeResource, AttendanceTypeAttributes, AttendanceTypeRelationships, AttendanceTypesList, AttendanceTypeSingle, RosterListPersonResource, RosterListPersonAttributes, RosterListPersonRelationships, RosterListPersonsList, RosterListPersonSingle, OrganizationResource, OrganizationAttributes, OrganizationRelationships, OrganizationsList, OrganizationSingle, IntegrationLinkResource, IntegrationLinkAttributes, IntegrationLinkRelationships, IntegrationLinksList, IntegrationLinkSingle, ThemeResource, ThemeAttributes, ThemeRelationships, ThemesList, ThemeSingle, LocationEventPeriodResource, LocationEventPeriodAttributes, LocationEventPeriodRelationships, LocationEventPeriodsList, LocationEventPeriodSingle, LocationEventTimeResource, LocationEventTimeAttributes, LocationEventTimeRelationships, LocationEventTimesList, LocationEventTimeSingle, } from './types';
|
|
7
7
|
export * from './types';
|
|
8
8
|
export { PcoApiError } from '@rachelallyson/planning-center-base-ts';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* AttendanceTypes Module for Check-Ins API
|
|
3
3
|
*/
|
|
4
4
|
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
+
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter, PaginationResult, Meta, TopLevelLinks } from '@rachelallyson/planning-center-base-ts';
|
|
6
6
|
import type { AttendanceTypeResource } from '../types';
|
|
7
7
|
export interface AttendanceTypesListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface AttendanceTypesListOptions {
|
|
|
13
13
|
export declare class AttendanceTypesModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all attendance types with optional filtering
|
|
16
|
+
* Get all attendance types across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: AttendanceTypesListOptions): Promise<
|
|
19
|
+
getAll(options?: AttendanceTypesListOptions): Promise<PaginationResult<AttendanceTypeResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of attendance types with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: AttendanceTypesListOptions): Promise<{
|
|
19
24
|
data: AttendanceTypeResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single attendance type by ID
|
|
25
31
|
*/
|
|
@@ -10,25 +10,31 @@ class AttendanceTypesModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all attendance types with optional filtering
|
|
13
|
+
* Get all attendance types across all pages with optional filtering.
|
|
14
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
14
15
|
*/
|
|
15
16
|
async getAll(options = {}) {
|
|
17
|
+
const params = this.buildParams(options);
|
|
18
|
+
return this.getAllPages('/attendance_types', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of attendance types with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
const params = this.buildParams(options);
|
|
25
|
+
return this.getList('/attendance_types', params);
|
|
26
|
+
}
|
|
27
|
+
buildParams(options) {
|
|
16
28
|
const params = {};
|
|
17
|
-
if (options.where)
|
|
18
|
-
Object.entries(options.where).forEach(([
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (options.include) {
|
|
29
|
+
if (options.where)
|
|
30
|
+
Object.entries(options.where).forEach(([k, v]) => { params[`where[${k}]`] = v; });
|
|
31
|
+
if (options.include)
|
|
23
32
|
params.include = options.include.join(',');
|
|
24
|
-
|
|
25
|
-
if (options.perPage) {
|
|
33
|
+
if (options.perPage != null)
|
|
26
34
|
params.per_page = options.perPage;
|
|
27
|
-
|
|
28
|
-
if (options.page) {
|
|
35
|
+
if (options.page != null)
|
|
29
36
|
params.page = options.page;
|
|
30
|
-
|
|
31
|
-
return this.getList('/check-ins/v2/attendance_types', params);
|
|
37
|
+
return params;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Get a single attendance type by ID
|
|
@@ -38,7 +44,7 @@ class AttendanceTypesModule extends planning_center_base_ts_1.BaseModule {
|
|
|
38
44
|
if (include) {
|
|
39
45
|
params.include = include.join(',');
|
|
40
46
|
}
|
|
41
|
-
return this.getSingle(`/
|
|
47
|
+
return this.getSingle(`/attendance_types/${id}`, params);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
exports.AttendanceTypesModule = AttendanceTypesModule;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* CheckInGroups Module for Check-Ins API
|
|
3
3
|
*/
|
|
4
4
|
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
+
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter, PaginationResult, Meta, TopLevelLinks } from '@rachelallyson/planning-center-base-ts';
|
|
6
6
|
import type { CheckInGroupResource } from '../types';
|
|
7
7
|
export interface CheckInGroupsListOptions {
|
|
8
|
+
/** Required: check-in groups are listed per station. */
|
|
9
|
+
stationId: string;
|
|
8
10
|
where?: Record<string, any>;
|
|
9
11
|
include?: string[];
|
|
10
12
|
perPage?: number;
|
|
@@ -13,13 +15,19 @@ export interface CheckInGroupsListOptions {
|
|
|
13
15
|
export declare class CheckInGroupsModule extends BaseModule {
|
|
14
16
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
17
|
/**
|
|
16
|
-
* Get all check-in groups
|
|
18
|
+
* Get all check-in groups for a station across all pages.
|
|
19
|
+
* Check-Ins API lists check-in groups under a station: GET /stations/:station_id/check_in_groups.
|
|
17
20
|
*/
|
|
18
|
-
getAll(options
|
|
21
|
+
getAll(options: CheckInGroupsListOptions): Promise<PaginationResult<CheckInGroupResource>>;
|
|
22
|
+
/**
|
|
23
|
+
* Get a single page of check-in groups for a station.
|
|
24
|
+
*/
|
|
25
|
+
getPage(options: CheckInGroupsListOptions): Promise<{
|
|
19
26
|
data: CheckInGroupResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
27
|
+
meta?: Meta;
|
|
28
|
+
links?: TopLevelLinks;
|
|
22
29
|
}>;
|
|
30
|
+
private buildParams;
|
|
23
31
|
/**
|
|
24
32
|
* Get a single check-in group by ID
|
|
25
33
|
*/
|
|
@@ -10,25 +10,33 @@ class CheckInGroupsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all check-in groups
|
|
13
|
+
* Get all check-in groups for a station across all pages.
|
|
14
|
+
* Check-Ins API lists check-in groups under a station: GET /stations/:station_id/check_in_groups.
|
|
14
15
|
*/
|
|
15
|
-
async getAll(options
|
|
16
|
+
async getAll(options) {
|
|
17
|
+
const { stationId, ...rest } = options;
|
|
18
|
+
const params = this.buildParams(rest);
|
|
19
|
+
return this.getAllPages(`/stations/${stationId}/check_in_groups`, params);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get a single page of check-in groups for a station.
|
|
23
|
+
*/
|
|
24
|
+
async getPage(options) {
|
|
25
|
+
const { stationId, ...rest } = options;
|
|
26
|
+
const params = this.buildParams(rest);
|
|
27
|
+
return this.getList(`/stations/${stationId}/check_in_groups`, params);
|
|
28
|
+
}
|
|
29
|
+
buildParams(options) {
|
|
16
30
|
const params = {};
|
|
17
|
-
if (options.where)
|
|
18
|
-
Object.entries(options.where).forEach(([
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (options.include) {
|
|
31
|
+
if (options.where)
|
|
32
|
+
Object.entries(options.where).forEach(([k, v]) => { params[`where[${k}]`] = v; });
|
|
33
|
+
if (options.include)
|
|
23
34
|
params.include = options.include.join(',');
|
|
24
|
-
|
|
25
|
-
if (options.perPage) {
|
|
35
|
+
if (options.perPage != null)
|
|
26
36
|
params.per_page = options.perPage;
|
|
27
|
-
|
|
28
|
-
if (options.page) {
|
|
37
|
+
if (options.page != null)
|
|
29
38
|
params.page = options.page;
|
|
30
|
-
|
|
31
|
-
return this.getList('/check-ins/v2/check_in_groups', params);
|
|
39
|
+
return params;
|
|
32
40
|
}
|
|
33
41
|
/**
|
|
34
42
|
* Get a single check-in group by ID
|
|
@@ -38,7 +46,7 @@ class CheckInGroupsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
38
46
|
if (include) {
|
|
39
47
|
params.include = include.join(',');
|
|
40
48
|
}
|
|
41
|
-
return this.getSingle(`/
|
|
49
|
+
return this.getSingle(`/check_in_groups/${id}`, params);
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
exports.CheckInGroupsModule = CheckInGroupsModule;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* CheckIns Module for Check-Ins API
|
|
3
3
|
*/
|
|
4
4
|
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
6
|
-
import type { CheckInResource, CheckInGroupResource, CheckInTimeResource, StationResource, EventResource, EventPeriodResource, EventTimeResource, LocationResource, OptionResource } from '../types';
|
|
5
|
+
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter, PaginationResult, Meta, TopLevelLinks } from '@rachelallyson/planning-center-base-ts';
|
|
6
|
+
import type { CheckInResource, CheckInGroupResource, CheckInTimeResource, StationResource, EventResource, EventPeriodResource, EventTimeResource, LocationResource, LocationLabelResource, OptionResource } from '../types';
|
|
7
7
|
export interface CheckInsListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
9
9
|
include?: string[];
|
|
@@ -14,13 +14,19 @@ export interface CheckInsListOptions {
|
|
|
14
14
|
export declare class CheckInsModule extends BaseModule {
|
|
15
15
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
16
16
|
/**
|
|
17
|
-
* Get all check-ins with optional filtering
|
|
17
|
+
* Get all check-ins across all pages with optional filtering.
|
|
18
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
18
19
|
*/
|
|
19
|
-
getAll(options?: CheckInsListOptions): Promise<
|
|
20
|
+
getAll(options?: CheckInsListOptions): Promise<PaginationResult<CheckInResource>>;
|
|
21
|
+
/**
|
|
22
|
+
* Get a single page of check-ins with optional filtering and pagination.
|
|
23
|
+
*/
|
|
24
|
+
getPage(options?: CheckInsListOptions): Promise<{
|
|
20
25
|
data: CheckInResource[];
|
|
21
|
-
meta?:
|
|
22
|
-
links?:
|
|
26
|
+
meta?: Meta;
|
|
27
|
+
links?: TopLevelLinks;
|
|
23
28
|
}>;
|
|
29
|
+
private buildCheckInsListParams;
|
|
24
30
|
/**
|
|
25
31
|
* Get a single check-in by ID
|
|
26
32
|
*/
|
|
@@ -73,6 +79,16 @@ export declare class CheckInsModule extends BaseModule {
|
|
|
73
79
|
meta?: any;
|
|
74
80
|
links?: any;
|
|
75
81
|
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Get location labels for a check-in at a specific location.
|
|
84
|
+
* Per API docs, location_labels are only available under check_ins, not under locations.
|
|
85
|
+
* @see https://developer.planning.center/docs/#/apps/check-ins/2025-05-28/vertices/location_label
|
|
86
|
+
*/
|
|
87
|
+
getLocationLabels(checkInId: string, locationId: string): Promise<{
|
|
88
|
+
data: LocationLabelResource[];
|
|
89
|
+
meta?: any;
|
|
90
|
+
links?: any;
|
|
91
|
+
}>;
|
|
76
92
|
/**
|
|
77
93
|
* Get options for a check-in
|
|
78
94
|
*/
|
|
@@ -10,31 +10,37 @@ class CheckInsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all check-ins with optional filtering
|
|
13
|
+
* Get all check-ins across all pages with optional filtering.
|
|
14
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
14
15
|
*/
|
|
15
16
|
async getAll(options = {}) {
|
|
17
|
+
const params = this.buildCheckInsListParams(options);
|
|
18
|
+
return this.getAllPages('/check_ins', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of check-ins with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
const params = this.buildCheckInsListParams(options);
|
|
25
|
+
return this.getList('/check_ins', params);
|
|
26
|
+
}
|
|
27
|
+
buildCheckInsListParams(options) {
|
|
16
28
|
const params = {};
|
|
17
29
|
if (options.where) {
|
|
18
30
|
Object.entries(options.where).forEach(([key, value]) => {
|
|
19
31
|
params[`where[${key}]`] = value;
|
|
20
32
|
});
|
|
21
33
|
}
|
|
22
|
-
if (options.include)
|
|
34
|
+
if (options.include)
|
|
23
35
|
params.include = options.include.join(',');
|
|
24
|
-
|
|
25
|
-
if (options.perPage) {
|
|
36
|
+
if (options.perPage != null)
|
|
26
37
|
params.per_page = options.perPage;
|
|
27
|
-
|
|
28
|
-
if (options.page) {
|
|
38
|
+
if (options.page != null)
|
|
29
39
|
params.page = options.page;
|
|
40
|
+
if (options.filter?.length) {
|
|
41
|
+
options.filter.forEach(filter => { params[filter] = 'true'; });
|
|
30
42
|
}
|
|
31
|
-
|
|
32
|
-
if (options.filter && options.filter.length > 0) {
|
|
33
|
-
options.filter.forEach(filter => {
|
|
34
|
-
params[filter] = 'true';
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return this.getList('/check-ins/v2/check_ins', params);
|
|
43
|
+
return params;
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Get a single check-in by ID
|
|
@@ -44,7 +50,7 @@ class CheckInsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
44
50
|
if (include) {
|
|
45
51
|
params.include = include.join(',');
|
|
46
52
|
}
|
|
47
|
-
return this.getSingle(`/
|
|
53
|
+
return this.getSingle(`/check_ins/${id}`, params);
|
|
48
54
|
}
|
|
49
55
|
// ===== Associations =====
|
|
50
56
|
/**
|
|
@@ -52,7 +58,7 @@ class CheckInsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
52
58
|
*/
|
|
53
59
|
async getCheckInGroup(checkInId) {
|
|
54
60
|
try {
|
|
55
|
-
return await this.getSingle(`/
|
|
61
|
+
return await this.getSingle(`/check_ins/${checkInId}/check_in_group`);
|
|
56
62
|
}
|
|
57
63
|
catch (error) {
|
|
58
64
|
if (error?.status === 404) {
|
|
@@ -65,14 +71,14 @@ class CheckInsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
65
71
|
* Get check-in times for a check-in
|
|
66
72
|
*/
|
|
67
73
|
async getCheckInTimes(checkInId) {
|
|
68
|
-
return this.getList(`/
|
|
74
|
+
return this.getList(`/check_ins/${checkInId}/check_in_times`);
|
|
69
75
|
}
|
|
70
76
|
/**
|
|
71
77
|
* Get station where check-in occurred (checked_in_at)
|
|
72
78
|
*/
|
|
73
79
|
async getCheckedInAt(checkInId) {
|
|
74
80
|
try {
|
|
75
|
-
return await this.getSingle(`/
|
|
81
|
+
return await this.getSingle(`/check_ins/${checkInId}/checked_in_at`);
|
|
76
82
|
}
|
|
77
83
|
catch (error) {
|
|
78
84
|
if (error?.status === 404) {
|
|
@@ -86,7 +92,7 @@ class CheckInsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
86
92
|
*/
|
|
87
93
|
async getCheckedInBy(checkInId) {
|
|
88
94
|
try {
|
|
89
|
-
return await this.getSingle(`/
|
|
95
|
+
return await this.getSingle(`/check_ins/${checkInId}/checked_in_by`);
|
|
90
96
|
}
|
|
91
97
|
catch (error) {
|
|
92
98
|
if (error?.status === 404) {
|
|
@@ -100,7 +106,7 @@ class CheckInsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
100
106
|
*/
|
|
101
107
|
async getCheckedOutBy(checkInId) {
|
|
102
108
|
try {
|
|
103
|
-
return await this.getSingle(`/
|
|
109
|
+
return await this.getSingle(`/check_ins/${checkInId}/checked_out_by`);
|
|
104
110
|
}
|
|
105
111
|
catch (error) {
|
|
106
112
|
if (error?.status === 404) {
|
|
@@ -113,38 +119,46 @@ class CheckInsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
113
119
|
* Get event for a check-in
|
|
114
120
|
*/
|
|
115
121
|
async getEvent(checkInId) {
|
|
116
|
-
return this.getSingle(`/
|
|
122
|
+
return this.getSingle(`/check_ins/${checkInId}/event`);
|
|
117
123
|
}
|
|
118
124
|
/**
|
|
119
125
|
* Get event period for a check-in
|
|
120
126
|
*/
|
|
121
127
|
async getEventPeriod(checkInId) {
|
|
122
|
-
return this.getSingle(`/
|
|
128
|
+
return this.getSingle(`/check_ins/${checkInId}/event_period`);
|
|
123
129
|
}
|
|
124
130
|
/**
|
|
125
131
|
* Get event times for a check-in
|
|
126
132
|
*/
|
|
127
133
|
async getEventTimes(checkInId) {
|
|
128
|
-
return this.getList(`/
|
|
134
|
+
return this.getList(`/check_ins/${checkInId}/event_times`);
|
|
129
135
|
}
|
|
130
136
|
/**
|
|
131
137
|
* Get locations for a check-in
|
|
132
138
|
*/
|
|
133
139
|
async getLocations(checkInId) {
|
|
134
|
-
return this.getList(`/
|
|
140
|
+
return this.getList(`/check_ins/${checkInId}/locations`);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Get location labels for a check-in at a specific location.
|
|
144
|
+
* Per API docs, location_labels are only available under check_ins, not under locations.
|
|
145
|
+
* @see https://developer.planning.center/docs/#/apps/check-ins/2025-05-28/vertices/location_label
|
|
146
|
+
*/
|
|
147
|
+
async getLocationLabels(checkInId, locationId) {
|
|
148
|
+
return this.getList(`/check_ins/${checkInId}/locations/${locationId}/location_labels`);
|
|
135
149
|
}
|
|
136
150
|
/**
|
|
137
151
|
* Get options for a check-in
|
|
138
152
|
*/
|
|
139
153
|
async getOptions(checkInId) {
|
|
140
|
-
return this.getList(`/
|
|
154
|
+
return this.getList(`/check_ins/${checkInId}/options`);
|
|
141
155
|
}
|
|
142
156
|
/**
|
|
143
157
|
* Get person for a check-in
|
|
144
158
|
*/
|
|
145
159
|
async getPerson(checkInId) {
|
|
146
160
|
try {
|
|
147
|
-
return await this.getSingle(`/
|
|
161
|
+
return await this.getSingle(`/check_ins/${checkInId}/person`);
|
|
148
162
|
}
|
|
149
163
|
catch (error) {
|
|
150
164
|
if (error?.status === 404) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* EventTimes Module for Check-Ins API
|
|
3
3
|
*/
|
|
4
4
|
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
+
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter, PaginationResult, Meta, TopLevelLinks } from '@rachelallyson/planning-center-base-ts';
|
|
6
6
|
import type { EventTimeResource, EventResource, EventPeriodResource, LocationEventTimeResource, CheckInResource } from '../types';
|
|
7
7
|
export interface EventTimesListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface EventTimesListOptions {
|
|
|
13
13
|
export declare class EventTimesModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all event times with optional filtering
|
|
16
|
+
* Get all event times across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: EventTimesListOptions): Promise<
|
|
19
|
+
getAll(options?: EventTimesListOptions): Promise<PaginationResult<EventTimeResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of event times with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: EventTimesListOptions): Promise<{
|
|
19
24
|
data: EventTimeResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single event time by ID
|
|
25
31
|
*/
|