@parra/parra-js-sdk 0.2.119 → 0.2.121

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.
@@ -419,9 +419,69 @@ export interface CampaignAction {
419
419
  app_area_id?: string | null;
420
420
  }
421
421
  export declare type CampaignActionList = Array<CampaignAction>;
422
- export interface FormResponse {
422
+ export interface CreateFeedbackFormRequestBody {
423
+ title: string;
424
+ description?: string | null;
425
+ data: FeedbackFormData;
426
+ }
427
+ export interface FeedbackFormStub {
428
+ id: string;
429
+ created_at: string;
430
+ updated_at: string;
431
+ deleted_at?: string | null;
432
+ title: string;
433
+ description?: string | null;
434
+ }
435
+ export interface FeedbackFormResponse {
436
+ id: string;
437
+ created_at: string;
438
+ updated_at: string;
439
+ deleted_at?: string | null;
440
+ title: string;
441
+ description?: string | null;
442
+ data: FeedbackFormData;
443
+ }
444
+ export interface FeedbackForm {
445
+ id: string;
446
+ created_at: string;
447
+ updated_at: string;
448
+ deleted_at?: string | null;
449
+ data?: FeedbackFormData;
450
+ }
451
+ export interface FeedbackFormData {
452
+ title: string;
453
+ description?: string | null;
454
+ fields: Array<FeedbackFormField>;
455
+ }
456
+ export interface FeedbackFormField {
457
+ name: string;
458
+ title?: string;
459
+ type: string;
460
+ required?: boolean;
461
+ data: FeedbackFormFieldData;
462
+ }
463
+ export declare type FeedbackFormFieldData = FeedbackFormTextFieldData | FeedbackFormTextFieldData;
464
+ export interface FeedbackFormTextFieldData {
465
+ placeholder?: string;
466
+ max_lines?: number;
467
+ min_characters?: number;
468
+ max_characters?: number;
423
469
  }
424
- export interface Form {
470
+ export interface FeedbackFormTextFieldData {
471
+ placeholder?: string;
472
+ options?: Array<FeedbackFormSelectFieldOption>;
473
+ }
474
+ export interface FeedbackFormSelectFieldOption {
475
+ title: string;
476
+ value: string;
477
+ is_other?: boolean;
478
+ }
479
+ export interface FeedbackFormCollectionResponse {
480
+ page: number;
481
+ page_count: number;
482
+ page_size: number;
483
+ total_count: number;
484
+ data: Array<FeedbackFormStub>;
425
485
  }
426
486
  export interface FeedbackMetrics {
427
487
  user_count: number;
@@ -1033,8 +1093,18 @@ declare class ParraAPI {
1033
1093
  getCards: (query?: {
1034
1094
  app_area_id?: string | undefined;
1035
1095
  } | undefined) => Promise<CardsResponse>;
1036
- getFormById: (form_id: string) => Promise<Form>;
1037
- submitFormById: (form_id: string, body?: FormResponse | undefined) => Promise<Response>;
1096
+ paginateFeedbackFormsForTenantById: (tenant_id: string, query?: {
1097
+ $select?: string | undefined;
1098
+ $top?: number | undefined;
1099
+ $skip?: number | undefined;
1100
+ $orderby?: string | undefined;
1101
+ $filter?: string | undefined;
1102
+ $expand?: string | undefined;
1103
+ $search?: string | undefined;
1104
+ } | undefined) => Promise<TenantUserCollectionResponse>;
1105
+ createFeedbackFormForTenantById: (tenant_id: string, body?: CreateFeedbackFormRequestBody | undefined) => Promise<FeedbackForm>;
1106
+ getFormById: (feedback_form_id: string) => Promise<FeedbackForm>;
1107
+ submitFormById: (feedback_form_id: string, body?: FeedbackFormResponse | undefined) => Promise<Response>;
1038
1108
  createQuestion: (body?: CreateQuestionRequestBody | undefined) => Promise<Question>;
1039
1109
  paginateQuestions: (query?: {
1040
1110
  $select?: string | undefined;
package/dist/ParraAPI.js CHANGED
@@ -372,13 +372,28 @@ var ParraAPI = /** @class */ (function () {
372
372
  query: query,
373
373
  });
374
374
  };
375
- this.getFormById = function (form_id) {
376
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/forms/").concat(form_id), {
375
+ this.paginateFeedbackFormsForTenantById = function (tenant_id, query) {
376
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
377
+ method: "get",
378
+ query: query,
379
+ });
380
+ };
381
+ this.createFeedbackFormForTenantById = function (tenant_id, body) {
382
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/feedback/forms"), {
383
+ method: "post",
384
+ body: JSON.stringify(body),
385
+ headers: {
386
+ "content-type": "application/json",
387
+ },
388
+ });
389
+ };
390
+ this.getFormById = function (feedback_form_id) {
391
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id), {
377
392
  method: "get",
378
393
  });
379
394
  };
380
- this.submitFormById = function (form_id, body) {
381
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/forms/").concat(form_id, "/submit"), {
395
+ this.submitFormById = function (feedback_form_id, body) {
396
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/feedback/forms/").concat(feedback_form_id, "/submit"), {
382
397
  method: "post",
383
398
  body: JSON.stringify(body),
384
399
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.119",
3
+ "version": "0.2.121",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",