@rachelallyson/planning-center-check-ins-ts 2.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.
@@ -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?: any;
21
- links?: any;
25
+ meta?: Meta;
26
+ links?: TopLevelLinks;
22
27
  }>;
28
+ private buildParams;
23
29
  /**
24
30
  * Get a single pass by ID
25
31
  */
@@ -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(([key, value]) => {
19
- params[`where[${key}]`] = value;
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(`/check-ins/v2/passes/${id}`, params);
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?: any;
21
- links?: any;
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(([key, value]) => {
19
- params[`where[${key}]`] = value;
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(`/check-ins/v2/pre_checks/${id}`, params);
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?: any;
21
- links?: any;
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(([key, value]) => {
19
- params[`where[${key}]`] = value;
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(`/check-ins/v2/roster_list_persons/${id}`, params);
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?: any;
21
- links?: any;
25
+ meta?: Meta;
26
+ links?: TopLevelLinks;
22
27
  }>;
28
+ private buildParams;
23
29
  /**
24
30
  * Get a single station by ID
25
31
  */
@@ -10,25 +10,31 @@ class StationsModule extends planning_center_base_ts_1.BaseModule {
10
10
  super(httpClient, paginationHelper, eventEmitter);
11
11
  }
12
12
  /**
13
- * Get all stations with optional filtering
13
+ * Get all stations 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('/stations', params);
19
+ }
20
+ /**
21
+ * Get a single page of stations with optional filtering and pagination.
22
+ */
23
+ async getPage(options = {}) {
24
+ const params = this.buildParams(options);
25
+ return this.getList('/stations', params);
26
+ }
27
+ buildParams(options) {
16
28
  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) {
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/stations', params);
37
+ return params;
32
38
  }
33
39
  /**
34
40
  * Get a single station by ID
@@ -38,7 +44,7 @@ class StationsModule extends planning_center_base_ts_1.BaseModule {
38
44
  if (include) {
39
45
  params.include = include.join(',');
40
46
  }
41
- return this.getSingle(`/check-ins/v2/stations/${id}`, params);
47
+ return this.getSingle(`/stations/${id}`, params);
42
48
  }
43
49
  }
44
50
  exports.StationsModule = StationsModule;
@@ -2,7 +2,7 @@
2
2
  * Themes 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 { ThemeResource } from '../types';
7
7
  export interface ThemesListOptions {
8
8
  where?: Record<string, any>;
@@ -13,13 +13,19 @@ export interface ThemesListOptions {
13
13
  export declare class ThemesModule extends BaseModule {
14
14
  constructor(httpClient: PcoHttpClient, paginationHelper: PaginationHelper, eventEmitter: PcoEventEmitter);
15
15
  /**
16
- * Get all themes with optional filtering
16
+ * Get all themes across all pages with optional filtering.
17
+ * Use getPage() when you need a single page or custom perPage/page.
17
18
  */
18
- getAll(options?: ThemesListOptions): Promise<{
19
+ getAll(options?: ThemesListOptions): Promise<PaginationResult<ThemeResource>>;
20
+ /**
21
+ * Get a single page of themes with optional filtering and pagination.
22
+ */
23
+ getPage(options?: ThemesListOptions): Promise<{
19
24
  data: ThemeResource[];
20
- meta?: any;
21
- links?: any;
25
+ meta?: Meta;
26
+ links?: TopLevelLinks;
22
27
  }>;
28
+ private buildParams;
23
29
  /**
24
30
  * Get a single theme by ID
25
31
  */
@@ -10,25 +10,31 @@ class ThemesModule extends planning_center_base_ts_1.BaseModule {
10
10
  super(httpClient, paginationHelper, eventEmitter);
11
11
  }
12
12
  /**
13
- * Get all themes with optional filtering
13
+ * Get all themes 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('/themes', params);
19
+ }
20
+ /**
21
+ * Get a single page of themes with optional filtering and pagination.
22
+ */
23
+ async getPage(options = {}) {
24
+ const params = this.buildParams(options);
25
+ return this.getList('/themes', params);
26
+ }
27
+ buildParams(options) {
16
28
  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) {
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/themes', params);
37
+ return params;
32
38
  }
33
39
  /**
34
40
  * Get a single theme by ID
@@ -38,7 +44,7 @@ class ThemesModule extends planning_center_base_ts_1.BaseModule {
38
44
  if (include) {
39
45
  params.include = include.join(',');
40
46
  }
41
- return this.getSingle(`/check-ins/v2/themes/${id}`, params);
47
+ return this.getSingle(`/themes/${id}`, params);
42
48
  }
43
49
  }
44
50
  exports.ThemesModule = ThemesModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rachelallyson/planning-center-check-ins-ts",
3
- "version": "2.0.0",
3
+ "version": "3.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",
@@ -9,10 +9,10 @@
9
9
  "dev": "tsc --watch",
10
10
  "clean": "rm -rf dist",
11
11
  "prebuild": "npm run clean",
12
- "test": "jest --testPathIgnorePatterns=integration.test.ts",
13
- "test:watch": "jest --watch --testPathIgnorePatterns=integration.test.ts",
14
- "test:coverage": "jest --coverage --testPathIgnorePatterns=integration.test.ts",
15
- "test:ci": "jest --ci --coverage --watchAll=false --testPathIgnorePatterns=integration.test.ts",
12
+ "test": "dotenv -e .env.test -- jest",
13
+ "test:watch": "jest --watch",
14
+ "test:coverage": "jest --coverage",
15
+ "test:ci": "jest --ci --coverage --watchAll=false",
16
16
  "test:integration": "dotenv -e .env.test -- jest --testPathPatterns=integration/.*.integration.test.ts --setupFilesAfterEnv='<rootDir>/tests/integration-setup.ts' --testTimeout=60000",
17
17
  "docs": "typedoc",
18
18
  "docs:watch": "typedoc --watch",
@@ -70,6 +70,6 @@
70
70
  "access": "public"
71
71
  },
72
72
  "dependencies": {
73
- "@rachelallyson/planning-center-base-ts": "^1.0.0"
73
+ "@rachelallyson/planning-center-base-ts": "^1.1.2"
74
74
  }
75
- }
75
+ }