@parra/parra-js-sdk 0.3.113 → 0.3.115

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.
@@ -73,13 +73,14 @@ export interface TenantUserCollectionStub {
73
73
  email?: string | null;
74
74
  email_verified?: boolean | null;
75
75
  phone_number?: string | null;
76
- phone_number_verified?: boolean;
76
+ phone_number_verified?: boolean | null;
77
77
  first_name?: string | null;
78
78
  last_name?: string | null;
79
79
  locale?: string | null;
80
80
  signed_up_at?: string | null;
81
81
  last_updated_at?: string | null;
82
82
  last_seen_at?: string | null;
83
+ last_login_at?: string | null;
83
84
  }
84
85
  export interface TenantUser {
85
86
  id: string;
@@ -93,13 +94,14 @@ export interface TenantUser {
93
94
  email?: string | null;
94
95
  email_verified?: boolean | null;
95
96
  phone_number?: string | null;
96
- phone_number_verified?: boolean;
97
+ phone_number_verified?: boolean | null;
97
98
  first_name?: string | null;
98
99
  last_name?: string | null;
99
100
  locale?: string | null;
100
101
  signed_up_at?: string | null;
101
102
  last_updated_at?: string | null;
102
103
  last_seen_at?: string | null;
104
+ last_login_at?: string | null;
103
105
  properties: object;
104
106
  identities?: Array<Identity> | null;
105
107
  }
@@ -1398,6 +1400,79 @@ export interface UpdateChannelRequestBody {
1398
1400
  apns?: UpdateApnsChannelRequestBody;
1399
1401
  inbox?: UpdateInboxChannelRequestBody;
1400
1402
  }
1403
+ export interface TenantUserInfo {
1404
+ roles: Array<string>;
1405
+ user: TenantUser;
1406
+ }
1407
+ export declare enum GrantType {
1408
+ authorizationCode = "authorization_code",
1409
+ clientCredentials = "client_credentials",
1410
+ implicit = "implicit",
1411
+ password = "password",
1412
+ refreshToken = "refresh_token"
1413
+ }
1414
+ export interface Grant {
1415
+ id: GrantType;
1416
+ title: string;
1417
+ }
1418
+ export interface ClientGrant {
1419
+ id: GrantType;
1420
+ title: string;
1421
+ enabled: boolean;
1422
+ }
1423
+ export declare enum JwtAlgorithm {
1424
+ rs256 = "RS256"
1425
+ }
1426
+ export interface JwtConfiguration {
1427
+ alg: JwtAlgorithm;
1428
+ lifetime_in_seconds: number;
1429
+ secret_encoded: boolean;
1430
+ }
1431
+ export interface RefreshTokenConfiguration {
1432
+ expiration_type: string;
1433
+ rotation_type: string;
1434
+ idle_token_lifetime: number;
1435
+ infinite_idle_token_lifetime: boolean;
1436
+ infinite_token_lifetime: boolean;
1437
+ leeway: number;
1438
+ token_lifetime: number;
1439
+ }
1440
+ export interface Client {
1441
+ id: string;
1442
+ created_at: string;
1443
+ updated_at: string;
1444
+ deleted_at?: string | null;
1445
+ type: string;
1446
+ is_first_party: boolean;
1447
+ client_id: string;
1448
+ client_secret: string;
1449
+ allowed_origins: Array<string>;
1450
+ allowed_web_origins: Array<string>;
1451
+ allowed_callbacks: Array<string>;
1452
+ allowed_logout_urls: Array<string>;
1453
+ grants: Array<ClientGrant>;
1454
+ jwt: JwtConfiguration;
1455
+ refresh_token: RefreshTokenConfiguration;
1456
+ }
1457
+ export interface UpdateClientRequestBody {
1458
+ name?: string;
1459
+ description?: string | null;
1460
+ allowed_origins?: Array<string>;
1461
+ allowed_web_origins?: Array<string>;
1462
+ allowed_callbacks?: Array<string>;
1463
+ allowed_logout_urls?: Array<string>;
1464
+ grants?: Array<GrantType>;
1465
+ refresh_token_expiration_type?: string;
1466
+ refresh_token_idle_token_lifetime?: number;
1467
+ refresh_token_infinite_idle_token_lifetime?: boolean;
1468
+ refresh_token_infinite_token_lifetime?: boolean;
1469
+ refresh_token_leeway?: number;
1470
+ refresh_token_token_lifetime?: number;
1471
+ refresh_token_rotation_type?: string;
1472
+ jwt_alg?: JwtAlgorithm;
1473
+ jwt_lifetime_in_seconds?: number;
1474
+ jwt_secret_encoded?: boolean;
1475
+ }
1401
1476
  export declare enum ApplicationType {
1402
1477
  ios = "ios"
1403
1478
  }
@@ -1970,6 +2045,13 @@ declare class ParraAPI {
1970
2045
  createChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, body: CreateChannelRequestBody) => Promise<Channel>;
1971
2046
  updateChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string, body: UpdateChannelRequestBody) => Promise<Channel>;
1972
2047
  deleteChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string) => Promise<Response>;
2048
+ loginUserForTenant: (tenant_id: string) => Promise<TenantUserInfo>;
2049
+ getTenantUserInfo: (tenant_id: string) => Promise<TenantUserInfo>;
2050
+ logoutUserForTenant: (tenant_id: string) => Promise<Response>;
2051
+ getClientForTenantApplication: (tenant_id: string, application_id: string) => Promise<Client>;
2052
+ createClientForTenantApplication: (tenant_id: string, application_id: string) => Promise<Client>;
2053
+ updateClientForTenantApplication: (tenant_id: string, application_id: string, body?: UpdateClientRequestBody) => Promise<Client>;
2054
+ deleteClientForTenantApplication: (tenant_id: string, application_id: string) => Promise<Response>;
1973
2055
  createApplicationForTenantById: (tenant_id: string, body: CreateApplicationRequestBody) => Promise<Application>;
1974
2056
  paginateApplicationsForTenantById: (tenant_id: string, query?: {
1975
2057
  $select?: string;
package/dist/ParraAPI.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.ApplicationType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.FeedbackFormFieldType = exports.SubscriptionStatus = exports.Currency = exports.Interval = void 0;
3
+ exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.ApplicationType = exports.JwtAlgorithm = exports.GrantType = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.FeedbackFormFieldType = exports.SubscriptionStatus = exports.Currency = exports.Interval = void 0;
4
4
  var Interval;
5
5
  (function (Interval) {
6
6
  Interval["monthly"] = "monthly";
@@ -163,6 +163,18 @@ var ApnsPushType;
163
163
  ApnsPushType["voip"] = "voip";
164
164
  ApnsPushType["mdm"] = "mdm";
165
165
  })(ApnsPushType || (exports.ApnsPushType = ApnsPushType = {}));
166
+ var GrantType;
167
+ (function (GrantType) {
168
+ GrantType["authorizationCode"] = "authorization_code";
169
+ GrantType["clientCredentials"] = "client_credentials";
170
+ GrantType["implicit"] = "implicit";
171
+ GrantType["password"] = "password";
172
+ GrantType["refreshToken"] = "refresh_token";
173
+ })(GrantType || (exports.GrantType = GrantType = {}));
174
+ var JwtAlgorithm;
175
+ (function (JwtAlgorithm) {
176
+ JwtAlgorithm["rs256"] = "RS256";
177
+ })(JwtAlgorithm || (exports.JwtAlgorithm = JwtAlgorithm = {}));
166
178
  var ApplicationType;
167
179
  (function (ApplicationType) {
168
180
  ApplicationType["ios"] = "ios";
@@ -903,6 +915,45 @@ var ParraAPI = /** @class */ (function () {
903
915
  method: "delete",
904
916
  });
905
917
  };
918
+ this.loginUserForTenant = function (tenant_id) {
919
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/auth/login"), {
920
+ method: "post",
921
+ });
922
+ };
923
+ this.getTenantUserInfo = function (tenant_id) {
924
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/auth/user-info"), {
925
+ method: "post",
926
+ });
927
+ };
928
+ this.logoutUserForTenant = function (tenant_id) {
929
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/auth/logout"), {
930
+ method: "post",
931
+ });
932
+ };
933
+ this.getClientForTenantApplication = function (tenant_id, application_id) {
934
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/client"), {
935
+ method: "get",
936
+ });
937
+ };
938
+ this.createClientForTenantApplication = function (tenant_id, application_id) {
939
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/client"), {
940
+ method: "post",
941
+ });
942
+ };
943
+ this.updateClientForTenantApplication = function (tenant_id, application_id, body) {
944
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/client"), {
945
+ method: "put",
946
+ body: JSON.stringify(body),
947
+ headers: {
948
+ "content-type": "application/json",
949
+ },
950
+ });
951
+ };
952
+ this.deleteClientForTenantApplication = function (tenant_id, application_id) {
953
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/client"), {
954
+ method: "delete",
955
+ });
956
+ };
906
957
  this.createApplicationForTenantById = function (tenant_id, body) {
907
958
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications"), {
908
959
  method: "post",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.113",
3
+ "version": "0.3.115",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",