@rachelallyson/planning-center-check-ins-ts 1.0.0 → 2.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 +23 -0
- package/README.md +4 -5
- package/dist/client.d.ts +0 -6
- package/dist/client.js +1 -10
- package/dist/modules/events.d.ts +49 -21
- package/dist/modules/events.js +62 -1
- package/dist/modules/labels.d.ts +1 -25
- package/dist/modules/labels.js +0 -64
- package/dist/modules/organization.js +2 -1
- package/package.json +2 -2
- 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,29 @@ 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
|
+
## [2.0.0] - 2026-01-20
|
|
9
|
+
|
|
10
|
+
### ⚠️ **Breaking Changes**
|
|
11
|
+
|
|
12
|
+
- **Module Consolidation**: Removed standalone `checkInTimes`, `eventPeriods`, and `personEvents` modules
|
|
13
|
+
- Check-in times now accessible via `client.checkIns.getCheckInTimes(checkInId)`
|
|
14
|
+
- Event periods now accessible via `client.events.getEventPeriods(eventId)`
|
|
15
|
+
- Person events now accessible via `client.events.getPersonEvents(eventId)`
|
|
16
|
+
- **Reduced Module Count**: Client now has 16 modules instead of 19
|
|
17
|
+
|
|
18
|
+
### ✨ **New Features**
|
|
19
|
+
|
|
20
|
+
- **Enhanced Events Module**: Added `getAllEventPeriods()`, `getAllEvents()`, and `getEventTimesForPeriod()` methods
|
|
21
|
+
- **Improved Pagination**: Added `getAllPages()` support for comprehensive data retrieval
|
|
22
|
+
- **Better Type Safety**: Replaced `any` types with proper `Meta` and `TopLevelLinks` interfaces
|
|
23
|
+
- **Comprehensive Integration Tests**: Added type validation and endpoint coverage tests
|
|
24
|
+
|
|
25
|
+
### 🔧 **Technical Improvements**
|
|
26
|
+
|
|
27
|
+
- Consolidated related functionality into parent modules for better API design
|
|
28
|
+
- Enhanced error handling and type validation throughout
|
|
29
|
+
- Updated Jest configuration for local package resolution
|
|
30
|
+
|
|
8
31
|
## [1.0.0] - 2024-XX-XX
|
|
9
32
|
|
|
10
33
|
### 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);
|
|
@@ -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/modules/events.d.ts
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Events 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 { EventResource, EventPeriodResource, EventTimeResource, AttendanceTypeResource, CheckInResource, EventLabelResource, LocationResource, PersonEventResource, IntegrationLinkResource } from '../types';
|
|
5
|
+
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter, Meta, TopLevelLinks } from '@rachelallyson/planning-center-base-ts';
|
|
6
|
+
import type { EventResource, EventPeriodResource, EventTimeResource, AttendanceTypeResource, CheckInResource, EventLabelResource, LocationResource, PersonEventResource, IntegrationLinkResource, HeadcountResource } from '../types';
|
|
7
7
|
export interface EventsListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
9
|
+
filter?: string | string[];
|
|
9
10
|
include?: string[];
|
|
10
11
|
perPage?: number;
|
|
11
12
|
page?: number;
|
|
@@ -17,8 +18,8 @@ export declare class EventsModule extends BaseModule {
|
|
|
17
18
|
*/
|
|
18
19
|
getAll(options?: EventsListOptions): Promise<{
|
|
19
20
|
data: EventResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
21
|
+
meta?: Meta;
|
|
22
|
+
links?: TopLevelLinks;
|
|
22
23
|
}>;
|
|
23
24
|
/**
|
|
24
25
|
* Get a single event by ID
|
|
@@ -29,8 +30,8 @@ export declare class EventsModule extends BaseModule {
|
|
|
29
30
|
*/
|
|
30
31
|
getAttendanceTypes(eventId: string): Promise<{
|
|
31
32
|
data: AttendanceTypeResource[];
|
|
32
|
-
meta?:
|
|
33
|
-
links?:
|
|
33
|
+
meta?: Meta;
|
|
34
|
+
links?: TopLevelLinks;
|
|
34
35
|
}>;
|
|
35
36
|
/**
|
|
36
37
|
* Get check-ins for an event
|
|
@@ -39,55 +40,82 @@ export declare class EventsModule extends BaseModule {
|
|
|
39
40
|
filter?: string[];
|
|
40
41
|
}): Promise<{
|
|
41
42
|
data: CheckInResource[];
|
|
42
|
-
meta?:
|
|
43
|
-
links?:
|
|
43
|
+
meta?: Meta;
|
|
44
|
+
links?: TopLevelLinks;
|
|
44
45
|
}>;
|
|
45
46
|
/**
|
|
46
47
|
* Get current event times for an event
|
|
47
48
|
*/
|
|
48
49
|
getCurrentEventTimes(eventId: string): Promise<{
|
|
49
50
|
data: EventTimeResource[];
|
|
50
|
-
meta?:
|
|
51
|
-
links?:
|
|
51
|
+
meta?: Meta;
|
|
52
|
+
links?: TopLevelLinks;
|
|
52
53
|
}>;
|
|
53
54
|
/**
|
|
54
55
|
* Get event labels for an event
|
|
55
56
|
*/
|
|
56
57
|
getEventLabels(eventId: string): Promise<{
|
|
57
58
|
data: EventLabelResource[];
|
|
58
|
-
meta?:
|
|
59
|
-
links?:
|
|
59
|
+
meta?: Meta;
|
|
60
|
+
links?: TopLevelLinks;
|
|
60
61
|
}>;
|
|
61
62
|
/**
|
|
62
|
-
* Get event periods for an event
|
|
63
|
+
* Get event periods for an event (single page)
|
|
63
64
|
*/
|
|
64
65
|
getEventPeriods(eventId: string): Promise<{
|
|
65
66
|
data: EventPeriodResource[];
|
|
66
|
-
meta?:
|
|
67
|
-
links?:
|
|
67
|
+
meta?: Meta;
|
|
68
|
+
links?: TopLevelLinks;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Get all event periods for an event (all pages)
|
|
72
|
+
*/
|
|
73
|
+
getAllEventPeriods(eventId: string, options?: {
|
|
74
|
+
perPage?: number;
|
|
75
|
+
}): Promise<EventPeriodResource[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Get all events with pagination (all pages)
|
|
78
|
+
*/
|
|
79
|
+
getAllEvents(options?: {
|
|
80
|
+
filter?: string | string[];
|
|
81
|
+
perPage?: number;
|
|
82
|
+
}): Promise<EventResource[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Get event times for a specific event period
|
|
85
|
+
*
|
|
86
|
+
* Possible included resources: HeadcountResource, AttendanceTypeResource
|
|
87
|
+
*/
|
|
88
|
+
getEventTimesForPeriod(eventId: string, periodId: string, options?: {
|
|
89
|
+
include?: string[] | string;
|
|
90
|
+
perPage?: number;
|
|
91
|
+
}): Promise<{
|
|
92
|
+
data: EventTimeResource[];
|
|
93
|
+
included?: (HeadcountResource | AttendanceTypeResource)[];
|
|
94
|
+
meta?: Meta;
|
|
95
|
+
links?: TopLevelLinks;
|
|
68
96
|
}>;
|
|
69
97
|
/**
|
|
70
98
|
* Get integration links for an event
|
|
71
99
|
*/
|
|
72
100
|
getIntegrationLinks(eventId: string): Promise<{
|
|
73
101
|
data: IntegrationLinkResource[];
|
|
74
|
-
meta?:
|
|
75
|
-
links?:
|
|
102
|
+
meta?: Meta;
|
|
103
|
+
links?: TopLevelLinks;
|
|
76
104
|
}>;
|
|
77
105
|
/**
|
|
78
106
|
* Get locations for an event
|
|
79
107
|
*/
|
|
80
108
|
getLocations(eventId: string): Promise<{
|
|
81
109
|
data: LocationResource[];
|
|
82
|
-
meta?:
|
|
83
|
-
links?:
|
|
110
|
+
meta?: Meta;
|
|
111
|
+
links?: TopLevelLinks;
|
|
84
112
|
}>;
|
|
85
113
|
/**
|
|
86
114
|
* Get person events for an event
|
|
87
115
|
*/
|
|
88
116
|
getPersonEvents(eventId: string): Promise<{
|
|
89
117
|
data: PersonEventResource[];
|
|
90
|
-
meta?:
|
|
91
|
-
links?:
|
|
118
|
+
meta?: Meta;
|
|
119
|
+
links?: TopLevelLinks;
|
|
92
120
|
}>;
|
|
93
121
|
}
|
package/dist/modules/events.js
CHANGED
|
@@ -19,6 +19,17 @@ class EventsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
19
19
|
params[`where[${key}]`] = value;
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
+
if (options.filter) {
|
|
23
|
+
// Support both string and array formats
|
|
24
|
+
if (Array.isArray(options.filter)) {
|
|
25
|
+
options.filter.forEach(filter => {
|
|
26
|
+
params.filter = filter; // Use the last filter value, or combine them
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
params.filter = options.filter;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
22
33
|
if (options.include) {
|
|
23
34
|
params.include = options.include.join(',');
|
|
24
35
|
}
|
|
@@ -74,11 +85,61 @@ class EventsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
74
85
|
return this.getList(`/check-ins/v2/events/${eventId}/event_labels`);
|
|
75
86
|
}
|
|
76
87
|
/**
|
|
77
|
-
* Get event periods for an event
|
|
88
|
+
* Get event periods for an event (single page)
|
|
78
89
|
*/
|
|
79
90
|
async getEventPeriods(eventId) {
|
|
80
91
|
return this.getList(`/check-ins/v2/events/${eventId}/event_periods`);
|
|
81
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Get all event periods for an event (all pages)
|
|
95
|
+
*/
|
|
96
|
+
async getAllEventPeriods(eventId, options) {
|
|
97
|
+
const result = await this.getAllPages(`/check-ins/v2/events/${eventId}/event_periods`, {}, { perPage: options?.perPage || 100 });
|
|
98
|
+
return result.data;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get all events with pagination (all pages)
|
|
102
|
+
*/
|
|
103
|
+
async getAllEvents(options) {
|
|
104
|
+
const params = {};
|
|
105
|
+
if (options?.filter) {
|
|
106
|
+
if (Array.isArray(options.filter)) {
|
|
107
|
+
params.filter = options.filter[0]; // Use first filter if array
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
params.filter = options.filter;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const result = await this.getAllPages('/check-ins/v2/events', params, { perPage: options?.perPage || 100 });
|
|
114
|
+
return result.data;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get event times for a specific event period
|
|
118
|
+
*
|
|
119
|
+
* Possible included resources: HeadcountResource, AttendanceTypeResource
|
|
120
|
+
*/
|
|
121
|
+
async getEventTimesForPeriod(eventId, periodId, options) {
|
|
122
|
+
const params = {};
|
|
123
|
+
if (options?.include) {
|
|
124
|
+
params.include = Array.isArray(options.include)
|
|
125
|
+
? options.include.join(',')
|
|
126
|
+
: options.include;
|
|
127
|
+
}
|
|
128
|
+
if (options?.perPage) {
|
|
129
|
+
params.per_page = options.perPage;
|
|
130
|
+
}
|
|
131
|
+
const response = await this.httpClient.request({
|
|
132
|
+
method: 'GET',
|
|
133
|
+
endpoint: `/check-ins/v2/events/${eventId}/event_periods/${periodId}/event_times`,
|
|
134
|
+
params,
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
data: response.data.data,
|
|
138
|
+
included: response.data.included,
|
|
139
|
+
meta: response.data.meta,
|
|
140
|
+
links: response.data.links,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
82
143
|
/**
|
|
83
144
|
* Get integration links for an event
|
|
84
145
|
*/
|
package/dist/modules/labels.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
5
|
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
6
|
-
import type { LabelResource
|
|
6
|
+
import type { LabelResource } from '../types';
|
|
7
7
|
export interface LabelsListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
9
9
|
include?: string[];
|
|
@@ -24,28 +24,4 @@ export declare class LabelsModule extends BaseModule {
|
|
|
24
24
|
* Get a single label by ID
|
|
25
25
|
*/
|
|
26
26
|
getById(id: string, include?: string[]): Promise<LabelResource>;
|
|
27
|
-
/**
|
|
28
|
-
* Get all event labels
|
|
29
|
-
*/
|
|
30
|
-
getEventLabels(options?: LabelsListOptions): Promise<{
|
|
31
|
-
data: EventLabelResource[];
|
|
32
|
-
meta?: any;
|
|
33
|
-
links?: any;
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* Get a single event label by ID
|
|
37
|
-
*/
|
|
38
|
-
getEventLabelById(id: string, include?: string[]): Promise<EventLabelResource>;
|
|
39
|
-
/**
|
|
40
|
-
* Get all location labels
|
|
41
|
-
*/
|
|
42
|
-
getLocationLabels(options?: LabelsListOptions): Promise<{
|
|
43
|
-
data: LocationLabelResource[];
|
|
44
|
-
meta?: any;
|
|
45
|
-
links?: any;
|
|
46
|
-
}>;
|
|
47
|
-
/**
|
|
48
|
-
* Get a single location label by ID
|
|
49
|
-
*/
|
|
50
|
-
getLocationLabelById(id: string, include?: string[]): Promise<LocationLabelResource>;
|
|
51
27
|
}
|
package/dist/modules/labels.js
CHANGED
|
@@ -40,69 +40,5 @@ class LabelsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
40
40
|
}
|
|
41
41
|
return this.getSingle(`/check-ins/v2/labels/${id}`, params);
|
|
42
42
|
}
|
|
43
|
-
// ===== Event Labels =====
|
|
44
|
-
/**
|
|
45
|
-
* Get all event labels
|
|
46
|
-
*/
|
|
47
|
-
async getEventLabels(options = {}) {
|
|
48
|
-
const params = {};
|
|
49
|
-
if (options.where) {
|
|
50
|
-
Object.entries(options.where).forEach(([key, value]) => {
|
|
51
|
-
params[`where[${key}]`] = value;
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (options.include) {
|
|
55
|
-
params.include = options.include.join(',');
|
|
56
|
-
}
|
|
57
|
-
if (options.perPage) {
|
|
58
|
-
params.per_page = options.perPage;
|
|
59
|
-
}
|
|
60
|
-
if (options.page) {
|
|
61
|
-
params.page = options.page;
|
|
62
|
-
}
|
|
63
|
-
return this.getList('/check-ins/v2/event_labels', params);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get a single event label by ID
|
|
67
|
-
*/
|
|
68
|
-
async getEventLabelById(id, include) {
|
|
69
|
-
const params = {};
|
|
70
|
-
if (include) {
|
|
71
|
-
params.include = include.join(',');
|
|
72
|
-
}
|
|
73
|
-
return this.getSingle(`/check-ins/v2/event_labels/${id}`, params);
|
|
74
|
-
}
|
|
75
|
-
// ===== Location Labels =====
|
|
76
|
-
/**
|
|
77
|
-
* Get all location labels
|
|
78
|
-
*/
|
|
79
|
-
async getLocationLabels(options = {}) {
|
|
80
|
-
const params = {};
|
|
81
|
-
if (options.where) {
|
|
82
|
-
Object.entries(options.where).forEach(([key, value]) => {
|
|
83
|
-
params[`where[${key}]`] = value;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (options.include) {
|
|
87
|
-
params.include = options.include.join(',');
|
|
88
|
-
}
|
|
89
|
-
if (options.perPage) {
|
|
90
|
-
params.per_page = options.perPage;
|
|
91
|
-
}
|
|
92
|
-
if (options.page) {
|
|
93
|
-
params.page = options.page;
|
|
94
|
-
}
|
|
95
|
-
return this.getList('/check-ins/v2/location_labels', params);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Get a single location label by ID
|
|
99
|
-
*/
|
|
100
|
-
async getLocationLabelById(id, include) {
|
|
101
|
-
const params = {};
|
|
102
|
-
if (include) {
|
|
103
|
-
params.include = include.join(',');
|
|
104
|
-
}
|
|
105
|
-
return this.getSingle(`/check-ins/v2/location_labels/${id}`, params);
|
|
106
|
-
}
|
|
107
43
|
}
|
|
108
44
|
exports.LabelsModule = LabelsModule;
|
|
@@ -13,7 +13,8 @@ class OrganizationModule extends planning_center_base_ts_1.BaseModule {
|
|
|
13
13
|
* Get organization information
|
|
14
14
|
*/
|
|
15
15
|
async get() {
|
|
16
|
-
|
|
16
|
+
// The organization endpoint is at /check-ins/v2 (not /check-ins/v2/organization)
|
|
17
|
+
return this.getSingle('/check-ins/v2');
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
exports.OrganizationModule = OrganizationModule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rachelallyson/planning-center-check-ins-ts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A strictly typed TypeScript client for Planning Center Online Check-Ins API with batch operations and enhanced developer experience",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -72,4 +72,4 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@rachelallyson/planning-center-base-ts": "^1.0.0"
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CheckInTimes Module for Check-Ins API
|
|
3
|
-
*/
|
|
4
|
-
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
6
|
-
import type { CheckInTimeResource } from '../types';
|
|
7
|
-
export interface CheckInTimesListOptions {
|
|
8
|
-
where?: Record<string, any>;
|
|
9
|
-
include?: string[];
|
|
10
|
-
perPage?: number;
|
|
11
|
-
page?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare class CheckInTimesModule extends BaseModule {
|
|
14
|
-
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
|
-
/**
|
|
16
|
-
* Get all check-in times with optional filtering
|
|
17
|
-
*/
|
|
18
|
-
getAll(options?: CheckInTimesListOptions): Promise<{
|
|
19
|
-
data: CheckInTimeResource[];
|
|
20
|
-
meta?: any;
|
|
21
|
-
links?: any;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Get a single check-in time by ID
|
|
25
|
-
*/
|
|
26
|
-
getById(id: string, include?: string[]): Promise<CheckInTimeResource>;
|
|
27
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* CheckInTimes Module for Check-Ins API
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CheckInTimesModule = void 0;
|
|
7
|
-
const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
|
|
8
|
-
class CheckInTimesModule extends planning_center_base_ts_1.BaseModule {
|
|
9
|
-
constructor(httpClient, paginationHelper, eventEmitter) {
|
|
10
|
-
super(httpClient, paginationHelper, eventEmitter);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Get all check-in times with optional filtering
|
|
14
|
-
*/
|
|
15
|
-
async getAll(options = {}) {
|
|
16
|
-
const params = {};
|
|
17
|
-
if (options.where) {
|
|
18
|
-
Object.entries(options.where).forEach(([key, value]) => {
|
|
19
|
-
params[`where[${key}]`] = value;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (options.include) {
|
|
23
|
-
params.include = options.include.join(',');
|
|
24
|
-
}
|
|
25
|
-
if (options.perPage) {
|
|
26
|
-
params.per_page = options.perPage;
|
|
27
|
-
}
|
|
28
|
-
if (options.page) {
|
|
29
|
-
params.page = options.page;
|
|
30
|
-
}
|
|
31
|
-
return this.getList('/check-ins/v2/check_in_times', params);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get a single check-in time by ID
|
|
35
|
-
*/
|
|
36
|
-
async getById(id, include) {
|
|
37
|
-
const params = {};
|
|
38
|
-
if (include) {
|
|
39
|
-
params.include = include.join(',');
|
|
40
|
-
}
|
|
41
|
-
return this.getSingle(`/check-ins/v2/check_in_times/${id}`, params);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.CheckInTimesModule = CheckInTimesModule;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EventPeriods Module for Check-Ins API
|
|
3
|
-
*/
|
|
4
|
-
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
6
|
-
import type { EventPeriodResource, EventResource, EventTimeResource, CheckInResource, LocationEventPeriodResource } from '../types';
|
|
7
|
-
export interface EventPeriodsListOptions {
|
|
8
|
-
where?: Record<string, any>;
|
|
9
|
-
include?: string[];
|
|
10
|
-
perPage?: number;
|
|
11
|
-
page?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare class EventPeriodsModule extends BaseModule {
|
|
14
|
-
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
|
-
/**
|
|
16
|
-
* Get all event periods with optional filtering
|
|
17
|
-
*/
|
|
18
|
-
getAll(options?: EventPeriodsListOptions): Promise<{
|
|
19
|
-
data: EventPeriodResource[];
|
|
20
|
-
meta?: any;
|
|
21
|
-
links?: any;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Get a single event period by ID
|
|
25
|
-
*/
|
|
26
|
-
getById(id: string, include?: string[]): Promise<EventPeriodResource>;
|
|
27
|
-
/**
|
|
28
|
-
* Get event for an event period
|
|
29
|
-
*/
|
|
30
|
-
getEvent(eventPeriodId: string): Promise<EventResource>;
|
|
31
|
-
/**
|
|
32
|
-
* Get event times for an event period
|
|
33
|
-
*/
|
|
34
|
-
getEventTimes(eventPeriodId: string): Promise<{
|
|
35
|
-
data: EventTimeResource[];
|
|
36
|
-
meta?: any;
|
|
37
|
-
links?: any;
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* Get check-ins for an event period
|
|
41
|
-
*/
|
|
42
|
-
getCheckIns(eventPeriodId: string, options?: {
|
|
43
|
-
filter?: string[];
|
|
44
|
-
}): Promise<{
|
|
45
|
-
data: CheckInResource[];
|
|
46
|
-
meta?: any;
|
|
47
|
-
links?: any;
|
|
48
|
-
}>;
|
|
49
|
-
/**
|
|
50
|
-
* Get location event periods for an event period
|
|
51
|
-
*/
|
|
52
|
-
getLocationEventPeriods(eventPeriodId: string): Promise<{
|
|
53
|
-
data: LocationEventPeriodResource[];
|
|
54
|
-
meta?: any;
|
|
55
|
-
links?: any;
|
|
56
|
-
}>;
|
|
57
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* EventPeriods Module for Check-Ins API
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EventPeriodsModule = void 0;
|
|
7
|
-
const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
|
|
8
|
-
class EventPeriodsModule extends planning_center_base_ts_1.BaseModule {
|
|
9
|
-
constructor(httpClient, paginationHelper, eventEmitter) {
|
|
10
|
-
super(httpClient, paginationHelper, eventEmitter);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Get all event periods with optional filtering
|
|
14
|
-
*/
|
|
15
|
-
async getAll(options = {}) {
|
|
16
|
-
const params = {};
|
|
17
|
-
if (options.where) {
|
|
18
|
-
Object.entries(options.where).forEach(([key, value]) => {
|
|
19
|
-
params[`where[${key}]`] = value;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (options.include) {
|
|
23
|
-
params.include = options.include.join(',');
|
|
24
|
-
}
|
|
25
|
-
if (options.perPage) {
|
|
26
|
-
params.per_page = options.perPage;
|
|
27
|
-
}
|
|
28
|
-
if (options.page) {
|
|
29
|
-
params.page = options.page;
|
|
30
|
-
}
|
|
31
|
-
return this.getList('/check-ins/v2/event_periods', params);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get a single event period by ID
|
|
35
|
-
*/
|
|
36
|
-
async getById(id, include) {
|
|
37
|
-
const params = {};
|
|
38
|
-
if (include) {
|
|
39
|
-
params.include = include.join(',');
|
|
40
|
-
}
|
|
41
|
-
return this.getSingle(`/check-ins/v2/event_periods/${id}`, params);
|
|
42
|
-
}
|
|
43
|
-
// ===== Associations =====
|
|
44
|
-
/**
|
|
45
|
-
* Get event for an event period
|
|
46
|
-
*/
|
|
47
|
-
async getEvent(eventPeriodId) {
|
|
48
|
-
return this.getSingle(`/check-ins/v2/event_periods/${eventPeriodId}/event`);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get event times for an event period
|
|
52
|
-
*/
|
|
53
|
-
async getEventTimes(eventPeriodId) {
|
|
54
|
-
return this.getList(`/check-ins/v2/event_periods/${eventPeriodId}/event_times`);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get check-ins for an event period
|
|
58
|
-
*/
|
|
59
|
-
async getCheckIns(eventPeriodId, options = {}) {
|
|
60
|
-
const params = {};
|
|
61
|
-
if (options.filter && options.filter.length > 0) {
|
|
62
|
-
options.filter.forEach(filter => {
|
|
63
|
-
params[filter] = 'true';
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return this.getList(`/check-ins/v2/event_periods/${eventPeriodId}/check_ins`, params);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Get location event periods for an event period
|
|
70
|
-
*/
|
|
71
|
-
async getLocationEventPeriods(eventPeriodId) {
|
|
72
|
-
return this.getList(`/check-ins/v2/event_periods/${eventPeriodId}/location_event_periods`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.EventPeriodsModule = EventPeriodsModule;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PersonEvents Module for Check-Ins API
|
|
3
|
-
*/
|
|
4
|
-
import { BaseModule } from '@rachelallyson/planning-center-base-ts';
|
|
5
|
-
import type { PcoHttpClient, PaginationHelper, PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
|
|
6
|
-
import type { PersonEventResource } from '../types';
|
|
7
|
-
export interface PersonEventsListOptions {
|
|
8
|
-
where?: Record<string, any>;
|
|
9
|
-
include?: string[];
|
|
10
|
-
perPage?: number;
|
|
11
|
-
page?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare class PersonEventsModule extends BaseModule {
|
|
14
|
-
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
|
-
/**
|
|
16
|
-
* Get all person events with optional filtering
|
|
17
|
-
*/
|
|
18
|
-
getAll(options?: PersonEventsListOptions): Promise<{
|
|
19
|
-
data: PersonEventResource[];
|
|
20
|
-
meta?: any;
|
|
21
|
-
links?: any;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Get a single person event by ID
|
|
25
|
-
*/
|
|
26
|
-
getById(id: string, include?: string[]): Promise<PersonEventResource>;
|
|
27
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* PersonEvents Module for Check-Ins API
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PersonEventsModule = void 0;
|
|
7
|
-
const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
|
|
8
|
-
class PersonEventsModule extends planning_center_base_ts_1.BaseModule {
|
|
9
|
-
constructor(httpClient, paginationHelper, eventEmitter) {
|
|
10
|
-
super(httpClient, paginationHelper, eventEmitter);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Get all person events with optional filtering
|
|
14
|
-
*/
|
|
15
|
-
async getAll(options = {}) {
|
|
16
|
-
const params = {};
|
|
17
|
-
if (options.where) {
|
|
18
|
-
Object.entries(options.where).forEach(([key, value]) => {
|
|
19
|
-
params[`where[${key}]`] = value;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (options.include) {
|
|
23
|
-
params.include = options.include.join(',');
|
|
24
|
-
}
|
|
25
|
-
if (options.perPage) {
|
|
26
|
-
params.per_page = options.perPage;
|
|
27
|
-
}
|
|
28
|
-
if (options.page) {
|
|
29
|
-
params.page = options.page;
|
|
30
|
-
}
|
|
31
|
-
return this.getList('/check-ins/v2/person_events', params);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get a single person event by ID
|
|
35
|
-
*/
|
|
36
|
-
async getById(id, include) {
|
|
37
|
-
const params = {};
|
|
38
|
-
if (include) {
|
|
39
|
-
params.include = include.join(',');
|
|
40
|
-
}
|
|
41
|
-
return this.getSingle(`/check-ins/v2/person_events/${id}`, params);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.PersonEventsModule = PersonEventsModule;
|