@parra/parra-js-sdk 0.3.417 → 0.3.418

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.
@@ -753,21 +753,43 @@ export interface AppleSubscription {
753
753
  group_level: number;
754
754
  product?: ProductStub | null;
755
755
  }
756
+ export declare enum AppPaywallType {
757
+ apple = "apple",
758
+ parra = "parra"
759
+ }
756
760
  export interface ApplePaywallMarketingContent {
757
761
  title: string;
758
762
  subtitle?: string | null;
759
763
  product_image: ImageAssetStub | null;
760
764
  }
761
- export interface ApplePaywall {
765
+ export interface PaywallHeaderSection {
766
+ id: string;
767
+ title: string;
768
+ type: string;
769
+ description?: string | null;
770
+ icon?: ImageAssetStub | null;
771
+ }
772
+ export interface PaywallOffering {
773
+ id: string;
774
+ title: string;
775
+ }
776
+ export interface PaywallOfferingSection {
777
+ id: string;
778
+ type: string;
779
+ offerings: Array<PaywallOffering>;
780
+ }
781
+ export type PaywallSection = PaywallHeaderSection | PaywallOfferingSection;
782
+ export interface AppPaywall {
762
783
  id: string;
763
784
  created_at: string;
764
785
  updated_at: string;
765
786
  deleted_at?: string | null;
787
+ type: AppPaywallType;
766
788
  group_id?: string | null;
767
789
  product_ids?: Array<string> | null;
768
790
  marketing_content?: ApplePaywallMarketingContent | null;
791
+ sections?: Array<PaywallSection> | null;
769
792
  }
770
- export type AppPaywall = ApplePaywall;
771
793
  export interface CreateAppPurchaseRequestBody {
772
794
  apple_receipt?: string;
773
795
  apple_receipts?: Array<string>;
@@ -928,6 +950,117 @@ export interface UpdateProductEntitlementRequestBody {
928
950
  consumable_quantity?: number | null;
929
951
  update_for_all_existing_entitlements?: boolean | null;
930
952
  }
953
+ export interface CreatePaidDmChannelRequestBody {
954
+ type: string;
955
+ key: string;
956
+ }
957
+ export type CreateChatChannelRequestBody = CreatePaidDmChannelRequestBody;
958
+ export declare enum ChatChannelType {
959
+ paidDm = "paid_dm",
960
+ dm = "dm",
961
+ default = "default",
962
+ app = "app",
963
+ group = "group",
964
+ user = "user"
965
+ }
966
+ export declare enum ChatChannelStatus {
967
+ active = "active",
968
+ closed = "closed",
969
+ archived = "archived"
970
+ }
971
+ export interface TenantUserStub {
972
+ id: string;
973
+ tenant_id: string;
974
+ name?: string | null;
975
+ avatar?: ImageAssetStub | null;
976
+ verified?: boolean | null;
977
+ roles?: Array<TenantUserRoleStub> | null;
978
+ }
979
+ export declare enum ChannelMemberType {
980
+ tenantUser = "tenant_user",
981
+ user = "user",
982
+ bot = "bot"
983
+ }
984
+ export declare enum ChannelMemberRole {
985
+ admin = "admin",
986
+ member = "member",
987
+ guest = "guest"
988
+ }
989
+ export interface ChannelMember {
990
+ id: string;
991
+ created_at: string;
992
+ updated_at: string;
993
+ deleted_at?: string | null;
994
+ user?: TenantUserStub | null;
995
+ type: ChannelMemberType;
996
+ roles: Array<ChannelMemberRole>;
997
+ }
998
+ export interface Channel {
999
+ id: string;
1000
+ created_at: string;
1001
+ updated_at: string;
1002
+ deleted_at?: string | null;
1003
+ type: ChannelType;
1004
+ name: string;
1005
+ description?: string | null;
1006
+ apns?: CreateApnsChannelRequestBody;
1007
+ inbox?: CreateInboxChannelRequestBody;
1008
+ }
1009
+ export interface ChannelCollectionResponse {
1010
+ page: number;
1011
+ page_count: number;
1012
+ page_size: number;
1013
+ total_count: number;
1014
+ data: Array<Channel>;
1015
+ }
1016
+ export interface UpdateChatChannelRequestBody {
1017
+ status?: ChatChannelStatus;
1018
+ }
1019
+ export interface MessageCollectionStub {
1020
+ id: string;
1021
+ created_at: string;
1022
+ updated_at: string;
1023
+ deleted_at?: string | null;
1024
+ tenant_id: string;
1025
+ channel_id: string;
1026
+ member_id: string;
1027
+ content: string;
1028
+ }
1029
+ export interface MessageCollectionResponse {
1030
+ page: number;
1031
+ page_count: number;
1032
+ page_size: number;
1033
+ total_count: number;
1034
+ data: Array<MessageCollectionStub>;
1035
+ }
1036
+ export interface CreateMessageRequestBody {
1037
+ content: string;
1038
+ }
1039
+ export interface Message {
1040
+ id: string;
1041
+ created_at: string;
1042
+ updated_at: string;
1043
+ deleted_at?: string | null;
1044
+ tenant_id: string;
1045
+ channel_id: string;
1046
+ member_id: string;
1047
+ user?: TenantUserStub | null;
1048
+ content: string;
1049
+ }
1050
+ export interface FlagMessageRequestBody {
1051
+ reason?: string | null;
1052
+ }
1053
+ export interface CreateReactionRequestBody {
1054
+ option_id: string;
1055
+ }
1056
+ export interface Reaction {
1057
+ id: string;
1058
+ created_at: string;
1059
+ updated_at: string;
1060
+ deleted_at?: string | null;
1061
+ option_id: string;
1062
+ user_id: string;
1063
+ }
931
1064
  export interface AppFaq {
932
1065
  id: string;
933
1066
  created_at: string;
@@ -1142,10 +1275,12 @@ export interface CreateCreatorUpdateTemplateRequestBody {
1142
1275
  feed_view_id?: string;
1143
1276
  notification_template_id?: string;
1144
1277
  entitlement_id?: string | null;
1278
+ paywall_context?: string | null;
1145
1279
  post_visibility?: CreatorUpdateVisibilityType;
1146
1280
  attachment_visibility?: CreatorUpdateVisibilityType;
1147
1281
  }
1148
1282
  export interface CreatorUpdateVisibility {
1283
+ paywall_context?: string | null;
1149
1284
  entitlement_id?: string | null;
1150
1285
  post_visibility: CreatorUpdateVisibilityType;
1151
1286
  attachment_visibility?: CreatorUpdateVisibilityType | null;
@@ -1177,6 +1312,7 @@ export interface UpdateCreatorUpdateTemplateRequestBody {
1177
1312
  feed_view_id?: string;
1178
1313
  notification_template_id?: string;
1179
1314
  entitlement_id?: string | null;
1315
+ paywall_context?: string | null;
1180
1316
  post_visibility?: CreatorUpdateVisibilityType;
1181
1317
  attachment_visibility?: CreatorUpdateVisibilityType;
1182
1318
  }
@@ -1465,14 +1601,6 @@ export interface UpdateFeedItemRequestBody {
1465
1601
  export interface CreateCommentRequestBody {
1466
1602
  body: string;
1467
1603
  }
1468
- export interface TenantUserStub {
1469
- id: string;
1470
- tenant_id: string;
1471
- name?: string | null;
1472
- avatar?: ImageAssetStub | null;
1473
- verified?: boolean | null;
1474
- roles?: Array<TenantUserRoleStub> | null;
1475
- }
1476
1604
  export interface Comment {
1477
1605
  id: string;
1478
1606
  created_at: string;
@@ -1531,17 +1659,6 @@ export interface SubmitCommentReviewRequestBody {
1531
1659
  status: SubmitCommentReviewStatus;
1532
1660
  note?: string | null;
1533
1661
  }
1534
- export interface CreateReactionRequestBody {
1535
- option_id: string;
1536
- }
1537
- export interface Reaction {
1538
- id: string;
1539
- created_at: string;
1540
- updated_at: string;
1541
- deleted_at?: string | null;
1542
- option_id: string;
1543
- user_id: string;
1544
- }
1545
1662
  export interface SubmitFeedbackFormResponseBody {
1546
1663
  }
1547
1664
  export interface FeedbackFormResponse {
@@ -2616,17 +2733,6 @@ export interface CreateChannelRequestBody {
2616
2733
  apns?: CreateApnsChannelRequestBody;
2617
2734
  inbox?: CreateInboxChannelRequestBody;
2618
2735
  }
2619
- export interface Channel {
2620
- id: string;
2621
- created_at: string;
2622
- updated_at: string;
2623
- deleted_at?: string | null;
2624
- type: ChannelType;
2625
- name: string;
2626
- description?: string | null;
2627
- apns?: CreateApnsChannelRequestBody;
2628
- inbox?: CreateInboxChannelRequestBody;
2629
- }
2630
2736
  export interface NotificationTemplate {
2631
2737
  id: string;
2632
2738
  created_at: string;
@@ -4281,6 +4387,23 @@ declare class ParraAPI {
4281
4387
  addEntitlementToProduct: (tenant_id: string, product_id: string, body: CreateProductEntitlementRequestBody, options?: Options) => Promise<ProductEntitlement>;
4282
4388
  updateProductEntitlement: (tenant_id: string, product_id: string, product_entitlement_id: string, body?: UpdateProductEntitlementRequestBody, options?: Options) => Promise<ProductEntitlement>;
4283
4389
  deleteProductEntitlement: (tenant_id: string, product_id: string, product_entitlement_id: string, options?: Options) => Promise<Response>;
4390
+ createChatChannel: (tenant_id: string, body?: CreateChatChannelRequestBody, options?: Options) => Promise<Channel>;
4391
+ paginateChatChannels: (tenant_id: string, query?: {
4392
+ type?: string;
4393
+ limit?: number;
4394
+ offset?: number;
4395
+ }, options?: Options) => Promise<ChannelCollectionResponse>;
4396
+ updateChatChannel: (tenant_id: string, channel_id: string, body?: UpdateChatChannelRequestBody, options?: Options) => Promise<Channel>;
4397
+ deleteChatChannel: (tenant_id: string, channel_id: string, options?: Options) => Promise<Response>;
4398
+ paginateMessagesForChatChannel: (tenant_id: string, channel_id: string, query?: {
4399
+ limit?: number;
4400
+ offset?: number;
4401
+ }, options?: Options) => Promise<MessageCollectionResponse>;
4402
+ createMessageForChatChannel: (tenant_id: string, channel_id: string, body: CreateMessageRequestBody, options?: Options) => Promise<Message>;
4403
+ deleteChatMessage: (tenant_id: string, message_id: string, options?: Options) => Promise<Response>;
4404
+ flagChatMessage: (tenant_id: string, message_id: string, body?: FlagMessageRequestBody, options?: Options) => Promise<Response>;
4405
+ addReactionToChatMessage: (tenant_id: string, message_id: string, body: CreateReactionRequestBody, options?: Options) => Promise<Reaction>;
4406
+ removeReactionFromChatMessage: (tenant_id: string, message_id: string, reaction_id: string, options?: Options) => Promise<Response>;
4284
4407
  listAppFaqs: (tenant_id: string, application_id: string, query?: {
4285
4408
  app_area_id?: string;
4286
4409
  }, options?: Options) => Promise<AppFaqView>;
package/dist/ParraAPI.js CHANGED
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.ConnectedAppType = exports.TenantOnboardingGoal = exports.DashboardChecklistItemStatus = exports.DashboardChecklistItemType = exports.RefreshTokenRotationType = exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.PasswordlessStrategy = exports.SsoProvider = exports.SettingsItemType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.TicketLinkType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.SubmitCommentReviewStatus = exports.CommentReviewStatus = exports.ReactionType = exports.FeedItemType = exports.CreatorUpdateChannelType = exports.CreatorUpdateStatus = exports.CreatorUpdateVisibilityType = exports.FeedbackFormFieldType = exports.BillingSourceType = exports.SubscriptionStatus = exports.Interval = exports.Currency = exports.IdentityType = exports.PolicyDocumentType = exports.AppleSsoScope = exports.DomainStatus = exports.DomainType = exports.ApplicationType = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = void 0;
15
- exports.PolicyDocumentVersionStatus = exports.PolicyDocumentStatus = exports.MailTemplateStatus = exports.MailTemplateVersionStatus = exports.MailTemplateType = exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = void 0;
14
+ exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.PasswordlessStrategy = exports.SsoProvider = exports.SettingsItemType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.TicketLinkType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.SubmitCommentReviewStatus = exports.CommentReviewStatus = exports.ReactionType = exports.FeedItemType = exports.CreatorUpdateChannelType = exports.CreatorUpdateStatus = exports.CreatorUpdateVisibilityType = exports.FeedbackFormFieldType = exports.ChannelMemberRole = exports.ChannelMemberType = exports.ChatChannelStatus = exports.ChatChannelType = exports.BillingSourceType = exports.AppPaywallType = exports.SubscriptionStatus = exports.Interval = exports.Currency = exports.IdentityType = exports.PolicyDocumentType = exports.AppleSsoScope = exports.DomainStatus = exports.DomainType = exports.ApplicationType = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = void 0;
15
+ exports.PolicyDocumentVersionStatus = exports.PolicyDocumentStatus = exports.MailTemplateStatus = exports.MailTemplateVersionStatus = exports.MailTemplateType = exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.TenantOnboardingGoal = exports.DashboardChecklistItemStatus = exports.DashboardChecklistItemType = exports.RefreshTokenRotationType = void 0;
16
16
  var TicketType;
17
17
  (function (TicketType) {
18
18
  TicketType["bug"] = "bug";
@@ -119,6 +119,11 @@ var SubscriptionStatus;
119
119
  SubscriptionStatus["canceled"] = "canceled";
120
120
  SubscriptionStatus["unpaid"] = "unpaid";
121
121
  })(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
122
+ var AppPaywallType;
123
+ (function (AppPaywallType) {
124
+ AppPaywallType["apple"] = "apple";
125
+ AppPaywallType["parra"] = "parra";
126
+ })(AppPaywallType || (exports.AppPaywallType = AppPaywallType = {}));
122
127
  var BillingSourceType;
123
128
  (function (BillingSourceType) {
124
129
  BillingSourceType["stripe"] = "stripe";
@@ -129,6 +134,33 @@ var BillingSourceType;
129
134
  BillingSourceType["microsoft"] = "microsoft";
130
135
  BillingSourceType["other"] = "other";
131
136
  })(BillingSourceType || (exports.BillingSourceType = BillingSourceType = {}));
137
+ var ChatChannelType;
138
+ (function (ChatChannelType) {
139
+ ChatChannelType["paidDm"] = "paid_dm";
140
+ ChatChannelType["dm"] = "dm";
141
+ ChatChannelType["default"] = "default";
142
+ ChatChannelType["app"] = "app";
143
+ ChatChannelType["group"] = "group";
144
+ ChatChannelType["user"] = "user";
145
+ })(ChatChannelType || (exports.ChatChannelType = ChatChannelType = {}));
146
+ var ChatChannelStatus;
147
+ (function (ChatChannelStatus) {
148
+ ChatChannelStatus["active"] = "active";
149
+ ChatChannelStatus["closed"] = "closed";
150
+ ChatChannelStatus["archived"] = "archived";
151
+ })(ChatChannelStatus || (exports.ChatChannelStatus = ChatChannelStatus = {}));
152
+ var ChannelMemberType;
153
+ (function (ChannelMemberType) {
154
+ ChannelMemberType["tenantUser"] = "tenant_user";
155
+ ChannelMemberType["user"] = "user";
156
+ ChannelMemberType["bot"] = "bot";
157
+ })(ChannelMemberType || (exports.ChannelMemberType = ChannelMemberType = {}));
158
+ var ChannelMemberRole;
159
+ (function (ChannelMemberRole) {
160
+ ChannelMemberRole["admin"] = "admin";
161
+ ChannelMemberRole["member"] = "member";
162
+ ChannelMemberRole["guest"] = "guest";
163
+ })(ChannelMemberRole || (exports.ChannelMemberRole = ChannelMemberRole = {}));
132
164
  var FeedbackFormFieldType;
133
165
  (function (FeedbackFormFieldType) {
134
166
  FeedbackFormFieldType["text"] = "text";
@@ -688,6 +720,56 @@ var ParraAPI = /** @class */ (function () {
688
720
  if (options === void 0) { options = {}; }
689
721
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/billing/products/").concat(product_id, "/entitlements/").concat(product_entitlement_id), __assign({ method: "delete" }, options));
690
722
  };
723
+ this.createChatChannel = function (tenant_id, body, options) {
724
+ if (options === void 0) { options = {}; }
725
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/channels"), __assign({ method: "post", body: JSON.stringify(body), headers: {
726
+ "content-type": "application/json",
727
+ } }, options));
728
+ };
729
+ this.paginateChatChannels = function (tenant_id, query, options) {
730
+ if (options === void 0) { options = {}; }
731
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/channels"), __assign({ method: "get", query: query }, options));
732
+ };
733
+ this.updateChatChannel = function (tenant_id, channel_id, body, options) {
734
+ if (options === void 0) { options = {}; }
735
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/channels/").concat(channel_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
736
+ "content-type": "application/json",
737
+ } }, options));
738
+ };
739
+ this.deleteChatChannel = function (tenant_id, channel_id, options) {
740
+ if (options === void 0) { options = {}; }
741
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/channels/").concat(channel_id), __assign({ method: "delete" }, options));
742
+ };
743
+ this.paginateMessagesForChatChannel = function (tenant_id, channel_id, query, options) {
744
+ if (options === void 0) { options = {}; }
745
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/channels/").concat(channel_id, "/messages"), __assign({ method: "get", query: query }, options));
746
+ };
747
+ this.createMessageForChatChannel = function (tenant_id, channel_id, body, options) {
748
+ if (options === void 0) { options = {}; }
749
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/channels/").concat(channel_id, "/messages"), __assign({ method: "post", body: JSON.stringify(body), headers: {
750
+ "content-type": "application/json",
751
+ } }, options));
752
+ };
753
+ this.deleteChatMessage = function (tenant_id, message_id, options) {
754
+ if (options === void 0) { options = {}; }
755
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/messages/").concat(message_id), __assign({ method: "delete" }, options));
756
+ };
757
+ this.flagChatMessage = function (tenant_id, message_id, body, options) {
758
+ if (options === void 0) { options = {}; }
759
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/messages/").concat(message_id, "/flag"), __assign({ method: "post", body: JSON.stringify(body), headers: {
760
+ "content-type": "application/json",
761
+ }, raw: true }, options));
762
+ };
763
+ this.addReactionToChatMessage = function (tenant_id, message_id, body, options) {
764
+ if (options === void 0) { options = {}; }
765
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/messages/").concat(message_id, "/reactions"), __assign({ method: "post", body: JSON.stringify(body), headers: {
766
+ "content-type": "application/json",
767
+ } }, options));
768
+ };
769
+ this.removeReactionFromChatMessage = function (tenant_id, message_id, reaction_id, options) {
770
+ if (options === void 0) { options = {}; }
771
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/chat/messages/").concat(message_id, "/reactions/").concat(reaction_id), __assign({ method: "delete" }, options));
772
+ };
691
773
  this.listAppFaqs = function (tenant_id, application_id, query, options) {
692
774
  if (options === void 0) { options = {}; }
693
775
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/faqs"), __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.417",
3
+ "version": "0.3.418",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",