@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/dist/modules/labels.js
CHANGED
|
@@ -10,99 +10,48 @@ class LabelsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all labels with optional filtering
|
|
13
|
+
* Get all labels 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 = {}) {
|
|
16
|
-
const params =
|
|
17
|
-
|
|
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/labels', params);
|
|
17
|
+
const params = this.buildLabelsParams(options);
|
|
18
|
+
return this.getAllPages('/labels', params);
|
|
32
19
|
}
|
|
33
20
|
/**
|
|
34
|
-
* Get a single
|
|
21
|
+
* Get a single page of labels with optional filtering and pagination.
|
|
35
22
|
*/
|
|
36
|
-
async
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
return this.getList('/labels', {
|
|
25
|
+
where: options.where,
|
|
26
|
+
include: options.include,
|
|
27
|
+
per_page: options.perPage,
|
|
28
|
+
page: options.page,
|
|
29
|
+
});
|
|
42
30
|
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Get all event labels
|
|
46
|
-
*/
|
|
47
|
-
async getEventLabels(options = {}) {
|
|
31
|
+
buildLabelsParams(options) {
|
|
48
32
|
const params = {};
|
|
49
33
|
if (options.where) {
|
|
50
34
|
Object.entries(options.where).forEach(([key, value]) => {
|
|
51
35
|
params[`where[${key}]`] = value;
|
|
52
36
|
});
|
|
53
37
|
}
|
|
54
|
-
if (options.include)
|
|
38
|
+
if (options.include)
|
|
55
39
|
params.include = options.include.join(',');
|
|
56
|
-
|
|
57
|
-
if (options.perPage) {
|
|
40
|
+
if (options.perPage != null)
|
|
58
41
|
params.per_page = options.perPage;
|
|
59
|
-
|
|
60
|
-
if (options.page) {
|
|
42
|
+
if (options.page != null)
|
|
61
43
|
params.page = options.page;
|
|
62
|
-
|
|
63
|
-
return this.getList('/check-ins/v2/event_labels', params);
|
|
44
|
+
return params;
|
|
64
45
|
}
|
|
65
46
|
/**
|
|
66
|
-
* Get a single
|
|
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
|
|
47
|
+
* Get a single label by ID
|
|
99
48
|
*/
|
|
100
|
-
async
|
|
49
|
+
async getById(id, include) {
|
|
101
50
|
const params = {};
|
|
102
51
|
if (include) {
|
|
103
52
|
params.include = include.join(',');
|
|
104
53
|
}
|
|
105
|
-
return this.getSingle(`/
|
|
54
|
+
return this.getSingle(`/labels/${id}`, params);
|
|
106
55
|
}
|
|
107
56
|
}
|
|
108
57
|
exports.LabelsModule = LabelsModule;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Locations 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 { LocationResource, LocationEventPeriodResource, LocationEventTimeResource, LocationLabelResource } from '../types';
|
|
7
7
|
export interface LocationsListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface LocationsListOptions {
|
|
|
13
13
|
export declare class LocationsModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all locations with optional filtering
|
|
16
|
+
* Get all locations across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: LocationsListOptions): Promise<
|
|
19
|
+
getAll(options?: LocationsListOptions): Promise<PaginationResult<LocationResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of locations with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: LocationsListOptions): Promise<{
|
|
19
24
|
data: LocationResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single location by ID
|
|
25
31
|
*/
|
|
@@ -41,7 +47,10 @@ export declare class LocationsModule extends BaseModule {
|
|
|
41
47
|
links?: any;
|
|
42
48
|
}>;
|
|
43
49
|
/**
|
|
44
|
-
* Get location labels for a location
|
|
50
|
+
* Get location labels for a location.
|
|
51
|
+
* Note: The API docs list location_labels only under check_ins (check_in_id + location_id).
|
|
52
|
+
* If this returns empty or 404, use checkIns.getLocationLabels(checkInId, locationId) instead.
|
|
53
|
+
* @see https://developer.planning.center/docs/#/apps/check-ins/2025-05-28/vertices/location_label
|
|
45
54
|
*/
|
|
46
55
|
getLocationLabels(locationId: string): Promise<{
|
|
47
56
|
data: LocationLabelResource[];
|
|
@@ -10,25 +10,31 @@ class LocationsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all locations with optional filtering
|
|
13
|
+
* Get all locations 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('/locations', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of locations with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
const params = this.buildParams(options);
|
|
25
|
+
return this.getList('/locations', 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/locations', params);
|
|
37
|
+
return params;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Get a single location by ID
|
|
@@ -38,26 +44,29 @@ class LocationsModule 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(`/locations/${id}`, params);
|
|
42
48
|
}
|
|
43
49
|
// ===== Associations =====
|
|
44
50
|
/**
|
|
45
51
|
* Get location event periods for a location
|
|
46
52
|
*/
|
|
47
53
|
async getLocationEventPeriods(locationId) {
|
|
48
|
-
return this.getList(`/
|
|
54
|
+
return this.getList(`/locations/${locationId}/location_event_periods`);
|
|
49
55
|
}
|
|
50
56
|
/**
|
|
51
57
|
* Get location event times for a location
|
|
52
58
|
*/
|
|
53
59
|
async getLocationEventTimes(locationId) {
|
|
54
|
-
return this.getList(`/
|
|
60
|
+
return this.getList(`/locations/${locationId}/location_event_times`);
|
|
55
61
|
}
|
|
56
62
|
/**
|
|
57
|
-
* Get location labels for a location
|
|
63
|
+
* Get location labels for a location.
|
|
64
|
+
* Note: The API docs list location_labels only under check_ins (check_in_id + location_id).
|
|
65
|
+
* If this returns empty or 404, use checkIns.getLocationLabels(checkInId, locationId) instead.
|
|
66
|
+
* @see https://developer.planning.center/docs/#/apps/check-ins/2025-05-28/vertices/location_label
|
|
58
67
|
*/
|
|
59
68
|
async getLocationLabels(locationId) {
|
|
60
|
-
return this.getList(`/
|
|
69
|
+
return this.getList(`/locations/${locationId}/location_labels`);
|
|
61
70
|
}
|
|
62
71
|
}
|
|
63
72
|
exports.LocationsModule = LocationsModule;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Options 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 { OptionResource } from '../types';
|
|
7
7
|
export interface OptionsListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface OptionsListOptions {
|
|
|
13
13
|
export declare class OptionsModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all options with optional filtering
|
|
16
|
+
* Get all options across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: OptionsListOptions): Promise<
|
|
19
|
+
getAll(options?: OptionsListOptions): Promise<PaginationResult<OptionResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of options with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: OptionsListOptions): Promise<{
|
|
19
24
|
data: OptionResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single option by ID
|
|
25
31
|
*/
|
package/dist/modules/options.js
CHANGED
|
@@ -10,25 +10,31 @@ class OptionsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all options with optional filtering
|
|
13
|
+
* Get all options 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('/options', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of options with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
const params = this.buildParams(options);
|
|
25
|
+
return this.getList('/options', 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/options', params);
|
|
37
|
+
return params;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Get a single option by ID
|
|
@@ -38,7 +44,7 @@ class OptionsModule 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(`/options/${id}`, params);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
exports.OptionsModule = OptionsModule;
|
|
@@ -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
|
+
// Organization is the root of the Check-Ins API (baseURL is .../check-ins/v2)
|
|
17
|
+
return this.getSingle('/');
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
exports.OrganizationModule = OrganizationModule;
|
package/dist/modules/passes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Passes 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 { PassResource } from '../types';
|
|
7
7
|
export interface PassesListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface PassesListOptions {
|
|
|
13
13
|
export declare class PassesModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all passes with optional filtering
|
|
16
|
+
* Get all passes across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: PassesListOptions): Promise<
|
|
19
|
+
getAll(options?: PassesListOptions): Promise<PaginationResult<PassResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of passes with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: PassesListOptions): Promise<{
|
|
19
24
|
data: PassResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single pass by ID
|
|
25
31
|
*/
|
package/dist/modules/passes.js
CHANGED
|
@@ -10,25 +10,31 @@ class PassesModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all passes with optional filtering
|
|
13
|
+
* Get all passes 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('/passes', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of passes with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
const params = this.buildParams(options);
|
|
25
|
+
return this.getList('/passes', 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/passes', params);
|
|
37
|
+
return params;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Get a single pass by ID
|
|
@@ -38,7 +44,7 @@ class PassesModule 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(`/passes/${id}`, params);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
exports.PassesModule = PassesModule;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* PreChecks 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 { PreCheckResource } from '../types';
|
|
7
7
|
export interface PreChecksListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface PreChecksListOptions {
|
|
|
13
13
|
export declare class PreChecksModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all pre-checks with optional filtering
|
|
16
|
+
* Get all pre-checks across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: PreChecksListOptions): Promise<
|
|
19
|
+
getAll(options?: PreChecksListOptions): Promise<PaginationResult<PreCheckResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of pre-checks with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: PreChecksListOptions): Promise<{
|
|
19
24
|
data: PreCheckResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single pre-check by ID
|
|
25
31
|
*/
|
|
@@ -10,25 +10,31 @@ class PreChecksModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all pre-checks with optional filtering
|
|
13
|
+
* Get all pre-checks 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('/pre_checks', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of pre-checks with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
const params = this.buildParams(options);
|
|
25
|
+
return this.getList('/pre_checks', 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/pre_checks', params);
|
|
37
|
+
return params;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Get a single pre-check by ID
|
|
@@ -38,7 +44,7 @@ class PreChecksModule 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(`/pre_checks/${id}`, params);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
exports.PreChecksModule = PreChecksModule;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* RosterListPersons 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 { RosterListPersonResource } from '../types';
|
|
7
7
|
export interface RosterListPersonsListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface RosterListPersonsListOptions {
|
|
|
13
13
|
export declare class RosterListPersonsModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all roster list persons with optional filtering
|
|
16
|
+
* Get all roster list persons across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: RosterListPersonsListOptions): Promise<
|
|
19
|
+
getAll(options?: RosterListPersonsListOptions): Promise<PaginationResult<RosterListPersonResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of roster list persons with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: RosterListPersonsListOptions): Promise<{
|
|
19
24
|
data: RosterListPersonResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single roster list person by ID
|
|
25
31
|
*/
|
|
@@ -10,25 +10,31 @@ class RosterListPersonsModule extends planning_center_base_ts_1.BaseModule {
|
|
|
10
10
|
super(httpClient, paginationHelper, eventEmitter);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Get all roster list persons with optional filtering
|
|
13
|
+
* Get all roster list persons 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('/roster_list_persons', params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of roster list persons with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
async getPage(options = {}) {
|
|
24
|
+
const params = this.buildParams(options);
|
|
25
|
+
return this.getList('/roster_list_persons', 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/roster_list_persons', params);
|
|
37
|
+
return params;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Get a single roster list person by ID
|
|
@@ -38,7 +44,7 @@ class RosterListPersonsModule 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(`/roster_list_persons/${id}`, params);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
exports.RosterListPersonsModule = RosterListPersonsModule;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Stations 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 { StationResource } from '../types';
|
|
7
7
|
export interface StationsListOptions {
|
|
8
8
|
where?: Record<string, any>;
|
|
@@ -13,13 +13,19 @@ export interface StationsListOptions {
|
|
|
13
13
|
export declare class StationsModule extends BaseModule {
|
|
14
14
|
constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
|
|
15
15
|
/**
|
|
16
|
-
* Get all stations with optional filtering
|
|
16
|
+
* Get all stations across all pages with optional filtering.
|
|
17
|
+
* Use getPage() when you need a single page or custom perPage/page.
|
|
17
18
|
*/
|
|
18
|
-
getAll(options?: StationsListOptions): Promise<
|
|
19
|
+
getAll(options?: StationsListOptions): Promise<PaginationResult<StationResource>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a single page of stations with optional filtering and pagination.
|
|
22
|
+
*/
|
|
23
|
+
getPage(options?: StationsListOptions): Promise<{
|
|
19
24
|
data: StationResource[];
|
|
20
|
-
meta?:
|
|
21
|
-
links?:
|
|
25
|
+
meta?: Meta;
|
|
26
|
+
links?: TopLevelLinks;
|
|
22
27
|
}>;
|
|
28
|
+
private buildParams;
|
|
23
29
|
/**
|
|
24
30
|
* Get a single station by ID
|
|
25
31
|
*/
|