@parra/parra-js-sdk 0.2.90 → 0.2.92

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.
@@ -157,7 +157,7 @@ export interface CreateTenantForUserRequestBody {
157
157
  name: string;
158
158
  is_test: boolean;
159
159
  }
160
- export interface TenantUser {
160
+ export interface TenantMember {
161
161
  id: string;
162
162
  created_at: string;
163
163
  updated_at: string;
@@ -296,6 +296,34 @@ export interface AppAreaCollectionResponse {
296
296
  data: Array<AppArea>;
297
297
  }
298
298
  export declare type AppAreaListResponse = Array<AppArea>;
299
+ export interface UpdateCampaignRequestBody {
300
+ name: string;
301
+ description?: string | null;
302
+ }
303
+ export interface CreateCampaignRequestBody {
304
+ name: string;
305
+ description?: string | null;
306
+ }
307
+ export interface Campaign {
308
+ id: string;
309
+ created_at: string;
310
+ updated_at: string;
311
+ deleted_at?: string | null;
312
+ tenant_id: string;
313
+ name: string;
314
+ description?: string | null;
315
+ published_at?: string | null;
316
+ start_at?: string | null;
317
+ end_at?: string | null;
318
+ }
319
+ export interface CampaignCollectionResponse {
320
+ page: number;
321
+ page_count: number;
322
+ page_size: number;
323
+ total_count: number;
324
+ data: Array<Campaign>;
325
+ }
326
+ export declare type CampaignListResponse = Array<Campaign>;
299
327
  export interface FormResponse {
300
328
  }
301
329
  export interface Form {
@@ -508,12 +536,38 @@ export interface ImageQuestionMetricsOption {
508
536
  export interface Event {
509
537
  name: string;
510
538
  created_at: string | null;
511
- event_properties?: Map<string, any> | null;
539
+ metadata?: Map<string, any> | null;
512
540
  }
513
541
  export interface Session {
514
542
  user_properties?: Map<string, any> | null;
515
543
  events?: Array<Event>;
516
544
  }
545
+ export interface TenantUserStub {
546
+ id: string;
547
+ created_at: string;
548
+ updated_at: string;
549
+ deleted_at?: string | null;
550
+ identity: string;
551
+ tenant_id: string;
552
+ name?: string | null;
553
+ }
554
+ export interface TenantUser {
555
+ id: string;
556
+ created_at: string;
557
+ updated_at: string;
558
+ deleted_at?: string | null;
559
+ identity: string;
560
+ tenant_id: string;
561
+ name?: string | null;
562
+ properties: Map<string, any>;
563
+ }
564
+ export interface TenantUserCollectionResponse {
565
+ page: number;
566
+ page_count: number;
567
+ page_size: number;
568
+ total_count: number;
569
+ data: Array<TenantUserStub>;
570
+ }
517
571
  export interface NotificationRecipient {
518
572
  user_id?: string | null;
519
573
  }
@@ -664,6 +718,19 @@ declare class ParraAPI {
664
718
  getAppAreaById: (tenant_id: string, app_area_id: string) => Promise<AppArea>;
665
719
  updateAppAreaById: (tenant_id: string, app_area_id: string, body?: UpdateAppAreaRequestBody | undefined) => Promise<AppArea>;
666
720
  deleteAppAreaById: (tenant_id: string, app_area_id: string) => Promise<Response>;
721
+ createCampaign: (tenant_id: string, body?: CreateCampaignRequestBody | undefined) => Promise<Campaign>;
722
+ paginateCampaignsForTenantById: (tenant_id: string, query?: {
723
+ $select?: string | undefined;
724
+ $top?: number | undefined;
725
+ $skip?: number | undefined;
726
+ $orderby?: string | undefined;
727
+ $filter?: string | undefined;
728
+ $expand?: string | undefined;
729
+ $search?: string | undefined;
730
+ } | undefined) => Promise<CampaignListResponse>;
731
+ getCampaignById: (tenant_id: string, campaign_id: string) => Promise<Campaign>;
732
+ updateCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody | undefined) => Promise<Campaign>;
733
+ deleteCampaignById: (tenant_id: string, campaign_id: string) => Promise<Response>;
667
734
  getCards: (query?: {
668
735
  app_area_id?: string | undefined;
669
736
  } | undefined) => Promise<CardsResponse>;
@@ -686,6 +753,15 @@ declare class ParraAPI {
686
753
  createMetricsForQuestionById: (question_id: string) => Promise<QuestionMetrics>;
687
754
  answerQuestionById: (question_id: string, body?: AnswerQuestionBody | undefined) => Promise<Response>;
688
755
  bulkAnswerQuestions: (body?: BulkAnswerQuestionsBody | undefined) => Promise<Response>;
756
+ paginateTenantUsersForTenantById: (tenant_id: string, query?: {
757
+ $select?: string | undefined;
758
+ $top?: number | undefined;
759
+ $skip?: number | undefined;
760
+ $orderby?: string | undefined;
761
+ $filter?: string | undefined;
762
+ $expand?: string | undefined;
763
+ $search?: string | undefined;
764
+ } | undefined) => Promise<TenantUserCollectionResponse>;
689
765
  createUser: (body: CreateUserRequestBody) => Promise<UserResponse>;
690
766
  listUsers: (query?: {
691
767
  $select?: string | undefined;
package/dist/ParraAPI.js CHANGED
@@ -245,6 +245,40 @@ var ParraAPI = /** @class */ (function () {
245
245
  method: "delete",
246
246
  });
247
247
  };
248
+ this.createCampaign = function (tenant_id, body) {
249
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns"), {
250
+ method: "post",
251
+ body: JSON.stringify(body),
252
+ headers: {
253
+ "content-type": "application/json",
254
+ },
255
+ });
256
+ };
257
+ this.paginateCampaignsForTenantById = function (tenant_id, query) {
258
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns"), {
259
+ method: "get",
260
+ query: query,
261
+ });
262
+ };
263
+ this.getCampaignById = function (tenant_id, campaign_id) {
264
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
265
+ method: "get",
266
+ });
267
+ };
268
+ this.updateCampaignById = function (tenant_id, campaign_id, body) {
269
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
270
+ method: "put",
271
+ body: JSON.stringify(body),
272
+ headers: {
273
+ "content-type": "application/json",
274
+ },
275
+ });
276
+ };
277
+ this.deleteCampaignById = function (tenant_id, campaign_id) {
278
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
279
+ method: "delete",
280
+ });
281
+ };
248
282
  this.getCards = function (query) {
249
283
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
250
284
  method: "get",
@@ -330,6 +364,12 @@ var ParraAPI = /** @class */ (function () {
330
364
  raw: true,
331
365
  });
332
366
  };
367
+ this.paginateTenantUsersForTenantById = function (tenant_id, query) {
368
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/users"), {
369
+ method: "get",
370
+ query: query,
371
+ });
372
+ };
333
373
  this.createUser = function (body) {
334
374
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/users"), {
335
375
  method: "post",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.90",
3
+ "version": "0.2.92",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",