@parra/parra-js-sdk 0.2.70 → 0.2.71

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.
@@ -124,9 +124,17 @@ export interface Entitlement {
124
124
  }
125
125
  export declare type Entitlements = Array<Entitlement>;
126
126
  export declare type UpdateEntitlementsRequestBody = Array<Entitlement>;
127
+ export interface UpdateTenantRequestBody {
128
+ name: string;
129
+ }
127
130
  export interface CreateTenantRequestBody {
128
131
  name: string;
129
132
  is_test: boolean;
133
+ parent_tenant_id?: string | null;
134
+ }
135
+ export interface CreateTenantForUserRequestBody {
136
+ name: string;
137
+ is_test: boolean;
130
138
  }
131
139
  export interface TenantUser {
132
140
  id: string;
@@ -135,6 +143,7 @@ export interface TenantUser {
135
143
  deleted_at?: string | null;
136
144
  name: string;
137
145
  is_test: boolean;
146
+ parent_tenant_id?: string | null;
138
147
  entitlements?: Array<Entitlement> | null;
139
148
  scopes: Array<string>;
140
149
  }
@@ -145,6 +154,7 @@ export interface Tenant {
145
154
  deleted_at?: string | null;
146
155
  name: string;
147
156
  is_test: boolean;
157
+ parent_tenant_id?: string | null;
148
158
  entitlements?: Array<Entitlement> | null;
149
159
  }
150
160
  export declare type TenantListResponse = Array<Tenant>;
@@ -157,6 +167,7 @@ export interface TenantCollectionResponse {
157
167
  }
158
168
  export interface TenantMetrics {
159
169
  team_member_count: number;
170
+ child_tenant_count: number;
160
171
  }
161
172
  export interface CreateApiKeyRequestBody {
162
173
  name: string;
@@ -182,7 +193,7 @@ export interface ApiKeyWithSecretResponse {
182
193
  description?: string | null;
183
194
  is_public: boolean;
184
195
  tenant_id: string;
185
- secret: string;
196
+ secret?: string | null;
186
197
  }
187
198
  export interface ApiKeyCollectionResponse {
188
199
  page: number;
@@ -484,8 +495,11 @@ declare class ParraAPI {
484
495
  getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
485
496
  createAudience: (body?: CreateAudienceRequestBody | undefined) => Promise<Audience>;
486
497
  createSubscriberForAudienceById: (audience_id: string, body?: CreateSubscriberRequestBody | undefined) => Promise<Response>;
498
+ createTenant: (body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
487
499
  getTenantById: (tenant_id: string) => Promise<Tenant>;
488
- createTenantForUserById: (user_id: string, body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
500
+ updateTenantById: (tenant_id: string, body?: UpdateTenantRequestBody | undefined) => Promise<Tenant>;
501
+ deleteTenantById: (tenant_id: string) => Promise<Response>;
502
+ createTenantForUserById: (user_id: string, body?: CreateTenantForUserRequestBody | undefined) => Promise<Tenant>;
489
503
  getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
490
504
  createApiKeyForTenantById: (tenant_id: string, body?: CreateApiKeyRequestBody | undefined) => Promise<ApiKeyWithSecretResponse>;
491
505
  getApiKeysForTenantById: (tenant_id: string) => Promise<ApiKeyCollectionResponse>;
package/dist/ParraAPI.js CHANGED
@@ -97,11 +97,34 @@ var ParraAPI = /** @class */ (function () {
97
97
  raw: true,
98
98
  });
99
99
  };
100
+ this.createTenant = function (body) {
101
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants"), {
102
+ method: "post",
103
+ body: JSON.stringify(body),
104
+ headers: {
105
+ "content-type": "application/json",
106
+ },
107
+ });
108
+ };
100
109
  this.getTenantById = function (tenant_id) {
101
110
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
102
111
  method: "get",
103
112
  });
104
113
  };
114
+ this.updateTenantById = function (tenant_id, body) {
115
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
116
+ method: "put",
117
+ body: JSON.stringify(body),
118
+ headers: {
119
+ "content-type": "application/json",
120
+ },
121
+ });
122
+ };
123
+ this.deleteTenantById = function (tenant_id) {
124
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id), {
125
+ method: "delete",
126
+ });
127
+ };
105
128
  this.createTenantForUserById = function (user_id, body) {
106
129
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users/").concat(user_id, "/tenants"), {
107
130
  method: "post",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.70",
3
+ "version": "0.2.71",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",