@parra/parra-js-sdk 0.3.12 → 0.3.14

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/dist/ParraAPI.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChannelType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ApplicationType = exports.TemplateType = exports.QuestionKind = exports.QuestionType = exports.CardItemType = exports.CardItemDisplayType = exports.FeedbackFormFieldType = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CampaignStatus = exports.SubscriptionStatus = exports.Interval = exports.Currency = void 0;
4
- var Currency;
5
- (function (Currency) {
6
- Currency["usd"] = "usd";
7
- })(Currency || (exports.Currency = Currency = {}));
3
+ exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.ApplicationType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.FeedbackFormFieldType = exports.QuestionKind = exports.QuestionType = exports.CardItemDisplayType = exports.CardItemType = exports.SubscriptionStatus = exports.Currency = exports.Interval = void 0;
8
4
  var Interval;
9
5
  (function (Interval) {
10
6
  Interval["monthly"] = "monthly";
11
7
  Interval["annual"] = "annual";
12
8
  })(Interval || (exports.Interval = Interval = {}));
9
+ var Currency;
10
+ (function (Currency) {
11
+ Currency["usd"] = "usd";
12
+ })(Currency || (exports.Currency = Currency = {}));
13
13
  var SubscriptionStatus;
14
14
  (function (SubscriptionStatus) {
15
15
  SubscriptionStatus["incomplete"] = "incomplete";
@@ -20,41 +20,15 @@ var SubscriptionStatus;
20
20
  SubscriptionStatus["canceled"] = "canceled";
21
21
  SubscriptionStatus["unpaid"] = "unpaid";
22
22
  })(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
23
- var CampaignStatus;
24
- (function (CampaignStatus) {
25
- CampaignStatus["active"] = "active";
26
- CampaignStatus["paused"] = "paused";
27
- CampaignStatus["draft"] = "draft";
28
- CampaignStatus["scheduled"] = "scheduled";
29
- CampaignStatus["complete"] = "complete";
30
- CampaignStatus["closed"] = "closed";
31
- CampaignStatus["archived"] = "archived";
32
- })(CampaignStatus || (exports.CampaignStatus = CampaignStatus = {}));
33
- var CampaignActionType;
34
- (function (CampaignActionType) {
35
- CampaignActionType["question"] = "question";
36
- CampaignActionType["notification"] = "notification";
37
- })(CampaignActionType || (exports.CampaignActionType = CampaignActionType = {}));
38
- var CampaignActionDisplayType;
39
- (function (CampaignActionDisplayType) {
40
- CampaignActionDisplayType["popup"] = "popup";
41
- CampaignActionDisplayType["inline"] = "inline";
42
- })(CampaignActionDisplayType || (exports.CampaignActionDisplayType = CampaignActionDisplayType = {}));
43
- var FeedbackFormFieldType;
44
- (function (FeedbackFormFieldType) {
45
- FeedbackFormFieldType["text"] = "text";
46
- FeedbackFormFieldType["input"] = "input";
47
- FeedbackFormFieldType["select"] = "select";
48
- })(FeedbackFormFieldType || (exports.FeedbackFormFieldType = FeedbackFormFieldType = {}));
23
+ var CardItemType;
24
+ (function (CardItemType) {
25
+ CardItemType["question"] = "question";
26
+ })(CardItemType || (exports.CardItemType = CardItemType = {}));
49
27
  var CardItemDisplayType;
50
28
  (function (CardItemDisplayType) {
51
29
  CardItemDisplayType["inline"] = "inline";
52
30
  CardItemDisplayType["popup"] = "popup";
53
31
  })(CardItemDisplayType || (exports.CardItemDisplayType = CardItemDisplayType = {}));
54
- var CardItemType;
55
- (function (CardItemType) {
56
- CardItemType["question"] = "question";
57
- })(CardItemType || (exports.CardItemType = CardItemType = {}));
58
32
  var QuestionType;
59
33
  (function (QuestionType) {
60
34
  QuestionType["choice"] = "choice";
@@ -78,6 +52,32 @@ var QuestionKind;
78
52
  QuestionKind["rankedChoice"] = "ranked-choice";
79
53
  QuestionKind["tag"] = "tag";
80
54
  })(QuestionKind || (exports.QuestionKind = QuestionKind = {}));
55
+ var FeedbackFormFieldType;
56
+ (function (FeedbackFormFieldType) {
57
+ FeedbackFormFieldType["text"] = "text";
58
+ FeedbackFormFieldType["input"] = "input";
59
+ FeedbackFormFieldType["select"] = "select";
60
+ })(FeedbackFormFieldType || (exports.FeedbackFormFieldType = FeedbackFormFieldType = {}));
61
+ var CampaignActionType;
62
+ (function (CampaignActionType) {
63
+ CampaignActionType["question"] = "question";
64
+ CampaignActionType["notification"] = "notification";
65
+ })(CampaignActionType || (exports.CampaignActionType = CampaignActionType = {}));
66
+ var CampaignActionDisplayType;
67
+ (function (CampaignActionDisplayType) {
68
+ CampaignActionDisplayType["popup"] = "popup";
69
+ CampaignActionDisplayType["inline"] = "inline";
70
+ })(CampaignActionDisplayType || (exports.CampaignActionDisplayType = CampaignActionDisplayType = {}));
71
+ var CampaignStatus;
72
+ (function (CampaignStatus) {
73
+ CampaignStatus["active"] = "active";
74
+ CampaignStatus["paused"] = "paused";
75
+ CampaignStatus["draft"] = "draft";
76
+ CampaignStatus["scheduled"] = "scheduled";
77
+ CampaignStatus["complete"] = "complete";
78
+ CampaignStatus["closed"] = "closed";
79
+ CampaignStatus["archived"] = "archived";
80
+ })(CampaignStatus || (exports.CampaignStatus = CampaignStatus = {}));
81
81
  var TemplateType;
82
82
  (function (TemplateType) {
83
83
  TemplateType["question"] = "question";
@@ -86,6 +86,11 @@ var ApplicationType;
86
86
  (function (ApplicationType) {
87
87
  ApplicationType["ios"] = "ios";
88
88
  })(ApplicationType || (exports.ApplicationType = ApplicationType = {}));
89
+ var ChannelType;
90
+ (function (ChannelType) {
91
+ ChannelType["apns"] = "apns";
92
+ ChannelType["inbox"] = "inbox";
93
+ })(ChannelType || (exports.ChannelType = ChannelType = {}));
89
94
  var ApnsEnvironment;
90
95
  (function (ApnsEnvironment) {
91
96
  ApnsEnvironment["production"] = "production";
@@ -103,31 +108,33 @@ var ApnsPushType;
103
108
  ApnsPushType["voip"] = "voip";
104
109
  ApnsPushType["mdm"] = "mdm";
105
110
  })(ApnsPushType || (exports.ApnsPushType = ApnsPushType = {}));
106
- var ChannelType;
107
- (function (ChannelType) {
108
- ChannelType["apns"] = "apns";
109
- ChannelType["inbox"] = "inbox";
110
- })(ChannelType || (exports.ChannelType = ChannelType = {}));
111
111
  var ParraAPI = /** @class */ (function () {
112
112
  function ParraAPI(http, options) {
113
113
  var _this = this;
114
114
  this.http = http;
115
115
  this.options = options;
116
- this.uploadAvatarForUser = function (body) {
117
- var formData = new FormData();
118
- Object.entries(body || {}).forEach(function (_a) {
119
- var key = _a[0], value = _a[1];
120
- formData.append(key, value);
116
+ this.checkAuthorization = function (body) {
117
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/authorization/check"), {
118
+ method: "post",
119
+ body: JSON.stringify(body),
120
+ headers: {
121
+ "content-type": "application/json",
122
+ },
121
123
  });
122
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/avatar"), {
124
+ };
125
+ this.getUserInfo = function () {
126
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/user-info"), {
127
+ method: "get",
128
+ });
129
+ };
130
+ this.getParraAuthToken = function () {
131
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/parra/auth/token"), {
123
132
  method: "post",
124
- body: formData,
125
- headers: {},
126
133
  });
127
134
  };
128
135
  this.uploadImageAssetForTenantById = function (tenant_id, body) {
129
136
  var formData = new FormData();
130
- Object.entries(body || {}).forEach(function (_a) {
137
+ Object.entries(body).forEach(function (_a) {
131
138
  var key = _a[0], value = _a[1];
132
139
  formData.append(key, value);
133
140
  });
@@ -137,23 +144,16 @@ var ParraAPI = /** @class */ (function () {
137
144
  headers: {},
138
145
  });
139
146
  };
140
- this.createCustomer = function (body) {
141
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/customers"), {
142
- method: "post",
143
- body: JSON.stringify(body),
144
- headers: {
145
- "content-type": "application/json",
146
- },
147
- });
148
- };
149
- this.updateEntitlementsForCustomerById = function (customer_id) {
150
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/customers/").concat(customer_id, "/entitlements"), {
151
- method: "post",
147
+ this.uploadAvatarForUser = function (body) {
148
+ var formData = new FormData();
149
+ Object.entries(body).forEach(function (_a) {
150
+ var key = _a[0], value = _a[1];
151
+ formData.append(key, value);
152
152
  });
153
- };
154
- this.createBillingPortalSession = function (tenant_id) {
155
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing-portal/sessions"), {
153
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/avatar"), {
156
154
  method: "post",
155
+ body: formData,
156
+ headers: {},
157
157
  });
158
158
  };
159
159
  this.createCheckoutSession = function (body) {
@@ -170,13 +170,9 @@ var ParraAPI = /** @class */ (function () {
170
170
  method: "post",
171
171
  });
172
172
  };
173
- this.createAudience = function (body) {
174
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/email/audiences"), {
173
+ this.createBillingPortalSession = function (tenant_id) {
174
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing-portal/sessions"), {
175
175
  method: "post",
176
- body: JSON.stringify(body),
177
- headers: {
178
- "content-type": "application/json",
179
- },
180
176
  });
181
177
  };
182
178
  this.createSubscriberForAudienceById = function (audience_id, body) {
@@ -189,8 +185,20 @@ var ParraAPI = /** @class */ (function () {
189
185
  raw: true,
190
186
  });
191
187
  };
192
- this.createTenant = function (body) {
193
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants"), {
188
+ this.getCards = function (query) {
189
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
190
+ method: "get",
191
+ query: query,
192
+ });
193
+ };
194
+ this.paginateFeedbackFormsForTenantById = function (tenant_id, query) {
195
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
196
+ method: "get",
197
+ query: query,
198
+ });
199
+ };
200
+ this.createFeedbackFormForTenantById = function (tenant_id, body) {
201
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
194
202
  method: "post",
195
203
  body: JSON.stringify(body),
196
204
  headers: {
@@ -198,14 +206,13 @@ var ParraAPI = /** @class */ (function () {
198
206
  },
199
207
  });
200
208
  };
201
- this.getTenantById = function (tenant_id, query) {
202
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
209
+ this.getFeedbackFormForTenantById = function (tenant_id, feedback_form_id) {
210
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
203
211
  method: "get",
204
- query: query,
205
212
  });
206
213
  };
207
- this.updateTenantById = function (tenant_id, body) {
208
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
214
+ this.updateFeedbackFormForTenantById = function (tenant_id, feedback_form_id, body) {
215
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
209
216
  method: "put",
210
217
  body: JSON.stringify(body),
211
218
  headers: {
@@ -213,38 +220,34 @@ var ParraAPI = /** @class */ (function () {
213
220
  },
214
221
  });
215
222
  };
216
- this.deleteTenantById = function (tenant_id) {
217
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
223
+ this.deleteFeedbackFormForTenantById = function (tenant_id, feedback_form_id) {
224
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
218
225
  method: "delete",
219
226
  });
220
227
  };
221
- this.paginateTenantUsersForTenantById = function (tenant_id, query) {
222
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users"), {
228
+ this.paginateFeedbackFormResponsesForTenantById = function (tenant_id, feedback_form_id, query) {
229
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id, "/responses"), {
223
230
  method: "get",
224
231
  query: query,
225
232
  });
226
233
  };
227
- this.getUserForTenantById = function (tenant_id, user_id) {
228
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users/").concat(user_id), {
234
+ this.getFormById = function (feedback_form_id) {
235
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id), {
229
236
  method: "get",
230
237
  });
231
238
  };
232
- this.createTenantForUserById = function (user_id, body) {
233
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
239
+ this.submitFormById = function (feedback_form_id, body) {
240
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id, "/submit"), {
234
241
  method: "post",
235
242
  body: JSON.stringify(body),
236
243
  headers: {
237
244
  "content-type": "application/json",
238
245
  },
246
+ raw: true,
239
247
  });
240
248
  };
241
- this.getTenantsForUserById = function (user_id) {
242
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
243
- method: "get",
244
- });
245
- };
246
- this.createApiKeyForTenantById = function (tenant_id, body) {
247
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys"), {
249
+ this.createQuestion = function (body) {
250
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions"), {
248
251
  method: "post",
249
252
  body: JSON.stringify(body),
250
253
  headers: {
@@ -252,53 +255,56 @@ var ParraAPI = /** @class */ (function () {
252
255
  },
253
256
  });
254
257
  };
255
- this.getApiKeysForTenantById = function (tenant_id) {
256
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys"), {
257
- method: "get",
258
- });
259
- };
260
- this.deleteApiKeyForTenantById = function (tenant_id, api_key_id) {
261
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys/").concat(api_key_id), {
262
- method: "delete",
263
- });
264
- };
265
- this.getTenantForApiKeyById = function (api_key_id) {
266
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/api-keys/").concat(api_key_id, "/tenant"), {
258
+ this.paginateQuestions = function (query) {
259
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions"), {
267
260
  method: "get",
261
+ query: query,
268
262
  });
269
263
  };
270
- this.getInvitationsForTenantById = function (tenant_id) {
271
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/invitations"), {
264
+ this.getQuestionById = function (question_id, query) {
265
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
272
266
  method: "get",
267
+ query: query,
273
268
  });
274
269
  };
275
- this.createInvitationForTenantById = function (tenant_id, body) {
276
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/invitations"), {
277
- method: "post",
270
+ this.updateQuestionById = function (question_id, body) {
271
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
272
+ method: "put",
278
273
  body: JSON.stringify(body),
279
274
  headers: {
280
275
  "content-type": "application/json",
281
276
  },
282
277
  });
283
278
  };
284
- this.acceptInvitationByCode = function (invitation_code) {
285
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/invitations/").concat(invitation_code, "/accept"), {
286
- method: "post",
279
+ this.deleteQuestionById = function (question_id) {
280
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
281
+ method: "delete",
287
282
  });
288
283
  };
289
- this.getTeamMembersForTenantById = function (tenant_id) {
290
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/team-members"), {
284
+ this.paginateAnswersForQuestionById = function (question_id, query) {
285
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/answers"), {
291
286
  method: "get",
287
+ query: query,
292
288
  });
293
289
  };
294
- this.deleteTeamMemberForTenantById = function (tenant_id, team_member_id) {
295
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/team-members/").concat(team_member_id), {
296
- method: "delete",
290
+ this.answerQuestionById = function (question_id, body) {
291
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/answer"), {
292
+ method: "put",
293
+ body: JSON.stringify(body),
294
+ headers: {
295
+ "content-type": "application/json",
296
+ },
297
+ raw: true,
297
298
  });
298
299
  };
299
- this.updateTeamMemberUserForTenantById = function (tenant_id, team_member_id) {
300
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/team-members/").concat(team_member_id, "/user"), {
300
+ this.bulkAnswerQuestions = function (body) {
301
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/bulk/questions/answer"), {
301
302
  method: "post",
303
+ body: JSON.stringify(body),
304
+ headers: {
305
+ "content-type": "application/json",
306
+ },
307
+ raw: true,
302
308
  });
303
309
  };
304
310
  this.createAnalyticEventTypeForTenantById = function (tenant_id, body) {
@@ -316,25 +322,6 @@ var ParraAPI = /** @class */ (function () {
316
322
  query: query,
317
323
  });
318
324
  };
319
- this.getAnalyticEventTypeById = function (tenant_id, analytic_event_type_id) {
320
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/analytics/events/types/").concat(analytic_event_type_id), {
321
- method: "get",
322
- });
323
- };
324
- this.updateAnalyticEventTypeById = function (tenant_id, analytic_event_type_id, body) {
325
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/analytics/events/types/").concat(analytic_event_type_id), {
326
- method: "put",
327
- body: JSON.stringify(body),
328
- headers: {
329
- "content-type": "application/json",
330
- },
331
- });
332
- };
333
- this.deleteAnalyticEventTypeById = function (tenant_id, analytic_event_type_id) {
334
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/analytics/events/types/").concat(analytic_event_type_id), {
335
- method: "delete",
336
- });
337
- };
338
325
  this.createAppArea = function (tenant_id, body) {
339
326
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app-areas"), {
340
327
  method: "post",
@@ -403,123 +390,13 @@ var ParraAPI = /** @class */ (function () {
403
390
  method: "delete",
404
391
  });
405
392
  };
406
- this.publishCampaignById = function (tenant_id, campaign_id, body) {
407
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id, "/publish"), {
408
- method: "post",
409
- body: JSON.stringify(body),
410
- headers: {
411
- "content-type": "application/json",
412
- },
413
- });
414
- };
415
- this.enrollEligibleUsersForCampaignById = function (campaign_id) {
416
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/campaigns/").concat(campaign_id, "/enroll"), {
417
- method: "post",
418
- });
419
- };
420
393
  this.closeCampaignById = function (tenant_id, campaign_id) {
421
394
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id, "/close"), {
422
395
  method: "post",
423
396
  });
424
397
  };
425
- this.getCards = function (query) {
426
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
427
- method: "get",
428
- query: query,
429
- });
430
- };
431
- this.paginateFeedbackFormsForTenantById = function (tenant_id, query) {
432
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
433
- method: "get",
434
- query: query,
435
- });
436
- };
437
- this.createFeedbackFormForTenantById = function (tenant_id, body) {
438
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
439
- method: "post",
440
- body: JSON.stringify(body),
441
- headers: {
442
- "content-type": "application/json",
443
- },
444
- });
445
- };
446
- this.getFeedbackFormForTenantById = function (tenant_id, feedback_form_id) {
447
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
448
- method: "get",
449
- });
450
- };
451
- this.updateFeedbackFormForTenantById = function (tenant_id, feedback_form_id, body) {
452
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
453
- method: "put",
454
- body: JSON.stringify(body),
455
- headers: {
456
- "content-type": "application/json",
457
- },
458
- });
459
- };
460
- this.deleteFeedbackFormForTenantById = function (tenant_id, feedback_form_id) {
461
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
462
- method: "delete",
463
- });
464
- };
465
- this.paginateFeedbackFormResponsesForTenantById = function (tenant_id, feedback_form_id, query) {
466
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id, "/responses"), {
467
- method: "get",
468
- query: query,
469
- });
470
- };
471
- this.getFormById = function (feedback_form_id) {
472
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id), {
473
- method: "get",
474
- });
475
- };
476
- this.submitFormById = function (feedback_form_id, body) {
477
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id, "/submit"), {
478
- method: "post",
479
- body: JSON.stringify(body),
480
- headers: {
481
- "content-type": "application/json",
482
- },
483
- raw: true,
484
- });
485
- };
486
- this.createQuestion = function (body) {
487
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions"), {
488
- method: "post",
489
- body: JSON.stringify(body),
490
- headers: {
491
- "content-type": "application/json",
492
- },
493
- });
494
- };
495
- this.paginateQuestions = function (query) {
496
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions"), {
497
- method: "get",
498
- query: query,
499
- });
500
- };
501
- this.getQuestionById = function (question_id, query) {
502
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
503
- method: "get",
504
- query: query,
505
- });
506
- };
507
- this.updateQuestionById = function (question_id, body) {
508
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
509
- method: "put",
510
- body: JSON.stringify(body),
511
- headers: {
512
- "content-type": "application/json",
513
- },
514
- });
515
- };
516
- this.deleteQuestionById = function (question_id) {
517
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
518
- method: "delete",
519
- });
520
- };
521
- this.createMetricsForQuestionById = function (question_id, body) {
522
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/metrics"), {
398
+ this.publishCampaignById = function (tenant_id, campaign_id, body) {
399
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id, "/publish"), {
523
400
  method: "post",
524
401
  body: JSON.stringify(body),
525
402
  headers: {
@@ -527,30 +404,15 @@ var ParraAPI = /** @class */ (function () {
527
404
  },
528
405
  });
529
406
  };
530
- this.answerQuestionById = function (question_id, body) {
531
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/answer"), {
532
- method: "put",
533
- body: JSON.stringify(body),
534
- headers: {
535
- "content-type": "application/json",
536
- },
537
- raw: true,
538
- });
539
- };
540
- this.paginateAnswersForQuestionById = function (question_id, query) {
541
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/answers"), {
407
+ this.paginateTemplatesForTenantById = function (tenant_id, query) {
408
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/templates"), {
542
409
  method: "get",
543
410
  query: query,
544
411
  });
545
412
  };
546
- this.bulkAnswerQuestions = function (body) {
547
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/bulk/questions/answer"), {
413
+ this.cloneTemplateForTenantById = function (tenant_id, template_id) {
414
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/templates/").concat(template_id, "/clone"), {
548
415
  method: "post",
549
- body: JSON.stringify(body),
550
- headers: {
551
- "content-type": "application/json",
552
- },
553
- raw: true,
554
416
  });
555
417
  };
556
418
  this.paginateTemplateTags = function (query) {
@@ -559,17 +421,6 @@ var ParraAPI = /** @class */ (function () {
559
421
  query: query,
560
422
  });
561
423
  };
562
- this.paginateTemplatesForTenantById = function (tenant_id, query) {
563
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/templates"), {
564
- method: "get",
565
- query: query,
566
- });
567
- };
568
- this.cloneTemplateForTenantById = function (tenant_id, template_id) {
569
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/templates/").concat(template_id, "/clone"), {
570
- method: "post",
571
- });
572
- };
573
424
  this.createApplicationForTenantById = function (tenant_id, body) {
574
425
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications"), {
575
426
  method: "post",
@@ -687,8 +538,23 @@ var ParraAPI = /** @class */ (function () {
687
538
  method: "delete",
688
539
  });
689
540
  };
690
- this.createUser = function (body) {
691
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
541
+ this.getTenantForApiKeyById = function (api_key_id) {
542
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/api-keys/").concat(api_key_id, "/tenant"), {
543
+ method: "get",
544
+ });
545
+ };
546
+ this.acceptInvitationByCode = function (invitation_code) {
547
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/invitations/").concat(invitation_code, "/accept"), {
548
+ method: "post",
549
+ });
550
+ };
551
+ this.deleteApiKeyForTenantById = function (tenant_id, api_key_id) {
552
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys/").concat(api_key_id), {
553
+ method: "delete",
554
+ });
555
+ };
556
+ this.createApiKeyForTenantById = function (tenant_id, body) {
557
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys"), {
692
558
  method: "post",
693
559
  body: JSON.stringify(body),
694
560
  headers: {
@@ -696,19 +562,40 @@ var ParraAPI = /** @class */ (function () {
696
562
  },
697
563
  });
698
564
  };
699
- this.listUsers = function (query) {
700
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
565
+ this.getApiKeysForTenantById = function (tenant_id) {
566
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys"), {
567
+ method: "get",
568
+ });
569
+ };
570
+ this.getTeamMembersForTenantById = function (tenant_id) {
571
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/team-members"), {
572
+ method: "get",
573
+ });
574
+ };
575
+ this.deleteTeamMemberForTenantById = function (tenant_id, team_member_id) {
576
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/team-members/").concat(team_member_id), {
577
+ method: "delete",
578
+ });
579
+ };
580
+ this.getUserForTenantById = function (tenant_id, user_id) {
581
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users/").concat(user_id), {
582
+ method: "get",
583
+ });
584
+ };
585
+ this.paginateTenantUsersForTenantById = function (tenant_id, query) {
586
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users"), {
701
587
  method: "get",
702
588
  query: query,
703
589
  });
704
590
  };
705
- this.getUserById = function (user_id) {
706
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id), {
591
+ this.getTenantById = function (tenant_id, query) {
592
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
707
593
  method: "get",
594
+ query: query,
708
595
  });
709
596
  };
710
- this.updateUserById = function (user_id, body) {
711
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id), {
597
+ this.updateTenantById = function (tenant_id, body) {
598
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
712
599
  method: "put",
713
600
  body: JSON.stringify(body),
714
601
  headers: {
@@ -716,23 +603,22 @@ var ParraAPI = /** @class */ (function () {
716
603
  },
717
604
  });
718
605
  };
719
- this.deleteUserById = function (user_id) {
720
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id), {
606
+ this.deleteTenantById = function (tenant_id) {
607
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
721
608
  method: "delete",
722
609
  });
723
610
  };
724
- this.updateAvatarForUserById = function (user_id, body) {
725
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/avatar"), {
611
+ this.createTenant = function (body) {
612
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants"), {
726
613
  method: "post",
727
614
  body: JSON.stringify(body),
728
615
  headers: {
729
616
  "content-type": "application/json",
730
617
  },
731
- raw: true,
732
618
  });
733
619
  };
734
- this.createIdentityForUserById = function (user_id, body) {
735
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/identities"), {
620
+ this.createTenantForUserById = function (user_id, body) {
621
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
736
622
  method: "post",
737
623
  body: JSON.stringify(body),
738
624
  headers: {
@@ -740,33 +626,43 @@ var ParraAPI = /** @class */ (function () {
740
626
  },
741
627
  });
742
628
  };
743
- this.listIdentitiesForUserById = function (user_id) {
744
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/identities"), {
629
+ this.getTenantsForUserById = function (user_id) {
630
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
745
631
  method: "get",
746
632
  });
747
633
  };
748
- this.getUserByProviderAndProviderUserId = function (provider, provider_user_id) {
749
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/providers/").concat(provider, "/identities/").concat(provider_user_id, "/user"), {
634
+ this.getUserById = function (user_id) {
635
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id), {
750
636
  method: "get",
751
637
  });
752
638
  };
753
- this.checkAuthorization = function (body) {
754
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/authorization/check"), {
755
- method: "post",
639
+ this.updateUserById = function (user_id, body) {
640
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id), {
641
+ method: "put",
756
642
  body: JSON.stringify(body),
757
643
  headers: {
758
644
  "content-type": "application/json",
759
645
  },
760
646
  });
761
647
  };
762
- this.getUserInfo = function () {
763
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/user-info"), {
764
- method: "get",
648
+ this.deleteUserById = function (user_id) {
649
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id), {
650
+ method: "delete",
765
651
  });
766
652
  };
767
- this.getParraAuthToken = function () {
768
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/parra/auth/token"), {
653
+ this.createUser = function (body) {
654
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
769
655
  method: "post",
656
+ body: JSON.stringify(body),
657
+ headers: {
658
+ "content-type": "application/json",
659
+ },
660
+ });
661
+ };
662
+ this.listUsers = function (query) {
663
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
664
+ method: "get",
665
+ query: query,
770
666
  });
771
667
  };
772
668
  }