mp-js-api 0.0.26 → 0.0.29
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/.gitattributes +2 -2
- package/dist/api.d.ts +44 -22
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +75 -75
- package/dist/index.d.ts +65 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +109 -91
- package/dist/tables/addresses.d.ts.map +1 -1
- package/dist/tables/contacts.d.ts +6 -0
- package/dist/tables/contacts.d.ts.map +1 -1
- package/dist/tables/files.d.ts +17 -0
- package/dist/tables/files.d.ts.map +1 -0
- package/dist/tables/files.js +2 -0
- package/dist/tables/form-responses.d.ts +1 -1
- package/dist/tables/groups.d.ts.map +1 -1
- package/dist/tables/households.d.ts.map +1 -1
- package/dist/tables/participants.d.ts.map +1 -1
- package/dist/utils/converters.d.ts +2 -2
- package/dist/utils/converters.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/api.ts +135 -116
- package/src/index.ts +233 -195
- package/src/tables/addresses.ts +48 -48
- package/src/tables/contacts.ts +8 -0
- package/src/tables/files.ts +16 -0
- package/src/tables/form-responses.ts +1 -1
- package/src/tables/groups.ts +96 -96
- package/src/tables/households.ts +48 -48
- package/src/tables/participants.ts +56 -56
- package/src/utils/converters.ts +2 -2
- package/tsconfig.json +4 -3
package/.gitattributes
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text=auto
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
package/dist/api.d.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
-
export type APIGetOneInstance = <T,
|
|
2
|
+
export type APIGetOneInstance = <T extends Record<string, any>>({ id, path, mpQuery, config }: APIGetParameter & {
|
|
3
3
|
id: number;
|
|
4
|
-
}) => Promise<
|
|
4
|
+
}) => Promise<T | undefined | {
|
|
5
5
|
error: ErrorDetails;
|
|
6
6
|
}>;
|
|
7
|
-
export type APIGetMultipleInstance = <T,
|
|
8
|
-
|
|
9
|
-
}) => Promise<
|
|
7
|
+
export type APIGetMultipleInstance = <T extends Record<string, any>>({ path, mpQuery, config }: APIGetParameter & {
|
|
8
|
+
mpQuery: MPGetQuery;
|
|
9
|
+
}) => Promise<T[] | {
|
|
10
10
|
error: ErrorDetails;
|
|
11
11
|
}>;
|
|
12
|
-
export type APICreateOneInstance = <T,
|
|
12
|
+
export type APICreateOneInstance = <T extends Record<string, any>>({ path, mpQuery, data, config }: APICreateOneParameter) => Promise<T | {
|
|
13
13
|
error: ErrorDetails;
|
|
14
14
|
}>;
|
|
15
|
-
export type APICreateManyInstance = <T,
|
|
15
|
+
export type APICreateManyInstance = <T extends Record<string, any>>({ path, mpQuery, data, config }: APICreateManyParameter) => Promise<T[] | {
|
|
16
16
|
error: ErrorDetails;
|
|
17
17
|
}>;
|
|
18
|
-
export type
|
|
18
|
+
export type APICreateFileInstance = <T extends Record<string, any>>({ path, mpQuery, data, config }: APICreateFileParameter) => Promise<T | {
|
|
19
|
+
error: ErrorDetails;
|
|
20
|
+
}>;
|
|
21
|
+
export type APIUpdateInstance = <T extends Record<string, any>>({ path, mpQuery, data, config }: APIUpdateParameter) => Promise<T[] | {
|
|
19
22
|
error: ErrorDetails;
|
|
20
23
|
}>;
|
|
21
24
|
export interface MPApiBase {
|
|
@@ -23,7 +26,9 @@ export interface MPApiBase {
|
|
|
23
26
|
getMany: APIGetMultipleInstance;
|
|
24
27
|
createOne: APICreateOneInstance;
|
|
25
28
|
createMany: APICreateManyInstance;
|
|
26
|
-
|
|
29
|
+
updateMany: APIUpdateInstance;
|
|
30
|
+
createFile: APICreateFileInstance;
|
|
31
|
+
updateFile: APICreateFileInstance;
|
|
27
32
|
get: AxiosInstance['get'];
|
|
28
33
|
post: AxiosInstance['post'];
|
|
29
34
|
put: AxiosInstance['put'];
|
|
@@ -45,7 +50,7 @@ export declare const createApiBase: ({ auth }: {
|
|
|
45
50
|
password: string;
|
|
46
51
|
};
|
|
47
52
|
}) => MPApiBase;
|
|
48
|
-
export type
|
|
53
|
+
export type MPGetQuery = {
|
|
49
54
|
select?: string;
|
|
50
55
|
filter?: string;
|
|
51
56
|
orderBy?: string;
|
|
@@ -54,32 +59,49 @@ export type MPGetOptions = {
|
|
|
54
59
|
skip?: number;
|
|
55
60
|
distinct?: boolean;
|
|
56
61
|
};
|
|
57
|
-
export type
|
|
62
|
+
export type MPCreateQuery = {
|
|
58
63
|
userId?: number;
|
|
59
64
|
select?: string;
|
|
60
65
|
};
|
|
61
|
-
export type
|
|
66
|
+
export type MPCreateFileQuery = {
|
|
67
|
+
description?: string;
|
|
68
|
+
default?: boolean;
|
|
69
|
+
longestDimension?: number;
|
|
70
|
+
userId?: number;
|
|
71
|
+
};
|
|
72
|
+
export type MPGetFileQuery = {
|
|
73
|
+
thumbnail?: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type MPUpdateQuery = MPCreateQuery & {
|
|
76
|
+
allowCreate: boolean;
|
|
77
|
+
};
|
|
62
78
|
interface APIGetParameter {
|
|
63
79
|
path: string;
|
|
64
|
-
|
|
80
|
+
mpQuery?: MPGetQuery;
|
|
81
|
+
config?: AxiosRequestConfig;
|
|
82
|
+
}
|
|
83
|
+
interface APICreateOneParameter {
|
|
84
|
+
path: string;
|
|
85
|
+
data: Record<string, any>;
|
|
86
|
+
mpQuery?: MPCreateQuery;
|
|
65
87
|
config?: AxiosRequestConfig;
|
|
66
88
|
}
|
|
67
|
-
interface
|
|
89
|
+
interface APICreateManyParameter {
|
|
68
90
|
path: string;
|
|
69
|
-
|
|
70
|
-
|
|
91
|
+
data: Record<string, any>[];
|
|
92
|
+
mpQuery?: MPCreateQuery;
|
|
71
93
|
config?: AxiosRequestConfig;
|
|
72
94
|
}
|
|
73
|
-
interface
|
|
95
|
+
interface APICreateFileParameter {
|
|
74
96
|
path: string;
|
|
75
|
-
|
|
76
|
-
|
|
97
|
+
data: Record<string, any>;
|
|
98
|
+
mpQuery?: MPCreateFileQuery;
|
|
77
99
|
config?: AxiosRequestConfig;
|
|
78
100
|
}
|
|
79
|
-
interface APIUpdateParameter
|
|
101
|
+
interface APIUpdateParameter {
|
|
80
102
|
path: string;
|
|
81
|
-
|
|
82
|
-
|
|
103
|
+
data: Record<string, any>[];
|
|
104
|
+
mpQuery?: MPUpdateQuery;
|
|
83
105
|
config?: AxiosRequestConfig;
|
|
84
106
|
}
|
|
85
107
|
export type DateTimeIsoString = `${number}-${number}-${number}T${number}:${number}:${number}`;
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAiB,MAAM,OAAO,CAAC;AAK5F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAiB,MAAM,OAAO,CAAC;AAK5F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,eAAe,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;CAAE,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG;IAAE,KAAK,EAAE,YAAY,CAAC;CAAE,CAAC,CAAC;AACvL,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE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AAa,CAAC;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,MAAM,iBAAiB,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC"}
|
package/dist/api.js
CHANGED
|
@@ -43,113 +43,110 @@ const createApiBase = ({ auth }) => {
|
|
|
43
43
|
const api = axios_1.default.create({
|
|
44
44
|
baseURL: 'https://mp.revival.com/ministryplatformapi',
|
|
45
45
|
});
|
|
46
|
-
const
|
|
46
|
+
const get = async (url, config) => api.get(url, {
|
|
47
|
+
...config,
|
|
48
|
+
headers: {
|
|
49
|
+
...config?.headers,
|
|
50
|
+
Authorization: `Bearer ${await getToken()}`,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const post = async (url, data, config) => api.post(url, data, {
|
|
54
|
+
...config,
|
|
55
|
+
headers: {
|
|
56
|
+
...config?.headers,
|
|
57
|
+
Authorization: `Bearer ${await getToken()}`,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const put = async (url, data, config) => api.put(url, data, {
|
|
61
|
+
...config,
|
|
62
|
+
headers: {
|
|
63
|
+
...config?.headers,
|
|
64
|
+
Authorization: `Bearer ${await getToken()}`,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
const getOne = async ({ id, path, mpQuery, config }) => {
|
|
47
68
|
try {
|
|
48
|
-
const url = `${path}/${id}` + (0, converters_1.stringifyURLParams)(
|
|
49
|
-
const res = await
|
|
50
|
-
...config,
|
|
51
|
-
headers: {
|
|
52
|
-
...config?.headers,
|
|
53
|
-
Authorization: `Bearer ${await getToken()}`,
|
|
54
|
-
},
|
|
55
|
-
});
|
|
69
|
+
const url = `${path}/${id}` + (0, converters_1.stringifyURLParams)(mpQuery);
|
|
70
|
+
const res = await get(url, config);
|
|
56
71
|
return res.data[0] ? (0, converters_1.convertToCamelCase)(res.data[0]) : undefined;
|
|
57
72
|
}
|
|
58
73
|
catch (err) {
|
|
59
74
|
return { error: getError(err) };
|
|
60
75
|
}
|
|
61
76
|
};
|
|
62
|
-
const getMany = async ({ path,
|
|
77
|
+
const getMany = async ({ path, mpQuery, config }) => {
|
|
63
78
|
try {
|
|
64
|
-
const url = path + '/get'; //+ stringifyURLParams(
|
|
65
|
-
const data =
|
|
66
|
-
const res = await
|
|
67
|
-
...config,
|
|
68
|
-
...{
|
|
69
|
-
headers: {
|
|
70
|
-
...config?.headers,
|
|
71
|
-
Authorization: `Bearer ${await getToken()}`,
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
79
|
+
const url = path + '/get'; //+ stringifyURLParams(mpQuery);
|
|
80
|
+
const data = mpQuery && (0, converters_1.escapeApostrophes)((0, converters_1.convertToSnakeCase)(mpQuery));
|
|
81
|
+
const res = await post(url, data, config);
|
|
75
82
|
return res.data.map(record => (0, converters_1.convertToCamelCase)(record));
|
|
76
83
|
}
|
|
77
84
|
catch (err) {
|
|
78
85
|
return { error: getError(err) };
|
|
79
86
|
}
|
|
80
87
|
};
|
|
81
|
-
const createOne = async ({ path,
|
|
82
|
-
const query = (0, converters_1.stringifyURLParams)(
|
|
83
|
-
const data = [(0, converters_1.convertToSnakeCase)(
|
|
88
|
+
const createOne = async ({ path, mpQuery, data: payload, config }) => {
|
|
89
|
+
const query = (0, converters_1.stringifyURLParams)(mpQuery);
|
|
90
|
+
const data = [(0, converters_1.convertToSnakeCase)(payload)];
|
|
91
|
+
const url = path + query;
|
|
84
92
|
try {
|
|
85
|
-
const res = await
|
|
86
|
-
...config,
|
|
87
|
-
headers: {
|
|
88
|
-
...config?.headers,
|
|
89
|
-
Authorization: `Bearer ${await getToken()}`,
|
|
90
|
-
},
|
|
91
|
-
});
|
|
93
|
+
const res = await post(url, data, config);
|
|
92
94
|
return (0, converters_1.convertToCamelCase)(res.data[0]);
|
|
93
95
|
}
|
|
94
96
|
catch (err) {
|
|
95
97
|
return { error: getError(err) };
|
|
96
98
|
}
|
|
97
99
|
};
|
|
98
|
-
const createMany = async ({ path,
|
|
99
|
-
const query = (0, converters_1.stringifyURLParams)(
|
|
100
|
-
const data =
|
|
100
|
+
const createMany = async ({ path, mpQuery, data: payload, config }) => {
|
|
101
|
+
const query = (0, converters_1.stringifyURLParams)(mpQuery);
|
|
102
|
+
const data = payload.map(p => (0, converters_1.convertToSnakeCase)(p));
|
|
103
|
+
const url = path + query;
|
|
101
104
|
try {
|
|
102
|
-
const res = await
|
|
103
|
-
...config,
|
|
104
|
-
headers: {
|
|
105
|
-
...config?.headers,
|
|
106
|
-
Authorization: `Bearer ${await getToken()}`,
|
|
107
|
-
},
|
|
108
|
-
});
|
|
105
|
+
const res = await post(url, data, config);
|
|
109
106
|
return res.data.map(record => (0, converters_1.convertToCamelCase)(record));
|
|
110
107
|
}
|
|
111
108
|
catch (err) {
|
|
112
109
|
return { error: getError(err) };
|
|
113
110
|
}
|
|
114
111
|
};
|
|
115
|
-
const
|
|
116
|
-
const query = (0, converters_1.stringifyURLParams)(
|
|
117
|
-
const data =
|
|
112
|
+
const updateMany = async ({ path, mpQuery, data: payload, config }) => {
|
|
113
|
+
const query = (0, converters_1.stringifyURLParams)(mpQuery);
|
|
114
|
+
const data = payload.map(r => (0, converters_1.convertToSnakeCase)(r));
|
|
115
|
+
const url = path + query;
|
|
118
116
|
try {
|
|
119
|
-
const res = await
|
|
120
|
-
...config,
|
|
121
|
-
headers: {
|
|
122
|
-
...config?.headers,
|
|
123
|
-
Authorization: `Bearer ${await getToken()}`,
|
|
124
|
-
},
|
|
125
|
-
});
|
|
117
|
+
const res = await put(url, data, config);
|
|
126
118
|
return res.data.map(record => (0, converters_1.convertToCamelCase)(record));
|
|
127
119
|
}
|
|
128
120
|
catch (err) {
|
|
129
121
|
return { error: getError(err) };
|
|
130
122
|
}
|
|
131
123
|
};
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
124
|
+
const createFile = async ({ path, mpQuery, data: payload, config }) => {
|
|
125
|
+
const query = (0, converters_1.stringifyURLParams)(mpQuery);
|
|
126
|
+
// const data = [convertToSnakeCase<Partial<T>>(payload)];
|
|
127
|
+
const data = payload;
|
|
128
|
+
const url = path + query;
|
|
129
|
+
try {
|
|
130
|
+
const res = await post(url, data, config);
|
|
131
|
+
return (0, converters_1.convertToCamelCase)(res.data[0]);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
return { error: getError(err) };
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const updateFile = async ({ path, mpQuery, data: payload, config }) => {
|
|
138
|
+
const query = (0, converters_1.stringifyURLParams)(mpQuery);
|
|
139
|
+
// const data = [convertToSnakeCase<Partial<T>>(payload)];
|
|
140
|
+
const data = payload;
|
|
141
|
+
const url = path + query;
|
|
142
|
+
try {
|
|
143
|
+
const res = await put(url, data, config);
|
|
144
|
+
return (0, converters_1.convertToCamelCase)(res.data[0]);
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
return { error: getError(err) };
|
|
148
|
+
}
|
|
149
|
+
};
|
|
153
150
|
const getError = function (error) {
|
|
154
151
|
return {
|
|
155
152
|
message: error.message,
|
|
@@ -163,14 +160,16 @@ const createApiBase = ({ auth }) => {
|
|
|
163
160
|
};
|
|
164
161
|
};
|
|
165
162
|
return {
|
|
166
|
-
createOne,
|
|
167
|
-
createMany,
|
|
168
|
-
update,
|
|
169
163
|
get,
|
|
170
164
|
put,
|
|
171
165
|
post,
|
|
172
166
|
getOne,
|
|
173
167
|
getMany,
|
|
168
|
+
createOne,
|
|
169
|
+
createMany,
|
|
170
|
+
updateMany,
|
|
171
|
+
createFile,
|
|
172
|
+
updateFile,
|
|
174
173
|
getError
|
|
175
174
|
};
|
|
176
175
|
};
|
|
@@ -178,3 +177,4 @@ exports.createApiBase = createApiBase;
|
|
|
178
177
|
;
|
|
179
178
|
;
|
|
180
179
|
;
|
|
180
|
+
;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { MPApiBase, ErrorDetails,
|
|
2
|
+
import { MPApiBase, ErrorDetails, MPGetQuery, MPCreateQuery, MPUpdateQuery, DateTimeIsoString } from './api';
|
|
3
3
|
import { convertToCamelCase, convertToSnakeCase, escapeSql, stringifyURLParams } from './utils/converters';
|
|
4
4
|
import { Contact } from './tables/contacts';
|
|
5
5
|
import { Event } from './tables/events';
|
|
@@ -13,20 +13,22 @@ import { ContactAttribute, ContactWithAttribute } from './tables/contact-attribu
|
|
|
13
13
|
import { FormResponse } from './tables/form-responses';
|
|
14
14
|
import { FormResponseAnswer } from './tables/from-response-answers';
|
|
15
15
|
import { ContactEmailAddress, ContactWithEmailAddress, ContactWithEmailAddresses } from './tables/contact-email-addresses';
|
|
16
|
+
import { AttachedFile } from './tables/files';
|
|
16
17
|
export type WithRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
17
18
|
export type AtLeastOne<T> = {
|
|
18
19
|
[K in keyof T]-?: Required<Pick<T, K>>;
|
|
19
20
|
}[keyof T];
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export type
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
21
|
+
export type CreateContactPayload = WithRequired<Omit<Partial<Contact>, 'contactID'>, 'company' | 'displayName'>;
|
|
22
|
+
export type CreateHouseholdPayload = WithRequired<Partial<Household>, 'householdName'>;
|
|
23
|
+
export type CreateAddressPayload = WithRequired<Partial<Address>, 'addressLine1'>;
|
|
24
|
+
export type CreateParticipantPayload = WithRequired<Partial<Participant>, 'contactID' | 'participantTypeID' | 'participantStartDate'>;
|
|
25
|
+
export type CreateEventParticipantPayload = WithRequired<Partial<EventParticipant>, 'eventID' | 'participantID' | 'participationStatusID'>;
|
|
26
|
+
export type CreateGroupParticipantPayload = WithRequired<Partial<GroupParticipant>, 'groupID' | 'participantID' | 'groupRoleID' | 'startDate'>;
|
|
27
|
+
export type CreateContactAttributePayload = WithRequired<Partial<ContactAttribute>, 'attributeID' | 'contactID' | 'startDate'>;
|
|
28
|
+
export type CreateFormResponsePayload = WithRequired<Omit<Partial<FormResponse>, 'formResponseID'>, 'formID' | 'responseDate'>;
|
|
29
|
+
export type CreateFormResponseAnswerPayload = WithRequired<Omit<Partial<FormResponseAnswer>, 'formResponseAnswerID'>, 'formFieldID' | 'formResponseID'>;
|
|
30
|
+
export type CreateContactEmailAddressPayload = WithRequired<Omit<Partial<ContactEmailAddress>, 'emailAddressID'>, 'emailAddress' | 'contactID'>;
|
|
31
|
+
export type CreateFilePayload = WithRequired<Omit<Partial<AttachedFile>, 'FileId'>, 'Description' | 'IsDefaultImage'>;
|
|
30
32
|
export interface ContactDetails extends Contact, Participant, Household {
|
|
31
33
|
householdID: number;
|
|
32
34
|
gender: 'Male' | 'Female' | null;
|
|
@@ -40,127 +42,138 @@ export type MPInstance = {
|
|
|
40
42
|
post: AxiosInstance['post'];
|
|
41
43
|
createOne: MPApiBase['createOne'];
|
|
42
44
|
createMany: MPApiBase['createMany'];
|
|
43
|
-
|
|
45
|
+
updateMany: MPApiBase['updateMany'];
|
|
44
46
|
getOne: MPApiBase['getOne'];
|
|
45
47
|
getMany: MPApiBase['getMany'];
|
|
46
|
-
|
|
48
|
+
createFile: MPApiBase['createFile'];
|
|
49
|
+
updateFile: MPApiBase['updateFile'];
|
|
50
|
+
getContact(id: number, mpQuery?: MPGetQuery): Promise<Contact | undefined | {
|
|
47
51
|
error: ErrorDetails;
|
|
48
52
|
}>;
|
|
49
|
-
getContactDetails(id: number,
|
|
53
|
+
getContactDetails(id: number, mpQuery?: MPGetQuery): Promise<ContactDetails | undefined | {
|
|
50
54
|
error: ErrorDetails;
|
|
51
55
|
}>;
|
|
52
|
-
getContactAttribute(id: number,
|
|
56
|
+
getContactAttribute(id: number, mpQuery?: MPGetQuery): Promise<ContactAttribute | undefined | {
|
|
53
57
|
error: ErrorDetails;
|
|
54
58
|
}>;
|
|
55
|
-
getContactEmailAddress(id: number,
|
|
59
|
+
getContactEmailAddress(id: number, mpQuery?: MPGetQuery): Promise<ContactEmailAddress | undefined | {
|
|
56
60
|
error: ErrorDetails;
|
|
57
61
|
}>;
|
|
58
|
-
getHousehold(id: number,
|
|
62
|
+
getHousehold(id: number, mpQuery?: MPGetQuery): Promise<Household | undefined | {
|
|
59
63
|
error: ErrorDetails;
|
|
60
64
|
}>;
|
|
61
|
-
getAddress(id: number,
|
|
65
|
+
getAddress(id: number, mpQuery?: MPGetQuery): Promise<Address | undefined | {
|
|
62
66
|
error: ErrorDetails;
|
|
63
67
|
}>;
|
|
64
|
-
getParticipant(id: number,
|
|
68
|
+
getParticipant(id: number, mpQuery?: MPGetQuery): Promise<Participant | undefined | {
|
|
65
69
|
error: ErrorDetails;
|
|
66
70
|
}>;
|
|
67
|
-
getEvent(id: number,
|
|
71
|
+
getEvent(id: number, mpQuery?: MPGetQuery): Promise<Event | undefined | {
|
|
68
72
|
error: ErrorDetails;
|
|
69
73
|
}>;
|
|
70
|
-
getGroup(id: number,
|
|
74
|
+
getGroup(id: number, mpQuery?: MPGetQuery): Promise<Group | undefined | {
|
|
71
75
|
error: ErrorDetails;
|
|
72
76
|
}>;
|
|
73
|
-
getEventParticipant(id: number,
|
|
77
|
+
getEventParticipant(id: number, mpQuery?: MPGetQuery): Promise<EventParticipant | undefined | {
|
|
74
78
|
error: ErrorDetails;
|
|
75
79
|
}>;
|
|
76
|
-
getGroupParticipant(id: number,
|
|
80
|
+
getGroupParticipant(id: number, mpQuery?: MPGetQuery): Promise<GroupParticipant | undefined | {
|
|
77
81
|
error: ErrorDetails;
|
|
78
82
|
}>;
|
|
79
|
-
getFormResponse(id: number,
|
|
83
|
+
getFormResponse(id: number, mpQuery?: MPGetQuery): Promise<FormResponse | undefined | {
|
|
80
84
|
error: ErrorDetails;
|
|
81
85
|
}>;
|
|
82
|
-
getContacts(
|
|
86
|
+
getContacts(mpQuery: AtLeastOne<MPGetQuery>): Promise<Contact[] | {
|
|
83
87
|
error: ErrorDetails;
|
|
84
88
|
}>;
|
|
85
|
-
getContactAttributes(
|
|
89
|
+
getContactAttributes(mpQuery: AtLeastOne<MPGetQuery>): Promise<ContactAttribute[] | {
|
|
86
90
|
error: ErrorDetails;
|
|
87
91
|
}>;
|
|
88
|
-
getContactsWithAttributes(
|
|
92
|
+
getContactsWithAttributes(mpQuery: AtLeastOne<Omit<MPGetQuery, "select">>): Promise<ContactWithAttribute[] | {
|
|
89
93
|
error: ErrorDetails;
|
|
90
94
|
}>;
|
|
91
|
-
getContactEmailAddresses(
|
|
95
|
+
getContactEmailAddresses(mpQuery: AtLeastOne<MPGetQuery>): Promise<ContactEmailAddress[] | {
|
|
92
96
|
error: ErrorDetails;
|
|
93
97
|
}>;
|
|
94
|
-
getContactsWithEmailAddress(
|
|
98
|
+
getContactsWithEmailAddress(mpQuery: AtLeastOne<Omit<MPGetQuery, "select">>): Promise<ContactWithEmailAddress[] | {
|
|
95
99
|
error: ErrorDetails;
|
|
96
100
|
}>;
|
|
97
|
-
getHouseholds(
|
|
101
|
+
getHouseholds(mpQuery: AtLeastOne<MPGetQuery>): Promise<Household[] | {
|
|
98
102
|
error: ErrorDetails;
|
|
99
103
|
}>;
|
|
100
|
-
getAddresses(
|
|
104
|
+
getAddresses(mpQuery: AtLeastOne<MPGetQuery>): Promise<Address[] | {
|
|
101
105
|
error: ErrorDetails;
|
|
102
106
|
}>;
|
|
103
|
-
getParticipants(
|
|
107
|
+
getParticipants(mpQuery: AtLeastOne<MPGetQuery>): Promise<Participant[] | {
|
|
104
108
|
error: ErrorDetails;
|
|
105
109
|
}>;
|
|
106
|
-
getEvents(
|
|
110
|
+
getEvents(mpQuery: AtLeastOne<MPGetQuery>): Promise<Event[] | {
|
|
107
111
|
error: ErrorDetails;
|
|
108
112
|
}>;
|
|
109
|
-
getGroups(
|
|
113
|
+
getGroups(mpQuery: AtLeastOne<MPGetQuery>): Promise<Group[] | {
|
|
110
114
|
error: ErrorDetails;
|
|
111
115
|
}>;
|
|
112
|
-
getEventParticipants(
|
|
116
|
+
getEventParticipants(mpQuery: AtLeastOne<MPGetQuery>): Promise<EventParticipant[] | {
|
|
113
117
|
error: ErrorDetails;
|
|
114
118
|
}>;
|
|
115
|
-
getGroupParticipants(
|
|
119
|
+
getGroupParticipants(mpQuery: AtLeastOne<MPGetQuery>): Promise<GroupParticipant[] | {
|
|
116
120
|
error: ErrorDetails;
|
|
117
121
|
}>;
|
|
118
|
-
getFormResponseAnswers(
|
|
122
|
+
getFormResponseAnswers(mpQuery: AtLeastOne<MPGetQuery>): Promise<FormResponseAnswer[] | {
|
|
119
123
|
error: ErrorDetails;
|
|
120
124
|
}>;
|
|
121
|
-
createContact(
|
|
125
|
+
createContact(data: CreateContactPayload, mpQuery?: MPCreateQuery): Promise<Contact | {
|
|
122
126
|
error: ErrorDetails;
|
|
123
127
|
}>;
|
|
124
|
-
createHousehold(
|
|
128
|
+
createHousehold(data: CreateHouseholdPayload, mpQuery?: MPCreateQuery): Promise<Household | {
|
|
125
129
|
error: ErrorDetails;
|
|
126
130
|
}>;
|
|
127
|
-
createAddress(
|
|
131
|
+
createAddress(data: CreateAddressPayload, mpQuery?: MPCreateQuery): Promise<Address | {
|
|
128
132
|
error: ErrorDetails;
|
|
129
133
|
}>;
|
|
130
|
-
createParticipant(
|
|
134
|
+
createParticipant(data: CreateParticipantPayload, mpQuery?: MPCreateQuery): Promise<Participant | {
|
|
131
135
|
error: ErrorDetails;
|
|
132
136
|
}>;
|
|
133
|
-
createEventParticipant(
|
|
137
|
+
createEventParticipant(data: CreateEventParticipantPayload, mpQuery?: MPCreateQuery): Promise<EventParticipant | {
|
|
134
138
|
error: ErrorDetails;
|
|
135
139
|
}>;
|
|
136
|
-
createGroupParticipant(
|
|
140
|
+
createGroupParticipant(data: CreateGroupParticipantPayload, mpQuery?: MPCreateQuery): Promise<GroupParticipant | {
|
|
137
141
|
error: ErrorDetails;
|
|
138
142
|
}>;
|
|
139
|
-
createContactAttribute(
|
|
143
|
+
createContactAttribute(data: CreateContactAttributePayload, mpQuery?: MPCreateQuery): Promise<ContactAttribute | {
|
|
140
144
|
error: ErrorDetails;
|
|
141
145
|
}>;
|
|
142
|
-
createFormResponse(
|
|
146
|
+
createFormResponse(data: CreateFormResponsePayload, mpQuery?: MPCreateQuery): Promise<FormResponse | {
|
|
143
147
|
error: ErrorDetails;
|
|
144
148
|
}>;
|
|
145
|
-
createFormResponseAnswers(
|
|
149
|
+
createFormResponseAnswers(data: CreateFormResponseAnswerPayload[], mpQuery?: MPCreateQuery): Promise<FormResponseAnswer[] | {
|
|
146
150
|
error: ErrorDetails;
|
|
147
151
|
}>;
|
|
148
|
-
createContactEmailAddress(
|
|
152
|
+
createContactEmailAddress(data: CreateContactEmailAddressPayload[], mpQuery?: MPCreateQuery): Promise<ContactEmailAddress[] | {
|
|
149
153
|
error: ErrorDetails;
|
|
150
154
|
}>;
|
|
151
|
-
updateContacts(contacts: WithRequired<Partial<Contact>, 'contactID'>[],
|
|
155
|
+
updateContacts(contacts: WithRequired<Partial<Contact>, 'contactID'>[], mpQuery?: MPUpdateQuery): Promise<Contact[] | {
|
|
152
156
|
error: ErrorDetails;
|
|
153
157
|
}>;
|
|
154
|
-
updateHouseholds(households: WithRequired<Partial<Household>, 'householdID'>[],
|
|
158
|
+
updateHouseholds(households: WithRequired<Partial<Household>, 'householdID'>[], mpQuery?: MPUpdateQuery): Promise<Household[] | {
|
|
155
159
|
error: ErrorDetails;
|
|
156
160
|
}>;
|
|
157
|
-
updateEventParticipants(participants: WithRequired<Partial<EventParticipant>, 'eventParticipantID'>[],
|
|
161
|
+
updateEventParticipants(participants: WithRequired<Partial<EventParticipant>, 'eventParticipantID'>[], mpQuery?: MPUpdateQuery): Promise<EventParticipant[] | {
|
|
158
162
|
error: ErrorDetails;
|
|
159
163
|
}>;
|
|
160
|
-
updateGroupParticipants(participants: WithRequired<Partial<GroupParticipant>, 'groupParticipantID'>[],
|
|
164
|
+
updateGroupParticipants(participants: WithRequired<Partial<GroupParticipant>, 'groupParticipantID'>[], mpQuery?: MPUpdateQuery): Promise<GroupParticipant[] | {
|
|
161
165
|
error: ErrorDetails;
|
|
162
166
|
}>;
|
|
163
|
-
updateFormResponseAnswers(participants: WithRequired<Partial<FormResponseAnswer>, 'formResponseAnswerID'>[],
|
|
167
|
+
updateFormResponseAnswers(participants: WithRequired<Partial<FormResponseAnswer>, 'formResponseAnswerID'>[], mpQuery?: MPUpdateQuery): Promise<FormResponseAnswer[] | {
|
|
168
|
+
error: ErrorDetails;
|
|
169
|
+
}>;
|
|
170
|
+
getFiles(table: string, recordId: number, mpQuery?: MPGetQuery): Promise<AttachedFile[] | {
|
|
171
|
+
error: ErrorDetails;
|
|
172
|
+
}>;
|
|
173
|
+
uploadFiles(table: string, recordId: number, data: CreateFilePayload[]): Promise<AttachedFile | {
|
|
174
|
+
error: ErrorDetails;
|
|
175
|
+
}>;
|
|
176
|
+
updateFiles(table: string, fileId: number, data: WithRequired<Partial<AttachedFile>, 'FileId'>[]): Promise<AttachedFile[] | {
|
|
164
177
|
error: ErrorDetails;
|
|
165
178
|
}>;
|
|
166
179
|
};
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAiB,SAAS,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts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