@rachelallyson/planning-center-people-ts 2.14.1 → 3.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 +82 -7
- package/README.md +42 -4
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +14 -6
- package/dist/client.d.ts +33 -8
- package/dist/client.js +47 -22
- package/dist/core.d.ts +4 -2
- package/dist/core.js +3 -2
- package/dist/error-handling.d.ts +4 -4
- package/dist/error-handling.js +13 -2
- package/dist/error-scenarios.d.ts +11 -7
- package/dist/error-scenarios.js +26 -10
- package/dist/helpers.d.ts +124 -48
- package/dist/helpers.js +237 -93
- package/dist/index.d.ts +10 -8
- package/dist/index.js +31 -72
- package/dist/matching/matcher.d.ts +8 -4
- package/dist/matching/matcher.js +51 -58
- package/dist/matching/scoring.d.ts +9 -6
- package/dist/matching/scoring.js +18 -14
- package/dist/modules/campus.d.ts +31 -36
- package/dist/modules/campus.js +36 -49
- package/dist/modules/contacts.d.ts +33 -29
- package/dist/modules/contacts.js +36 -12
- package/dist/modules/fields.d.ts +39 -55
- package/dist/modules/fields.js +65 -105
- package/dist/modules/forms.d.ts +35 -24
- package/dist/modules/forms.js +41 -23
- package/dist/modules/households.d.ts +17 -19
- package/dist/modules/households.js +25 -34
- package/dist/modules/lists.d.ts +38 -28
- package/dist/modules/lists.js +62 -42
- package/dist/modules/notes.d.ts +32 -30
- package/dist/modules/notes.js +40 -52
- package/dist/modules/people.d.ts +83 -71
- package/dist/modules/people.js +323 -172
- package/dist/modules/reports.d.ts +18 -32
- package/dist/modules/reports.js +28 -40
- package/dist/modules/service-time.d.ts +19 -24
- package/dist/modules/service-time.js +28 -28
- package/dist/modules/workflows.d.ts +42 -47
- package/dist/modules/workflows.js +52 -53
- package/dist/performance.d.ts +14 -10
- package/dist/performance.js +61 -25
- package/dist/testing/recorder.js +11 -2
- package/dist/testing/simple-builders.d.ts +6 -4
- package/dist/testing/simple-builders.js +36 -49
- package/dist/testing/types.d.ts +4 -0
- package/dist/types/api-options.d.ts +380 -0
- package/dist/types/api-options.js +6 -0
- package/dist/types/client.d.ts +4 -2
- package/dist/types/client.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/people.d.ts +61 -9
- package/package.json +7 -7
- package/dist/core/http.d.ts +0 -56
- package/dist/core/http.js +0 -360
- package/dist/core/pagination.d.ts +0 -34
- package/dist/core/pagination.js +0 -178
- package/dist/people/contacts.d.ts +0 -43
- package/dist/people/contacts.js +0 -122
- package/dist/people/core.d.ts +0 -28
- package/dist/people/core.js +0 -69
- package/dist/people/fields.d.ts +0 -68
- package/dist/people/fields.js +0 -305
- package/dist/people/households.d.ts +0 -15
- package/dist/people/households.js +0 -31
- package/dist/people/index.d.ts +0 -8
- package/dist/people/index.js +0 -25
- package/dist/people/lists.d.ts +0 -34
- package/dist/people/lists.js +0 -48
- package/dist/people/notes.d.ts +0 -30
- package/dist/people/notes.js +0 -37
- package/dist/people/organization.d.ts +0 -12
- package/dist/people/organization.js +0 -15
- package/dist/people/workflows.d.ts +0 -37
- package/dist/people/workflows.js +0 -75
package/dist/people/lists.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { PcoClientState } from '../core';
|
|
2
|
-
import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
|
|
3
|
-
import { ListCategoriesList, ListSingle, ListsList } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Get all lists
|
|
6
|
-
*/
|
|
7
|
-
export declare function getLists(client: PcoClientState, params?: {
|
|
8
|
-
where?: Record<string, any>;
|
|
9
|
-
include?: string[];
|
|
10
|
-
per_page?: number;
|
|
11
|
-
page?: number;
|
|
12
|
-
}, context?: Partial<ErrorContext>): Promise<ListsList>;
|
|
13
|
-
/**
|
|
14
|
-
* Get a single list
|
|
15
|
-
*/
|
|
16
|
-
export declare function getListById(client: PcoClientState, listId: string, params?: {
|
|
17
|
-
where?: Record<string, any>;
|
|
18
|
-
include?: string[];
|
|
19
|
-
per_page?: number;
|
|
20
|
-
page?: number;
|
|
21
|
-
}, context?: Partial<ErrorContext>): Promise<ListSingle>;
|
|
22
|
-
/**
|
|
23
|
-
* Get all list categories
|
|
24
|
-
*/
|
|
25
|
-
export declare function getListCategories(client: PcoClientState, params?: {
|
|
26
|
-
where?: Record<string, any>;
|
|
27
|
-
include?: string[];
|
|
28
|
-
per_page?: number;
|
|
29
|
-
page?: number;
|
|
30
|
-
}, context?: Partial<ErrorContext>): Promise<ListCategoriesList>;
|
|
31
|
-
/**
|
|
32
|
-
* Run a List to update its results
|
|
33
|
-
*/
|
|
34
|
-
export declare function runList(client: PcoClientState, listId: string, context?: Partial<ErrorContext>): Promise<ListSingle>;
|
package/dist/people/lists.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLists = getLists;
|
|
4
|
-
exports.getListById = getListById;
|
|
5
|
-
exports.getListCategories = getListCategories;
|
|
6
|
-
exports.runList = runList;
|
|
7
|
-
const core_1 = require("../core");
|
|
8
|
-
const helpers_1 = require("../helpers");
|
|
9
|
-
/**
|
|
10
|
-
* Get all lists
|
|
11
|
-
*/
|
|
12
|
-
async function getLists(client, params, context) {
|
|
13
|
-
return (0, core_1.getList)(client, '/lists', (0, helpers_1.buildQueryParams)(params), {
|
|
14
|
-
...context,
|
|
15
|
-
endpoint: '/lists',
|
|
16
|
-
method: 'GET',
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get a single list
|
|
21
|
-
*/
|
|
22
|
-
async function getListById(client, listId, params, context) {
|
|
23
|
-
return (0, core_1.getSingle)(client, `/lists/${listId}`, (0, helpers_1.buildQueryParams)(params), {
|
|
24
|
-
...context,
|
|
25
|
-
endpoint: `/lists/${listId}`,
|
|
26
|
-
method: 'GET',
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get all list categories
|
|
31
|
-
*/
|
|
32
|
-
async function getListCategories(client, params, context) {
|
|
33
|
-
return (0, core_1.getList)(client, '/list_categories', (0, helpers_1.buildQueryParams)(params), {
|
|
34
|
-
...context,
|
|
35
|
-
endpoint: '/list_categories',
|
|
36
|
-
method: 'GET',
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Run a List to update its results
|
|
41
|
-
*/
|
|
42
|
-
async function runList(client, listId, context) {
|
|
43
|
-
return (0, core_1.post)(client, `/lists/${listId}/run`, {}, undefined, {
|
|
44
|
-
...context,
|
|
45
|
-
endpoint: `/lists/${listId}/run`,
|
|
46
|
-
method: 'POST',
|
|
47
|
-
});
|
|
48
|
-
}
|
package/dist/people/notes.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { PcoClientState } from '../core';
|
|
2
|
-
import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
|
|
3
|
-
import { NoteCategoriesList, NoteSingle, NotesList } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Get all notes
|
|
6
|
-
*/
|
|
7
|
-
export declare function getNotes(client: PcoClientState, params?: {
|
|
8
|
-
where?: Record<string, any>;
|
|
9
|
-
include?: string[];
|
|
10
|
-
per_page?: number;
|
|
11
|
-
page?: number;
|
|
12
|
-
}, context?: Partial<ErrorContext>): Promise<NotesList>;
|
|
13
|
-
/**
|
|
14
|
-
* Get a single note
|
|
15
|
-
*/
|
|
16
|
-
export declare function getNote(client: PcoClientState, noteId: string, params?: {
|
|
17
|
-
where?: Record<string, any>;
|
|
18
|
-
include?: string[];
|
|
19
|
-
per_page?: number;
|
|
20
|
-
page?: number;
|
|
21
|
-
}, context?: Partial<ErrorContext>): Promise<NoteSingle>;
|
|
22
|
-
/**
|
|
23
|
-
* Get all note categories
|
|
24
|
-
*/
|
|
25
|
-
export declare function getNoteCategories(client: PcoClientState, params?: {
|
|
26
|
-
where?: Record<string, any>;
|
|
27
|
-
include?: string[];
|
|
28
|
-
per_page?: number;
|
|
29
|
-
page?: number;
|
|
30
|
-
}, context?: Partial<ErrorContext>): Promise<NoteCategoriesList>;
|
package/dist/people/notes.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNotes = getNotes;
|
|
4
|
-
exports.getNote = getNote;
|
|
5
|
-
exports.getNoteCategories = getNoteCategories;
|
|
6
|
-
const core_1 = require("../core");
|
|
7
|
-
const helpers_1 = require("../helpers");
|
|
8
|
-
/**
|
|
9
|
-
* Get all notes
|
|
10
|
-
*/
|
|
11
|
-
async function getNotes(client, params, context) {
|
|
12
|
-
return (0, core_1.getList)(client, '/notes', (0, helpers_1.buildQueryParams)(params), {
|
|
13
|
-
...context,
|
|
14
|
-
endpoint: '/notes',
|
|
15
|
-
method: 'GET',
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Get a single note
|
|
20
|
-
*/
|
|
21
|
-
async function getNote(client, noteId, params, context) {
|
|
22
|
-
return (0, core_1.getSingle)(client, `/notes/${noteId}`, (0, helpers_1.buildQueryParams)(params), {
|
|
23
|
-
...context,
|
|
24
|
-
endpoint: `/notes/${noteId}`,
|
|
25
|
-
method: 'GET',
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Get all note categories
|
|
30
|
-
*/
|
|
31
|
-
async function getNoteCategories(client, params, context) {
|
|
32
|
-
return (0, core_1.getList)(client, '/note_categories', (0, helpers_1.buildQueryParams)(params), {
|
|
33
|
-
...context,
|
|
34
|
-
endpoint: '/note_categories',
|
|
35
|
-
method: 'GET',
|
|
36
|
-
});
|
|
37
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PcoClientState } from '../core';
|
|
2
|
-
import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
|
|
3
|
-
import { OrganizationSingle } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Get organization information
|
|
6
|
-
*/
|
|
7
|
-
export declare function getOrganization(client: PcoClientState, params?: {
|
|
8
|
-
where?: Record<string, any>;
|
|
9
|
-
include?: string[];
|
|
10
|
-
per_page?: number;
|
|
11
|
-
page?: number;
|
|
12
|
-
}, context?: Partial<ErrorContext>): Promise<OrganizationSingle>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOrganization = getOrganization;
|
|
4
|
-
const core_1 = require("../core");
|
|
5
|
-
const helpers_1 = require("../helpers");
|
|
6
|
-
/**
|
|
7
|
-
* Get organization information
|
|
8
|
-
*/
|
|
9
|
-
async function getOrganization(client, params, context) {
|
|
10
|
-
return (0, core_1.getSingle)(client, '/', (0, helpers_1.buildQueryParams)(params), {
|
|
11
|
-
...context,
|
|
12
|
-
endpoint: '/',
|
|
13
|
-
method: 'GET',
|
|
14
|
-
});
|
|
15
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { PcoClientState } from '../core';
|
|
2
|
-
import type { ErrorContext } from '@rachelallyson/planning-center-base-ts';
|
|
3
|
-
import { WorkflowCardNoteAttributes, WorkflowCardNoteSingle, WorkflowCardNotesList, WorkflowCardSingle, WorkflowCardsList, WorkflowSingle, WorkflowsList } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* List notes for a workflow card
|
|
6
|
-
*/
|
|
7
|
-
export declare function getWorkflowCardNotes(client: PcoClientState, personId: string, workflowCardId: string, context?: Partial<ErrorContext>): Promise<WorkflowCardNotesList>;
|
|
8
|
-
/**
|
|
9
|
-
* Create a note for a workflow card
|
|
10
|
-
*/
|
|
11
|
-
export declare function createWorkflowCardNote(client: PcoClientState, personId: string, workflowCardId: string, data: Partial<WorkflowCardNoteAttributes>, context?: Partial<ErrorContext>): Promise<WorkflowCardNoteSingle>;
|
|
12
|
-
/**
|
|
13
|
-
* List workflow cards for a person
|
|
14
|
-
*/
|
|
15
|
-
export declare function getWorkflowCards(client: PcoClientState, personId: string, context?: Partial<ErrorContext>): Promise<WorkflowCardsList>;
|
|
16
|
-
/**
|
|
17
|
-
* Create a workflow card in a workflow for a person
|
|
18
|
-
*/
|
|
19
|
-
export declare function createWorkflowCard(client: PcoClientState, workflowId: string, personId: string, context?: Partial<ErrorContext>): Promise<WorkflowCardSingle>;
|
|
20
|
-
/**
|
|
21
|
-
* Get all workflows
|
|
22
|
-
*/
|
|
23
|
-
export declare function getWorkflows(client: PcoClientState, params?: {
|
|
24
|
-
where?: Record<string, any>;
|
|
25
|
-
include?: string[];
|
|
26
|
-
per_page?: number;
|
|
27
|
-
page?: number;
|
|
28
|
-
}, context?: Partial<ErrorContext>): Promise<WorkflowsList>;
|
|
29
|
-
/**
|
|
30
|
-
* Get a single workflow
|
|
31
|
-
*/
|
|
32
|
-
export declare function getWorkflow(client: PcoClientState, workflowId: string, params?: {
|
|
33
|
-
where?: Record<string, any>;
|
|
34
|
-
include?: string[];
|
|
35
|
-
per_page?: number;
|
|
36
|
-
page?: number;
|
|
37
|
-
}, context?: Partial<ErrorContext>): Promise<WorkflowSingle>;
|
package/dist/people/workflows.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getWorkflowCardNotes = getWorkflowCardNotes;
|
|
4
|
-
exports.createWorkflowCardNote = createWorkflowCardNote;
|
|
5
|
-
exports.getWorkflowCards = getWorkflowCards;
|
|
6
|
-
exports.createWorkflowCard = createWorkflowCard;
|
|
7
|
-
exports.getWorkflows = getWorkflows;
|
|
8
|
-
exports.getWorkflow = getWorkflow;
|
|
9
|
-
const core_1 = require("../core");
|
|
10
|
-
const helpers_1 = require("../helpers");
|
|
11
|
-
/**
|
|
12
|
-
* List notes for a workflow card
|
|
13
|
-
*/
|
|
14
|
-
async function getWorkflowCardNotes(client, personId, workflowCardId, context) {
|
|
15
|
-
return (0, core_1.getList)(client, `/people/${personId}/workflow_cards/${workflowCardId}/notes`, undefined, {
|
|
16
|
-
...context,
|
|
17
|
-
endpoint: `/people/${personId}/workflow_cards/${workflowCardId}/notes`,
|
|
18
|
-
method: 'GET',
|
|
19
|
-
personId,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Create a note for a workflow card
|
|
24
|
-
*/
|
|
25
|
-
async function createWorkflowCardNote(client, personId, workflowCardId, data, context) {
|
|
26
|
-
return (0, core_1.post)(client, `/people/${personId}/workflow_cards/${workflowCardId}/notes`, data, undefined, {
|
|
27
|
-
...context,
|
|
28
|
-
endpoint: `/people/${personId}/workflow_cards/${workflowCardId}/notes`,
|
|
29
|
-
method: 'POST',
|
|
30
|
-
personId,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* List workflow cards for a person
|
|
35
|
-
*/
|
|
36
|
-
async function getWorkflowCards(client, personId, context) {
|
|
37
|
-
return (0, core_1.getList)(client, `/people/${personId}/workflow_cards`, undefined, {
|
|
38
|
-
...context,
|
|
39
|
-
endpoint: `/people/${personId}/workflow_cards`,
|
|
40
|
-
method: 'GET',
|
|
41
|
-
personId,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Create a workflow card in a workflow for a person
|
|
46
|
-
*/
|
|
47
|
-
async function createWorkflowCard(client, workflowId, personId, context) {
|
|
48
|
-
return (0, core_1.post)(client, `/workflows/${workflowId}/cards`, { person_id: personId }, undefined, {
|
|
49
|
-
...context,
|
|
50
|
-
endpoint: `/workflows/${workflowId}/cards`,
|
|
51
|
-
metadata: { ...(context?.metadata ?? {}), workflowId },
|
|
52
|
-
method: 'POST',
|
|
53
|
-
personId,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get all workflows
|
|
58
|
-
*/
|
|
59
|
-
async function getWorkflows(client, params, context) {
|
|
60
|
-
return (0, core_1.getList)(client, '/workflows', (0, helpers_1.buildQueryParams)(params), {
|
|
61
|
-
...context,
|
|
62
|
-
endpoint: '/workflows',
|
|
63
|
-
method: 'GET',
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Get a single workflow
|
|
68
|
-
*/
|
|
69
|
-
async function getWorkflow(client, workflowId, params, context) {
|
|
70
|
-
return (0, core_1.getSingle)(client, `/workflows/${workflowId}`, (0, helpers_1.buildQueryParams)(params), {
|
|
71
|
-
...context,
|
|
72
|
-
endpoint: `/workflows/${workflowId}`,
|
|
73
|
-
method: 'GET',
|
|
74
|
-
});
|
|
75
|
-
}
|