@parra/parra-js-sdk 0.3.329 → 0.3.331

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.
@@ -403,6 +403,10 @@ export interface Identity {
403
403
  external_id?: string | null;
404
404
  has_password?: boolean | null;
405
405
  }
406
+ export interface TenantUserEntitlement {
407
+ id: string;
408
+ key: string;
409
+ }
406
410
  export interface TenantUserStub {
407
411
  id: string;
408
412
  created_at: string;
@@ -502,6 +506,7 @@ export interface TenantUser {
502
506
  properties: object;
503
507
  metadata: object;
504
508
  identities?: Array<Identity> | null;
509
+ entitlements?: Array<TenantUserEntitlement> | null;
505
510
  }
506
511
  export interface UserInfoResponse {
507
512
  roles?: Array<string>;
@@ -617,6 +622,32 @@ export interface BillingPortalSession {
617
622
  export interface CreateEmailSubscriberRequestBody {
618
623
  email: string;
619
624
  }
625
+ export interface ApplePaywallMarketingContent {
626
+ title: string;
627
+ subtitle?: string | null;
628
+ product_image: ImageAssetStub | null;
629
+ }
630
+ export interface ApplePaywall {
631
+ id: string;
632
+ created_at: string;
633
+ updated_at: string;
634
+ deleted_at?: string | null;
635
+ group_id?: string | null;
636
+ product_ids?: Array<string> | null;
637
+ marketing_content?: ApplePaywallMarketingContent | null;
638
+ }
639
+ export type AppPaywall = ApplePaywall;
640
+ export interface CreateAppPurchaseRequestBody {
641
+ apple_receipt?: string;
642
+ apple_receipts?: Array<string>;
643
+ }
644
+ export interface AppEntitlement {
645
+ id: string;
646
+ key: string;
647
+ }
648
+ export interface AppPurchaseResponseBody {
649
+ entitlements: Array<AppEntitlement>;
650
+ }
620
651
  export declare enum BillingSourceType {
621
652
  stripe = "stripe",
622
653
  paypal = "paypal",
@@ -637,6 +668,12 @@ export interface CreateBillingSourceRequestBody {
637
668
  application_id: string;
638
669
  data: CreateBillingSourceBillingSourceData;
639
670
  }
671
+ export interface BillingSourceAppleData {
672
+ app_store_connect_api_connection_id: string;
673
+ app_store_server_notification_production_url: string;
674
+ app_store_server_notification_sandbox_url: string;
675
+ }
676
+ export type BillingSourceData = BillingSourceAppleData;
640
677
  export interface BillingSource {
641
678
  id: string;
642
679
  created_at: string;
@@ -647,20 +684,20 @@ export interface BillingSource {
647
684
  type: BillingSourceType;
648
685
  description?: string | null;
649
686
  application_id: string;
650
- data: CreateBillingSourceBillingSourceData;
687
+ data: BillingSourceData;
651
688
  }
652
689
  export interface UpdateBillingSourceRequestBody {
653
690
  title: string;
654
691
  description?: string | null;
655
692
  }
656
693
  export interface UpdateEntitlementRequestBody {
657
- title: string;
658
- key: string;
694
+ title?: string;
695
+ key?: string;
659
696
  description?: string | null;
660
697
  }
661
698
  export interface CreateEntitlementRequestBody {
662
- title: string;
663
- key: string;
699
+ title?: string;
700
+ key?: string;
664
701
  description?: string | null;
665
702
  }
666
703
  export interface Entitlement {
@@ -676,13 +713,13 @@ export interface Entitlement {
676
713
  is_free: boolean;
677
714
  }
678
715
  export interface UpdateProductRequestBody {
679
- title: string;
680
- key: string;
716
+ title?: string;
717
+ key?: string;
681
718
  description?: string | null;
682
719
  }
683
720
  export interface CreateProductRequestBody {
684
- title: string;
685
- key: string;
721
+ title?: string;
722
+ key?: string;
686
723
  description?: string | null;
687
724
  }
688
725
  export interface ProductEntitlement {
@@ -899,17 +936,12 @@ export interface CreatorUpdateAttachmentStub {
899
936
  id: string;
900
937
  image?: ImageAssetStub | null;
901
938
  }
902
- export interface EntitlementStub {
903
- id: string;
904
- title: string;
905
- key: string;
906
- }
907
939
  export declare enum CreatorUpdateVisibilityType {
908
940
  public = "public",
909
941
  private = "private"
910
942
  }
911
943
  export interface CreatorUpdateVisibility {
912
- entitlement?: EntitlementStub;
944
+ entitlement_id?: string | null;
913
945
  post_visibility: CreatorUpdateVisibilityType;
914
946
  attachment_visibility?: CreatorUpdateVisibilityType | null;
915
947
  }
@@ -1011,6 +1043,7 @@ export interface ContentCardBackground {
1011
1043
  }
1012
1044
  export interface ContentCardAction {
1013
1045
  url: string;
1046
+ confirmation_message?: string | null;
1014
1047
  }
1015
1048
  export interface ContentCard {
1016
1049
  id: string;
@@ -1020,8 +1053,18 @@ export interface ContentCard {
1020
1053
  background?: ContentCardBackground | null;
1021
1054
  title?: string | null;
1022
1055
  description?: string | null;
1056
+ badge?: string | null;
1023
1057
  action?: ContentCardAction | null;
1024
1058
  }
1059
+ export interface EntitlementStub {
1060
+ id: string;
1061
+ title: string;
1062
+ key: string;
1063
+ }
1064
+ export interface AppPaywallConfiguration {
1065
+ context?: string | null;
1066
+ entitlement?: EntitlementStub;
1067
+ }
1025
1068
  export interface CreatorUpdateAppStub {
1026
1069
  id: string;
1027
1070
  created_at: string;
@@ -1031,6 +1074,7 @@ export interface CreatorUpdateAppStub {
1031
1074
  body?: string;
1032
1075
  sender?: CreatorUpdateSenderStub | null;
1033
1076
  attachments?: Array<CreatorUpdateAttachmentStub>;
1077
+ attachment_paywall?: AppPaywallConfiguration | null;
1034
1078
  }
1035
1079
  export type FeedItemData = YoutubeVideo | ContentCard | CreatorUpdateAppStub;
1036
1080
  export interface FeedItem {
@@ -3667,20 +3711,26 @@ declare class ParraAPI {
3667
3711
  getPlansForTenantById: (tenant_id: string, options?: Options) => Promise<TenantPlansResponse>;
3668
3712
  createBillingPortalSession: (tenant_id: string, options?: Options) => Promise<BillingPortalSession>;
3669
3713
  createSubscriberForEmailAudienceById: (email_audience_id: string, body: CreateEmailSubscriberRequestBody, options?: Options) => Promise<Response>;
3714
+ getAppPaywall: (tenant_id: string, application_id: string, query?: {
3715
+ entitlement?: string;
3716
+ context?: string;
3717
+ }, options?: Options) => Promise<AppPaywall>;
3718
+ createPurchaseForTenantApplication: (tenant_id: string, application_id: string, body?: CreateAppPurchaseRequestBody, options?: Options) => Promise<AppPurchaseResponseBody>;
3670
3719
  createBillingSource: (tenant_id: string, body: CreateBillingSourceRequestBody, options?: Options) => Promise<BillingSource>;
3671
3720
  listBillingSources: (tenant_id: string, options?: Options) => Promise<Array<BillingSource>>;
3672
3721
  getBillingSourceById: (tenant_id: string, billing_source_id: string, options?: Options) => Promise<BillingSource>;
3673
3722
  updateBillingSourceById: (tenant_id: string, billing_source_id: string, body: UpdateBillingSourceRequestBody, options?: Options) => Promise<BillingSource>;
3674
3723
  deleteBillingSourceById: (tenant_id: string, billing_source_id: string, options?: Options) => Promise<Response>;
3724
+ setupAppStoreServerNotificationsForAppleBillingSource: (tenant_id: string, billing_source_id: string, options?: Options) => Promise<Response>;
3675
3725
  createEntitlement: (tenant_id: string, body?: CreateEntitlementRequestBody, options?: Options) => Promise<Entitlement>;
3676
3726
  listEntitlements: (tenant_id: string, options?: Options) => Promise<Array<Entitlement>>;
3677
3727
  getEntitlementById: (tenant_id: string, entitlement_id: string, options?: Options) => Promise<Entitlement>;
3678
- updateEntitlementById: (tenant_id: string, entitlement_id: string, body: UpdateEntitlementRequestBody, options?: Options) => Promise<Entitlement>;
3728
+ updateEntitlementById: (tenant_id: string, entitlement_id: string, body?: UpdateEntitlementRequestBody, options?: Options) => Promise<Entitlement>;
3679
3729
  deleteEntitlementById: (tenant_id: string, entitlement_id: string, options?: Options) => Promise<Response>;
3680
3730
  createProduct: (tenant_id: string, body?: CreateProductRequestBody, options?: Options) => Promise<Product>;
3681
3731
  listProducts: (tenant_id: string, options?: Options) => Promise<Array<Product>>;
3682
3732
  getProductById: (tenant_id: string, product_id: string, options?: Options) => Promise<Product>;
3683
- updateProductById: (tenant_id: string, product_id: string, body: UpdateProductRequestBody, options?: Options) => Promise<Product>;
3733
+ updateProductById: (tenant_id: string, product_id: string, body?: UpdateProductRequestBody, options?: Options) => Promise<Product>;
3684
3734
  deleteProductById: (tenant_id: string, product_id: string, options?: Options) => Promise<Response>;
3685
3735
  addEntitlementToProduct: (tenant_id: string, product_id: string, body: CreateProductEntitlementRequestBody, options?: Options) => Promise<ProductEntitlement>;
3686
3736
  deleteProductEntitlement: (tenant_id: string, product_id: string, product_entitlement_id: string, options?: Options) => Promise<Response>;
@@ -4021,6 +4071,7 @@ declare class ParraAPI {
4021
4071
  group?: string;
4022
4072
  type?: string;
4023
4073
  }, options?: Options) => Promise<Array<TenantConnectedApp>>;
4074
+ getConnectedAppConnectionById: (tenant_id: string, connected_app_connection_id: string, options?: Options) => Promise<ConnectedAppConnection>;
4024
4075
  updateConnectedAppConnectionById: (tenant_id: string, connected_app_connection_id: string, body?: UpdateConnectedAppConnectionRequestBody, options?: Options) => Promise<ConnectedAppConnection>;
4025
4076
  deleteConnectedAppConnectionById: (tenant_id: string, connected_app_connection_id: string, options?: Options) => Promise<ConnectedAppConnection>;
4026
4077
  createConnectionForConnectedApp: (tenant_id: string, connected_app_id: string, body?: CreateConnectedAppConnectionRequestBody, options?: Options) => Promise<ConnectedAppConnection>;
package/dist/ParraAPI.js CHANGED
@@ -497,6 +497,16 @@ var ParraAPI = /** @class */ (function () {
497
497
  "content-type": "application/json",
498
498
  }, raw: true }, options));
499
499
  };
500
+ this.getAppPaywall = function (tenant_id, application_id, query, options) {
501
+ if (options === void 0) { options = {}; }
502
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/paywall"), __assign({ method: "get", query: query }, options));
503
+ };
504
+ this.createPurchaseForTenantApplication = function (tenant_id, application_id, body, options) {
505
+ if (options === void 0) { options = {}; }
506
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/purchases"), __assign({ method: "post", body: JSON.stringify(body), headers: {
507
+ "content-type": "application/json",
508
+ } }, options));
509
+ };
500
510
  this.createBillingSource = function (tenant_id, body, options) {
501
511
  if (options === void 0) { options = {}; }
502
512
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing/sources"), __assign({ method: "post", body: JSON.stringify(body), headers: {
@@ -521,6 +531,10 @@ var ParraAPI = /** @class */ (function () {
521
531
  if (options === void 0) { options = {}; }
522
532
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing/sources/").concat(billing_source_id), __assign({ method: "delete" }, options));
523
533
  };
534
+ this.setupAppStoreServerNotificationsForAppleBillingSource = function (tenant_id, billing_source_id, options) {
535
+ if (options === void 0) { options = {}; }
536
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing/sources/").concat(billing_source_id, "/apple/app-store-server-notifications"), __assign({ method: "post" }, options));
537
+ };
524
538
  this.createEntitlement = function (tenant_id, body, options) {
525
539
  if (options === void 0) { options = {}; }
526
540
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing/entitlements"), __assign({ method: "post", body: JSON.stringify(body), headers: {
@@ -1437,6 +1451,10 @@ var ParraAPI = /** @class */ (function () {
1437
1451
  if (options === void 0) { options = {}; }
1438
1452
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/connected-apps"), __assign({ method: "get", query: query }, options));
1439
1453
  };
1454
+ this.getConnectedAppConnectionById = function (tenant_id, connected_app_connection_id, options) {
1455
+ if (options === void 0) { options = {}; }
1456
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/connected-apps/connections/").concat(connected_app_connection_id), __assign({ method: "get" }, options));
1457
+ };
1440
1458
  this.updateConnectedAppConnectionById = function (tenant_id, connected_app_connection_id, body, options) {
1441
1459
  if (options === void 0) { options = {}; }
1442
1460
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/connected-apps/connections/").concat(connected_app_connection_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.329",
3
+ "version": "0.3.331",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",