@rachelallyson/planning-center-people-ts 2.6.1 → 2.6.2

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,51 @@ 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.6.2] - 2025-01-10
9
+
10
+ ### 🎯 **TYPE DEFINITION ENHANCEMENT**
11
+
12
+ This patch release adds enhanced type definitions for better TypeScript support and developer experience.
13
+
14
+ ### Added
15
+
16
+ - **📝 FieldDataType Type**: Added comprehensive type definition for field data types
17
+ - **Types**: `'boolean' | 'checkboxes' | 'date' | 'file' | 'number' | 'select' | 'string' | 'text'`
18
+ - **Usage**: Provides type safety for field definition operations
19
+ - **Benefits**: Better IntelliSense and compile-time validation
20
+
21
+ ### Enhanced Type Safety
22
+
23
+ ```typescript
24
+ // Now you get full type safety for field data types
25
+ const fieldDefinition: FieldDefinitionAttributes = {
26
+ data_type: 'select', // ✅ TypeScript knows this is valid
27
+ // ... other properties
28
+ };
29
+
30
+ // Invalid types will be caught at compile time
31
+ const invalidField = {
32
+ data_type: 'invalid', // ❌ TypeScript error
33
+ };
34
+ ```
35
+
36
+ ### Migration
37
+
38
+ No breaking changes - this is a type enhancement release:
39
+
40
+ ```typescript
41
+ // Existing code continues to work
42
+ const fields = await client.people.getFieldDefinitions();
43
+
44
+ // New type safety benefits
45
+ fields.data.forEach(field => {
46
+ if (field.attributes.data_type === 'select') {
47
+ // TypeScript knows this is a select field
48
+ console.log('Select field:', field.attributes.name);
49
+ }
50
+ });
51
+ ```
52
+
8
53
  ## [2.6.1] - 2025-01-10
9
54
 
10
55
  ### 🐛 **CRITICAL BUG FIXES**
@@ -1,6 +1,6 @@
1
1
  import { PcoClientState } from '../core';
2
2
  import type { ErrorContext } from '../error-handling';
3
- import { FieldDataList, FieldDataSingle, FieldDefinitionsList, FieldDefinitionSingle, FieldOptionAttributes, FieldOptionSingle, FieldOptionsList, TabsList } from '../types';
3
+ import { FieldDataList, FieldDataSingle, FieldDataType, FieldDefinitionsList, FieldDefinitionSingle, FieldOptionAttributes, FieldOptionSingle, FieldOptionsList, TabsList } from '../types';
4
4
  /**
5
5
  * Delete field data for a person
6
6
  */
@@ -46,7 +46,7 @@ export declare function getTabs(client: PcoClientState, params?: {
46
46
  */
47
47
  export declare function createFieldDefinition(client: PcoClientState, tabId: string, data: {
48
48
  name: string;
49
- data_type: string;
49
+ data_type: FieldDataType;
50
50
  sequence?: number;
51
51
  slug?: string;
52
52
  config?: string | Record<string, any>;
@@ -128,9 +128,10 @@ export interface SocialProfileResource extends ResourceObject<'SocialProfile', S
128
128
  }
129
129
  export type SocialProfilesList = Paginated<SocialProfileResource>;
130
130
  export type SocialProfileSingle = Response<SocialProfileResource>;
131
+ export type FieldDataType = 'boolean' | 'checkboxes' | 'date' | 'file' | 'number' | 'select' | 'string' | 'text';
131
132
  export interface FieldDefinitionAttributes extends Attributes {
132
133
  config: string | Record<string, any> | null;
133
- data_type: string;
134
+ data_type: FieldDataType;
134
135
  deleted_at: string | null | false;
135
136
  name: string;
136
137
  sequence: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rachelallyson/planning-center-people-ts",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "A strictly typed TypeScript client for Planning Center Online People API with smart matching, batch operations, and enhanced developer experience",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",