@n3oltd/umbraco-giving-client 9.0.0-beta-82
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/README.md +1 -0
- package/build/esm/index.d.ts +315 -0
- package/build/esm/index.d.ts.map +1 -0
- package/build/esm/index.js +844 -0
- package/build/esm/index.js.map +1 -0
- package/build/index.d.ts +315 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +844 -0
- package/build/index.js.map +1 -0
- package/build/index.min.js +1 -0
- package/build/index.min.js.map +1 -0
- package/esm/index.d.ts +315 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +844 -0
- package/esm/index.js.map +1 -0
- package/package.json +40 -0
- package/src/index.ts +1021 -0
- package/tsconfig.json +21 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,1021 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
//----------------------
|
|
4
|
+
// <auto-generated>
|
|
5
|
+
// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org)
|
|
6
|
+
// </auto-generated>
|
|
7
|
+
//----------------------
|
|
8
|
+
// ReSharper disable InconsistentNaming
|
|
9
|
+
|
|
10
|
+
export class AllocationsClient {
|
|
11
|
+
private http: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> };
|
|
12
|
+
private baseUrl: string;
|
|
13
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;
|
|
14
|
+
|
|
15
|
+
constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) {
|
|
16
|
+
this.http = http ? http : <any>window;
|
|
17
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:6001";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
getDonationForm(donationFormId: string): Promise<DonationFormRes> {
|
|
21
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/donationForms/{donationFormId}";
|
|
22
|
+
if (donationFormId === undefined || donationFormId === null)
|
|
23
|
+
throw new Error("The parameter 'donationFormId' must be defined.");
|
|
24
|
+
url_ = url_.replace("{donationFormId}", encodeURIComponent("" + donationFormId));
|
|
25
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
26
|
+
|
|
27
|
+
let options_ = <RequestInit>{
|
|
28
|
+
method: "GET",
|
|
29
|
+
headers: {
|
|
30
|
+
"Accept": "application/json"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
35
|
+
return this.processGetDonationForm(_response);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected processGetDonationForm(response: Response): Promise<DonationFormRes> {
|
|
40
|
+
const status = response.status;
|
|
41
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
42
|
+
if (status === 200) {
|
|
43
|
+
return response.text().then((_responseText) => {
|
|
44
|
+
let result200: any = null;
|
|
45
|
+
result200 = _responseText === "" ? null : <DonationFormRes>JSON.parse(_responseText, this.jsonParseReviver);
|
|
46
|
+
return result200;
|
|
47
|
+
});
|
|
48
|
+
} else if (status === 400) {
|
|
49
|
+
return response.text().then((_responseText) => {
|
|
50
|
+
let result400: any = null;
|
|
51
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
52
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
53
|
+
});
|
|
54
|
+
} else if (status === 500) {
|
|
55
|
+
return response.text().then((_responseText) => {
|
|
56
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
57
|
+
});
|
|
58
|
+
} else if (status === 404) {
|
|
59
|
+
return response.text().then((_responseText) => {
|
|
60
|
+
let result404: any = null;
|
|
61
|
+
result404 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
62
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
63
|
+
});
|
|
64
|
+
} else if (status !== 200 && status !== 204) {
|
|
65
|
+
return response.text().then((_responseText) => {
|
|
66
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return Promise.resolve<DonationFormRes>(<any>null);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
getFundStructure(): Promise<FundStructureRes> {
|
|
73
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/fundStructure";
|
|
74
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
75
|
+
|
|
76
|
+
let options_ = <RequestInit>{
|
|
77
|
+
method: "GET",
|
|
78
|
+
headers: {
|
|
79
|
+
"Accept": "application/json"
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
84
|
+
return this.processGetFundStructure(_response);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
protected processGetFundStructure(response: Response): Promise<FundStructureRes> {
|
|
89
|
+
const status = response.status;
|
|
90
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
91
|
+
if (status === 200) {
|
|
92
|
+
return response.text().then((_responseText) => {
|
|
93
|
+
let result200: any = null;
|
|
94
|
+
result200 = _responseText === "" ? null : <FundStructureRes>JSON.parse(_responseText, this.jsonParseReviver);
|
|
95
|
+
return result200;
|
|
96
|
+
});
|
|
97
|
+
} else if (status === 400) {
|
|
98
|
+
return response.text().then((_responseText) => {
|
|
99
|
+
let result400: any = null;
|
|
100
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
101
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
102
|
+
});
|
|
103
|
+
} else if (status === 500) {
|
|
104
|
+
return response.text().then((_responseText) => {
|
|
105
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
106
|
+
});
|
|
107
|
+
} else if (status !== 200 && status !== 204) {
|
|
108
|
+
return response.text().then((_responseText) => {
|
|
109
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return Promise.resolve<FundStructureRes>(<any>null);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
getLookupAllocationTypes(): Promise<NamedLookupRes[]> {
|
|
116
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/allocationTypes";
|
|
117
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
118
|
+
|
|
119
|
+
let options_ = <RequestInit>{
|
|
120
|
+
method: "GET",
|
|
121
|
+
headers: {
|
|
122
|
+
"Accept": "application/json"
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
127
|
+
return this.processGetLookupAllocationTypes(_response);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
protected processGetLookupAllocationTypes(response: Response): Promise<NamedLookupRes[]> {
|
|
132
|
+
const status = response.status;
|
|
133
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
134
|
+
if (status === 200) {
|
|
135
|
+
return response.text().then((_responseText) => {
|
|
136
|
+
let result200: any = null;
|
|
137
|
+
result200 = _responseText === "" ? null : <NamedLookupRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
138
|
+
return result200;
|
|
139
|
+
});
|
|
140
|
+
} else if (status === 400) {
|
|
141
|
+
return response.text().then((_responseText) => {
|
|
142
|
+
let result400: any = null;
|
|
143
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
144
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
145
|
+
});
|
|
146
|
+
} else if (status === 500) {
|
|
147
|
+
return response.text().then((_responseText) => {
|
|
148
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
149
|
+
});
|
|
150
|
+
} else if (status !== 200 && status !== 204) {
|
|
151
|
+
return response.text().then((_responseText) => {
|
|
152
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return Promise.resolve<NamedLookupRes[]>(<any>null);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
getLookupCurrencies(): Promise<CurrencyRes[]> {
|
|
159
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/currencies";
|
|
160
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
161
|
+
|
|
162
|
+
let options_ = <RequestInit>{
|
|
163
|
+
method: "GET",
|
|
164
|
+
headers: {
|
|
165
|
+
"Accept": "application/json"
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
170
|
+
return this.processGetLookupCurrencies(_response);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
protected processGetLookupCurrencies(response: Response): Promise<CurrencyRes[]> {
|
|
175
|
+
const status = response.status;
|
|
176
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
177
|
+
if (status === 200) {
|
|
178
|
+
return response.text().then((_responseText) => {
|
|
179
|
+
let result200: any = null;
|
|
180
|
+
result200 = _responseText === "" ? null : <CurrencyRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
181
|
+
return result200;
|
|
182
|
+
});
|
|
183
|
+
} else if (status === 400) {
|
|
184
|
+
return response.text().then((_responseText) => {
|
|
185
|
+
let result400: any = null;
|
|
186
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
187
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
188
|
+
});
|
|
189
|
+
} else if (status === 500) {
|
|
190
|
+
return response.text().then((_responseText) => {
|
|
191
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
192
|
+
});
|
|
193
|
+
} else if (status !== 200 && status !== 204) {
|
|
194
|
+
return response.text().then((_responseText) => {
|
|
195
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return Promise.resolve<CurrencyRes[]>(<any>null);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
getLookupDonationItems(): Promise<DonationItemRes[]> {
|
|
202
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/donationItems";
|
|
203
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
204
|
+
|
|
205
|
+
let options_ = <RequestInit>{
|
|
206
|
+
method: "GET",
|
|
207
|
+
headers: {
|
|
208
|
+
"Accept": "application/json"
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
213
|
+
return this.processGetLookupDonationItems(_response);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
protected processGetLookupDonationItems(response: Response): Promise<DonationItemRes[]> {
|
|
218
|
+
const status = response.status;
|
|
219
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
220
|
+
if (status === 200) {
|
|
221
|
+
return response.text().then((_responseText) => {
|
|
222
|
+
let result200: any = null;
|
|
223
|
+
result200 = _responseText === "" ? null : <DonationItemRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
224
|
+
return result200;
|
|
225
|
+
});
|
|
226
|
+
} else if (status === 400) {
|
|
227
|
+
return response.text().then((_responseText) => {
|
|
228
|
+
let result400: any = null;
|
|
229
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
230
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
231
|
+
});
|
|
232
|
+
} else if (status === 500) {
|
|
233
|
+
return response.text().then((_responseText) => {
|
|
234
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
235
|
+
});
|
|
236
|
+
} else if (status !== 200 && status !== 204) {
|
|
237
|
+
return response.text().then((_responseText) => {
|
|
238
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return Promise.resolve<DonationItemRes[]>(<any>null);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
getLookupFundDimension1Values(): Promise<FundDimensionValueRes[]> {
|
|
245
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/fundDimension1Values";
|
|
246
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
247
|
+
|
|
248
|
+
let options_ = <RequestInit>{
|
|
249
|
+
method: "GET",
|
|
250
|
+
headers: {
|
|
251
|
+
"Accept": "application/json"
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
256
|
+
return this.processGetLookupFundDimension1Values(_response);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
protected processGetLookupFundDimension1Values(response: Response): Promise<FundDimensionValueRes[]> {
|
|
261
|
+
const status = response.status;
|
|
262
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
263
|
+
if (status === 200) {
|
|
264
|
+
return response.text().then((_responseText) => {
|
|
265
|
+
let result200: any = null;
|
|
266
|
+
result200 = _responseText === "" ? null : <FundDimensionValueRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
267
|
+
return result200;
|
|
268
|
+
});
|
|
269
|
+
} else if (status === 400) {
|
|
270
|
+
return response.text().then((_responseText) => {
|
|
271
|
+
let result400: any = null;
|
|
272
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
273
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
274
|
+
});
|
|
275
|
+
} else if (status === 500) {
|
|
276
|
+
return response.text().then((_responseText) => {
|
|
277
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
278
|
+
});
|
|
279
|
+
} else if (status !== 200 && status !== 204) {
|
|
280
|
+
return response.text().then((_responseText) => {
|
|
281
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
return Promise.resolve<FundDimensionValueRes[]>(<any>null);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
getLookupFundDimension2Values(): Promise<FundDimensionValueRes[]> {
|
|
288
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/fundDimension2Values";
|
|
289
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
290
|
+
|
|
291
|
+
let options_ = <RequestInit>{
|
|
292
|
+
method: "GET",
|
|
293
|
+
headers: {
|
|
294
|
+
"Accept": "application/json"
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
299
|
+
return this.processGetLookupFundDimension2Values(_response);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
protected processGetLookupFundDimension2Values(response: Response): Promise<FundDimensionValueRes[]> {
|
|
304
|
+
const status = response.status;
|
|
305
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
306
|
+
if (status === 200) {
|
|
307
|
+
return response.text().then((_responseText) => {
|
|
308
|
+
let result200: any = null;
|
|
309
|
+
result200 = _responseText === "" ? null : <FundDimensionValueRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
310
|
+
return result200;
|
|
311
|
+
});
|
|
312
|
+
} else if (status === 400) {
|
|
313
|
+
return response.text().then((_responseText) => {
|
|
314
|
+
let result400: any = null;
|
|
315
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
316
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
317
|
+
});
|
|
318
|
+
} else if (status === 500) {
|
|
319
|
+
return response.text().then((_responseText) => {
|
|
320
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
321
|
+
});
|
|
322
|
+
} else if (status !== 200 && status !== 204) {
|
|
323
|
+
return response.text().then((_responseText) => {
|
|
324
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
return Promise.resolve<FundDimensionValueRes[]>(<any>null);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
getLookupFundDimension3Values(): Promise<FundDimensionValueRes[]> {
|
|
331
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/fundDimension3Values";
|
|
332
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
333
|
+
|
|
334
|
+
let options_ = <RequestInit>{
|
|
335
|
+
method: "GET",
|
|
336
|
+
headers: {
|
|
337
|
+
"Accept": "application/json"
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
342
|
+
return this.processGetLookupFundDimension3Values(_response);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
protected processGetLookupFundDimension3Values(response: Response): Promise<FundDimensionValueRes[]> {
|
|
347
|
+
const status = response.status;
|
|
348
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
349
|
+
if (status === 200) {
|
|
350
|
+
return response.text().then((_responseText) => {
|
|
351
|
+
let result200: any = null;
|
|
352
|
+
result200 = _responseText === "" ? null : <FundDimensionValueRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
353
|
+
return result200;
|
|
354
|
+
});
|
|
355
|
+
} else if (status === 400) {
|
|
356
|
+
return response.text().then((_responseText) => {
|
|
357
|
+
let result400: any = null;
|
|
358
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
359
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
360
|
+
});
|
|
361
|
+
} else if (status === 500) {
|
|
362
|
+
return response.text().then((_responseText) => {
|
|
363
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
364
|
+
});
|
|
365
|
+
} else if (status !== 200 && status !== 204) {
|
|
366
|
+
return response.text().then((_responseText) => {
|
|
367
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
return Promise.resolve<FundDimensionValueRes[]>(<any>null);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
getLookupFundDimension4Values(): Promise<FundDimensionValueRes[]> {
|
|
374
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/fundDimension4Values";
|
|
375
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
376
|
+
|
|
377
|
+
let options_ = <RequestInit>{
|
|
378
|
+
method: "GET",
|
|
379
|
+
headers: {
|
|
380
|
+
"Accept": "application/json"
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
385
|
+
return this.processGetLookupFundDimension4Values(_response);
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
protected processGetLookupFundDimension4Values(response: Response): Promise<FundDimensionValueRes[]> {
|
|
390
|
+
const status = response.status;
|
|
391
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
392
|
+
if (status === 200) {
|
|
393
|
+
return response.text().then((_responseText) => {
|
|
394
|
+
let result200: any = null;
|
|
395
|
+
result200 = _responseText === "" ? null : <FundDimensionValueRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
396
|
+
return result200;
|
|
397
|
+
});
|
|
398
|
+
} else if (status === 400) {
|
|
399
|
+
return response.text().then((_responseText) => {
|
|
400
|
+
let result400: any = null;
|
|
401
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
402
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
403
|
+
});
|
|
404
|
+
} else if (status === 500) {
|
|
405
|
+
return response.text().then((_responseText) => {
|
|
406
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
407
|
+
});
|
|
408
|
+
} else if (status !== 200 && status !== 204) {
|
|
409
|
+
return response.text().then((_responseText) => {
|
|
410
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
return Promise.resolve<FundDimensionValueRes[]>(<any>null);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
getLookupGivingTypes(): Promise<NamedLookupRes[]> {
|
|
417
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/givingTypes";
|
|
418
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
419
|
+
|
|
420
|
+
let options_ = <RequestInit>{
|
|
421
|
+
method: "GET",
|
|
422
|
+
headers: {
|
|
423
|
+
"Accept": "application/json"
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
428
|
+
return this.processGetLookupGivingTypes(_response);
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
protected processGetLookupGivingTypes(response: Response): Promise<NamedLookupRes[]> {
|
|
433
|
+
const status = response.status;
|
|
434
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
435
|
+
if (status === 200) {
|
|
436
|
+
return response.text().then((_responseText) => {
|
|
437
|
+
let result200: any = null;
|
|
438
|
+
result200 = _responseText === "" ? null : <NamedLookupRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
439
|
+
return result200;
|
|
440
|
+
});
|
|
441
|
+
} else if (status === 400) {
|
|
442
|
+
return response.text().then((_responseText) => {
|
|
443
|
+
let result400: any = null;
|
|
444
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
445
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
446
|
+
});
|
|
447
|
+
} else if (status === 500) {
|
|
448
|
+
return response.text().then((_responseText) => {
|
|
449
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
450
|
+
});
|
|
451
|
+
} else if (status !== 200 && status !== 204) {
|
|
452
|
+
return response.text().then((_responseText) => {
|
|
453
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
return Promise.resolve<NamedLookupRes[]>(<any>null);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
getLookupSponsorshipDurations(): Promise<SponsorshipDurationRes[]> {
|
|
460
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/sponsorshipDurations";
|
|
461
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
462
|
+
|
|
463
|
+
let options_ = <RequestInit>{
|
|
464
|
+
method: "GET",
|
|
465
|
+
headers: {
|
|
466
|
+
"Accept": "application/json"
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
471
|
+
return this.processGetLookupSponsorshipDurations(_response);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
protected processGetLookupSponsorshipDurations(response: Response): Promise<SponsorshipDurationRes[]> {
|
|
476
|
+
const status = response.status;
|
|
477
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
478
|
+
if (status === 200) {
|
|
479
|
+
return response.text().then((_responseText) => {
|
|
480
|
+
let result200: any = null;
|
|
481
|
+
result200 = _responseText === "" ? null : <SponsorshipDurationRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
482
|
+
return result200;
|
|
483
|
+
});
|
|
484
|
+
} else if (status === 400) {
|
|
485
|
+
return response.text().then((_responseText) => {
|
|
486
|
+
let result400: any = null;
|
|
487
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
488
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
489
|
+
});
|
|
490
|
+
} else if (status === 500) {
|
|
491
|
+
return response.text().then((_responseText) => {
|
|
492
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
493
|
+
});
|
|
494
|
+
} else if (status !== 200 && status !== 204) {
|
|
495
|
+
return response.text().then((_responseText) => {
|
|
496
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
return Promise.resolve<SponsorshipDurationRes[]>(<any>null);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
getLookupSponsorshipSchemes(): Promise<SponsorshipSchemeRes[]> {
|
|
503
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/sponsorshipSchemes";
|
|
504
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
505
|
+
|
|
506
|
+
let options_ = <RequestInit>{
|
|
507
|
+
method: "GET",
|
|
508
|
+
headers: {
|
|
509
|
+
"Accept": "application/json"
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
514
|
+
return this.processGetLookupSponsorshipSchemes(_response);
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
protected processGetLookupSponsorshipSchemes(response: Response): Promise<SponsorshipSchemeRes[]> {
|
|
519
|
+
const status = response.status;
|
|
520
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
521
|
+
if (status === 200) {
|
|
522
|
+
return response.text().then((_responseText) => {
|
|
523
|
+
let result200: any = null;
|
|
524
|
+
result200 = _responseText === "" ? null : <SponsorshipSchemeRes[]>JSON.parse(_responseText, this.jsonParseReviver);
|
|
525
|
+
return result200;
|
|
526
|
+
});
|
|
527
|
+
} else if (status === 400) {
|
|
528
|
+
return response.text().then((_responseText) => {
|
|
529
|
+
let result400: any = null;
|
|
530
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
531
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
532
|
+
});
|
|
533
|
+
} else if (status === 500) {
|
|
534
|
+
return response.text().then((_responseText) => {
|
|
535
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
536
|
+
});
|
|
537
|
+
} else if (status !== 200 && status !== 204) {
|
|
538
|
+
return response.text().then((_responseText) => {
|
|
539
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
return Promise.resolve<SponsorshipSchemeRes[]>(<any>null);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
getPrice(criteria: PriceCriteria): Promise<PriceRes> {
|
|
546
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/pricing";
|
|
547
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
548
|
+
|
|
549
|
+
const content_ = JSON.stringify(criteria);
|
|
550
|
+
|
|
551
|
+
let options_ = <RequestInit>{
|
|
552
|
+
body: content_,
|
|
553
|
+
method: "POST",
|
|
554
|
+
headers: {
|
|
555
|
+
"Content-Type": "application/json",
|
|
556
|
+
"Accept": "application/json"
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
561
|
+
return this.processGetPrice(_response);
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
protected processGetPrice(response: Response): Promise<PriceRes> {
|
|
566
|
+
const status = response.status;
|
|
567
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
568
|
+
if (status === 200) {
|
|
569
|
+
return response.text().then((_responseText) => {
|
|
570
|
+
let result200: any = null;
|
|
571
|
+
result200 = _responseText === "" ? null : <PriceRes>JSON.parse(_responseText, this.jsonParseReviver);
|
|
572
|
+
return result200;
|
|
573
|
+
});
|
|
574
|
+
} else if (status === 400) {
|
|
575
|
+
return response.text().then((_responseText) => {
|
|
576
|
+
let result400: any = null;
|
|
577
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
578
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
579
|
+
});
|
|
580
|
+
} else if (status === 500) {
|
|
581
|
+
return response.text().then((_responseText) => {
|
|
582
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
583
|
+
});
|
|
584
|
+
} else if (status !== 200 && status !== 204) {
|
|
585
|
+
return response.text().then((_responseText) => {
|
|
586
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
return Promise.resolve<PriceRes>(<any>null);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
setCurrency(currencyCode: string): Promise<CurrencyRes> {
|
|
593
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/currency/{currencyCode}";
|
|
594
|
+
if (currencyCode === undefined || currencyCode === null)
|
|
595
|
+
throw new Error("The parameter 'currencyCode' must be defined.");
|
|
596
|
+
url_ = url_.replace("{currencyCode}", encodeURIComponent("" + currencyCode));
|
|
597
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
598
|
+
|
|
599
|
+
let options_ = <RequestInit>{
|
|
600
|
+
method: "POST",
|
|
601
|
+
headers: {
|
|
602
|
+
"Accept": "application/json"
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
607
|
+
return this.processSetCurrency(_response);
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
protected processSetCurrency(response: Response): Promise<CurrencyRes> {
|
|
612
|
+
const status = response.status;
|
|
613
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
614
|
+
if (status === 200) {
|
|
615
|
+
return response.text().then((_responseText) => {
|
|
616
|
+
let result200: any = null;
|
|
617
|
+
result200 = _responseText === "" ? null : <CurrencyRes>JSON.parse(_responseText, this.jsonParseReviver);
|
|
618
|
+
return result200;
|
|
619
|
+
});
|
|
620
|
+
} else if (status === 400) {
|
|
621
|
+
return response.text().then((_responseText) => {
|
|
622
|
+
let result400: any = null;
|
|
623
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
624
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
625
|
+
});
|
|
626
|
+
} else if (status === 500) {
|
|
627
|
+
return response.text().then((_responseText) => {
|
|
628
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
629
|
+
});
|
|
630
|
+
} else if (status === 404) {
|
|
631
|
+
return response.text().then((_responseText) => {
|
|
632
|
+
let result404: any = null;
|
|
633
|
+
result404 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
634
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
635
|
+
});
|
|
636
|
+
} else if (status !== 200 && status !== 204) {
|
|
637
|
+
return response.text().then((_responseText) => {
|
|
638
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
return Promise.resolve<CurrencyRes>(<any>null);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
getAllLookups(criteria: LookupsCriteria): Promise<GivingLookupsRes> {
|
|
645
|
+
let url_ = this.baseUrl + "/umbraco/api/Giving/lookups/all";
|
|
646
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
647
|
+
|
|
648
|
+
const content_ = JSON.stringify(criteria);
|
|
649
|
+
|
|
650
|
+
let options_ = <RequestInit>{
|
|
651
|
+
body: content_,
|
|
652
|
+
method: "POST",
|
|
653
|
+
headers: {
|
|
654
|
+
"Content-Type": "application/json",
|
|
655
|
+
"Accept": "application/json"
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
return this.http.fetch(url_, options_).then((_response: Response) => {
|
|
660
|
+
return this.processGetAllLookups(_response);
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
protected processGetAllLookups(response: Response): Promise<GivingLookupsRes> {
|
|
665
|
+
const status = response.status;
|
|
666
|
+
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
|
667
|
+
if (status === 200) {
|
|
668
|
+
return response.text().then((_responseText) => {
|
|
669
|
+
let result200: any = null;
|
|
670
|
+
result200 = _responseText === "" ? null : <GivingLookupsRes>JSON.parse(_responseText, this.jsonParseReviver);
|
|
671
|
+
return result200;
|
|
672
|
+
});
|
|
673
|
+
} else if (status === 400) {
|
|
674
|
+
return response.text().then((_responseText) => {
|
|
675
|
+
let result400: any = null;
|
|
676
|
+
result400 = _responseText === "" ? null : <ProblemDetails>JSON.parse(_responseText, this.jsonParseReviver);
|
|
677
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
678
|
+
});
|
|
679
|
+
} else if (status === 500) {
|
|
680
|
+
return response.text().then((_responseText) => {
|
|
681
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
682
|
+
});
|
|
683
|
+
} else if (status !== 200 && status !== 204) {
|
|
684
|
+
return response.text().then((_responseText) => {
|
|
685
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
return Promise.resolve<GivingLookupsRes>(<any>null);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
export interface DonationFormRes {
|
|
693
|
+
title?: string | undefined;
|
|
694
|
+
options?: DonationOptionRes[] | undefined;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
export interface DonationOptionRes {
|
|
698
|
+
type?: AllocationType | undefined;
|
|
699
|
+
dimension1?: FixedOrDefaultFundDimensionValueRes | undefined;
|
|
700
|
+
dimension2?: FixedOrDefaultFundDimensionValueRes | undefined;
|
|
701
|
+
dimension3?: FixedOrDefaultFundDimensionValueRes | undefined;
|
|
702
|
+
dimension4?: FixedOrDefaultFundDimensionValueRes | undefined;
|
|
703
|
+
hideQuantity?: boolean;
|
|
704
|
+
hideDonation?: boolean;
|
|
705
|
+
hideRegularGiving?: boolean;
|
|
706
|
+
fund?: FundDonationOptionRes | undefined;
|
|
707
|
+
sponsorship?: SponsorshipDonationOptionRes | undefined;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/** One of 'fund', 'sponsorship' */
|
|
711
|
+
export enum AllocationType {
|
|
712
|
+
Fund = "fund",
|
|
713
|
+
Sponsorship = "sponsorship",
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export interface FixedOrDefaultFundDimensionValueRes {
|
|
717
|
+
fixed?: FundDimensionValueRes | undefined;
|
|
718
|
+
default?: FundDimensionValueRes | undefined;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export interface FundDimensionValueRes {
|
|
722
|
+
name?: string | undefined;
|
|
723
|
+
id?: string | undefined;
|
|
724
|
+
isUnrestricted?: boolean;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
export interface FundDonationOptionRes {
|
|
728
|
+
donationItem?: string | undefined;
|
|
729
|
+
donationPriceHandles?: PriceHandleRes[] | undefined;
|
|
730
|
+
regularGivingPriceHandles?: PriceHandleRes[] | undefined;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
export interface IPublishedContent {
|
|
734
|
+
id?: number;
|
|
735
|
+
name?: string | undefined;
|
|
736
|
+
urlSegment?: string | undefined;
|
|
737
|
+
sortOrder?: number;
|
|
738
|
+
level?: number;
|
|
739
|
+
path?: string | undefined;
|
|
740
|
+
templateId?: number | undefined;
|
|
741
|
+
creatorId?: number;
|
|
742
|
+
createDate?: Date;
|
|
743
|
+
writerId?: number;
|
|
744
|
+
updateDate?: Date;
|
|
745
|
+
cultures?: { [key: string]: PublishedCultureInfo; } | undefined;
|
|
746
|
+
itemType?: PublishedItemType;
|
|
747
|
+
parent?: IPublishedContent | undefined;
|
|
748
|
+
children?: IPublishedContent[] | undefined;
|
|
749
|
+
childrenForAllCultures?: IPublishedContent[] | undefined;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
export interface PublishedCultureInfo {
|
|
753
|
+
culture?: string | undefined;
|
|
754
|
+
name?: string | undefined;
|
|
755
|
+
urlSegment?: string | undefined;
|
|
756
|
+
date?: Date;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
export enum PublishedItemType {
|
|
760
|
+
Unknown = 0,
|
|
761
|
+
Element = 1,
|
|
762
|
+
Content = 2,
|
|
763
|
+
Media = 3,
|
|
764
|
+
Member = 4,
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/** One of 'donation', 'regularGiving' */
|
|
768
|
+
export enum GivingType {
|
|
769
|
+
Donation = "donation",
|
|
770
|
+
RegularGiving = "regularGiving",
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export interface PriceContent {
|
|
774
|
+
content?: IPublishedContent | undefined;
|
|
775
|
+
amount?: number;
|
|
776
|
+
locked?: boolean;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export interface PricingRuleElement {
|
|
780
|
+
content?: IPublishedElement | undefined;
|
|
781
|
+
amount?: number;
|
|
782
|
+
locked?: boolean;
|
|
783
|
+
dimension1?: string | undefined;
|
|
784
|
+
dimension2?: string | undefined;
|
|
785
|
+
dimension3?: string | undefined;
|
|
786
|
+
dimension4?: string | undefined;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export interface IPublishedElement {
|
|
790
|
+
contentType?: IPublishedContentType | undefined;
|
|
791
|
+
key?: string;
|
|
792
|
+
properties?: IPublishedProperty[] | undefined;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
export interface IPublishedContentType {
|
|
796
|
+
key?: string;
|
|
797
|
+
id?: number;
|
|
798
|
+
alias?: string | undefined;
|
|
799
|
+
itemType?: PublishedItemType;
|
|
800
|
+
compositionAliases?: string[] | undefined;
|
|
801
|
+
variations?: ContentVariation;
|
|
802
|
+
isElement?: boolean;
|
|
803
|
+
propertyTypes?: IPublishedPropertyType[] | undefined;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export enum ContentVariation {
|
|
807
|
+
Nothing = 0,
|
|
808
|
+
Culture = 1,
|
|
809
|
+
Segment = 2,
|
|
810
|
+
CultureAndSegment = 3,
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export interface IPublishedPropertyType {
|
|
814
|
+
contentType?: IPublishedContentType | undefined;
|
|
815
|
+
dataType?: PublishedDataType | undefined;
|
|
816
|
+
alias?: string | undefined;
|
|
817
|
+
editorAlias?: string | undefined;
|
|
818
|
+
isUserProperty?: boolean;
|
|
819
|
+
variations?: ContentVariation;
|
|
820
|
+
cacheLevel?: PropertyCacheLevel;
|
|
821
|
+
modelClrType?: string | undefined;
|
|
822
|
+
clrType?: string | undefined;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
export interface PublishedDataType {
|
|
826
|
+
id?: number;
|
|
827
|
+
editorAlias?: string | undefined;
|
|
828
|
+
configuration?: any | undefined;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export enum PropertyCacheLevel {
|
|
832
|
+
Unknown = 0,
|
|
833
|
+
Element = 1,
|
|
834
|
+
Elements = 2,
|
|
835
|
+
Snapshot = 3,
|
|
836
|
+
None = 4,
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
export interface IPublishedProperty {
|
|
840
|
+
propertyType?: IPublishedPropertyType | undefined;
|
|
841
|
+
alias?: string | undefined;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
export interface PriceHandleRes {
|
|
845
|
+
amount?: MoneyRes | undefined;
|
|
846
|
+
description?: string | undefined;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
export interface MoneyRes {
|
|
850
|
+
amount?: number;
|
|
851
|
+
currency?: string | undefined;
|
|
852
|
+
text?: string | undefined;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
export interface SponsorshipDonationOptionRes {
|
|
856
|
+
scheme?: string | undefined;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/** One of '_6', '_12', '_18', '_24' */
|
|
860
|
+
export enum SponsorshipDuration {
|
|
861
|
+
_6 = "_6",
|
|
862
|
+
_12 = "_12",
|
|
863
|
+
_18 = "_18",
|
|
864
|
+
_24 = "_24",
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
export interface ProblemDetails {
|
|
868
|
+
type?: string | undefined;
|
|
869
|
+
title?: string | undefined;
|
|
870
|
+
status?: number | undefined;
|
|
871
|
+
detail?: string | undefined;
|
|
872
|
+
instance?: string | undefined;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
export interface FundStructureRes {
|
|
876
|
+
dimension1?: FundDimensionRes | undefined;
|
|
877
|
+
dimension2?: FundDimensionRes | undefined;
|
|
878
|
+
dimension3?: FundDimensionRes | undefined;
|
|
879
|
+
dimension4?: FundDimensionRes | undefined;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export interface FundDimensionRes {
|
|
883
|
+
name?: string | undefined;
|
|
884
|
+
id?: string | undefined;
|
|
885
|
+
isActive?: boolean;
|
|
886
|
+
options?: FundDimensionValueRes[] | undefined;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
export interface NamedLookupRes {
|
|
890
|
+
id?: string | undefined;
|
|
891
|
+
name?: string | undefined;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
export interface CurrencyRes {
|
|
895
|
+
name?: string | undefined;
|
|
896
|
+
id?: string | undefined;
|
|
897
|
+
code?: string | undefined;
|
|
898
|
+
isBaseCurrency?: boolean;
|
|
899
|
+
symbol?: string | undefined;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
export interface DonationItemRes {
|
|
903
|
+
name?: string | undefined;
|
|
904
|
+
id?: string | undefined;
|
|
905
|
+
allowedGivingTypes?: GivingType[] | undefined;
|
|
906
|
+
dimension1Options?: FundDimensionValueRes[] | undefined;
|
|
907
|
+
dimension2Options?: FundDimensionValueRes[] | undefined;
|
|
908
|
+
dimension3Options?: FundDimensionValueRes[] | undefined;
|
|
909
|
+
dimension4Options?: FundDimensionValueRes[] | undefined;
|
|
910
|
+
pricing?: PricingRes | undefined;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
export interface PricingRes {
|
|
914
|
+
amount?: number;
|
|
915
|
+
locked?: boolean;
|
|
916
|
+
priceRules?: PricingRuleRes[] | undefined;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
export interface PricingRuleRes {
|
|
920
|
+
amount?: number;
|
|
921
|
+
locked?: boolean;
|
|
922
|
+
fundDimensions?: FundDimensionValuesRes | undefined;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
export interface FundDimensionValuesRes {
|
|
926
|
+
dimension1?: string | undefined;
|
|
927
|
+
dimension2?: string | undefined;
|
|
928
|
+
dimension3?: string | undefined;
|
|
929
|
+
dimension4?: string | undefined;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export interface SponsorshipDurationRes {
|
|
933
|
+
name?: string | undefined;
|
|
934
|
+
id?: string | undefined;
|
|
935
|
+
months?: number;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export interface SponsorshipSchemeRes {
|
|
939
|
+
name?: string | undefined;
|
|
940
|
+
id?: string | undefined;
|
|
941
|
+
allowedGivingTypes?: GivingType[] | undefined;
|
|
942
|
+
allowedDurations?: SponsorshipDuration[] | undefined;
|
|
943
|
+
dimension1Options?: FundDimensionValueRes[] | undefined;
|
|
944
|
+
dimension2Options?: FundDimensionValueRes[] | undefined;
|
|
945
|
+
dimension3Options?: FundDimensionValueRes[] | undefined;
|
|
946
|
+
dimension4Options?: FundDimensionValueRes[] | undefined;
|
|
947
|
+
components?: SponsorshipComponentRes[] | undefined;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
export interface SponsorshipComponentRes {
|
|
951
|
+
name?: string | undefined;
|
|
952
|
+
id?: string | undefined;
|
|
953
|
+
pricing?: PricingRes | undefined;
|
|
954
|
+
mandatory?: boolean;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
export interface PriceRes {
|
|
958
|
+
amount?: number;
|
|
959
|
+
locked?: boolean;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
export interface PriceCriteria {
|
|
963
|
+
donationItem?: string | undefined;
|
|
964
|
+
sponsorshipComponent?: string | undefined;
|
|
965
|
+
fundDimensions?: FundDimensionValuesReq | undefined;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export interface FundDimensionValuesReq {
|
|
969
|
+
dimension1?: string | undefined;
|
|
970
|
+
dimension2?: string | undefined;
|
|
971
|
+
dimension3?: string | undefined;
|
|
972
|
+
dimension4?: string | undefined;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export interface GivingLookupsRes {
|
|
976
|
+
allocationTypes?: NamedLookupRes[] | undefined;
|
|
977
|
+
currencies?: CurrencyRes[] | undefined;
|
|
978
|
+
donationItems?: DonationItemRes[] | undefined;
|
|
979
|
+
givingTypes?: NamedLookupRes[] | undefined;
|
|
980
|
+
fundDimension1Values?: FundDimensionValueRes[] | undefined;
|
|
981
|
+
fundDimension2Values?: FundDimensionValueRes[] | undefined;
|
|
982
|
+
fundDimension3Values?: FundDimensionValueRes[] | undefined;
|
|
983
|
+
fundDimension4Values?: FundDimensionValueRes[] | undefined;
|
|
984
|
+
sponsorshipDurations?: SponsorshipDurationRes[] | undefined;
|
|
985
|
+
sponsorshipSchemes?: SponsorshipSchemeRes[] | undefined;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
export interface LookupsCriteria {
|
|
989
|
+
types?: string[] | undefined;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
export class ApiException extends Error {
|
|
993
|
+
message: string;
|
|
994
|
+
status: number;
|
|
995
|
+
response: string;
|
|
996
|
+
headers: { [key: string]: any; };
|
|
997
|
+
result: any;
|
|
998
|
+
|
|
999
|
+
constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) {
|
|
1000
|
+
super();
|
|
1001
|
+
|
|
1002
|
+
this.message = message;
|
|
1003
|
+
this.status = status;
|
|
1004
|
+
this.response = response;
|
|
1005
|
+
this.headers = headers;
|
|
1006
|
+
this.result = result;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
protected isApiException = true;
|
|
1010
|
+
|
|
1011
|
+
static isApiException(obj: any): obj is ApiException {
|
|
1012
|
+
return obj.isApiException === true;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any {
|
|
1017
|
+
if (result !== null && result !== undefined)
|
|
1018
|
+
throw result;
|
|
1019
|
+
else
|
|
1020
|
+
throw new ApiException(message, status, response, headers, null);
|
|
1021
|
+
}
|