@parra/parra-js-sdk 0.2.119 → 0.2.120

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,62 @@ 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
+ }
437
+ export interface FeedbackForm {
438
+ id: string;
439
+ created_at: string;
440
+ updated_at: string;
441
+ deleted_at?: string | null;
442
+ data?: FeedbackFormData;
443
+ }
444
+ export interface FeedbackFormData {
445
+ title: string;
446
+ description?: string | null;
447
+ fields: Array<FeedbackFormField>;
448
+ }
449
+ export interface FeedbackFormField {
450
+ name: string;
451
+ title?: string;
452
+ type: string;
453
+ required?: boolean;
454
+ data: FeedbackFormFieldData;
455
+ }
456
+ export declare type FeedbackFormFieldData = FeedbackFormTextFieldData | FeedbackFormTextFieldData;
457
+ export interface FeedbackFormTextFieldData {
458
+ placeholder?: string;
459
+ max_lines?: number;
460
+ min_characters?: number;
461
+ max_characters?: number;
423
462
  }
424
- export interface Form {
463
+ export interface FeedbackFormTextFieldData {
464
+ placeholder?: string;
465
+ options?: Array<FeedbackFormSelectFieldOption>;
466
+ }
467
+ export interface FeedbackFormSelectFieldOption {
468
+ title: string;
469
+ value: string;
470
+ is_other?: boolean;
471
+ }
472
+ export interface FeedbackFormCollectionResponse {
473
+ page: number;
474
+ page_count: number;
475
+ page_size: number;
476
+ total_count: number;
477
+ data: Array<FeedbackFormStub>;
425
478
  }
426
479
  export interface FeedbackMetrics {
427
480
  user_count: number;
@@ -1033,8 +1086,18 @@ declare class ParraAPI {
1033
1086
  getCards: (query?: {
1034
1087
  app_area_id?: string | undefined;
1035
1088
  } | undefined) => Promise<CardsResponse>;
1036
- getFormById: (form_id: string) => Promise<Form>;
1037
- submitFormById: (form_id: string, body?: FormResponse | undefined) => Promise<Response>;
1089
+ paginateFeedbackFormsForTenantById: (tenant_id: string, query?: {
1090
+ $select?: string | undefined;
1091
+ $top?: number | undefined;
1092
+ $skip?: number | undefined;
1093
+ $orderby?: string | undefined;
1094
+ $filter?: string | undefined;
1095
+ $expand?: string | undefined;
1096
+ $search?: string | undefined;
1097
+ } | undefined) => Promise<TenantUserCollectionResponse>;
1098
+ createFeedbackFormForTenantById: (tenant_id: string, body?: CreateFeedbackFormRequestBody | undefined) => Promise<FeedbackForm>;
1099
+ getFormById: (feedback_form_id: string) => Promise<FeedbackForm>;
1100
+ submitFormById: (feedback_form_id: string, body?: FeedbackFormResponse | undefined) => Promise<Response>;
1038
1101
  createQuestion: (body?: CreateQuestionRequestBody | undefined) => Promise<Question>;
1039
1102
  paginateQuestions: (query?: {
1040
1103
  $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.120",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",