@parra/parra-js-sdk 0.2.70 → 0.2.72

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;
@@ -223,6 +234,34 @@ export interface TeamMember {
223
234
  export declare type TeamMemberListResponse = Array<TeamMember>;
224
235
  export interface AnswerData {
225
236
  }
237
+ export interface UpdateAppAreaRequestBody {
238
+ title: string;
239
+ slug: string;
240
+ description?: string | null;
241
+ }
242
+ export interface CreateAppAreaRequestBody {
243
+ title: string;
244
+ slug: string;
245
+ description?: string | null;
246
+ }
247
+ export interface AppArea {
248
+ id: string;
249
+ created_at: string;
250
+ updated_at: string;
251
+ deleted_at?: string | null;
252
+ tenant_id: string;
253
+ title: string;
254
+ slug: string;
255
+ description?: string | null;
256
+ }
257
+ export interface AppAreaCollectionResponse {
258
+ page: number;
259
+ page_count: number;
260
+ page_size: number;
261
+ total_count: number;
262
+ data: Array<AppArea>;
263
+ }
264
+ export declare type AppAreaListResponse = Array<AppArea>;
226
265
  export interface FormResponse {
227
266
  }
228
267
  export interface Form {
@@ -291,6 +330,7 @@ export declare type QuestionData = ChoiceQuestionBody;
291
330
  export interface UpdateQuestionRequestBody {
292
331
  title: string;
293
332
  subtitle?: string | null;
333
+ app_area_id?: string | null;
294
334
  data: MutableQuestionData | null;
295
335
  active?: boolean;
296
336
  expires_at?: string | null;
@@ -299,6 +339,7 @@ export interface UpdateQuestionRequestBody {
299
339
  export interface CreateQuestionRequestBody {
300
340
  title: string;
301
341
  subtitle?: string | null;
342
+ app_area_id?: string | null;
302
343
  data: MutableQuestionData | null;
303
344
  active?: boolean;
304
345
  expires_at?: string | null;
@@ -319,6 +360,7 @@ export interface Question {
319
360
  tenant_id: string;
320
361
  title: string;
321
362
  subtitle?: string | null;
363
+ app_area_id?: string | null;
322
364
  type: QuestionType | null;
323
365
  kind: QuestionKind | null;
324
366
  data: QuestionData | null;
@@ -484,8 +526,11 @@ declare class ParraAPI {
484
526
  getPlansForTenantById: (tenant_id: string) => Promise<TenantPlansResponse>;
485
527
  createAudience: (body?: CreateAudienceRequestBody | undefined) => Promise<Audience>;
486
528
  createSubscriberForAudienceById: (audience_id: string, body?: CreateSubscriberRequestBody | undefined) => Promise<Response>;
529
+ createTenant: (body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
487
530
  getTenantById: (tenant_id: string) => Promise<Tenant>;
488
- createTenantForUserById: (user_id: string, body?: CreateTenantRequestBody | undefined) => Promise<Tenant>;
531
+ updateTenantById: (tenant_id: string, body?: UpdateTenantRequestBody | undefined) => Promise<Tenant>;
532
+ deleteTenantById: (tenant_id: string) => Promise<Response>;
533
+ createTenantForUserById: (user_id: string, body?: CreateTenantForUserRequestBody | undefined) => Promise<Tenant>;
489
534
  getTenantsForUserById: (user_id: string) => Promise<TenantListResponse>;
490
535
  createApiKeyForTenantById: (tenant_id: string, body?: CreateApiKeyRequestBody | undefined) => Promise<ApiKeyWithSecretResponse>;
491
536
  getApiKeysForTenantById: (tenant_id: string) => Promise<ApiKeyCollectionResponse>;
@@ -497,6 +542,11 @@ declare class ParraAPI {
497
542
  getTeamMembersForTenantById: (tenant_id: string) => Promise<TeamMemberListResponse>;
498
543
  deleteTeamMemberForTenantById: (tenant_id: string, team_member_id: string) => Promise<Response>;
499
544
  updateTeamMemberUserForTenantById: (tenant_id: string, team_member_id: string) => Promise<Response>;
545
+ createAppArea: (tenant_id: string, body?: CreateAppAreaRequestBody | undefined) => Promise<AppArea>;
546
+ listAppAreas: (tenant_id: string) => Promise<AppAreaListResponse>;
547
+ getAppAreaById: (tenant_id: string, app_area_id: string) => Promise<AppArea>;
548
+ updateAppAreaById: (tenant_id: string, app_area_id: string, body?: UpdateAppAreaRequestBody | undefined) => Promise<AppArea>;
549
+ deleteAppAreaById: (tenant_id: string, app_area_id: string) => Promise<Response>;
500
550
  getCards: () => Promise<CardsResponse>;
501
551
  getFormById: (form_id: string) => Promise<Form>;
502
552
  submitFormById: (form_id: string, body?: FormResponse | undefined) => Promise<Response>;
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",
@@ -174,6 +197,39 @@ var ParraAPI = /** @class */ (function () {
174
197
  method: "post",
175
198
  });
176
199
  };
200
+ this.createAppArea = function (tenant_id, body) {
201
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app-areas"), {
202
+ method: "post",
203
+ body: JSON.stringify(body),
204
+ headers: {
205
+ "content-type": "application/json",
206
+ },
207
+ });
208
+ };
209
+ this.listAppAreas = function (tenant_id) {
210
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app-areas"), {
211
+ method: "get",
212
+ });
213
+ };
214
+ this.getAppAreaById = function (tenant_id, app_area_id) {
215
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app-areas/").concat(app_area_id), {
216
+ method: "get",
217
+ });
218
+ };
219
+ this.updateAppAreaById = function (tenant_id, app_area_id, body) {
220
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app-areas/").concat(app_area_id), {
221
+ method: "put",
222
+ body: JSON.stringify(body),
223
+ headers: {
224
+ "content-type": "application/json",
225
+ },
226
+ });
227
+ };
228
+ this.deleteAppAreaById = function (tenant_id, app_area_id) {
229
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/app-areas/").concat(app_area_id), {
230
+ method: "delete",
231
+ });
232
+ };
177
233
  this.getCards = function () {
178
234
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
179
235
  method: "get",
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.72",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",