@parra/parra-js-sdk 0.2.141 → 0.2.148

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.
@@ -979,12 +979,41 @@ export interface ApplicationCollectionResponse {
979
979
  data: Array<Application>;
980
980
  }
981
981
  export declare type ApplicationListResponse = Array<Application>;
982
- export declare enum ApnsConfigurationEnvironment {
982
+ export declare enum ApnsEnvironment {
983
983
  production = "production",
984
984
  sandbox = "sandbox"
985
985
  }
986
+ export declare enum ApnsPushType {
987
+ alert = "alert",
988
+ background = "background",
989
+ complication = "complication",
990
+ fileprovider = "fileprovider",
991
+ liveactivity = "liveactivity",
992
+ location = "location",
993
+ pushtotalk = "pushtotalk",
994
+ voip = "voip",
995
+ mdm = "mdm"
996
+ }
997
+ export interface CreateApnsChannelRequestBody {
998
+ application_id: string;
999
+ environment: ApnsEnvironment;
1000
+ push_type: ApnsPushType;
1001
+ expiration?: string | null;
1002
+ collapse_id?: string | null;
1003
+ priority?: number | null;
1004
+ payload: Map<string, any>;
1005
+ }
1006
+ export interface ApnsChannel {
1007
+ id: string;
1008
+ created_at: string;
1009
+ updated_at: string;
1010
+ deleted_at?: string | null;
1011
+ name: string;
1012
+ description?: string | null;
1013
+ apns?: CreateApnsChannelRequestBody;
1014
+ type: ChannelType;
1015
+ }
986
1016
  export interface UpdateApnsConfigurationRequestBody {
987
- environment: ApnsConfigurationEnvironment;
988
1017
  name: string;
989
1018
  description?: string | null;
990
1019
  team_id: string;
@@ -996,7 +1025,6 @@ export interface ApnsConfiguration {
996
1025
  created_at: string;
997
1026
  updated_at: string;
998
1027
  deleted_at?: string | null;
999
- environment: ApnsConfigurationEnvironment;
1000
1028
  name: string;
1001
1029
  description?: string | null;
1002
1030
  team_id: string;
@@ -1007,6 +1035,27 @@ export declare enum ChannelType {
1007
1035
  apns = "apns",
1008
1036
  inbox = "inbox"
1009
1037
  }
1038
+ export interface UpdateChannelRequestBody {
1039
+ name: string;
1040
+ description?: string | null;
1041
+ apns?: CreateApnsChannelRequestBody;
1042
+ }
1043
+ export interface CreateChannelRequestBody {
1044
+ name: string;
1045
+ description?: string | null;
1046
+ apns?: CreateApnsChannelRequestBody;
1047
+ type: ChannelType;
1048
+ }
1049
+ export interface Channel {
1050
+ id: string;
1051
+ created_at: string;
1052
+ updated_at: string;
1053
+ deleted_at?: string | null;
1054
+ name: string;
1055
+ description?: string | null;
1056
+ apns?: CreateApnsChannelRequestBody;
1057
+ type: ChannelType;
1058
+ }
1010
1059
  export interface CreateDeviceRequestBody {
1011
1060
  platform: string;
1012
1061
  platform_agent: string;
@@ -1083,6 +1132,7 @@ export interface NotificationTemplate {
1083
1132
  name: string;
1084
1133
  description?: string | null;
1085
1134
  tenant_id: string;
1135
+ channels?: Array<Channel> | null;
1086
1136
  }
1087
1137
  export interface NotificationTemplateCollectionResponse {
1088
1138
  page: number;
@@ -1262,7 +1312,7 @@ declare class ParraAPI {
1262
1312
  $search?: string | undefined;
1263
1313
  } | undefined) => Promise<FeedbackFormSubmissionCollectionResponse>;
1264
1314
  getFormById: (feedback_form_id: string) => Promise<FeedbackFormDataStub>;
1265
- submitFormById: (feedback_form_id: string, body?: FeedbackFormResponse | undefined) => Promise<Response>;
1315
+ submitFormById: (feedback_form_id: string, body?: SubmitFeedbackFormResponseBody | undefined) => Promise<Response>;
1266
1316
  createQuestion: (body?: CreateQuestionRequestBody | undefined) => Promise<Question>;
1267
1317
  paginateQuestions: (query?: {
1268
1318
  $select?: string | undefined;
@@ -1331,6 +1381,7 @@ declare class ParraAPI {
1331
1381
  } | undefined) => Promise<NotificationTemplate>;
1332
1382
  updateNotificationTemplateById: (tenant_id: string, notification_template_id: string, body?: UpdateNotificationTemplateRequestBody | undefined) => Promise<NotificationTemplate>;
1333
1383
  deleteNotificationTemplateById: (tenant_id: string, notification_template_id: string) => Promise<Response>;
1384
+ createChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, body?: CreateChannelRequestBody | undefined) => Promise<Channel>;
1334
1385
  createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
1335
1386
  listUsers: (query?: {
1336
1387
  $select?: string | undefined;
package/dist/ParraAPI.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChannelType = exports.ApnsConfigurationEnvironment = exports.ApplicationType = exports.TemplateType = exports.QuestionKind = exports.QuestionType = exports.CardItemType = exports.CardItemDisplayType = exports.FeedbackFormFieldType = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CampaignStatus = exports.SubscriptionStatus = exports.Interval = exports.Currency = void 0;
3
+ exports.ChannelType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ApplicationType = exports.TemplateType = exports.QuestionKind = exports.QuestionType = exports.CardItemType = exports.CardItemDisplayType = exports.FeedbackFormFieldType = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CampaignStatus = exports.SubscriptionStatus = exports.Interval = exports.Currency = void 0;
4
4
  var Currency;
5
5
  (function (Currency) {
6
6
  Currency["usd"] = "usd";
@@ -85,11 +85,23 @@ var ApplicationType;
85
85
  (function (ApplicationType) {
86
86
  ApplicationType["ios"] = "ios";
87
87
  })(ApplicationType = exports.ApplicationType || (exports.ApplicationType = {}));
88
- var ApnsConfigurationEnvironment;
89
- (function (ApnsConfigurationEnvironment) {
90
- ApnsConfigurationEnvironment["production"] = "production";
91
- ApnsConfigurationEnvironment["sandbox"] = "sandbox";
92
- })(ApnsConfigurationEnvironment = exports.ApnsConfigurationEnvironment || (exports.ApnsConfigurationEnvironment = {}));
88
+ var ApnsEnvironment;
89
+ (function (ApnsEnvironment) {
90
+ ApnsEnvironment["production"] = "production";
91
+ ApnsEnvironment["sandbox"] = "sandbox";
92
+ })(ApnsEnvironment = exports.ApnsEnvironment || (exports.ApnsEnvironment = {}));
93
+ var ApnsPushType;
94
+ (function (ApnsPushType) {
95
+ ApnsPushType["alert"] = "alert";
96
+ ApnsPushType["background"] = "background";
97
+ ApnsPushType["complication"] = "complication";
98
+ ApnsPushType["fileprovider"] = "fileprovider";
99
+ ApnsPushType["liveactivity"] = "liveactivity";
100
+ ApnsPushType["location"] = "location";
101
+ ApnsPushType["pushtotalk"] = "pushtotalk";
102
+ ApnsPushType["voip"] = "voip";
103
+ ApnsPushType["mdm"] = "mdm";
104
+ })(ApnsPushType = exports.ApnsPushType || (exports.ApnsPushType = {}));
93
105
  var ChannelType;
94
106
  (function (ChannelType) {
95
107
  ChannelType["apns"] = "apns";
@@ -618,6 +630,15 @@ var ParraAPI = /** @class */ (function () {
618
630
  method: "delete",
619
631
  });
620
632
  };
633
+ this.createChannelForNotificationTemplate = function (tenant_id, notification_template_id, body) {
634
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates/").concat(notification_template_id, "/channels"), {
635
+ method: "post",
636
+ body: JSON.stringify(body),
637
+ headers: {
638
+ "content-type": "application/json",
639
+ },
640
+ });
641
+ };
621
642
  this.createUser = function (body) {
622
643
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
623
644
  method: "post",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.141",
3
+ "version": "0.2.148",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",