@rachelallyson/planning-center-people-ts 2.8.0 → 2.9.1

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/LICENSE +1 -1
  3. package/README.md +12 -14
  4. package/dist/client-manager.js +5 -3
  5. package/dist/client.d.ts +8 -8
  6. package/dist/client.js +8 -11
  7. package/dist/core/http.d.ts +1 -1
  8. package/dist/core/http.js +15 -11
  9. package/dist/core.d.ts +3 -3
  10. package/dist/core.js +4 -4
  11. package/dist/error-handling.d.ts +1 -1
  12. package/dist/error-handling.js +3 -3
  13. package/dist/error-scenarios.js +4 -4
  14. package/dist/index.d.ts +8 -8
  15. package/dist/index.js +15 -15
  16. package/dist/matching/matcher.d.ts +22 -0
  17. package/dist/matching/matcher.js +251 -20
  18. package/dist/matching/scoring.d.ts +9 -7
  19. package/dist/matching/scoring.js +49 -20
  20. package/dist/matching/strategies.d.ts +1 -0
  21. package/dist/matching/strategies.js +15 -2
  22. package/dist/modules/campus.d.ts +5 -5
  23. package/dist/modules/campus.js +2 -2
  24. package/dist/modules/contacts.d.ts +1 -1
  25. package/dist/modules/contacts.js +2 -2
  26. package/dist/modules/fields.d.ts +4 -4
  27. package/dist/modules/fields.js +2 -2
  28. package/dist/modules/forms.d.ts +7 -4
  29. package/dist/modules/forms.js +5 -2
  30. package/dist/modules/households.d.ts +2 -2
  31. package/dist/modules/households.js +2 -2
  32. package/dist/modules/lists.d.ts +2 -2
  33. package/dist/modules/lists.js +2 -2
  34. package/dist/modules/notes.d.ts +2 -2
  35. package/dist/modules/notes.js +2 -2
  36. package/dist/modules/people.d.ts +57 -5
  37. package/dist/modules/people.js +38 -8
  38. package/dist/modules/reports.d.ts +5 -5
  39. package/dist/modules/reports.js +2 -2
  40. package/dist/modules/service-time.d.ts +5 -5
  41. package/dist/modules/service-time.js +2 -2
  42. package/dist/modules/workflows.d.ts +2 -2
  43. package/dist/modules/workflows.js +2 -2
  44. package/dist/people/contacts.d.ts +1 -1
  45. package/dist/people/core.d.ts +1 -1
  46. package/dist/people/fields.d.ts +1 -1
  47. package/dist/people/fields.js +4 -4
  48. package/dist/people/households.d.ts +1 -1
  49. package/dist/people/lists.d.ts +1 -1
  50. package/dist/people/notes.d.ts +1 -1
  51. package/dist/people/organization.d.ts +1 -1
  52. package/dist/people/workflows.d.ts +1 -1
  53. package/dist/types/client.d.ts +3 -96
  54. package/dist/types/client.js +2 -0
  55. package/dist/types/index.d.ts +1 -2
  56. package/dist/types/index.js +0 -2
  57. package/dist/types/people.d.ts +15 -15
  58. package/package.json +15 -17
  59. package/dist/api-error.d.ts +0 -10
  60. package/dist/api-error.js +0 -32
  61. package/dist/batch.d.ts +0 -47
  62. package/dist/batch.js +0 -376
  63. package/dist/modules/base.d.ts +0 -46
  64. package/dist/modules/base.js +0 -82
  65. package/dist/monitoring.d.ts +0 -53
  66. package/dist/monitoring.js +0 -142
  67. package/dist/rate-limiter.d.ts +0 -79
  68. package/dist/rate-limiter.js +0 -137
  69. package/dist/types/batch.d.ts +0 -50
  70. package/dist/types/batch.js +0 -5
  71. package/dist/types/events.d.ts +0 -85
  72. package/dist/types/events.js +0 -5
@@ -4,8 +4,8 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ListsModule = void 0;
7
- const base_1 = require("./base");
8
- class ListsModule extends base_1.BaseModule {
7
+ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
8
+ class ListsModule extends planning_center_base_ts_1.BaseModule {
9
9
  /**
10
10
  * Get all lists
11
11
  */
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * v2.0.0 Notes Module
3
3
  */
4
- import { BaseModule } from './base';
5
- import type { PaginationOptions, PaginationResult } from '../core/pagination';
4
+ import { BaseModule } from '@rachelallyson/planning-center-base-ts';
5
+ import type { PaginationOptions, PaginationResult } from '@rachelallyson/planning-center-base-ts';
6
6
  import type { NoteResource, NoteAttributes, NoteCategoryResource, NoteCategoryAttributes } from '../types';
7
7
  export interface NotesListOptions {
8
8
  where?: Record<string, any>;
@@ -4,8 +4,8 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.NotesModule = void 0;
7
- const base_1 = require("./base");
8
- class NotesModule extends base_1.BaseModule {
7
+ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
8
+ class NotesModule extends planning_center_base_ts_1.BaseModule {
9
9
  /**
10
10
  * Get all notes
11
11
  */
@@ -1,11 +1,8 @@
1
1
  /**
2
2
  * v2.0.0 People Module
3
3
  */
4
- import { BaseModule } from './base';
5
- import type { PcoHttpClient } from '../core/http';
6
- import type { PaginationHelper } from '../core/pagination';
7
- import type { PcoEventEmitter } from '../monitoring';
8
- import type { PaginationOptions, PaginationResult } from '../core/pagination';
4
+ import { BaseModule } from '@rachelallyson/planning-center-base-ts';
5
+ import type { PcoHttpClient, PaginationHelper, PcoEventEmitter, PaginationOptions, PaginationResult } from '@rachelallyson/planning-center-base-ts';
9
6
  import type { PersonResource, EmailResource, EmailAttributes, PhoneNumberResource, PhoneNumberAttributes, AddressResource, AddressAttributes, SocialProfileResource, SocialProfileAttributes, CampusResource, HouseholdResource } from '../types';
10
7
  export interface PeopleListOptions {
11
8
  where?: Record<string, any>;
@@ -42,17 +39,42 @@ export interface PersonCreateOptions {
42
39
  inactivatedAt?: string;
43
40
  resourcePermissionFlags?: Record<string, boolean>;
44
41
  }
42
+ /**
43
+ * Options for finding or creating a person with smart matching
44
+ */
45
45
  export interface PersonMatchOptions {
46
+ /** Person's first name */
46
47
  firstName?: string;
48
+ /** Person's last name */
47
49
  lastName?: string;
50
+ /** Person's email address */
48
51
  email?: string;
52
+ /** Person's phone number */
49
53
  phone?: string;
54
+ /**
55
+ * Matching strategy to use:
56
+ * - 'exact': Only return matches with verified email/phone matches (high confidence)
57
+ * - 'fuzzy': Return best match above threshold (default)
58
+ * - 'aggressive': Return best match with lower threshold
59
+ */
50
60
  matchStrategy?: 'exact' | 'fuzzy' | 'aggressive';
61
+ /** Campus ID to associate with the person */
51
62
  campusId?: string;
63
+ /** If true, create a new person if no match is found (default: true) */
52
64
  createIfNotFound?: boolean;
65
+ /**
66
+ * If true, automatically add missing email/phone contact information to a person's profile
67
+ * when a match is found. Missing contacts are added as non-primary to avoid overriding
68
+ * existing primary contacts. (default: false)
69
+ */
70
+ addMissingContactInfo?: boolean;
71
+ /** Age preference filter: 'adults' (18+), 'children' (<18), or 'any' */
53
72
  agePreference?: 'adults' | 'children' | 'any';
73
+ /** Minimum age filter */
54
74
  minAge?: number;
75
+ /** Maximum age filter */
55
76
  maxAge?: number;
77
+ /** Birth year filter (exact match) */
56
78
  birthYear?: number;
57
79
  }
58
80
  export declare class PeopleModule extends BaseModule {
@@ -176,6 +198,36 @@ export declare class PeopleModule extends BaseModule {
176
198
  }>;
177
199
  /**
178
200
  * Find or create a person with smart matching
201
+ *
202
+ * This method uses intelligent matching logic to find existing people or create new ones.
203
+ * It verifies email/phone matches and only uses name matching when appropriate.
204
+ *
205
+ * @param options - Matching options including name, contact info, and matching preferences
206
+ * @param options.addMissingContactInfo - If true, automatically adds missing email/phone
207
+ * to a person's profile when a match is found. The contacts are added as non-primary
208
+ * to preserve existing primary contacts.
209
+ *
210
+ * @example
211
+ * ```typescript
212
+ * // Basic find or create
213
+ * const person = await client.people.findOrCreate({
214
+ * firstName: 'John',
215
+ * lastName: 'Doe',
216
+ * email: 'john@example.com',
217
+ * phone: '+1234567890'
218
+ * });
219
+ *
220
+ * // Find and add missing contact info if match found
221
+ * const person = await client.people.findOrCreate({
222
+ * firstName: 'Jane',
223
+ * lastName: 'Smith',
224
+ * email: 'jane@example.com',
225
+ * phone: '+1987654321',
226
+ * addMissingContactInfo: true // Will add phone if person only has email
227
+ * });
228
+ * ```
229
+ *
230
+ * @returns The found or newly created person
179
231
  */
180
232
  findOrCreate(options: PersonMatchOptions): Promise<PersonResource>;
181
233
  /**
@@ -4,9 +4,9 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.PeopleModule = void 0;
7
- const base_1 = require("./base");
7
+ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
8
8
  const matcher_1 = require("../matching/matcher");
9
- class PeopleModule extends base_1.BaseModule {
9
+ class PeopleModule extends planning_center_base_ts_1.BaseModule {
10
10
  constructor(httpClient, paginationHelper, eventEmitter) {
11
11
  super(httpClient, paginationHelper, eventEmitter);
12
12
  this.personMatcher = new matcher_1.PersonMatcher(this);
@@ -89,7 +89,7 @@ class PeopleModule extends base_1.BaseModule {
89
89
  return this.httpClient.request({
90
90
  method: 'GET',
91
91
  endpoint: `/campuses/${campusData.id}`
92
- }).then(response => response.data);
92
+ }).then(response => response.data.data);
93
93
  }
94
94
  /**
95
95
  * Set a person's primary campus
@@ -107,7 +107,7 @@ class PeopleModule extends base_1.BaseModule {
107
107
  }
108
108
  }
109
109
  }
110
- }).then(response => response.data);
110
+ }).then(response => response.data.data);
111
111
  }
112
112
  /**
113
113
  * Remove a person's primary campus
@@ -125,7 +125,7 @@ class PeopleModule extends base_1.BaseModule {
125
125
  }
126
126
  }
127
127
  }
128
- }).then(response => response.data);
128
+ }).then(response => response.data.data);
129
129
  }
130
130
  /**
131
131
  * Get a person's household
@@ -140,7 +140,7 @@ class PeopleModule extends base_1.BaseModule {
140
140
  return this.httpClient.request({
141
141
  method: 'GET',
142
142
  endpoint: `/households/${householdData.id}`
143
- }).then(response => response.data);
143
+ }).then(response => response.data.data);
144
144
  }
145
145
  /**
146
146
  * Set a person's household
@@ -158,7 +158,7 @@ class PeopleModule extends base_1.BaseModule {
158
158
  }
159
159
  }
160
160
  }
161
- }).then(response => response.data);
161
+ }).then(response => response.data.data);
162
162
  }
163
163
  /**
164
164
  * Remove a person from their household
@@ -176,7 +176,7 @@ class PeopleModule extends base_1.BaseModule {
176
176
  }
177
177
  }
178
178
  }
179
- }).then(response => response.data);
179
+ }).then(response => response.data.data);
180
180
  }
181
181
  /**
182
182
  * Get all people in a specific household
@@ -280,6 +280,36 @@ class PeopleModule extends base_1.BaseModule {
280
280
  }
281
281
  /**
282
282
  * Find or create a person with smart matching
283
+ *
284
+ * This method uses intelligent matching logic to find existing people or create new ones.
285
+ * It verifies email/phone matches and only uses name matching when appropriate.
286
+ *
287
+ * @param options - Matching options including name, contact info, and matching preferences
288
+ * @param options.addMissingContactInfo - If true, automatically adds missing email/phone
289
+ * to a person's profile when a match is found. The contacts are added as non-primary
290
+ * to preserve existing primary contacts.
291
+ *
292
+ * @example
293
+ * ```typescript
294
+ * // Basic find or create
295
+ * const person = await client.people.findOrCreate({
296
+ * firstName: 'John',
297
+ * lastName: 'Doe',
298
+ * email: 'john@example.com',
299
+ * phone: '+1234567890'
300
+ * });
301
+ *
302
+ * // Find and add missing contact info if match found
303
+ * const person = await client.people.findOrCreate({
304
+ * firstName: 'Jane',
305
+ * lastName: 'Smith',
306
+ * email: 'jane@example.com',
307
+ * phone: '+1987654321',
308
+ * addMissingContactInfo: true // Will add phone if person only has email
309
+ * });
310
+ * ```
311
+ *
312
+ * @returns The found or newly created person
283
313
  */
284
314
  async findOrCreate(options) {
285
315
  return this.personMatcher.findOrCreate(options);
@@ -1,8 +1,8 @@
1
- import { BaseModule } from './base';
2
- import type { PcoHttpClient } from '../core/http';
3
- import type { PaginationHelper } from '../core/pagination';
4
- import type { PcoEventEmitter } from '../monitoring';
5
- import type { PaginationOptions, PaginationResult } from '../core/pagination';
1
+ import { BaseModule } from '@rachelallyson/planning-center-base-ts';
2
+ import type { PcoHttpClient } from '@rachelallyson/planning-center-base-ts';
3
+ import type { PaginationHelper } from '@rachelallyson/planning-center-base-ts';
4
+ import type { PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
5
+ import type { PaginationOptions, PaginationResult } from '@rachelallyson/planning-center-base-ts';
6
6
  import type { ReportResource, ReportAttributes, ReportsList, PersonResource } from '../types';
7
7
  /**
8
8
  * Reports module for managing report-related operations
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ReportsModule = void 0;
4
- const base_1 = require("./base");
4
+ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
5
5
  /**
6
6
  * Reports module for managing report-related operations
7
7
  */
8
- class ReportsModule extends base_1.BaseModule {
8
+ class ReportsModule extends planning_center_base_ts_1.BaseModule {
9
9
  constructor(httpClient, paginationHelper, eventEmitter) {
10
10
  super(httpClient, paginationHelper, eventEmitter);
11
11
  }
@@ -1,8 +1,8 @@
1
- import { BaseModule } from './base';
2
- import type { PcoHttpClient } from '../core/http';
3
- import type { PaginationHelper } from '../core/pagination';
4
- import type { PcoEventEmitter } from '../monitoring';
5
- import type { PaginationOptions, PaginationResult } from '../core/pagination';
1
+ import { BaseModule } from '@rachelallyson/planning-center-base-ts';
2
+ import type { PcoHttpClient } from '@rachelallyson/planning-center-base-ts';
3
+ import type { PaginationHelper } from '@rachelallyson/planning-center-base-ts';
4
+ import type { PcoEventEmitter } from '@rachelallyson/planning-center-base-ts';
5
+ import type { PaginationOptions, PaginationResult } from '@rachelallyson/planning-center-base-ts';
6
6
  import type { ServiceTimeResource, ServiceTimeAttributes, ServiceTimesList } from '../types';
7
7
  /**
8
8
  * ServiceTime module for managing service time-related operations
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ServiceTimeModule = void 0;
4
- const base_1 = require("./base");
4
+ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
5
5
  /**
6
6
  * ServiceTime module for managing service time-related operations
7
7
  * ServiceTimes are campus-scoped resources
8
8
  */
9
- class ServiceTimeModule extends base_1.BaseModule {
9
+ class ServiceTimeModule extends planning_center_base_ts_1.BaseModule {
10
10
  constructor(httpClient, paginationHelper, eventEmitter) {
11
11
  super(httpClient, paginationHelper, eventEmitter);
12
12
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * v2.0.0 Workflows Module
3
3
  */
4
- import { BaseModule } from './base';
5
- import type { PaginationOptions, PaginationResult } from '../core/pagination';
4
+ import { BaseModule } from '@rachelallyson/planning-center-base-ts';
5
+ import type { PaginationOptions, PaginationResult } from '@rachelallyson/planning-center-base-ts';
6
6
  import type { WorkflowResource, WorkflowAttributes, WorkflowCardResource, WorkflowCardAssignableAttributes, WorkflowCardSnoozeAttributes, WorkflowCardEmailAttributes, WorkflowCardNoteResource, WorkflowCardNoteAttributes } from '../types';
7
7
  export interface WorkflowListOptions {
8
8
  where?: Record<string, any>;
@@ -4,8 +4,8 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.WorkflowsModule = void 0;
7
- const base_1 = require("./base");
8
- class WorkflowsModule extends base_1.BaseModule {
7
+ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
8
+ class WorkflowsModule extends planning_center_base_ts_1.BaseModule {
9
9
  /**
10
10
  * Get all workflows
11
11
  */
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { AddressAttributes, AddressesList, AddressSingle, EmailAttributes, EmailSingle, EmailsList, PhoneNumberAttributes, PhoneNumberSingle, PhoneNumbersList, SocialProfileAttributes, SocialProfileSingle, SocialProfilesList } from '../types';
4
4
  /**
5
5
  * Get all emails for a person
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { PeopleList, PersonAttributes, PersonSingle } from '../types';
4
4
  /**
5
5
  * Get all people with optional filtering and pagination
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { FieldDataList, FieldDataSingle, FieldDataType, FieldDefinitionsList, FieldDefinitionSingle, FieldOptionAttributes, FieldOptionSingle, FieldOptionsList, TabsList } from '../types';
4
4
  /**
5
5
  * Delete field data for a person
@@ -11,7 +11,7 @@ exports.createFieldDefinition = createFieldDefinition;
11
11
  exports.deleteFieldDefinition = deleteFieldDefinition;
12
12
  exports.createPersonFieldData = createPersonFieldData;
13
13
  const core_1 = require("../core");
14
- const error_handling_1 = require("../error-handling");
14
+ const planning_center_base_ts_1 = require("@rachelallyson/planning-center-base-ts");
15
15
  const helpers_1 = require("../helpers");
16
16
  /**
17
17
  * Create field data for a person (internal)
@@ -53,7 +53,7 @@ async function getPersonFieldData(client, personId, context) {
53
53
  * Upload a file to PCO and create field data (internal)
54
54
  */
55
55
  async function createPersonFileFieldDataInternal(client, personId, fieldDefinitionId, fileUrl, context) {
56
- return (0, error_handling_1.withErrorBoundary)(async () => {
56
+ return (0, planning_center_base_ts_1.withErrorBoundary)(async () => {
57
57
  // No external dependencies needed - using native fetch API
58
58
  // Extract filename from URL
59
59
  const urlParts = fileUrl.split('/');
@@ -140,8 +140,8 @@ async function createPersonFileFieldDataInternal(client, personId, fieldDefiniti
140
140
  });
141
141
  }, {
142
142
  ...context,
143
- category: error_handling_1.ErrorCategory.EXTERNAL_API,
144
- severity: error_handling_1.ErrorSeverity.HIGH,
143
+ category: planning_center_base_ts_1.ErrorCategory.EXTERNAL_API,
144
+ severity: planning_center_base_ts_1.ErrorSeverity.HIGH,
145
145
  });
146
146
  }
147
147
  /**
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { HouseholdSingle, HouseholdsList } from '../types';
4
4
  /**
5
5
  * Get all households
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { ListCategoriesList, ListSingle, ListsList } from '../types';
4
4
  /**
5
5
  * Get all lists
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { NoteCategoriesList, NoteSingle, NotesList } from '../types';
4
4
  /**
5
5
  * Get all notes
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { OrganizationSingle } from '../types';
4
4
  /**
5
5
  * Get organization information
@@ -1,5 +1,5 @@
1
1
  import { PcoClientState } from '../core';
2
- import type { ErrorContext } from '../error-handling';
2
+ import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
3
3
  import { WorkflowCardNoteAttributes, WorkflowCardNoteSingle, WorkflowCardNotesList, WorkflowCardSingle, WorkflowCardsList, WorkflowSingle, WorkflowsList } from '../types';
4
4
  /**
5
5
  * List notes for a workflow card
@@ -1,99 +1,6 @@
1
1
  /**
2
2
  * v2.0.0 Client Configuration Types
3
+ *
4
+ * Re-exports from base package for convenience
3
5
  */
4
- /** Authentication configuration for Personal Access Token */
5
- export interface PersonalAccessTokenAuth {
6
- type: 'personal_access_token';
7
- personalAccessToken: string;
8
- }
9
- /** Authentication configuration for OAuth 2.0 with required refresh handling */
10
- export interface OAuthAuth {
11
- type: 'oauth';
12
- accessToken: string;
13
- refreshToken: string;
14
- onRefresh: (tokens: {
15
- accessToken: string;
16
- refreshToken: string;
17
- }) => void | Promise<void>;
18
- onRefreshFailure: (error: Error) => void | Promise<void>;
19
- /** Client ID for token refresh (optional, can use environment variable PCO_APP_ID) */
20
- clientId?: string;
21
- /** Client Secret for token refresh (optional, can use environment variable PCO_APP_SECRET) */
22
- clientSecret?: string;
23
- }
24
- /** Authentication configuration for Basic Auth with app credentials */
25
- export interface BasicAuth {
26
- type: 'basic';
27
- appId: string;
28
- appSecret: string;
29
- }
30
- /** Union type for authentication configurations */
31
- export type PcoAuthConfig = PersonalAccessTokenAuth | OAuthAuth | BasicAuth;
32
- export interface PcoClientConfig {
33
- /** Authentication configuration */
34
- auth: PcoAuthConfig;
35
- /** Caching configuration */
36
- caching?: {
37
- fieldDefinitions?: boolean;
38
- ttl?: number;
39
- maxSize?: number;
40
- };
41
- /** Retry configuration */
42
- retry?: {
43
- enabled?: boolean;
44
- maxRetries?: number;
45
- baseDelay?: number;
46
- maxDelay?: number;
47
- backoff?: 'linear' | 'exponential';
48
- };
49
- /** Event handlers */
50
- events?: {
51
- onError?: (event: ErrorEvent) => void | Promise<void>;
52
- onAuthFailure?: (event: AuthFailureEvent) => void | Promise<void>;
53
- onRequestStart?: (event: RequestStartEvent) => void | Promise<void>;
54
- onRequestComplete?: (event: RequestCompleteEvent) => void | Promise<void>;
55
- onRateLimit?: (event: RateLimitEvent) => void | Promise<void>;
56
- };
57
- /** Base URL override */
58
- baseURL?: string;
59
- /** Request timeout in milliseconds */
60
- timeout?: number;
61
- /** Custom headers */
62
- headers?: Record<string, string>;
63
- }
64
- export interface ErrorEvent {
65
- error: Error;
66
- operation: string;
67
- timestamp: string;
68
- context?: Record<string, any>;
69
- }
70
- export interface AuthFailureEvent {
71
- error: Error;
72
- timestamp: string;
73
- authType: 'oauth' | 'basic';
74
- }
75
- export interface RequestStartEvent {
76
- endpoint: string;
77
- method: string;
78
- timestamp: string;
79
- requestId: string;
80
- }
81
- export interface RequestCompleteEvent {
82
- endpoint: string;
83
- method: string;
84
- status: number;
85
- duration: number;
86
- timestamp: string;
87
- requestId: string;
88
- }
89
- export interface RateLimitEvent {
90
- limit: number;
91
- remaining: number;
92
- resetTime: string;
93
- timestamp: string;
94
- }
95
- export interface CacheEvent {
96
- key: string;
97
- operation: 'hit' | 'miss' | 'set' | 'invalidate';
98
- timestamp: string;
99
- }
6
+ export type { PcoClientConfig, PcoAuthConfig, PersonalAccessTokenAuth, OAuthAuth, BasicAuth, ErrorEvent, AuthFailureEvent, RequestStartEvent, RequestCompleteEvent, RateLimitEvent, CacheEvent, } from '@rachelallyson/planning-center-base-ts';
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * v2.0.0 Client Configuration Types
4
+ *
5
+ * Re-exports from base package for convenience
4
6
  */
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,3 @@
1
- export * from './json-api';
1
+ export type { JsonValue, Meta, LinkObject, Link, Links, PaginationLinks, TopLevelLinks, TopLevelJsonApi, ResourceIdentifier, Relationship, ToOne, ToMany, Attributes, ResourceObject, JsonApiBase, ErrorObject, ErrorDocument, DataDocumentSingle, DataDocumentMany, JsonApiDocument, Paginated, Response, } from '@rachelallyson/planning-center-base-ts';
2
2
  export * from './people';
3
- export type { Paginated, Relationship, ResourceIdentifier, ResourceObject, } from './json-api';
4
3
  export type { AddressAttributes, AddressesList, AddressResource, AddressSingle, EmailAttributes, EmailResource, EmailSingle, EmailsList, FieldDefinitionAttributes, FieldDefinitionResource, FieldDefinitionSingle, FieldDefinitionsList, FieldOptionAttributes, FieldOptionResource, FieldOptionSingle, FieldOptionsList, HouseholdAttributes, HouseholdResource, HouseholdSingle, HouseholdsList, PeopleList, PersonAttributes, PersonRelationships, PersonResource, PersonSingle, PhoneNumberAttributes, PhoneNumberResource, PhoneNumberSingle, PhoneNumbersList, SocialProfileAttributes, SocialProfileResource, SocialProfileSingle, SocialProfilesList, } from './people';
@@ -14,7 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- // Export all JSON:API types
18
- __exportStar(require("./json-api"), exports);
19
17
  // Export all People-specific types
20
18
  __exportStar(require("./people"), exports);
@@ -6,16 +6,16 @@ import { Attributes, Paginated, Relationship, ResourceObject, Response } from '.
6
6
  export interface PersonAttributes extends Attributes {
7
7
  first_name?: string;
8
8
  last_name?: string;
9
- given_name?: string;
10
- middle_name?: string;
11
- nickname?: string;
9
+ given_name?: string | null;
10
+ middle_name?: string | null;
11
+ nickname?: string | null;
12
12
  birthdate?: string;
13
- anniversary?: string;
14
- gender?: string;
15
- grade?: string;
13
+ anniversary?: string | null;
14
+ gender?: string | null;
15
+ grade?: string | null;
16
16
  child?: boolean;
17
17
  status?: string;
18
- medical_notes?: string;
18
+ medical_notes?: string | null;
19
19
  created_at?: string;
20
20
  updated_at?: string;
21
21
  name?: string;
@@ -23,7 +23,7 @@ export interface PersonAttributes extends Attributes {
23
23
  job_title?: string;
24
24
  employer?: string;
25
25
  school?: string;
26
- graduation_year?: string;
26
+ graduation_year?: string | null;
27
27
  avatar?: string;
28
28
  site_administrator?: boolean;
29
29
  accounting_administrator?: boolean;
@@ -315,7 +315,7 @@ export interface WorkflowCardAttributes extends Attributes {
315
315
  stage?: string;
316
316
  completed_at?: string | null;
317
317
  overdue?: boolean;
318
- calculated_due_at_in_days_ago?: number;
318
+ calculated_due_at_in_days_ago?: number | null;
319
319
  flagged_for_notification_at?: string | null;
320
320
  moved_to_step_at?: string | null;
321
321
  snooze_until?: string | null;
@@ -385,18 +385,18 @@ export type OrganizationStatisticsList = Paginated<OrganizationStatisticResource
385
385
  export type OrganizationStatisticSingle = Response<OrganizationStatisticResource>;
386
386
  export interface CampusAttributes extends Attributes {
387
387
  name: string;
388
- latitude?: number;
389
- longitude?: number;
388
+ latitude?: string | null;
389
+ longitude?: string | null;
390
390
  description?: string;
391
391
  street?: string;
392
392
  city?: string;
393
393
  state?: string;
394
394
  zip?: string;
395
395
  country?: string;
396
- phone_number?: string;
397
- website?: string;
398
- twenty_four_hour_time?: boolean;
399
- date_format?: number;
396
+ phone_number?: string | null;
397
+ website?: string | null;
398
+ twenty_four_hour_time?: boolean | null;
399
+ date_format?: number | null;
400
400
  church_center_enabled?: boolean;
401
401
  created_at?: string;
402
402
  updated_at?: string;