@parra/parra-js-sdk 0.2.140 → 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.
- package/dist/ParraAPI.d.ts +105 -5
- package/dist/ParraAPI.js +73 -6
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -507,11 +507,16 @@ export interface FeedbackFormData {
|
|
|
507
507
|
description?: string | null;
|
|
508
508
|
fields: Array<FeedbackFormField>;
|
|
509
509
|
}
|
|
510
|
+
export declare enum FeedbackFormFieldType {
|
|
511
|
+
text = "text",
|
|
512
|
+
input = "input",
|
|
513
|
+
select = "select"
|
|
514
|
+
}
|
|
510
515
|
export interface FeedbackFormField {
|
|
511
516
|
name: string;
|
|
512
517
|
title?: string;
|
|
513
518
|
helper_text?: string;
|
|
514
|
-
type:
|
|
519
|
+
type: FeedbackFormFieldType;
|
|
515
520
|
required?: boolean;
|
|
516
521
|
data: FeedbackFormFieldData;
|
|
517
522
|
}
|
|
@@ -965,6 +970,7 @@ export interface Application {
|
|
|
965
970
|
type: ApplicationType;
|
|
966
971
|
tenant_id: string;
|
|
967
972
|
apns?: ApnsConfiguration | null;
|
|
973
|
+
channels?: Array<Channel> | null;
|
|
968
974
|
}
|
|
969
975
|
export interface ApplicationCollectionResponse {
|
|
970
976
|
page: number;
|
|
@@ -974,12 +980,41 @@ export interface ApplicationCollectionResponse {
|
|
|
974
980
|
data: Array<Application>;
|
|
975
981
|
}
|
|
976
982
|
export declare type ApplicationListResponse = Array<Application>;
|
|
977
|
-
export declare enum
|
|
983
|
+
export declare enum ApnsEnvironment {
|
|
978
984
|
production = "production",
|
|
979
985
|
sandbox = "sandbox"
|
|
980
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
|
+
}
|
|
981
1017
|
export interface UpdateApnsConfigurationRequestBody {
|
|
982
|
-
environment: ApnsConfigurationEnvironment;
|
|
983
1018
|
name: string;
|
|
984
1019
|
description?: string | null;
|
|
985
1020
|
team_id: string;
|
|
@@ -991,13 +1026,37 @@ export interface ApnsConfiguration {
|
|
|
991
1026
|
created_at: string;
|
|
992
1027
|
updated_at: string;
|
|
993
1028
|
deleted_at?: string | null;
|
|
994
|
-
environment: ApnsConfigurationEnvironment;
|
|
995
1029
|
name: string;
|
|
996
1030
|
description?: string | null;
|
|
997
1031
|
team_id: string;
|
|
998
1032
|
key_id: string;
|
|
999
1033
|
key: string;
|
|
1000
1034
|
}
|
|
1035
|
+
export declare enum ChannelType {
|
|
1036
|
+
apns = "apns",
|
|
1037
|
+
inbox = "inbox"
|
|
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
|
+
}
|
|
1001
1060
|
export interface CreateDeviceRequestBody {
|
|
1002
1061
|
platform: string;
|
|
1003
1062
|
platform_agent: string;
|
|
@@ -1058,6 +1117,31 @@ export interface NotificationCollectionResponse {
|
|
|
1058
1117
|
export interface ReadNotificationsRequestBody {
|
|
1059
1118
|
notification_ids: Array<string>;
|
|
1060
1119
|
}
|
|
1120
|
+
export interface UpdateNotificationTemplateRequestBody {
|
|
1121
|
+
name: string;
|
|
1122
|
+
description?: string | null;
|
|
1123
|
+
}
|
|
1124
|
+
export interface CreateNotificationTemplateRequestBody {
|
|
1125
|
+
name: string;
|
|
1126
|
+
description?: string | null;
|
|
1127
|
+
}
|
|
1128
|
+
export interface NotificationTemplate {
|
|
1129
|
+
id: string;
|
|
1130
|
+
created_at: string;
|
|
1131
|
+
updated_at: string;
|
|
1132
|
+
deleted_at?: string | null;
|
|
1133
|
+
name: string;
|
|
1134
|
+
description?: string | null;
|
|
1135
|
+
tenant_id: string;
|
|
1136
|
+
}
|
|
1137
|
+
export interface NotificationTemplateCollectionResponse {
|
|
1138
|
+
page: number;
|
|
1139
|
+
page_count: number;
|
|
1140
|
+
page_size: number;
|
|
1141
|
+
total_count: number;
|
|
1142
|
+
data: Array<NotificationTemplate>;
|
|
1143
|
+
}
|
|
1144
|
+
export declare type NotificationTemplateListResponse = Array<NotificationTemplate>;
|
|
1061
1145
|
export interface CreatePushTokenRequestBody {
|
|
1062
1146
|
application_id: string;
|
|
1063
1147
|
type: string;
|
|
@@ -1228,7 +1312,7 @@ declare class ParraAPI {
|
|
|
1228
1312
|
$search?: string | undefined;
|
|
1229
1313
|
} | undefined) => Promise<FeedbackFormSubmissionCollectionResponse>;
|
|
1230
1314
|
getFormById: (feedback_form_id: string) => Promise<FeedbackFormDataStub>;
|
|
1231
|
-
submitFormById: (feedback_form_id: string, body?:
|
|
1315
|
+
submitFormById: (feedback_form_id: string, body?: SubmitFeedbackFormResponseBody | undefined) => Promise<Response>;
|
|
1232
1316
|
createQuestion: (body?: CreateQuestionRequestBody | undefined) => Promise<Question>;
|
|
1233
1317
|
paginateQuestions: (query?: {
|
|
1234
1318
|
$select?: string | undefined;
|
|
@@ -1282,6 +1366,22 @@ declare class ParraAPI {
|
|
|
1282
1366
|
updateApplicationByIdForTenantById: (tenant_id: string, application_id: string, body?: UpdateApplicationRequestBody | undefined) => Promise<Application>;
|
|
1283
1367
|
deleteApplicationByIdForTenantById: (tenant_id: string, application_id: string) => Promise<Response>;
|
|
1284
1368
|
updateApnsConfigurationForTenantApplication: (tenant_id: string, application_id: string, body?: UpdateApnsConfigurationRequestBody | undefined) => Promise<ApnsConfiguration>;
|
|
1369
|
+
createNotificationTemplate: (tenant_id: string, body?: CreateNotificationTemplateRequestBody | undefined) => Promise<NotificationTemplate>;
|
|
1370
|
+
paginateNotificationTemplatesForTenantById: (tenant_id: string, query?: {
|
|
1371
|
+
$select?: string | undefined;
|
|
1372
|
+
$top?: number | undefined;
|
|
1373
|
+
$skip?: number | undefined;
|
|
1374
|
+
$orderby?: string | undefined;
|
|
1375
|
+
$filter?: string | undefined;
|
|
1376
|
+
$expand?: string | undefined;
|
|
1377
|
+
$search?: string | undefined;
|
|
1378
|
+
} | undefined) => Promise<NotificationTemplateCollectionResponse>;
|
|
1379
|
+
getNotificationTemplateById: (tenant_id: string, notification_template_id: string, query?: {
|
|
1380
|
+
include?: string | undefined;
|
|
1381
|
+
} | undefined) => Promise<NotificationTemplate>;
|
|
1382
|
+
updateNotificationTemplateById: (tenant_id: string, notification_template_id: string, body?: UpdateNotificationTemplateRequestBody | undefined) => Promise<NotificationTemplate>;
|
|
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>;
|
|
1285
1385
|
createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
|
|
1286
1386
|
listUsers: (query?: {
|
|
1287
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.
|
|
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";
|
|
@@ -39,6 +39,12 @@ var CampaignActionDisplayType;
|
|
|
39
39
|
CampaignActionDisplayType["popup"] = "popup";
|
|
40
40
|
CampaignActionDisplayType["inline"] = "inline";
|
|
41
41
|
})(CampaignActionDisplayType = exports.CampaignActionDisplayType || (exports.CampaignActionDisplayType = {}));
|
|
42
|
+
var FeedbackFormFieldType;
|
|
43
|
+
(function (FeedbackFormFieldType) {
|
|
44
|
+
FeedbackFormFieldType["text"] = "text";
|
|
45
|
+
FeedbackFormFieldType["input"] = "input";
|
|
46
|
+
FeedbackFormFieldType["select"] = "select";
|
|
47
|
+
})(FeedbackFormFieldType = exports.FeedbackFormFieldType || (exports.FeedbackFormFieldType = {}));
|
|
42
48
|
var CardItemDisplayType;
|
|
43
49
|
(function (CardItemDisplayType) {
|
|
44
50
|
CardItemDisplayType["inline"] = "inline";
|
|
@@ -79,11 +85,28 @@ var ApplicationType;
|
|
|
79
85
|
(function (ApplicationType) {
|
|
80
86
|
ApplicationType["ios"] = "ios";
|
|
81
87
|
})(ApplicationType = exports.ApplicationType || (exports.ApplicationType = {}));
|
|
82
|
-
var
|
|
83
|
-
(function (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})(
|
|
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 = {}));
|
|
105
|
+
var ChannelType;
|
|
106
|
+
(function (ChannelType) {
|
|
107
|
+
ChannelType["apns"] = "apns";
|
|
108
|
+
ChannelType["inbox"] = "inbox";
|
|
109
|
+
})(ChannelType = exports.ChannelType || (exports.ChannelType = {}));
|
|
87
110
|
var ParraAPI = /** @class */ (function () {
|
|
88
111
|
function ParraAPI(http, options) {
|
|
89
112
|
var _this = this;
|
|
@@ -572,6 +595,50 @@ var ParraAPI = /** @class */ (function () {
|
|
|
572
595
|
},
|
|
573
596
|
});
|
|
574
597
|
};
|
|
598
|
+
this.createNotificationTemplate = function (tenant_id, body) {
|
|
599
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates"), {
|
|
600
|
+
method: "post",
|
|
601
|
+
body: JSON.stringify(body),
|
|
602
|
+
headers: {
|
|
603
|
+
"content-type": "application/json",
|
|
604
|
+
},
|
|
605
|
+
});
|
|
606
|
+
};
|
|
607
|
+
this.paginateNotificationTemplatesForTenantById = function (tenant_id, query) {
|
|
608
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates"), {
|
|
609
|
+
method: "get",
|
|
610
|
+
query: query,
|
|
611
|
+
});
|
|
612
|
+
};
|
|
613
|
+
this.getNotificationTemplateById = function (tenant_id, notification_template_id, query) {
|
|
614
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates/").concat(notification_template_id), {
|
|
615
|
+
method: "get",
|
|
616
|
+
query: query,
|
|
617
|
+
});
|
|
618
|
+
};
|
|
619
|
+
this.updateNotificationTemplateById = function (tenant_id, notification_template_id, body) {
|
|
620
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates/").concat(notification_template_id), {
|
|
621
|
+
method: "put",
|
|
622
|
+
body: JSON.stringify(body),
|
|
623
|
+
headers: {
|
|
624
|
+
"content-type": "application/json",
|
|
625
|
+
},
|
|
626
|
+
});
|
|
627
|
+
};
|
|
628
|
+
this.deleteNotificationTemplateById = function (tenant_id, notification_template_id) {
|
|
629
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates/").concat(notification_template_id), {
|
|
630
|
+
method: "delete",
|
|
631
|
+
});
|
|
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
|
+
};
|
|
575
642
|
this.createUser = function (body) {
|
|
576
643
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
|
|
577
644
|
method: "post",
|