@parra/parra-js-sdk 0.3.11 → 0.3.13

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,19 +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.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
+ },
123
+ });
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"), {
132
+ method: "post",
133
+ });
134
+ };
116
135
  this.uploadImageAssetForTenantById = function (tenant_id, body) {
117
136
  var formData = new FormData();
118
- Object.entries(body || {}).forEach(function (_a) {
137
+ Object.entries(body).forEach(function (_a) {
119
138
  var key = _a[0], value = _a[1];
120
139
  formData.append(key, value);
121
140
  });
@@ -125,23 +144,16 @@ var ParraAPI = /** @class */ (function () {
125
144
  headers: {},
126
145
  });
127
146
  };
128
- this.createCustomer = function (body) {
129
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/customers"), {
130
- method: "post",
131
- body: JSON.stringify(body),
132
- headers: {
133
- "content-type": "application/json",
134
- },
135
- });
136
- };
137
- this.updateEntitlementsForCustomerById = function (customer_id) {
138
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/customers/").concat(customer_id, "/entitlements"), {
139
- 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);
140
152
  });
141
- };
142
- this.createBillingPortalSession = function (tenant_id) {
143
- 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"), {
144
154
  method: "post",
155
+ body: formData,
156
+ headers: {},
145
157
  });
146
158
  };
147
159
  this.createCheckoutSession = function (body) {
@@ -158,13 +170,9 @@ var ParraAPI = /** @class */ (function () {
158
170
  method: "post",
159
171
  });
160
172
  };
161
- this.createAudience = function (body) {
162
- 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"), {
163
175
  method: "post",
164
- body: JSON.stringify(body),
165
- headers: {
166
- "content-type": "application/json",
167
- },
168
176
  });
169
177
  };
170
178
  this.createSubscriberForAudienceById = function (audience_id, body) {
@@ -177,8 +185,20 @@ var ParraAPI = /** @class */ (function () {
177
185
  raw: true,
178
186
  });
179
187
  };
180
- this.createTenant = function (body) {
181
- 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"), {
182
202
  method: "post",
183
203
  body: JSON.stringify(body),
184
204
  headers: {
@@ -186,14 +206,13 @@ var ParraAPI = /** @class */ (function () {
186
206
  },
187
207
  });
188
208
  };
189
- this.getTenantById = function (tenant_id, query) {
190
- 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), {
191
211
  method: "get",
192
- query: query,
193
212
  });
194
213
  };
195
- this.updateTenantById = function (tenant_id, body) {
196
- 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), {
197
216
  method: "put",
198
217
  body: JSON.stringify(body),
199
218
  headers: {
@@ -201,38 +220,34 @@ var ParraAPI = /** @class */ (function () {
201
220
  },
202
221
  });
203
222
  };
204
- this.deleteTenantById = function (tenant_id) {
205
- 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), {
206
225
  method: "delete",
207
226
  });
208
227
  };
209
- this.paginateTenantUsersForTenantById = function (tenant_id, query) {
210
- 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"), {
211
230
  method: "get",
212
231
  query: query,
213
232
  });
214
233
  };
215
- this.getUserForTenantById = function (tenant_id, user_id) {
216
- 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), {
217
236
  method: "get",
218
237
  });
219
238
  };
220
- this.createTenantForUserById = function (user_id, body) {
221
- 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"), {
222
241
  method: "post",
223
242
  body: JSON.stringify(body),
224
243
  headers: {
225
244
  "content-type": "application/json",
226
245
  },
246
+ raw: true,
227
247
  });
228
248
  };
229
- this.getTenantsForUserById = function (user_id) {
230
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
231
- method: "get",
232
- });
233
- };
234
- this.createApiKeyForTenantById = function (tenant_id, body) {
235
- 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"), {
236
251
  method: "post",
237
252
  body: JSON.stringify(body),
238
253
  headers: {
@@ -240,53 +255,56 @@ var ParraAPI = /** @class */ (function () {
240
255
  },
241
256
  });
242
257
  };
243
- this.getApiKeysForTenantById = function (tenant_id) {
244
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys"), {
245
- method: "get",
246
- });
247
- };
248
- this.deleteApiKeyForTenantById = function (tenant_id, api_key_id) {
249
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/api-keys/").concat(api_key_id), {
250
- method: "delete",
251
- });
252
- };
253
- this.getTenantForApiKeyById = function (api_key_id) {
254
- 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"), {
255
260
  method: "get",
261
+ query: query,
256
262
  });
257
263
  };
258
- this.getInvitationsForTenantById = function (tenant_id) {
259
- 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), {
260
266
  method: "get",
267
+ query: query,
261
268
  });
262
269
  };
263
- this.createInvitationForTenantById = function (tenant_id, body) {
264
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/invitations"), {
265
- 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",
266
273
  body: JSON.stringify(body),
267
274
  headers: {
268
275
  "content-type": "application/json",
269
276
  },
270
277
  });
271
278
  };
272
- this.acceptInvitationByCode = function (invitation_code) {
273
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/invitations/").concat(invitation_code, "/accept"), {
274
- 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",
275
282
  });
276
283
  };
277
- this.getTeamMembersForTenantById = function (tenant_id) {
278
- 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"), {
279
286
  method: "get",
287
+ query: query,
280
288
  });
281
289
  };
282
- this.deleteTeamMemberForTenantById = function (tenant_id, team_member_id) {
283
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/team-members/").concat(team_member_id), {
284
- 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,
285
298
  });
286
299
  };
287
- this.updateTeamMemberUserForTenantById = function (tenant_id, team_member_id) {
288
- 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"), {
289
302
  method: "post",
303
+ body: JSON.stringify(body),
304
+ headers: {
305
+ "content-type": "application/json",
306
+ },
307
+ raw: true,
290
308
  });
291
309
  };
292
310
  this.createAnalyticEventTypeForTenantById = function (tenant_id, body) {
@@ -304,25 +322,6 @@ var ParraAPI = /** @class */ (function () {
304
322
  query: query,
305
323
  });
306
324
  };
307
- this.getAnalyticEventTypeById = function (tenant_id, analytic_event_type_id) {
308
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/analytics/events/types/").concat(analytic_event_type_id), {
309
- method: "get",
310
- });
311
- };
312
- this.updateAnalyticEventTypeById = function (tenant_id, analytic_event_type_id, body) {
313
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/analytics/events/types/").concat(analytic_event_type_id), {
314
- method: "put",
315
- body: JSON.stringify(body),
316
- headers: {
317
- "content-type": "application/json",
318
- },
319
- });
320
- };
321
- this.deleteAnalyticEventTypeById = function (tenant_id, analytic_event_type_id) {
322
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/analytics/events/types/").concat(analytic_event_type_id), {
323
- method: "delete",
324
- });
325
- };
326
325
  this.createAppArea = function (tenant_id, body) {
327
326
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app-areas"), {
328
327
  method: "post",
@@ -391,123 +390,13 @@ var ParraAPI = /** @class */ (function () {
391
390
  method: "delete",
392
391
  });
393
392
  };
394
- this.publishCampaignById = function (tenant_id, campaign_id, body) {
395
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id, "/publish"), {
396
- method: "post",
397
- body: JSON.stringify(body),
398
- headers: {
399
- "content-type": "application/json",
400
- },
401
- });
402
- };
403
- this.enrollEligibleUsersForCampaignById = function (campaign_id) {
404
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/campaigns/").concat(campaign_id, "/enroll"), {
405
- method: "post",
406
- });
407
- };
408
393
  this.closeCampaignById = function (tenant_id, campaign_id) {
409
394
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id, "/close"), {
410
395
  method: "post",
411
396
  });
412
397
  };
413
- this.getCards = function (query) {
414
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
415
- method: "get",
416
- query: query,
417
- });
418
- };
419
- this.paginateFeedbackFormsForTenantById = function (tenant_id, query) {
420
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
421
- method: "get",
422
- query: query,
423
- });
424
- };
425
- this.createFeedbackFormForTenantById = function (tenant_id, body) {
426
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
427
- method: "post",
428
- body: JSON.stringify(body),
429
- headers: {
430
- "content-type": "application/json",
431
- },
432
- });
433
- };
434
- this.getFeedbackFormForTenantById = function (tenant_id, feedback_form_id) {
435
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
436
- method: "get",
437
- });
438
- };
439
- this.updateFeedbackFormForTenantById = function (tenant_id, feedback_form_id, body) {
440
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
441
- method: "put",
442
- body: JSON.stringify(body),
443
- headers: {
444
- "content-type": "application/json",
445
- },
446
- });
447
- };
448
- this.deleteFeedbackFormForTenantById = function (tenant_id, feedback_form_id) {
449
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id), {
450
- method: "delete",
451
- });
452
- };
453
- this.paginateFeedbackFormResponsesForTenantById = function (tenant_id, feedback_form_id, query) {
454
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms/").concat(feedback_form_id, "/responses"), {
455
- method: "get",
456
- query: query,
457
- });
458
- };
459
- this.getFormById = function (feedback_form_id) {
460
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id), {
461
- method: "get",
462
- });
463
- };
464
- this.submitFormById = function (feedback_form_id, body) {
465
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id, "/submit"), {
466
- method: "post",
467
- body: JSON.stringify(body),
468
- headers: {
469
- "content-type": "application/json",
470
- },
471
- raw: true,
472
- });
473
- };
474
- this.createQuestion = function (body) {
475
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions"), {
476
- method: "post",
477
- body: JSON.stringify(body),
478
- headers: {
479
- "content-type": "application/json",
480
- },
481
- });
482
- };
483
- this.paginateQuestions = function (query) {
484
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions"), {
485
- method: "get",
486
- query: query,
487
- });
488
- };
489
- this.getQuestionById = function (question_id, query) {
490
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
491
- method: "get",
492
- query: query,
493
- });
494
- };
495
- this.updateQuestionById = function (question_id, body) {
496
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
497
- method: "put",
498
- body: JSON.stringify(body),
499
- headers: {
500
- "content-type": "application/json",
501
- },
502
- });
503
- };
504
- this.deleteQuestionById = function (question_id) {
505
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id), {
506
- method: "delete",
507
- });
508
- };
509
- this.createMetricsForQuestionById = function (question_id, body) {
510
- 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"), {
511
400
  method: "post",
512
401
  body: JSON.stringify(body),
513
402
  headers: {
@@ -515,30 +404,15 @@ var ParraAPI = /** @class */ (function () {
515
404
  },
516
405
  });
517
406
  };
518
- this.answerQuestionById = function (question_id, body) {
519
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/questions/").concat(question_id, "/answer"), {
520
- method: "put",
521
- body: JSON.stringify(body),
522
- headers: {
523
- "content-type": "application/json",
524
- },
525
- raw: true,
526
- });
527
- };
528
- this.paginateAnswersForQuestionById = function (question_id, query) {
529
- 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"), {
530
409
  method: "get",
531
410
  query: query,
532
411
  });
533
412
  };
534
- this.bulkAnswerQuestions = function (body) {
535
- 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"), {
536
415
  method: "post",
537
- body: JSON.stringify(body),
538
- headers: {
539
- "content-type": "application/json",
540
- },
541
- raw: true,
542
416
  });
543
417
  };
544
418
  this.paginateTemplateTags = function (query) {
@@ -547,17 +421,6 @@ var ParraAPI = /** @class */ (function () {
547
421
  query: query,
548
422
  });
549
423
  };
550
- this.paginateTemplatesForTenantById = function (tenant_id, query) {
551
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/templates"), {
552
- method: "get",
553
- query: query,
554
- });
555
- };
556
- this.cloneTemplateForTenantById = function (tenant_id, template_id) {
557
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/templates/").concat(template_id, "/clone"), {
558
- method: "post",
559
- });
560
- };
561
424
  this.createApplicationForTenantById = function (tenant_id, body) {
562
425
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications"), {
563
426
  method: "post",
@@ -675,8 +538,23 @@ var ParraAPI = /** @class */ (function () {
675
538
  method: "delete",
676
539
  });
677
540
  };
678
- this.createUser = function (body) {
679
- 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"), {
680
558
  method: "post",
681
559
  body: JSON.stringify(body),
682
560
  headers: {
@@ -684,19 +562,40 @@ var ParraAPI = /** @class */ (function () {
684
562
  },
685
563
  });
686
564
  };
687
- this.listUsers = function (query) {
688
- 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"), {
689
587
  method: "get",
690
588
  query: query,
691
589
  });
692
590
  };
693
- this.getUserById = function (user_id) {
694
- 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), {
695
593
  method: "get",
594
+ query: query,
696
595
  });
697
596
  };
698
- this.updateUserById = function (user_id, body) {
699
- 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), {
700
599
  method: "put",
701
600
  body: JSON.stringify(body),
702
601
  headers: {
@@ -704,13 +603,13 @@ var ParraAPI = /** @class */ (function () {
704
603
  },
705
604
  });
706
605
  };
707
- this.deleteUserById = function (user_id) {
708
- 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), {
709
608
  method: "delete",
710
609
  });
711
610
  };
712
- this.createIdentityForUserById = function (user_id, body) {
713
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/identities"), {
611
+ this.createTenant = function (body) {
612
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants"), {
714
613
  method: "post",
715
614
  body: JSON.stringify(body),
716
615
  headers: {
@@ -718,33 +617,52 @@ var ParraAPI = /** @class */ (function () {
718
617
  },
719
618
  });
720
619
  };
721
- this.listIdentitiesForUserById = function (user_id) {
722
- 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"), {
622
+ method: "post",
623
+ body: JSON.stringify(body),
624
+ headers: {
625
+ "content-type": "application/json",
626
+ },
627
+ });
628
+ };
629
+ this.getTenantsForUserById = function (user_id) {
630
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
723
631
  method: "get",
724
632
  });
725
633
  };
726
- this.getUserByProviderAndProviderUserId = function (provider, provider_user_id) {
727
- 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), {
728
636
  method: "get",
729
637
  });
730
638
  };
731
- this.checkAuthorization = function (body) {
732
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/authorization/check"), {
733
- 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",
734
642
  body: JSON.stringify(body),
735
643
  headers: {
736
644
  "content-type": "application/json",
737
645
  },
738
646
  });
739
647
  };
740
- this.getUserInfo = function () {
741
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/user-info"), {
742
- 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",
743
651
  });
744
652
  };
745
- this.getParraAuthToken = function () {
746
- 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"), {
747
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,
748
666
  });
749
667
  };
750
668
  }