@parra/parra-js-sdk 0.3.386 → 0.3.387

Sign up to get free protection for your applications and to get access to all the features.
@@ -561,29 +561,19 @@ export interface ImageAsset {
561
561
  blur_hash?: string | null;
562
562
  thumbnails?: ImageAssetThumbnails | null;
563
563
  }
564
- export interface ContentCardBackground {
565
- image: ImageAssetStub | null;
566
- }
567
- export interface UpdateContentCardRequestBody {
568
- title?: string;
569
- description?: string | null;
570
- display_title?: string | null;
571
- display_description?: string | null;
572
- background?: ContentCardBackground | null;
573
- action_url?: string | null;
574
- action_confirmation_message?: string | null;
575
- badge?: string | null;
576
- }
577
564
  export interface CreateContentCardRequestBody {
578
- title?: string;
565
+ background_image: File;
566
+ title: string;
579
567
  description?: string | null;
580
568
  display_title?: string | null;
581
569
  display_description?: string | null;
582
- background?: ContentCardBackground | null;
583
570
  action_url?: string | null;
584
571
  action_confirmation_message?: string | null;
585
572
  badge?: string | null;
586
573
  }
574
+ export interface ContentCardBackground {
575
+ image: ImageAssetStub | null;
576
+ }
587
577
  export interface ContentCardAction {
588
578
  url: string;
589
579
  confirmation_message?: string | null;
@@ -593,9 +583,12 @@ export interface ContentCard {
593
583
  created_at: string;
594
584
  updated_at: string;
595
585
  deleted_at?: string | null;
586
+ tenant_id: string;
596
587
  background?: ContentCardBackground | null;
597
- title?: string | null;
588
+ title: string;
598
589
  description?: string | null;
590
+ display_title?: string | null;
591
+ display_description?: string | null;
599
592
  badge?: string | null;
600
593
  action?: ContentCardAction | null;
601
594
  }
@@ -1278,6 +1271,17 @@ export interface YoutubeVideo {
1278
1271
  live_broadcast_content?: string | null;
1279
1272
  statistics?: YoutubeStatistics | null;
1280
1273
  }
1274
+ export interface AppContentCard {
1275
+ id: string;
1276
+ created_at: string;
1277
+ updated_at: string;
1278
+ deleted_at?: string | null;
1279
+ background?: ContentCardBackground | null;
1280
+ title?: string | null;
1281
+ description?: string | null;
1282
+ badge?: string | null;
1283
+ action?: ContentCardAction | null;
1284
+ }
1281
1285
  export interface EntitlementStub {
1282
1286
  id: string;
1283
1287
  title: string;
@@ -1298,7 +1302,7 @@ export interface CreatorUpdateAppStub {
1298
1302
  attachments?: Array<CreatorUpdateAttachmentStub>;
1299
1303
  attachment_paywall?: AppPaywallConfiguration | null;
1300
1304
  }
1301
- export type FeedItemData = YoutubeVideo | ContentCard | CreatorUpdateAppStub;
1305
+ export type FeedItemData = YoutubeVideo | AppContentCard | CreatorUpdateAppStub;
1302
1306
  export declare enum ReactionType {
1303
1307
  emoji = "emoji",
1304
1308
  custom = "custom"
@@ -4120,9 +4124,7 @@ declare class ParraAPI {
4120
4124
  uploadHeaderForTenantRelease: (tenant_id: string, release_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
4121
4125
  uploadAttachmentForTicketById: (tenant_id: string, ticket_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
4122
4126
  createContentCard: (tenant_id: string, body: CreateContentCardRequestBody, options?: Options) => Promise<ContentCard>;
4123
- listContentCards: (tenant_id: string, options?: Options) => Promise<Array<ContentCard>>;
4124
- updateContentCardById: (tenant_id: string, content_card_id: string, body?: UpdateContentCardRequestBody, options?: Options) => Promise<ContentCard>;
4125
- deleteContentCardById: (tenant_id: string, content_card_id: string, options?: Options) => Promise<Response>;
4127
+ updateBackgroundImageForContentCardById: (tenant_id: string, content_card_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ContentCard>;
4126
4128
  uploadAttachmentForCreatorUpdateById: (tenant_id: string, creator_update_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
4127
4129
  uploadLogoForTenantById: (tenant_id: string, body: UploadImageRequestBody, options?: Options) => Promise<ImageAsset>;
4128
4130
  createCheckoutSession: (body: CreateCheckoutSessionRequestBody, options?: Options) => Promise<CheckoutSession>;
package/dist/ParraAPI.js CHANGED
@@ -483,23 +483,21 @@ var ParraAPI = /** @class */ (function () {
483
483
  };
484
484
  this.createContentCard = function (tenant_id, body, options) {
485
485
  if (options === void 0) { 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.listContentCards = function (tenant_id, 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" }, options));
493
- };
494
- this.updateContentCardById = function (tenant_id, content_card_id, body, options) {
495
- if (options === void 0) { options = {}; }
496
- 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: {
497
- "content-type": "application/json",
498
- } }, 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));
499
492
  };
500
- this.deleteContentCardById = function (tenant_id, content_card_id, options) {
493
+ this.updateBackgroundImageForContentCardById = function (tenant_id, content_card_id, body, options) {
501
494
  if (options === void 0) { options = {}; }
502
- return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards/").concat(content_card_id), __assign({ method: "delete" }, options));
495
+ var formData = new FormData();
496
+ Object.entries(body).forEach(function (_a) {
497
+ var key = _a[0], value = _a[1];
498
+ formData.append(key, value);
499
+ });
500
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/content-cards/").concat(content_card_id, "/background/image"), __assign({ method: "post", body: formData, headers: {} }, options));
503
501
  };
504
502
  this.uploadAttachmentForCreatorUpdateById = function (tenant_id, creator_update_id, body, options) {
505
503
  if (options === void 0) { options = {}; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.386",
3
+ "version": "0.3.387",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",