@parra/parra-js-sdk 0.3.387 → 0.3.389

Sign up to get free protection for your applications and to get access to all the features.
@@ -592,6 +592,19 @@ export interface ContentCard {
592
592
  badge?: string | null;
593
593
  action?: ContentCardAction | null;
594
594
  }
595
+ export interface CollectionResponse {
596
+ page: number;
597
+ page_count: number;
598
+ page_size: number;
599
+ total_count: number;
600
+ }
601
+ export interface ContentCardCollectionResponse {
602
+ page: number;
603
+ page_count: number;
604
+ page_size: number;
605
+ total_count: number;
606
+ data: Array<ContentCard>;
607
+ }
595
608
  export interface CreateCheckoutSessionRequestBody {
596
609
  plan_id: string;
597
610
  success_url?: string | null;
@@ -1014,12 +1027,6 @@ export interface CreateFaqRequestBody {
1014
1027
  body: string;
1015
1028
  faq_section_id?: string | null;
1016
1029
  }
1017
- export interface CollectionResponse {
1018
- page: number;
1019
- page_count: number;
1020
- page_size: number;
1021
- total_count: number;
1022
- }
1023
1030
  export interface FaqCollectionResponse {
1024
1031
  page: number;
1025
1032
  page_count: number;
@@ -1047,6 +1054,15 @@ export interface FaqSectionItemStub {
1047
1054
  faq_id: string;
1048
1055
  section_id: string;
1049
1056
  }
1057
+ export interface UpdateContentCardRequestBody {
1058
+ title?: string;
1059
+ description?: string | null;
1060
+ display_title?: string | null;
1061
+ display_description?: string | null;
1062
+ action_url?: string | null;
1063
+ action_confirmation_message?: string | null;
1064
+ badge?: string | null;
1065
+ }
1050
1066
  export interface CreatorUpdateSender {
1051
1067
  id: string;
1052
1068
  created_at: string;
@@ -4124,6 +4140,15 @@ declare class ParraAPI {
4124
4140
  uploadHeaderForTenantRelease: (tenant_id: string, release_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
4125
4141
  uploadAttachmentForTicketById: (tenant_id: string, ticket_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
4126
4142
  createContentCard: (tenant_id: string, body: CreateContentCardRequestBody, options?: Options) => Promise<ContentCard>;
4143
+ paginateContentCards: (tenant_id: string, query?: {
4144
+ $select?: string;
4145
+ $top?: number;
4146
+ $skip?: number;
4147
+ $orderby?: string;
4148
+ $filter?: string;
4149
+ $expand?: string;
4150
+ $search?: string;
4151
+ }, options?: Options) => Promise<ContentCardCollectionResponse>;
4127
4152
  updateBackgroundImageForContentCardById: (tenant_id: string, content_card_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ContentCard>;
4128
4153
  uploadAttachmentForCreatorUpdateById: (tenant_id: string, creator_update_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
4129
4154
  uploadLogoForTenantById: (tenant_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
@@ -4180,6 +4205,9 @@ declare class ParraAPI {
4180
4205
  deleteFaqSectionById: (tenant_id: string, faq_view_id: string, faq_section_id: string, options?: Options) => Promise<Response>;
4181
4206
  addFaqToSection: (tenant_id: string, faq_view_id: string, faq_section_id: string, body: AddFaqToSectionRequestBody, options?: Options) => Promise<FaqSectionItemStub>;
4182
4207
  removeFaqFromSection: (tenant_id: string, faq_view_id: string, faq_section_id: string, faq_section_item_id: string, options?: Options) => Promise<Response>;
4208
+ getContentCardById: (tenant_id: string, content_card_id: string, options?: Options) => Promise<ContentCard>;
4209
+ updateContentCardById: (tenant_id: string, content_card_id: string, body?: UpdateContentCardRequestBody, options?: Options) => Promise<ContentCard>;
4210
+ deleteContentCardById: (tenant_id: string, content_card_id: string, options?: Options) => Promise<Response>;
4183
4211
  paginateCreatorUpdateSendersForTenant: (tenant_id: string, query?: {
4184
4212
  $select?: string;
4185
4213
  $top?: number;
package/dist/ParraAPI.js CHANGED
@@ -483,12 +483,13 @@ var ParraAPI = /** @class */ (function () {
483
483
  };
484
484
  this.createContentCard = function (tenant_id, body, options) {
485
485
  if (options === void 0) { options = {}; }
486
- var formData = new FormData();
487
- Object.entries(body).forEach(function (_a) {
488
- var key = _a[0], value = _a[1];
489
- formData.append(key, value);
490
- });
491
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards"), __assign({ method: "post", body: formData, headers: {} }, options));
486
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards"), __assign({ method: "post", body: JSON.stringify(body), headers: {
487
+ "content-type": "application/json",
488
+ } }, options));
489
+ };
490
+ this.paginateContentCards = function (tenant_id, query, options) {
491
+ if (options === void 0) { options = {}; }
492
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards"), __assign({ method: "get", query: query }, options));
492
493
  };
493
494
  this.updateBackgroundImageForContentCardById = function (tenant_id, content_card_id, body, options) {
494
495
  if (options === void 0) { options = {}; }
@@ -749,6 +750,20 @@ var ParraAPI = /** @class */ (function () {
749
750
  if (options === void 0) { options = {}; }
750
751
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/faqs/views/").concat(faq_view_id, "/sections/").concat(faq_section_id, "/items/").concat(faq_section_item_id), __assign({ method: "delete" }, options));
751
752
  };
753
+ this.getContentCardById = function (tenant_id, content_card_id, options) {
754
+ if (options === void 0) { options = {}; }
755
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards/").concat(content_card_id), __assign({ method: "get" }, options));
756
+ };
757
+ this.updateContentCardById = function (tenant_id, content_card_id, body, options) {
758
+ if (options === void 0) { options = {}; }
759
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards/").concat(content_card_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
760
+ "content-type": "application/json",
761
+ } }, options));
762
+ };
763
+ this.deleteContentCardById = function (tenant_id, content_card_id, options) {
764
+ if (options === void 0) { options = {}; }
765
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards/").concat(content_card_id), __assign({ method: "delete" }, options));
766
+ };
752
767
  this.paginateCreatorUpdateSendersForTenant = function (tenant_id, query, options) {
753
768
  if (options === void 0) { options = {}; }
754
769
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/creator/updates/senders"), __assign({ method: "get", query: query }, options));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.387",
3
+ "version": "0.3.389",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",