@rachelallyson/planning-center-people-ts 1.1.0 → 2.1.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 +181 -0
- package/README.md +16 -0
- package/dist/batch.d.ts +47 -0
- package/dist/batch.js +376 -0
- package/dist/client-manager.d.ts +66 -0
- package/dist/client-manager.js +156 -0
- package/dist/client.d.ts +71 -0
- package/dist/client.js +123 -0
- package/dist/core/http.d.ts +48 -0
- package/dist/core/http.js +265 -0
- package/dist/core/pagination.d.ts +34 -0
- package/dist/core/pagination.js +164 -0
- package/dist/index.d.ts +13 -3
- package/dist/index.js +23 -5
- package/dist/matching/matcher.d.ts +41 -0
- package/dist/matching/matcher.js +161 -0
- package/dist/matching/scoring.d.ts +35 -0
- package/dist/matching/scoring.js +141 -0
- package/dist/matching/strategies.d.ts +35 -0
- package/dist/matching/strategies.js +79 -0
- package/dist/modules/base.d.ts +46 -0
- package/dist/modules/base.js +82 -0
- package/dist/modules/contacts.d.ts +103 -0
- package/dist/modules/contacts.js +130 -0
- package/dist/modules/fields.d.ts +157 -0
- package/dist/modules/fields.js +294 -0
- package/dist/modules/households.d.ts +42 -0
- package/dist/modules/households.js +74 -0
- package/dist/modules/lists.d.ts +62 -0
- package/dist/modules/lists.js +92 -0
- package/dist/modules/notes.d.ts +74 -0
- package/dist/modules/notes.js +125 -0
- package/dist/modules/people.d.ts +196 -0
- package/dist/modules/people.js +221 -0
- package/dist/modules/workflows.d.ts +131 -0
- package/dist/modules/workflows.js +221 -0
- package/dist/monitoring.d.ts +53 -0
- package/dist/monitoring.js +142 -0
- package/dist/testing/index.d.ts +9 -0
- package/dist/testing/index.js +24 -0
- package/dist/testing/recorder.d.ts +58 -0
- package/dist/testing/recorder.js +195 -0
- package/dist/testing/simple-builders.d.ts +33 -0
- package/dist/testing/simple-builders.js +124 -0
- package/dist/testing/simple-factories.d.ts +91 -0
- package/dist/testing/simple-factories.js +288 -0
- package/dist/testing/types.d.ts +160 -0
- package/dist/testing/types.js +5 -0
- package/dist/types/batch.d.ts +50 -0
- package/dist/types/batch.js +5 -0
- package/dist/types/client.d.ts +89 -0
- package/dist/types/client.js +5 -0
- package/dist/types/events.d.ts +85 -0
- package/dist/types/events.js +5 -0
- package/dist/types/people.d.ts +20 -1
- package/package.json +9 -3
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.0.0 Event System Types
|
|
3
|
+
*/
|
|
4
|
+
export type EventType = 'request:start' | 'request:complete' | 'request:error' | 'auth:success' | 'auth:failure' | 'auth:refresh' | 'rate:limit' | 'rate:available' | 'cache:hit' | 'cache:miss' | 'cache:set' | 'cache:invalidate' | 'error';
|
|
5
|
+
export interface BaseEvent {
|
|
6
|
+
type: EventType;
|
|
7
|
+
timestamp: string;
|
|
8
|
+
requestId?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RequestStartEvent extends BaseEvent {
|
|
11
|
+
type: 'request:start';
|
|
12
|
+
endpoint: string;
|
|
13
|
+
method: string;
|
|
14
|
+
requestId: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RequestCompleteEvent extends BaseEvent {
|
|
17
|
+
type: 'request:complete';
|
|
18
|
+
endpoint: string;
|
|
19
|
+
method: string;
|
|
20
|
+
status: number;
|
|
21
|
+
duration: number;
|
|
22
|
+
requestId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RequestErrorEvent extends BaseEvent {
|
|
25
|
+
type: 'request:error';
|
|
26
|
+
endpoint: string;
|
|
27
|
+
method: string;
|
|
28
|
+
error: Error;
|
|
29
|
+
requestId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface AuthSuccessEvent extends BaseEvent {
|
|
32
|
+
type: 'auth:success';
|
|
33
|
+
authType: 'oauth' | 'basic';
|
|
34
|
+
}
|
|
35
|
+
export interface AuthFailureEvent extends BaseEvent {
|
|
36
|
+
type: 'auth:failure';
|
|
37
|
+
authType: 'oauth' | 'basic';
|
|
38
|
+
error: Error;
|
|
39
|
+
}
|
|
40
|
+
export interface AuthRefreshEvent extends BaseEvent {
|
|
41
|
+
type: 'auth:refresh';
|
|
42
|
+
authType: 'oauth';
|
|
43
|
+
success: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface RateLimitEvent extends BaseEvent {
|
|
46
|
+
type: 'rate:limit';
|
|
47
|
+
limit: number;
|
|
48
|
+
remaining: number;
|
|
49
|
+
resetTime: string;
|
|
50
|
+
}
|
|
51
|
+
export interface RateAvailableEvent extends BaseEvent {
|
|
52
|
+
type: 'rate:available';
|
|
53
|
+
limit: number;
|
|
54
|
+
remaining: number;
|
|
55
|
+
}
|
|
56
|
+
export interface CacheHitEvent extends BaseEvent {
|
|
57
|
+
type: 'cache:hit';
|
|
58
|
+
key: string;
|
|
59
|
+
}
|
|
60
|
+
export interface CacheMissEvent extends BaseEvent {
|
|
61
|
+
type: 'cache:miss';
|
|
62
|
+
key: string;
|
|
63
|
+
}
|
|
64
|
+
export interface CacheSetEvent extends BaseEvent {
|
|
65
|
+
type: 'cache:set';
|
|
66
|
+
key: string;
|
|
67
|
+
ttl?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface CacheInvalidateEvent extends BaseEvent {
|
|
70
|
+
type: 'cache:invalidate';
|
|
71
|
+
key: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ErrorEvent extends BaseEvent {
|
|
74
|
+
type: 'error';
|
|
75
|
+
error: Error;
|
|
76
|
+
operation: string;
|
|
77
|
+
context?: Record<string, any>;
|
|
78
|
+
}
|
|
79
|
+
export type PcoEvent = RequestStartEvent | RequestCompleteEvent | RequestErrorEvent | AuthSuccessEvent | AuthFailureEvent | AuthRefreshEvent | RateLimitEvent | RateAvailableEvent | CacheHitEvent | CacheMissEvent | CacheSetEvent | CacheInvalidateEvent | ErrorEvent;
|
|
80
|
+
export type EventHandler<T extends PcoEvent = PcoEvent> = (event: T) => void | Promise<void>;
|
|
81
|
+
export interface EventEmitter {
|
|
82
|
+
on<T extends PcoEvent>(eventType: T['type'], handler: EventHandler<T>): void;
|
|
83
|
+
off<T extends PcoEvent>(eventType: T['type'], handler: EventHandler<T>): void;
|
|
84
|
+
emit<T extends PcoEvent>(event: T): void;
|
|
85
|
+
}
|
package/dist/types/people.d.ts
CHANGED
|
@@ -305,15 +305,34 @@ export interface WorkflowCardAttributes extends Attributes {
|
|
|
305
305
|
status?: string;
|
|
306
306
|
created_at?: string;
|
|
307
307
|
updated_at?: string;
|
|
308
|
+
stage?: string;
|
|
308
309
|
completed_at?: string | null;
|
|
309
|
-
|
|
310
|
+
overdue?: boolean;
|
|
311
|
+
calculated_due_at_in_days_ago?: number;
|
|
312
|
+
flagged_for_notification_at?: string | null;
|
|
313
|
+
moved_to_step_at?: string | null;
|
|
310
314
|
snooze_until?: string | null;
|
|
315
|
+
removed_at?: string | null;
|
|
311
316
|
overdue_at?: string | null;
|
|
312
317
|
stage_id?: string;
|
|
313
318
|
}
|
|
319
|
+
export interface WorkflowCardAssignableAttributes {
|
|
320
|
+
sticky_assignment?: boolean;
|
|
321
|
+
assignee_id?: string;
|
|
322
|
+
person_id?: string;
|
|
323
|
+
}
|
|
324
|
+
export interface WorkflowCardSnoozeAttributes {
|
|
325
|
+
duration: number;
|
|
326
|
+
}
|
|
327
|
+
export interface WorkflowCardEmailAttributes {
|
|
328
|
+
subject: string;
|
|
329
|
+
note: string;
|
|
330
|
+
}
|
|
314
331
|
export interface WorkflowCardRelationships {
|
|
315
332
|
workflow?: Relationship;
|
|
316
333
|
person?: Relationship;
|
|
334
|
+
assignee?: Relationship;
|
|
335
|
+
current_step?: Relationship;
|
|
317
336
|
}
|
|
318
337
|
export interface WorkflowCardResource extends ResourceObject<'WorkflowCard', WorkflowCardAttributes, WorkflowCardRelationships> {
|
|
319
338
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rachelallyson/planning-center-people-ts",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A strictly typed TypeScript client for Planning Center Online People API",
|
|
3
|
+
"version": "2.1.0",
|
|
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",
|
|
7
7
|
"scripts": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"test:ci": "jest --ci --coverage --watchAll=false --testPathIgnorePatterns=integration.test.ts",
|
|
16
16
|
"test:integration": "dotenv -e .env.test -- jest --testPathPatterns=integration.test.ts --setupFilesAfterEnv='<rootDir>/tests/integration-setup.ts' --testTimeout=30000",
|
|
17
17
|
"test:integration:people-all": "dotenv -e .env.test -- jest --testPathPatterns=integration/people-.*.integration.test.ts --setupFilesAfterEnv='<rootDir>/tests/integration-setup.ts' --testTimeout=30000",
|
|
18
|
+
"test:integration:v2:all": "dotenv -e .env.test -- jest --testPathPatterns=integration/v2/.*.integration.test.ts --setupFilesAfterEnv='<rootDir>/tests/integration-setup.ts' --testTimeout=30000",
|
|
18
19
|
"test:edge-cases": "jest --testPathPatterns=edge-cases.test.ts --testTimeout=30000",
|
|
19
20
|
"test:all": "npm run test && npm run test:edge-cases",
|
|
20
21
|
"prepublishOnly": "npm run build"
|
|
@@ -34,7 +35,12 @@
|
|
|
34
35
|
"rate-limiting",
|
|
35
36
|
"error-handling",
|
|
36
37
|
"performance",
|
|
37
|
-
"caching"
|
|
38
|
+
"caching",
|
|
39
|
+
"batch-operations",
|
|
40
|
+
"smart-matching",
|
|
41
|
+
"fluent-api",
|
|
42
|
+
"event-system",
|
|
43
|
+
"client-manager"
|
|
38
44
|
],
|
|
39
45
|
"author": "Rachel Higley",
|
|
40
46
|
"license": "MIT",
|