@n3oltd/umbraco-crowdfunding-client 10.0.156
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/dist/esm/index.d.ts +454 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +796 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.ts +287 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +355 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/esm/index.d.ts +454 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +796 -0
- package/esm/index.js.map +1 -0
- package/package.json +40 -0
- package/src/index.ts +1161 -0
- package/tsconfig.json +21 -0
package/esm/index.js
ADDED
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
//----------------------
|
|
2
|
+
// <auto-generated>
|
|
3
|
+
// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
|
|
4
|
+
// </auto-generated>
|
|
5
|
+
//----------------------
|
|
6
|
+
var __extends = (this && this.__extends) || (function () {
|
|
7
|
+
var extendStatics = function (d, b) {
|
|
8
|
+
extendStatics = Object.setPrototypeOf ||
|
|
9
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
11
|
+
return extendStatics(d, b);
|
|
12
|
+
};
|
|
13
|
+
return function (d, b) {
|
|
14
|
+
extendStatics(d, b);
|
|
15
|
+
function __() { this.constructor = d; }
|
|
16
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
/* tslint:disable */
|
|
20
|
+
/* eslint-disable */
|
|
21
|
+
// ReSharper disable InconsistentNaming
|
|
22
|
+
var CrowdfundingClient = /** @class */ (function () {
|
|
23
|
+
function CrowdfundingClient(baseUrl, http) {
|
|
24
|
+
this.jsonParseReviver = undefined;
|
|
25
|
+
this.http = http ? http : window;
|
|
26
|
+
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "https://localhost:6001";
|
|
27
|
+
}
|
|
28
|
+
CrowdfundingClient.prototype.getCampaignGoalOptions = function (campaignId, goalOptionId, crowdfunding_API_Key) {
|
|
29
|
+
var _this = this;
|
|
30
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/campaigns/{campaignId}/goalOptions/{goalOptionId}";
|
|
31
|
+
if (campaignId === undefined || campaignId === null)
|
|
32
|
+
throw new Error("The parameter 'campaignId' must be defined.");
|
|
33
|
+
url_ = url_.replace("{campaignId}", encodeURIComponent("" + campaignId));
|
|
34
|
+
if (goalOptionId === undefined || goalOptionId === null)
|
|
35
|
+
throw new Error("The parameter 'goalOptionId' must be defined.");
|
|
36
|
+
url_ = url_.replace("{goalOptionId}", encodeURIComponent("" + goalOptionId));
|
|
37
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
38
|
+
var options_ = {
|
|
39
|
+
method: "GET",
|
|
40
|
+
headers: {
|
|
41
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
42
|
+
"Accept": "application/json"
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
46
|
+
return _this.processGetCampaignGoalOptions(_response);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
CrowdfundingClient.prototype.processGetCampaignGoalOptions = function (response) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var status = response.status;
|
|
52
|
+
var _headers = {};
|
|
53
|
+
if (response.headers && response.headers.forEach) {
|
|
54
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
55
|
+
}
|
|
56
|
+
;
|
|
57
|
+
if (status === 200) {
|
|
58
|
+
return response.text().then(function (_responseText) {
|
|
59
|
+
var result200 = null;
|
|
60
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
61
|
+
return result200;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
else if (status === 400) {
|
|
65
|
+
return response.text().then(function (_responseText) {
|
|
66
|
+
var result400 = null;
|
|
67
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
68
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else if (status === 500) {
|
|
72
|
+
return response.text().then(function (_responseText) {
|
|
73
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else if (status === 404) {
|
|
77
|
+
return response.text().then(function (_responseText) {
|
|
78
|
+
var result404 = null;
|
|
79
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
80
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
else if (status !== 200 && status !== 204) {
|
|
84
|
+
return response.text().then(function (_responseText) {
|
|
85
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return Promise.resolve(null);
|
|
89
|
+
};
|
|
90
|
+
CrowdfundingClient.prototype.addToCart = function (crowdfunding_API_Key, crowdfundingReq) {
|
|
91
|
+
var _this = this;
|
|
92
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/addToCart";
|
|
93
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
94
|
+
var content_ = JSON.stringify(crowdfundingReq);
|
|
95
|
+
var options_ = {
|
|
96
|
+
body: content_,
|
|
97
|
+
method: "POST",
|
|
98
|
+
headers: {
|
|
99
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
100
|
+
"Content-Type": "application/json",
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
104
|
+
return _this.processAddToCart(_response);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
CrowdfundingClient.prototype.processAddToCart = function (response) {
|
|
108
|
+
var _this = this;
|
|
109
|
+
var status = response.status;
|
|
110
|
+
var _headers = {};
|
|
111
|
+
if (response.headers && response.headers.forEach) {
|
|
112
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
113
|
+
}
|
|
114
|
+
;
|
|
115
|
+
if (status === 200) {
|
|
116
|
+
return response.text().then(function (_responseText) {
|
|
117
|
+
return;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else if (status === 400) {
|
|
121
|
+
return response.text().then(function (_responseText) {
|
|
122
|
+
var result400 = null;
|
|
123
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
124
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else if (status === 500) {
|
|
128
|
+
return response.text().then(function (_responseText) {
|
|
129
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else if (status === 412) {
|
|
133
|
+
return response.text().then(function (_responseText) {
|
|
134
|
+
var result412 = null;
|
|
135
|
+
result412 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
136
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result412);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
else if (status !== 200 && status !== 204) {
|
|
140
|
+
return response.text().then(function (_responseText) {
|
|
141
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return Promise.resolve(null);
|
|
145
|
+
};
|
|
146
|
+
CrowdfundingClient.prototype.getContentPropertyValue = function (contentId, propertyAlias, crowdfunding_API_Key) {
|
|
147
|
+
var _this = this;
|
|
148
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/content/{contentId}/properties/{propertyAlias}";
|
|
149
|
+
if (contentId === undefined || contentId === null)
|
|
150
|
+
throw new Error("The parameter 'contentId' must be defined.");
|
|
151
|
+
url_ = url_.replace("{contentId}", encodeURIComponent("" + contentId));
|
|
152
|
+
if (propertyAlias === undefined || propertyAlias === null)
|
|
153
|
+
throw new Error("The parameter 'propertyAlias' must be defined.");
|
|
154
|
+
url_ = url_.replace("{propertyAlias}", encodeURIComponent("" + propertyAlias));
|
|
155
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
156
|
+
var options_ = {
|
|
157
|
+
method: "GET",
|
|
158
|
+
headers: {
|
|
159
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
160
|
+
"Accept": "application/json"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
164
|
+
return _this.processGetContentPropertyValue(_response);
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
CrowdfundingClient.prototype.processGetContentPropertyValue = function (response) {
|
|
168
|
+
var _this = this;
|
|
169
|
+
var status = response.status;
|
|
170
|
+
var _headers = {};
|
|
171
|
+
if (response.headers && response.headers.forEach) {
|
|
172
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
173
|
+
}
|
|
174
|
+
;
|
|
175
|
+
if (status === 200) {
|
|
176
|
+
return response.text().then(function (_responseText) {
|
|
177
|
+
var result200 = null;
|
|
178
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
179
|
+
return result200;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else if (status === 400) {
|
|
183
|
+
return response.text().then(function (_responseText) {
|
|
184
|
+
var result400 = null;
|
|
185
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
186
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
else if (status === 500) {
|
|
190
|
+
return response.text().then(function (_responseText) {
|
|
191
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
else if (status === 404) {
|
|
195
|
+
return response.text().then(function (_responseText) {
|
|
196
|
+
var result404 = null;
|
|
197
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
198
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
else if (status !== 200 && status !== 204) {
|
|
202
|
+
return response.text().then(function (_responseText) {
|
|
203
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return Promise.resolve(null);
|
|
207
|
+
};
|
|
208
|
+
CrowdfundingClient.prototype.getNestedPropertySchema = function (contentId, propertyAlias, crowdfunding_API_Key) {
|
|
209
|
+
var _this = this;
|
|
210
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/content/{contentId}/nested/{propertyAlias}/schema";
|
|
211
|
+
if (contentId === undefined || contentId === null)
|
|
212
|
+
throw new Error("The parameter 'contentId' must be defined.");
|
|
213
|
+
url_ = url_.replace("{contentId}", encodeURIComponent("" + contentId));
|
|
214
|
+
if (propertyAlias === undefined || propertyAlias === null)
|
|
215
|
+
throw new Error("The parameter 'propertyAlias' must be defined.");
|
|
216
|
+
url_ = url_.replace("{propertyAlias}", encodeURIComponent("" + propertyAlias));
|
|
217
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
218
|
+
var options_ = {
|
|
219
|
+
method: "GET",
|
|
220
|
+
headers: {
|
|
221
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
222
|
+
"Accept": "application/json"
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
226
|
+
return _this.processGetNestedPropertySchema(_response);
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
CrowdfundingClient.prototype.processGetNestedPropertySchema = function (response) {
|
|
230
|
+
var _this = this;
|
|
231
|
+
var status = response.status;
|
|
232
|
+
var _headers = {};
|
|
233
|
+
if (response.headers && response.headers.forEach) {
|
|
234
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
235
|
+
}
|
|
236
|
+
;
|
|
237
|
+
if (status === 200) {
|
|
238
|
+
return response.text().then(function (_responseText) {
|
|
239
|
+
var result200 = null;
|
|
240
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
241
|
+
return result200;
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
else if (status === 400) {
|
|
245
|
+
return response.text().then(function (_responseText) {
|
|
246
|
+
var result400 = null;
|
|
247
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
248
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
else if (status === 500) {
|
|
252
|
+
return response.text().then(function (_responseText) {
|
|
253
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
else if (status === 404) {
|
|
257
|
+
return response.text().then(function (_responseText) {
|
|
258
|
+
var result404 = null;
|
|
259
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
260
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
else if (status !== 200 && status !== 204) {
|
|
264
|
+
return response.text().then(function (_responseText) {
|
|
265
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
return Promise.resolve(null);
|
|
269
|
+
};
|
|
270
|
+
CrowdfundingClient.prototype.updateProperty = function (contentId, crowdfunding_API_Key, req) {
|
|
271
|
+
var _this = this;
|
|
272
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/content/{contentId}/property";
|
|
273
|
+
if (contentId === undefined || contentId === null)
|
|
274
|
+
throw new Error("The parameter 'contentId' must be defined.");
|
|
275
|
+
url_ = url_.replace("{contentId}", encodeURIComponent("" + contentId));
|
|
276
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
277
|
+
var content_ = JSON.stringify(req);
|
|
278
|
+
var options_ = {
|
|
279
|
+
body: content_,
|
|
280
|
+
method: "PUT",
|
|
281
|
+
headers: {
|
|
282
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
283
|
+
"Content-Type": "application/json",
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
287
|
+
return _this.processUpdateProperty(_response);
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
CrowdfundingClient.prototype.processUpdateProperty = function (response) {
|
|
291
|
+
var _this = this;
|
|
292
|
+
var status = response.status;
|
|
293
|
+
var _headers = {};
|
|
294
|
+
if (response.headers && response.headers.forEach) {
|
|
295
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
296
|
+
}
|
|
297
|
+
;
|
|
298
|
+
if (status === 200) {
|
|
299
|
+
return response.text().then(function (_responseText) {
|
|
300
|
+
return;
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
else if (status === 400) {
|
|
304
|
+
return response.text().then(function (_responseText) {
|
|
305
|
+
var result400 = null;
|
|
306
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
307
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else if (status === 500) {
|
|
311
|
+
return response.text().then(function (_responseText) {
|
|
312
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
else if (status === 404) {
|
|
316
|
+
return response.text().then(function (_responseText) {
|
|
317
|
+
var result404 = null;
|
|
318
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
319
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
else if (status !== 200 && status !== 204) {
|
|
323
|
+
return response.text().then(function (_responseText) {
|
|
324
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
return Promise.resolve(null);
|
|
328
|
+
};
|
|
329
|
+
CrowdfundingClient.prototype.suggestSlug = function (name, crowdfunding_API_Key) {
|
|
330
|
+
var _this = this;
|
|
331
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/suggestSlug?";
|
|
332
|
+
if (name !== undefined && name !== null)
|
|
333
|
+
url_ += "name=" + encodeURIComponent("" + name) + "&";
|
|
334
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
335
|
+
var options_ = {
|
|
336
|
+
method: "POST",
|
|
337
|
+
headers: {
|
|
338
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
339
|
+
"Accept": "application/json"
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
343
|
+
return _this.processSuggestSlug(_response);
|
|
344
|
+
});
|
|
345
|
+
};
|
|
346
|
+
CrowdfundingClient.prototype.processSuggestSlug = function (response) {
|
|
347
|
+
var _this = this;
|
|
348
|
+
var status = response.status;
|
|
349
|
+
var _headers = {};
|
|
350
|
+
if (response.headers && response.headers.forEach) {
|
|
351
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
352
|
+
}
|
|
353
|
+
;
|
|
354
|
+
if (status === 200) {
|
|
355
|
+
return response.text().then(function (_responseText) {
|
|
356
|
+
var result200 = null;
|
|
357
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
358
|
+
return result200;
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
else if (status === 400) {
|
|
362
|
+
return response.text().then(function (_responseText) {
|
|
363
|
+
var result400 = null;
|
|
364
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
365
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
else if (status === 500) {
|
|
369
|
+
return response.text().then(function (_responseText) {
|
|
370
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
else if (status === 412) {
|
|
374
|
+
return response.text().then(function (_responseText) {
|
|
375
|
+
var result412 = null;
|
|
376
|
+
result412 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
377
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result412);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
else if (status !== 200 && status !== 204) {
|
|
381
|
+
return response.text().then(function (_responseText) {
|
|
382
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
return Promise.resolve(null);
|
|
386
|
+
};
|
|
387
|
+
CrowdfundingClient.prototype.activateFundraiser = function (fundraiserId, crowdfunding_API_Key) {
|
|
388
|
+
var _this = this;
|
|
389
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/fundraisers/{fundraiserId}/activate";
|
|
390
|
+
if (fundraiserId === undefined || fundraiserId === null)
|
|
391
|
+
throw new Error("The parameter 'fundraiserId' must be defined.");
|
|
392
|
+
url_ = url_.replace("{fundraiserId}", encodeURIComponent("" + fundraiserId));
|
|
393
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
394
|
+
var options_ = {
|
|
395
|
+
method: "POST",
|
|
396
|
+
headers: {
|
|
397
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
401
|
+
return _this.processActivateFundraiser(_response);
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
CrowdfundingClient.prototype.processActivateFundraiser = function (response) {
|
|
405
|
+
var _this = this;
|
|
406
|
+
var status = response.status;
|
|
407
|
+
var _headers = {};
|
|
408
|
+
if (response.headers && response.headers.forEach) {
|
|
409
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
410
|
+
}
|
|
411
|
+
;
|
|
412
|
+
if (status === 200) {
|
|
413
|
+
return response.text().then(function (_responseText) {
|
|
414
|
+
return;
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
else if (status === 400) {
|
|
418
|
+
return response.text().then(function (_responseText) {
|
|
419
|
+
var result400 = null;
|
|
420
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
421
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
else if (status === 500) {
|
|
425
|
+
return response.text().then(function (_responseText) {
|
|
426
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
else if (status === 412) {
|
|
430
|
+
return response.text().then(function (_responseText) {
|
|
431
|
+
var result412 = null;
|
|
432
|
+
result412 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
433
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result412);
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
else if (status !== 200 && status !== 204) {
|
|
437
|
+
return response.text().then(function (_responseText) {
|
|
438
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
return Promise.resolve(null);
|
|
442
|
+
};
|
|
443
|
+
CrowdfundingClient.prototype.createFundraiser = function (crowdfunding_API_Key, req) {
|
|
444
|
+
var _this = this;
|
|
445
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/fundraisers";
|
|
446
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
447
|
+
var content_ = JSON.stringify(req);
|
|
448
|
+
var options_ = {
|
|
449
|
+
body: content_,
|
|
450
|
+
method: "POST",
|
|
451
|
+
headers: {
|
|
452
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
453
|
+
"Content-Type": "application/json",
|
|
454
|
+
"Accept": "application/json"
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
458
|
+
return _this.processCreateFundraiser(_response);
|
|
459
|
+
});
|
|
460
|
+
};
|
|
461
|
+
CrowdfundingClient.prototype.processCreateFundraiser = function (response) {
|
|
462
|
+
var _this = this;
|
|
463
|
+
var status = response.status;
|
|
464
|
+
var _headers = {};
|
|
465
|
+
if (response.headers && response.headers.forEach) {
|
|
466
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
467
|
+
}
|
|
468
|
+
;
|
|
469
|
+
if (status === 200) {
|
|
470
|
+
return response.text().then(function (_responseText) {
|
|
471
|
+
var result200 = null;
|
|
472
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
473
|
+
return result200;
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
else if (status === 400) {
|
|
477
|
+
return response.text().then(function (_responseText) {
|
|
478
|
+
var result400 = null;
|
|
479
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
480
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
else if (status === 500) {
|
|
484
|
+
return response.text().then(function (_responseText) {
|
|
485
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
else if (status === 412) {
|
|
489
|
+
return response.text().then(function (_responseText) {
|
|
490
|
+
var result412 = null;
|
|
491
|
+
result412 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
492
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result412);
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
else if (status !== 200 && status !== 204) {
|
|
496
|
+
return response.text().then(function (_responseText) {
|
|
497
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
return Promise.resolve(null);
|
|
501
|
+
};
|
|
502
|
+
CrowdfundingClient.prototype.deactivateFundraiser = function (fundraiserId, crowdfunding_API_Key) {
|
|
503
|
+
var _this = this;
|
|
504
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/fundraisers/{fundraiserId}/deactivate";
|
|
505
|
+
if (fundraiserId === undefined || fundraiserId === null)
|
|
506
|
+
throw new Error("The parameter 'fundraiserId' must be defined.");
|
|
507
|
+
url_ = url_.replace("{fundraiserId}", encodeURIComponent("" + fundraiserId));
|
|
508
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
509
|
+
var options_ = {
|
|
510
|
+
method: "POST",
|
|
511
|
+
headers: {
|
|
512
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
516
|
+
return _this.processDeactivateFundraiser(_response);
|
|
517
|
+
});
|
|
518
|
+
};
|
|
519
|
+
CrowdfundingClient.prototype.processDeactivateFundraiser = function (response) {
|
|
520
|
+
var _this = this;
|
|
521
|
+
var status = response.status;
|
|
522
|
+
var _headers = {};
|
|
523
|
+
if (response.headers && response.headers.forEach) {
|
|
524
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
525
|
+
}
|
|
526
|
+
;
|
|
527
|
+
if (status === 200) {
|
|
528
|
+
return response.text().then(function (_responseText) {
|
|
529
|
+
return;
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
else if (status === 400) {
|
|
533
|
+
return response.text().then(function (_responseText) {
|
|
534
|
+
var result400 = null;
|
|
535
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
536
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
else if (status === 500) {
|
|
540
|
+
return response.text().then(function (_responseText) {
|
|
541
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
else if (status === 412) {
|
|
545
|
+
return response.text().then(function (_responseText) {
|
|
546
|
+
var result412 = null;
|
|
547
|
+
result412 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
548
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result412);
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
else if (status !== 200 && status !== 204) {
|
|
552
|
+
return response.text().then(function (_responseText) {
|
|
553
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
return Promise.resolve(null);
|
|
557
|
+
};
|
|
558
|
+
CrowdfundingClient.prototype.getFundraiserGoals = function (fundraiserId, crowdfunding_API_Key) {
|
|
559
|
+
var _this = this;
|
|
560
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/fundraisers/{fundraiserId}/goals";
|
|
561
|
+
if (fundraiserId === undefined || fundraiserId === null)
|
|
562
|
+
throw new Error("The parameter 'fundraiserId' must be defined.");
|
|
563
|
+
url_ = url_.replace("{fundraiserId}", encodeURIComponent("" + fundraiserId));
|
|
564
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
565
|
+
var options_ = {
|
|
566
|
+
method: "GET",
|
|
567
|
+
headers: {
|
|
568
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
569
|
+
"Accept": "application/json"
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
573
|
+
return _this.processGetFundraiserGoals(_response);
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
CrowdfundingClient.prototype.processGetFundraiserGoals = function (response) {
|
|
577
|
+
var _this = this;
|
|
578
|
+
var status = response.status;
|
|
579
|
+
var _headers = {};
|
|
580
|
+
if (response.headers && response.headers.forEach) {
|
|
581
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
582
|
+
}
|
|
583
|
+
;
|
|
584
|
+
if (status === 200) {
|
|
585
|
+
return response.text().then(function (_responseText) {
|
|
586
|
+
var result200 = null;
|
|
587
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
588
|
+
return result200;
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
else if (status === 400) {
|
|
592
|
+
return response.text().then(function (_responseText) {
|
|
593
|
+
var result400 = null;
|
|
594
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
595
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
else if (status === 500) {
|
|
599
|
+
return response.text().then(function (_responseText) {
|
|
600
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
else if (status === 404) {
|
|
604
|
+
return response.text().then(function (_responseText) {
|
|
605
|
+
var result404 = null;
|
|
606
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
607
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
else if (status !== 200 && status !== 204) {
|
|
611
|
+
return response.text().then(function (_responseText) {
|
|
612
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
return Promise.resolve(null);
|
|
616
|
+
};
|
|
617
|
+
CrowdfundingClient.prototype.updateFundraiserGoals = function (fundraiserId, crowdfunding_API_Key, req) {
|
|
618
|
+
var _this = this;
|
|
619
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/fundraisers/{fundraiserId}/goals";
|
|
620
|
+
if (fundraiserId === undefined || fundraiserId === null)
|
|
621
|
+
throw new Error("The parameter 'fundraiserId' must be defined.");
|
|
622
|
+
url_ = url_.replace("{fundraiserId}", encodeURIComponent("" + fundraiserId));
|
|
623
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
624
|
+
var content_ = JSON.stringify(req);
|
|
625
|
+
var options_ = {
|
|
626
|
+
body: content_,
|
|
627
|
+
method: "PUT",
|
|
628
|
+
headers: {
|
|
629
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
630
|
+
"Content-Type": "application/json",
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
634
|
+
return _this.processUpdateFundraiserGoals(_response);
|
|
635
|
+
});
|
|
636
|
+
};
|
|
637
|
+
CrowdfundingClient.prototype.processUpdateFundraiserGoals = function (response) {
|
|
638
|
+
var _this = this;
|
|
639
|
+
var status = response.status;
|
|
640
|
+
var _headers = {};
|
|
641
|
+
if (response.headers && response.headers.forEach) {
|
|
642
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
643
|
+
}
|
|
644
|
+
;
|
|
645
|
+
if (status === 200) {
|
|
646
|
+
return response.text().then(function (_responseText) {
|
|
647
|
+
return;
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
else if (status === 400) {
|
|
651
|
+
return response.text().then(function (_responseText) {
|
|
652
|
+
var result400 = null;
|
|
653
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
654
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
else if (status === 500) {
|
|
658
|
+
return response.text().then(function (_responseText) {
|
|
659
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
else if (status !== 200 && status !== 204) {
|
|
663
|
+
return response.text().then(function (_responseText) {
|
|
664
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
return Promise.resolve(null);
|
|
668
|
+
};
|
|
669
|
+
CrowdfundingClient.prototype.getPropertyTypes = function (crowdfunding_API_Key) {
|
|
670
|
+
var _this = this;
|
|
671
|
+
var url_ = this.baseUrl + "/umbraco/api/Crowdfunding/lookups/propertyTypes";
|
|
672
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
673
|
+
var options_ = {
|
|
674
|
+
method: "GET",
|
|
675
|
+
headers: {
|
|
676
|
+
"Crowdfunding-API-Key": crowdfunding_API_Key !== undefined && crowdfunding_API_Key !== null ? "" + crowdfunding_API_Key : "",
|
|
677
|
+
"Accept": "application/json"
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
681
|
+
return _this.processGetPropertyTypes(_response);
|
|
682
|
+
});
|
|
683
|
+
};
|
|
684
|
+
CrowdfundingClient.prototype.processGetPropertyTypes = function (response) {
|
|
685
|
+
var _this = this;
|
|
686
|
+
var status = response.status;
|
|
687
|
+
var _headers = {};
|
|
688
|
+
if (response.headers && response.headers.forEach) {
|
|
689
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
690
|
+
}
|
|
691
|
+
;
|
|
692
|
+
if (status === 200) {
|
|
693
|
+
return response.text().then(function (_responseText) {
|
|
694
|
+
var result200 = null;
|
|
695
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
696
|
+
return result200;
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
else if (status === 400) {
|
|
700
|
+
return response.text().then(function (_responseText) {
|
|
701
|
+
var result400 = null;
|
|
702
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
703
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result400);
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
else if (status === 500) {
|
|
707
|
+
return response.text().then(function (_responseText) {
|
|
708
|
+
return throwException("A server side error occurred.", status, _responseText, _headers);
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
else if (status === 404) {
|
|
712
|
+
return response.text().then(function (_responseText) {
|
|
713
|
+
var result404 = null;
|
|
714
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
715
|
+
return throwException("A server side error occurred.", status, _responseText, _headers, result404);
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
else if (status !== 200 && status !== 204) {
|
|
719
|
+
return response.text().then(function (_responseText) {
|
|
720
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
return Promise.resolve(null);
|
|
724
|
+
};
|
|
725
|
+
return CrowdfundingClient;
|
|
726
|
+
}());
|
|
727
|
+
export { CrowdfundingClient };
|
|
728
|
+
/** One of 'feedback', 'fund', 'sponsorship' */
|
|
729
|
+
export var AllocationType;
|
|
730
|
+
(function (AllocationType) {
|
|
731
|
+
AllocationType["Feedback"] = "feedback";
|
|
732
|
+
AllocationType["Fund"] = "fund";
|
|
733
|
+
AllocationType["Sponsorship"] = "sponsorship";
|
|
734
|
+
})(AllocationType || (AllocationType = {}));
|
|
735
|
+
/** One of 'donation', 'regularGiving' */
|
|
736
|
+
export var GivingType;
|
|
737
|
+
(function (GivingType) {
|
|
738
|
+
GivingType["Donation"] = "donation";
|
|
739
|
+
GivingType["RegularGiving"] = "regularGiving";
|
|
740
|
+
})(GivingType || (GivingType = {}));
|
|
741
|
+
/** One of 'bool', 'date', 'text' */
|
|
742
|
+
export var FeedbackCustomFieldType;
|
|
743
|
+
(function (FeedbackCustomFieldType) {
|
|
744
|
+
FeedbackCustomFieldType["Bool"] = "bool";
|
|
745
|
+
FeedbackCustomFieldType["Date"] = "date";
|
|
746
|
+
FeedbackCustomFieldType["Text"] = "text";
|
|
747
|
+
})(FeedbackCustomFieldType || (FeedbackCustomFieldType = {}));
|
|
748
|
+
/** One of 'campaign', 'fundraiser' */
|
|
749
|
+
export var CrowdfunderType;
|
|
750
|
+
(function (CrowdfunderType) {
|
|
751
|
+
CrowdfunderType["Campaign"] = "campaign";
|
|
752
|
+
CrowdfunderType["Fundraiser"] = "fundraiser";
|
|
753
|
+
})(CrowdfunderType || (CrowdfunderType = {}));
|
|
754
|
+
/** One of 'boolean', 'cropper', 'dateTime', 'nested', 'numeric', 'raw', 'textarea', 'textBox' */
|
|
755
|
+
export var PropertyType;
|
|
756
|
+
(function (PropertyType) {
|
|
757
|
+
PropertyType["Boolean"] = "boolean";
|
|
758
|
+
PropertyType["Cropper"] = "cropper";
|
|
759
|
+
PropertyType["DateTime"] = "dateTime";
|
|
760
|
+
PropertyType["Nested"] = "nested";
|
|
761
|
+
PropertyType["Numeric"] = "numeric";
|
|
762
|
+
PropertyType["Raw"] = "raw";
|
|
763
|
+
PropertyType["Textarea"] = "textarea";
|
|
764
|
+
PropertyType["TextBox"] = "textBox";
|
|
765
|
+
})(PropertyType || (PropertyType = {}));
|
|
766
|
+
/** One of 'circle', 'rectangle' */
|
|
767
|
+
export var CropShape;
|
|
768
|
+
(function (CropShape) {
|
|
769
|
+
CropShape["Circle"] = "circle";
|
|
770
|
+
CropShape["Rectangle"] = "rectangle";
|
|
771
|
+
})(CropShape || (CropShape = {}));
|
|
772
|
+
var ApiException = /** @class */ (function (_super) {
|
|
773
|
+
__extends(ApiException, _super);
|
|
774
|
+
function ApiException(message, status, response, headers, result) {
|
|
775
|
+
var _this = _super.call(this) || this;
|
|
776
|
+
_this.isApiException = true;
|
|
777
|
+
_this.message = message;
|
|
778
|
+
_this.status = status;
|
|
779
|
+
_this.response = response;
|
|
780
|
+
_this.headers = headers;
|
|
781
|
+
_this.result = result;
|
|
782
|
+
return _this;
|
|
783
|
+
}
|
|
784
|
+
ApiException.isApiException = function (obj) {
|
|
785
|
+
return obj.isApiException === true;
|
|
786
|
+
};
|
|
787
|
+
return ApiException;
|
|
788
|
+
}(Error));
|
|
789
|
+
export { ApiException };
|
|
790
|
+
function throwException(message, status, response, headers, result) {
|
|
791
|
+
if (result !== null && result !== undefined)
|
|
792
|
+
throw result;
|
|
793
|
+
else
|
|
794
|
+
throw new ApiException(message, status, response, headers, null);
|
|
795
|
+
}
|
|
796
|
+
//# sourceMappingURL=index.js.map
|