@parra/parra-js-sdk 0.2.141 → 0.2.147

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.
@@ -970,6 +970,7 @@ export interface Application {
970
970
  type: ApplicationType;
971
971
  tenant_id: string;
972
972
  apns?: ApnsConfiguration | null;
973
+ channels?: Array<Channel> | null;
973
974
  }
974
975
  export interface ApplicationCollectionResponse {
975
976
  page: number;
@@ -979,12 +980,41 @@ export interface ApplicationCollectionResponse {
979
980
  data: Array<Application>;
980
981
  }
981
982
  export declare type ApplicationListResponse = Array<Application>;
982
- export declare enum ApnsConfigurationEnvironment {
983
+ export declare enum ApnsEnvironment {
983
984
  production = "production",
984
985
  sandbox = "sandbox"
985
986
  }
987
+ export declare enum ApnsPushType {
988
+ alert = "alert",
989
+ background = "background",
990
+ complication = "complication",
991
+ fileprovider = "fileprovider",
992
+ liveactivity = "liveactivity",
993
+ location = "location",
994
+ pushtotalk = "pushtotalk",
995
+ voip = "voip",
996
+ mdm = "mdm"
997
+ }
998
+ export interface CreateApnsChannelRequestBody {
999
+ application_id: string;
1000
+ environment: ApnsEnvironment;
1001
+ push_type: ApnsPushType;
1002
+ expiration?: string | null;
1003
+ collapse_id?: string | null;
1004
+ priority?: number | null;
1005
+ payload: Map<string, any>;
1006
+ }
1007
+ export interface ApnsChannel {
1008
+ id: string;
1009
+ created_at: string;
1010
+ updated_at: string;
1011
+ deleted_at?: string | null;
1012
+ name: string;
1013
+ description?: string | null;
1014
+ apns?: CreateApnsChannelRequestBody;
1015
+ type: ChannelType;
1016
+ }
986
1017
  export interface UpdateApnsConfigurationRequestBody {
987
- environment: ApnsConfigurationEnvironment;
988
1018
  name: string;
989
1019
  description?: string | null;
990
1020
  team_id: string;
@@ -996,7 +1026,6 @@ export interface ApnsConfiguration {
996
1026
  created_at: string;
997
1027
  updated_at: string;
998
1028
  deleted_at?: string | null;
999
- environment: ApnsConfigurationEnvironment;
1000
1029
  name: string;
1001
1030
  description?: string | null;
1002
1031
  team_id: string;
@@ -1007,6 +1036,27 @@ export declare enum ChannelType {
1007
1036
  apns = "apns",
1008
1037
  inbox = "inbox"
1009
1038
  }
1039
+ export interface UpdateChannelRequestBody {
1040
+ name: string;
1041
+ description?: string | null;
1042
+ apns?: CreateApnsChannelRequestBody;
1043
+ }
1044
+ export interface CreateChannelRequestBody {
1045
+ name: string;
1046
+ description?: string | null;
1047
+ apns?: CreateApnsChannelRequestBody;
1048
+ type: ChannelType;
1049
+ }
1050
+ export interface Channel {
1051
+ id: string;
1052
+ created_at: string;
1053
+ updated_at: string;
1054
+ deleted_at?: string | null;
1055
+ name: string;
1056
+ description?: string | null;
1057
+ apns?: CreateApnsChannelRequestBody;
1058
+ type: ChannelType;
1059
+ }
1010
1060
  export interface CreateDeviceRequestBody {
1011
1061
  platform: string;
1012
1062
  platform_agent: string;
@@ -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.147",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",