@rachelallyson/planning-center-people-ts 2.12.2 → 2.13.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 CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project 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.13.0] - 2026-01-20
9
+
10
+ ### ✨ **New Features**
11
+
12
+ - **🎯 Lenient Age Preference Filtering**: Added `agePreferenceLenient` option for flexible age-based filtering
13
+ - When `agePreferenceLenient: true`, age preferences only filter profiles that have birthdates
14
+ - Profiles without birthdates are included regardless of `agePreference` setting
15
+ - Prevents false negatives when searching for existing people with incomplete age data
16
+ - Backward compatible - default behavior remains strict filtering (only `agePreference: 'any'` includes profiles without birthdates)
17
+
8
18
  ## [2.12.2] - 2026-01-20
9
19
 
10
20
  ### ✨ **New Features**
package/dist/helpers.d.ts CHANGED
@@ -35,6 +35,7 @@ export declare function matchesAgeCriteria(birthdate: string | undefined, criter
35
35
  minAge?: number;
36
36
  maxAge?: number;
37
37
  birthYear?: number;
38
+ agePreferenceLenient?: boolean;
38
39
  }): boolean;
39
40
  /**
40
41
  * Calculate birth year from age
package/dist/helpers.js CHANGED
@@ -103,8 +103,13 @@ function isChild(birthdate) {
103
103
  */
104
104
  function matchesAgeCriteria(birthdate, criteria) {
105
105
  const age = calculateAgeSafe(birthdate);
106
- // If no birthdate, only match if preference is 'any'
106
+ // If no birthdate, match based on lenient setting
107
107
  if (age === null) {
108
+ if (criteria.agePreferenceLenient) {
109
+ // Lenient mode: include profiles without birthdates regardless of agePreference
110
+ return true;
111
+ }
112
+ // Strict mode (default): only match if preference is 'any'
108
113
  return criteria.agePreference === 'any' || criteria.agePreference === undefined;
109
114
  }
110
115
  // Check age preference
@@ -377,7 +377,8 @@ class PersonMatcher {
377
377
  agePreference: options.agePreference,
378
378
  minAge: options.minAge,
379
379
  maxAge: options.maxAge,
380
- birthYear: options.birthYear
380
+ birthYear: options.birthYear,
381
+ agePreferenceLenient: options.agePreferenceLenient
381
382
  });
382
383
  });
383
384
  }
@@ -164,7 +164,8 @@ class MatchScorer {
164
164
  agePreference: options.agePreference,
165
165
  minAge: options.minAge,
166
166
  maxAge: options.maxAge,
167
- birthYear: options.birthYear
167
+ birthYear: options.birthYear,
168
+ agePreferenceLenient: options.agePreferenceLenient
168
169
  });
169
170
  if (!matches) {
170
171
  return 0; // No match
@@ -70,6 +70,12 @@ export interface PersonMatchOptions {
70
70
  addMissingContactInfo?: boolean;
71
71
  /** Age preference filter: 'adults' (18+), 'children' (<18), or 'any' */
72
72
  agePreference?: 'adults' | 'children' | 'any';
73
+ /**
74
+ * When true, age preference filters only apply to profiles with birthdates.
75
+ * Profiles without birthdates are included regardless of agePreference.
76
+ * When false (default), profiles without birthdates only match when agePreference is 'any'.
77
+ */
78
+ agePreferenceLenient?: boolean;
73
79
  /** Minimum age filter */
74
80
  minAge?: number;
75
81
  /** Maximum age filter */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rachelallyson/planning-center-people-ts",
3
- "version": "2.12.2",
3
+ "version": "2.13.0",
4
4
  "description": "A strictly typed TypeScript client for Planning Center Online People API with comprehensive functionality and enhanced developer experience",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",