@parra/parra-js-sdk 0.2.139 → 0.2.141
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 +51 -1
- package/dist/ParraAPI.js +52 -1
- 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
|
}
|
|
@@ -998,6 +1003,10 @@ export interface ApnsConfiguration {
|
|
|
998
1003
|
key_id: string;
|
|
999
1004
|
key: string;
|
|
1000
1005
|
}
|
|
1006
|
+
export declare enum ChannelType {
|
|
1007
|
+
apns = "apns",
|
|
1008
|
+
inbox = "inbox"
|
|
1009
|
+
}
|
|
1001
1010
|
export interface CreateDeviceRequestBody {
|
|
1002
1011
|
platform: string;
|
|
1003
1012
|
platform_agent: string;
|
|
@@ -1058,6 +1067,31 @@ export interface NotificationCollectionResponse {
|
|
|
1058
1067
|
export interface ReadNotificationsRequestBody {
|
|
1059
1068
|
notification_ids: Array<string>;
|
|
1060
1069
|
}
|
|
1070
|
+
export interface UpdateNotificationTemplateRequestBody {
|
|
1071
|
+
name: string;
|
|
1072
|
+
description?: string | null;
|
|
1073
|
+
}
|
|
1074
|
+
export interface CreateNotificationTemplateRequestBody {
|
|
1075
|
+
name: string;
|
|
1076
|
+
description?: string | null;
|
|
1077
|
+
}
|
|
1078
|
+
export interface NotificationTemplate {
|
|
1079
|
+
id: string;
|
|
1080
|
+
created_at: string;
|
|
1081
|
+
updated_at: string;
|
|
1082
|
+
deleted_at?: string | null;
|
|
1083
|
+
name: string;
|
|
1084
|
+
description?: string | null;
|
|
1085
|
+
tenant_id: string;
|
|
1086
|
+
}
|
|
1087
|
+
export interface NotificationTemplateCollectionResponse {
|
|
1088
|
+
page: number;
|
|
1089
|
+
page_count: number;
|
|
1090
|
+
page_size: number;
|
|
1091
|
+
total_count: number;
|
|
1092
|
+
data: Array<NotificationTemplate>;
|
|
1093
|
+
}
|
|
1094
|
+
export declare type NotificationTemplateListResponse = Array<NotificationTemplate>;
|
|
1061
1095
|
export interface CreatePushTokenRequestBody {
|
|
1062
1096
|
application_id: string;
|
|
1063
1097
|
type: string;
|
|
@@ -1153,6 +1187,7 @@ declare class ParraAPI {
|
|
|
1153
1187
|
$expand?: string | undefined;
|
|
1154
1188
|
$search?: string | undefined;
|
|
1155
1189
|
} | undefined) => Promise<TenantUserCollectionResponse>;
|
|
1190
|
+
getUserForTenantById: (tenant_id: string, user_id: string) => Promise<TenantUser>;
|
|
1156
1191
|
createTenantForUserById: (user_id: string, body?: CreateTenantForUserRequestBody | undefined) => Promise<Tenant>;
|
|
1157
1192
|
getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
|
|
1158
1193
|
createApiKeyForTenantById: (tenant_id: string, body?: CreateApiKeyRequestBody | undefined) => Promise<ApiKeyWithSecretResponse>;
|
|
@@ -1281,6 +1316,21 @@ declare class ParraAPI {
|
|
|
1281
1316
|
updateApplicationByIdForTenantById: (tenant_id: string, application_id: string, body?: UpdateApplicationRequestBody | undefined) => Promise<Application>;
|
|
1282
1317
|
deleteApplicationByIdForTenantById: (tenant_id: string, application_id: string) => Promise<Response>;
|
|
1283
1318
|
updateApnsConfigurationForTenantApplication: (tenant_id: string, application_id: string, body?: UpdateApnsConfigurationRequestBody | undefined) => Promise<ApnsConfiguration>;
|
|
1319
|
+
createNotificationTemplate: (tenant_id: string, body?: CreateNotificationTemplateRequestBody | undefined) => Promise<NotificationTemplate>;
|
|
1320
|
+
paginateNotificationTemplatesForTenantById: (tenant_id: string, query?: {
|
|
1321
|
+
$select?: string | undefined;
|
|
1322
|
+
$top?: number | undefined;
|
|
1323
|
+
$skip?: number | undefined;
|
|
1324
|
+
$orderby?: string | undefined;
|
|
1325
|
+
$filter?: string | undefined;
|
|
1326
|
+
$expand?: string | undefined;
|
|
1327
|
+
$search?: string | undefined;
|
|
1328
|
+
} | undefined) => Promise<NotificationTemplateCollectionResponse>;
|
|
1329
|
+
getNotificationTemplateById: (tenant_id: string, notification_template_id: string, query?: {
|
|
1330
|
+
include?: string | undefined;
|
|
1331
|
+
} | undefined) => Promise<NotificationTemplate>;
|
|
1332
|
+
updateNotificationTemplateById: (tenant_id: string, notification_template_id: string, body?: UpdateNotificationTemplateRequestBody | undefined) => Promise<NotificationTemplate>;
|
|
1333
|
+
deleteNotificationTemplateById: (tenant_id: string, notification_template_id: string) => Promise<Response>;
|
|
1284
1334
|
createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
|
|
1285
1335
|
listUsers: (query?: {
|
|
1286
1336
|
$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.ApnsConfigurationEnvironment = exports.ApplicationType = exports.TemplateType = exports.QuestionKind = exports.QuestionType = exports.CardItemType = exports.CardItemDisplayType = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CampaignStatus = exports.SubscriptionStatus = exports.Interval = exports.Currency = void 0;
|
|
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;
|
|
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";
|
|
@@ -84,6 +90,11 @@ var ApnsConfigurationEnvironment;
|
|
|
84
90
|
ApnsConfigurationEnvironment["production"] = "production";
|
|
85
91
|
ApnsConfigurationEnvironment["sandbox"] = "sandbox";
|
|
86
92
|
})(ApnsConfigurationEnvironment = exports.ApnsConfigurationEnvironment || (exports.ApnsConfigurationEnvironment = {}));
|
|
93
|
+
var ChannelType;
|
|
94
|
+
(function (ChannelType) {
|
|
95
|
+
ChannelType["apns"] = "apns";
|
|
96
|
+
ChannelType["inbox"] = "inbox";
|
|
97
|
+
})(ChannelType = exports.ChannelType || (exports.ChannelType = {}));
|
|
87
98
|
var ParraAPI = /** @class */ (function () {
|
|
88
99
|
function ParraAPI(http, options) {
|
|
89
100
|
var _this = this;
|
|
@@ -188,6 +199,11 @@ var ParraAPI = /** @class */ (function () {
|
|
|
188
199
|
query: query,
|
|
189
200
|
});
|
|
190
201
|
};
|
|
202
|
+
this.getUserForTenantById = function (tenant_id, user_id) {
|
|
203
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users/").concat(user_id), {
|
|
204
|
+
method: "get",
|
|
205
|
+
});
|
|
206
|
+
};
|
|
191
207
|
this.createTenantForUserById = function (user_id, body) {
|
|
192
208
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
|
|
193
209
|
method: "post",
|
|
@@ -567,6 +583,41 @@ var ParraAPI = /** @class */ (function () {
|
|
|
567
583
|
},
|
|
568
584
|
});
|
|
569
585
|
};
|
|
586
|
+
this.createNotificationTemplate = function (tenant_id, body) {
|
|
587
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates"), {
|
|
588
|
+
method: "post",
|
|
589
|
+
body: JSON.stringify(body),
|
|
590
|
+
headers: {
|
|
591
|
+
"content-type": "application/json",
|
|
592
|
+
},
|
|
593
|
+
});
|
|
594
|
+
};
|
|
595
|
+
this.paginateNotificationTemplatesForTenantById = function (tenant_id, query) {
|
|
596
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates"), {
|
|
597
|
+
method: "get",
|
|
598
|
+
query: query,
|
|
599
|
+
});
|
|
600
|
+
};
|
|
601
|
+
this.getNotificationTemplateById = function (tenant_id, notification_template_id, query) {
|
|
602
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates/").concat(notification_template_id), {
|
|
603
|
+
method: "get",
|
|
604
|
+
query: query,
|
|
605
|
+
});
|
|
606
|
+
};
|
|
607
|
+
this.updateNotificationTemplateById = function (tenant_id, notification_template_id, body) {
|
|
608
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates/").concat(notification_template_id), {
|
|
609
|
+
method: "put",
|
|
610
|
+
body: JSON.stringify(body),
|
|
611
|
+
headers: {
|
|
612
|
+
"content-type": "application/json",
|
|
613
|
+
},
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
this.deleteNotificationTemplateById = function (tenant_id, notification_template_id) {
|
|
617
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/notification-templates/").concat(notification_template_id), {
|
|
618
|
+
method: "delete",
|
|
619
|
+
});
|
|
620
|
+
};
|
|
570
621
|
this.createUser = function (body) {
|
|
571
622
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
|
|
572
623
|
method: "post",
|