@parra/parra-js-sdk 0.3.114 → 0.3.116

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,10 @@ 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
+ }
1401
1407
  export declare enum GrantType {
1402
1408
  authorizationCode = "authorization_code",
1403
1409
  clientCredentials = "client_credentials",
@@ -1424,12 +1430,12 @@ export interface JwtConfiguration {
1424
1430
  }
1425
1431
  export interface RefreshTokenConfiguration {
1426
1432
  expiration_type: string;
1433
+ rotation_type: string;
1427
1434
  idle_token_lifetime: number;
1428
1435
  infinite_idle_token_lifetime: boolean;
1429
1436
  infinite_token_lifetime: boolean;
1430
1437
  leeway: number;
1431
1438
  token_lifetime: number;
1432
- rotation_type: string;
1433
1439
  }
1434
1440
  export interface Client {
1435
1441
  id: string;
@@ -1772,6 +1778,20 @@ export interface UpdateTenantUserRequestBody {
1772
1778
  name?: string | null;
1773
1779
  properties?: object | null;
1774
1780
  }
1781
+ export interface CreateTenantUserRequestBody {
1782
+ identity?: string | null;
1783
+ name?: string | null;
1784
+ password?: string | null;
1785
+ properties?: object | null;
1786
+ username?: string | null;
1787
+ email?: string | null;
1788
+ email_verified?: boolean | null;
1789
+ phone_number?: string | null;
1790
+ phone_number_verified?: boolean | null;
1791
+ first_name?: string | null;
1792
+ last_name?: string | null;
1793
+ locale?: string | null;
1794
+ }
1775
1795
  export interface TenantUserCollectionResponse {
1776
1796
  page: number;
1777
1797
  page_count: number;
@@ -2039,6 +2059,9 @@ declare class ParraAPI {
2039
2059
  createChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, body: CreateChannelRequestBody) => Promise<Channel>;
2040
2060
  updateChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string, body: UpdateChannelRequestBody) => Promise<Channel>;
2041
2061
  deleteChannelForNotificationTemplate: (tenant_id: string, notification_template_id: string, channel_id: string) => Promise<Response>;
2062
+ loginUserForTenant: (tenant_id: string) => Promise<TenantUserInfo>;
2063
+ getTenantUserInfo: (tenant_id: string) => Promise<TenantUserInfo>;
2064
+ logoutUserForTenant: (tenant_id: string) => Promise<Response>;
2042
2065
  getClientForTenantApplication: (tenant_id: string, application_id: string) => Promise<Client>;
2043
2066
  createClientForTenantApplication: (tenant_id: string, application_id: string) => Promise<Client>;
2044
2067
  updateClientForTenantApplication: (tenant_id: string, application_id: string, body?: UpdateClientRequestBody) => Promise<Client>;
@@ -2085,6 +2108,7 @@ declare class ParraAPI {
2085
2108
  }) => Promise<TenantUser>;
2086
2109
  updateUserForTenantById: (tenant_id: string, user_id: string, body?: UpdateTenantUserRequestBody) => Promise<TenantUser>;
2087
2110
  deleteUserForTenantById: (tenant_id: string, user_id: string) => Promise<Response>;
2111
+ createUserForTenantById: (tenant_id: string, body?: CreateTenantUserRequestBody) => Promise<TenantUser>;
2088
2112
  paginateTenantUsersForTenantById: (tenant_id: string, query?: {
2089
2113
  $select?: string;
2090
2114
  $top?: number;
package/dist/ParraAPI.js CHANGED
@@ -915,6 +915,21 @@ var ParraAPI = /** @class */ (function () {
915
915
  method: "delete",
916
916
  });
917
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
+ };
918
933
  this.getClientForTenantApplication = function (tenant_id, application_id) {
919
934
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/applications/").concat(application_id, "/client"), {
920
935
  method: "get",
@@ -1113,6 +1128,15 @@ var ParraAPI = /** @class */ (function () {
1113
1128
  method: "delete",
1114
1129
  });
1115
1130
  };
1131
+ this.createUserForTenantById = function (tenant_id, body) {
1132
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users"), {
1133
+ method: "post",
1134
+ body: JSON.stringify(body),
1135
+ headers: {
1136
+ "content-type": "application/json",
1137
+ },
1138
+ });
1139
+ };
1116
1140
  this.paginateTenantUsersForTenantById = function (tenant_id, query) {
1117
1141
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users"), {
1118
1142
  method: "get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.114",
3
+ "version": "0.3.116",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",